From: Yevhen Orlov Date: Sat, 1 Oct 2022 09:34:13 +0000 (+0300) Subject: net: marvell: prestera: Add length macros for prestera_ip_addr X-Git-Tag: v6.1-rc5~319^2~4^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59b44ea8aa56cec1c6b29019bf00b1f9474a9c51;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: Jakub Kicinski --- 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 {