use IEEE80211_FCTL_* kernel definitions

_TO_DS_, _FROM_DS_, _MORE_FRAG_, _RETRY_, _PWRMGT_, _MORE_DATA_,
_PRIVACY_, _ORDER_ definitions are duplicate IEEE80211_FCTL_*
kernel definitions.

Link: https://lore.kernel.org/r/20210213131148.458582-1-insafonov@gmail.com
This commit is contained in:
Carlos Garces 2021-10-18 19:32:53 +02:00
parent 0242513fe3
commit 5ae45c1296

View File

@ -83,37 +83,28 @@ enum {
/* IEEE 802.11r */ /* IEEE 802.11r */
#define WLAN_STATUS_INVALID_PMKID 53 #define WLAN_STATUS_INVALID_PMKID 53
#define _TO_DS_ BIT(8)
#define _FROM_DS_ BIT(9)
#define _MORE_FRAG_ BIT(10)
#define _RETRY_ BIT(11)
#define _PWRMGT_ BIT(12)
#define _MORE_DATA_ BIT(13)
#define _PRIVACY_ BIT(14)
#define _ORDER_ BIT(15)
#define SetToDs(pbuf) \ #define SetToDs(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_TO_DS_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_TODS); \
} while (0) } while (0)
#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_TO_DS_)) != 0) #define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_TODS)) != 0)
#define ClearToDs(pbuf) \ #define ClearToDs(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_TODS)); \
} while (0) } while (0)
#define SetFrDs(pbuf) \ #define SetFrDs(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_FROM_DS_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_FROMDS); \
} while (0) } while (0)
#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_FROM_DS_)) != 0) #define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_FROMDS)) != 0)
#define ClearFrDs(pbuf) \ #define ClearFrDs(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_FROMDS)); \
} while (0) } while (0)
#define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe)) #define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe))
@ -121,66 +112,66 @@ enum {
#define SetMFrag(pbuf) \ #define SetMFrag(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_MOREFRAGS); \
} while (0) } while (0)
#define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_FRAG_)) != 0) #define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_MOREFRAGS)) != 0)
#define ClearMFrag(pbuf) \ #define ClearMFrag(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)); \
} while (0) } while (0)
#define SetRetry(pbuf) \ #define SetRetry(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_RETRY_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_RETRY); \
} while (0) } while (0)
#define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_RETRY_)) != 0) #define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_RETRY)) != 0)
#define ClearRetry(pbuf) \ #define ClearRetry(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_RETRY)); \
} while (0) } while (0)
#define SetPwrMgt(pbuf) \ #define SetPwrMgt(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PWRMGT_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_PM); \
} while (0) } while (0)
#define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PWRMGT_)) != 0) #define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_PM)) != 0)
#define ClearPwrMgt(pbuf) \ #define ClearPwrMgt(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_PM)); \
} while (0) } while (0)
#define SetMData(pbuf) \ #define SetMData(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); \
} while (0) } while (0)
#define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_DATA_)) != 0) #define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_MOREDATA)) != 0)
#define ClearMData(pbuf) \ #define ClearMData(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_MOREDATA)); \
} while (0) } while (0)
#define SetPrivacy(pbuf) \ #define SetPrivacy(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PRIVACY_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); \
} while (0) } while (0)
#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PRIVACY_)) != 0) #define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_PROTECTED)) != 0)
#define ClearPrivacy(pbuf) \ #define ClearPrivacy(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \ *(unsigned short *)(pbuf) &= (~cpu_to_le16(IEEE80211_FCTL_PROTECTED)); \
} while (0) } while (0)
#define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0) #define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_ORDER)) != 0)
#define GetFrameType(pbuf) (le16_to_cpu(*(unsigned short *)(pbuf)) & (BIT(3) | BIT(2))) #define GetFrameType(pbuf) (le16_to_cpu(*(unsigned short *)(pbuf)) & (BIT(3) | BIT(2)))
@ -539,12 +530,12 @@ typedef enum _ELEMENT_ID {
#define set_order_bit(pbuf) \ #define set_order_bit(pbuf) \
do { \ do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \ *(unsigned short *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_ORDER); \
} while (0) } while (0)
#define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0) #define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(IEEE80211_FCTL_ORDER)) != 0)
#define ACT_CAT_VENDOR 0x7F/* 127 */ #define ACT_CAT_VENDOR 0x7F/* 127 */