diff options
Diffstat (limited to 'drivers/staging/r8188eu/include/wifi.h')
-rw-r--r-- | drivers/staging/r8188eu/include/wifi.h | 60 |
1 files changed, 9 insertions, 51 deletions
diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/include/wifi.h index c331be19ff83..0254310bdf44 100644 --- a/drivers/staging/r8188eu/include/wifi.h +++ b/drivers/staging/r8188eu/include/wifi.h @@ -4,25 +4,14 @@ #ifndef _WIFI_H_ #define _WIFI_H_ +#include <linux/bits.h> #include <linux/ieee80211.h> -#ifdef BIT -/* error "BIT define occurred earlier elsewhere!\n" */ -#undef BIT -#endif -#define BIT(x) (1 << (x)) - #define WLAN_ETHHDR_LEN 14 #define WLAN_HDR_A3_LEN 24 #define WLAN_HDR_A3_QOS_LEN 26 #define WLAN_SSID_MAXLEN 32 -enum WIFI_FRAME_TYPE { - WIFI_CTRL_TYPE = (BIT(2)), - WIFI_DATA_TYPE = (BIT(3)), - WIFI_QOS_DATA_TYPE = (BIT(7)|BIT(3)), /* QoS Data */ -}; - enum WIFI_FRAME_SUBTYPE { /* below is for mgt frame */ WIFI_ASSOCREQ = (0 | IEEE80211_FTYPE_MGMT), @@ -39,24 +28,15 @@ enum WIFI_FRAME_SUBTYPE { WIFI_ACTION = (BIT(7) | BIT(6) | BIT(4) | IEEE80211_FTYPE_MGMT), /* below is for control frame */ - WIFI_PSPOLL = (BIT(7) | BIT(5) | WIFI_CTRL_TYPE), - WIFI_RTS = (BIT(7) | BIT(5) | BIT(4) | WIFI_CTRL_TYPE), - WIFI_CTS = (BIT(7) | BIT(6) | WIFI_CTRL_TYPE), - WIFI_ACK = (BIT(7) | BIT(6) | BIT(4) | WIFI_CTRL_TYPE), - WIFI_CFEND = (BIT(7) | BIT(6) | BIT(5) | WIFI_CTRL_TYPE), - WIFI_CFEND_CFACK = (BIT(7) | BIT(6) | BIT(5) | BIT(4) | - WIFI_CTRL_TYPE), + WIFI_PSPOLL = (BIT(7) | BIT(5) | IEEE80211_FTYPE_CTL), /* below is for data frame */ - WIFI_DATA = (0 | WIFI_DATA_TYPE), - WIFI_DATA_CFACK = (BIT(4) | WIFI_DATA_TYPE), - WIFI_DATA_CFPOLL = (BIT(5) | WIFI_DATA_TYPE), - WIFI_DATA_CFACKPOLL = (BIT(5) | BIT(4) | WIFI_DATA_TYPE), - WIFI_DATA_NULL = (BIT(6) | WIFI_DATA_TYPE), - WIFI_CF_ACK = (BIT(6) | BIT(4) | WIFI_DATA_TYPE), - WIFI_CF_POLL = (BIT(6) | BIT(5) | WIFI_DATA_TYPE), - WIFI_CF_ACKPOLL = (BIT(6) | BIT(5) | BIT(4) | WIFI_DATA_TYPE), - WIFI_QOS_DATA_NULL = (BIT(6) | WIFI_QOS_DATA_TYPE), + WIFI_DATA = (0 | IEEE80211_FTYPE_DATA), + WIFI_DATA_CFACK = (BIT(4) | IEEE80211_FTYPE_DATA), + WIFI_DATA_CFPOLL = (BIT(5) | IEEE80211_FTYPE_DATA), + WIFI_DATA_CFACKPOLL = (BIT(5) | BIT(4) | IEEE80211_FTYPE_DATA), + WIFI_DATA_NULL = (BIT(6) | IEEE80211_FTYPE_DATA), + WIFI_QOS_DATA_NULL = (BIT(6) | IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA), }; enum WIFI_REASON_CODE { @@ -172,8 +152,6 @@ enum WIFI_REG_DOMAIN { #define GetFrDs(pbuf) (((*(__le16 *)(pbuf)) & cpu_to_le16(_FROM_DS_)) != 0) -#define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe)) - #define SetMFrag(pbuf) \ *(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_) @@ -209,12 +187,6 @@ enum WIFI_REG_DOMAIN { *(__le16 *)(pbuf) |= cpu_to_le16(type); \ } while (0) -#define GetSequence(pbuf) \ - (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 22)) >> 4) - -#define GetFragNum(pbuf) \ - (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 22)) & 0x0f) - #define GetTupleCache(pbuf) \ (cpu_to_le16(*(unsigned short *)((size_t)(pbuf) + 22))) @@ -239,8 +211,6 @@ enum WIFI_REG_DOMAIN { #define SetPriority(pbuf, tid) \ *(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf) -#define GetPriority(pbuf) ((le16_to_cpu(*(__le16 *)(pbuf))) & 0xf) - #define SetEOSP(pbuf, eosp) \ *(__le16 *)(pbuf) |= cpu_to_le16((eosp & 1) << 4) @@ -254,8 +224,6 @@ enum WIFI_REG_DOMAIN { #define SetAMsdu(pbuf, amsdu) \ *(__le16 *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7) -#define GetAid(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 2)) & 0x3fff) - #define GetTid(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + \ (((GetToDs(pbuf)<<1) | GetFrDs(pbuf)) == 3 ? \ 30 : 24))) & 0x000f) @@ -270,10 +238,7 @@ enum WIFI_REG_DOMAIN { static inline bool IS_MCAST(unsigned char *da) { - if ((*da) & 0x01) - return true; - else - return false; + return (*da) & 0x01; } static inline unsigned char *get_da(unsigned char *pframe) @@ -345,13 +310,6 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe) return sa; } -static inline bool IsFrameTypeCtrl(unsigned char *pframe) -{ - if (WIFI_CTRL_TYPE == GetFrameType(pframe)) - return true; - else - return false; -} /*----------------------------------------------------------------------------- Below is for the security related definition ------------------------------------------------------------------------------*/ |