From daa3a2e12290050be3af956915939a55aed50d5f Mon Sep 17 00:00:00 2001 From: Sylvain MARET Date: Wed, 27 Jul 2022 10:59:33 +0200 Subject: [PATCH] build support for kernel 5.18 and above --- include/ieee80211.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/ieee80211.h b/include/ieee80211.h index 5ba92b5..89d2eff 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -1529,6 +1529,7 @@ enum ieee80211_state { (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 00)) extern __inline int is_multicast_mac_addr(const u8 *addr) { return (addr[0] != 0xff) && (0x01 & addr[0]); @@ -1545,6 +1546,24 @@ 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)); } +#else +static __inline int is_multicast_mac_addr(const u8 *addr) +{ + return (addr[0] != 0xff) && (0x01 & addr[0]); +} + +static __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)); +} + +static __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 /* LINUX_VERSION_CODE */ #endif /* PLATFORM_FREEBSD */ #define CFG_IEEE80211_RESERVE_FCS (1<<0)