summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorYevhen Orlov <yevhen.orlov@plvision.eu>2022-10-01 12:34:13 +0300
committerJakub Kicinski <kuba@kernel.org>2022-10-04 03:14:53 +0300
commit59b44ea8aa56cec1c6b29019bf00b1f9474a9c51 (patch)
tree3bb2895251aa5405d1255fe5c4ecc99fa429e0a9 /drivers
parent90b6f9c098512b72b77028893e42f60316409fb1 (diff)
downloadlinux-59b44ea8aa56cec1c6b29019bf00b1f9474a9c51.tar.xz
net: marvell: prestera: Add length macros for prestera_ip_addr
Add macros to determine IP address length (internal driver types). This will be used in next patches for nexthops logic. Co-developed-by: Taras Chornyi <tchornyi@marvell.com> Signed-off-by: Taras Chornyi <tchornyi@marvell.com> Co-developed-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu> Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu> Signed-off-by: Yevhen Orlov <yevhen.orlov@plvision.eu> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/marvell/prestera/prestera_router_hw.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h
index 43bad23f38ec..9ca97919c863 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h
+++ b/drivers/net/ethernet/marvell/prestera/prestera_router_hw.h
@@ -31,6 +31,8 @@ struct prestera_ip_addr {
PRESTERA_IPV4 = 0,
PRESTERA_IPV6
} v;
+#define PRESTERA_IP_ADDR_PLEN(V) ((V) == PRESTERA_IPV4 ? 32 : \
+ /* (V) == PRESTERA_IPV6 ? */ 128 /* : 0 */)
};
struct prestera_nh_neigh_key {