diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 97eba25..ebb4829 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -2218,3 +2218,19 @@ const char *action_public_str(u8 action) return _action_public_str[action]; } +int is_multicast_mac_addr(const u8 *addr) +{ + return ((addr[0] != 0xff) && (0x01 & addr[0])); +} + +int is_broadcast_mac_addr(const u8 *addr) +{ + return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ + (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); +} + +int is_zero_mac_addr(const u8 *addr) +{ + return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ + (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); +} diff --git a/include/ieee80211.h b/include/ieee80211.h index fc293c4..3f067dc 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -1308,29 +1308,11 @@ enum ieee80211_state { #define IP_FMT "%d.%d.%d.%d" #define IP_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3] -#ifdef PLATFORM_FREEBSD //Baron change func to macro -#define is_multicast_mac_addr(Addr) ((((Addr[0]) & 0x01) == 0x01) && ((Addr[0]) != 0xff)) -#define is_broadcast_mac_addr(Addr) ((((Addr[0]) & 0xff) == 0xff) && (((Addr[1]) & 0xff) == 0xff) && \ -(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ -(((Addr[5]) & 0xff) == 0xff)) -#else -extern __inline int is_multicast_mac_addr(const u8 *addr) -{ - return ((addr[0] != 0xff) && (0x01 & addr[0])); -} +extern int is_multicast_mac_addr(const u8 *addr); -extern __inline int is_broadcast_mac_addr(const u8 *addr) -{ - return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ - (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); -} +extern int is_broadcast_mac_addr(const u8 *addr); -extern __inline int is_zero_mac_addr(const u8 *addr) -{ - return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ - (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); -} -#endif //PLATFORM_FREEBSD +extern int is_zero_mac_addr(const u8 *addr); #define CFG_IEEE80211_RESERVE_FCS (1<<0) #define CFG_IEEE80211_COMPUTE_FCS (1<<1)