From: Wang Xiao W Date: Thu, 10 Sep 2015 04:38:25 +0000 (+0800) Subject: fm10k/base: add macros for ethernet address checks X-Git-Tag: spdx-start~8416 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6f21dcc645fb351c526414ca460e998019bcfd97;p=dpdk.git fm10k/base: add macros for ethernet address checks To keep consistency with ND team, I add macro definitions about FM10K_IS_VALID_ETHER_ADD in fm10k_type.h, though they have already been defined in fm10k_osdep.h. Signed-off-by: Wang Xiao W --- diff --git a/drivers/net/fm10k/base/fm10k_type.h b/drivers/net/fm10k/base/fm10k_type.h index 534fab478b..e2ad65d833 100644 --- a/drivers/net/fm10k/base/fm10k_type.h +++ b/drivers/net/fm10k/base/fm10k_type.h @@ -488,8 +488,21 @@ struct fm10k_hw; #define ETH_ALEN 6 #endif /* ETH_ALEN */ - - +#ifndef FM10K_IS_ZERO_ETHER_ADDR +/* make certain address is not 0 */ +#define FM10K_IS_ZERO_ETHER_ADDR(addr) \ +(!((addr)[0] | (addr)[1] | (addr)[2] | (addr)[3] | (addr)[4] | (addr)[5])) +#endif + +#ifndef FM10K_IS_MULTICAST_ETHER_ADDR +#define FM10K_IS_MULTICAST_ETHER_ADDR(addr) ((addr)[0] & 0x1) +#endif + +#ifndef FM10K_IS_VALID_ETHER_ADDR +/* make certain address is not multicast or 0 */ +#define FM10K_IS_VALID_ETHER_ADDR(addr) \ +(!FM10K_IS_MULTICAST_ETHER_ADDR(addr) && !FM10K_IS_ZERO_ETHER_ADDR(addr)) +#endif enum fm10k_int_source { fm10k_int_Mailbox = 0,