Go to the documentation of this file.
63 #include <linux/if_ether.h>
66 #define WLAN_CRC_LEN 4
67 #define WLAN_BSSID_LEN 6
68 #define WLAN_HDR_A3_LEN 24
69 #define WLAN_HDR_A4_LEN 30
70 #define WLAN_SSID_MAXLEN 32
71 #define WLAN_DATA_MAXLEN 2312
72 #define WLAN_WEP_IV_LEN 4
73 #define WLAN_WEP_ICV_LEN 4
77 #define WLAN_FTYPE_MGMT 0x00
78 #define WLAN_FTYPE_CTL 0x01
79 #define WLAN_FTYPE_DATA 0x02
83 #define WLAN_FSTYPE_ASSOCREQ 0x00
84 #define WLAN_FSTYPE_ASSOCRESP 0x01
85 #define WLAN_FSTYPE_REASSOCREQ 0x02
86 #define WLAN_FSTYPE_REASSOCRESP 0x03
87 #define WLAN_FSTYPE_PROBEREQ 0x04
88 #define WLAN_FSTYPE_PROBERESP 0x05
89 #define WLAN_FSTYPE_BEACON 0x08
90 #define WLAN_FSTYPE_ATIM 0x09
91 #define WLAN_FSTYPE_DISASSOC 0x0a
92 #define WLAN_FSTYPE_AUTHEN 0x0b
93 #define WLAN_FSTYPE_DEAUTHEN 0x0c
96 #define WLAN_FSTYPE_BLOCKACKREQ 0x8
97 #define WLAN_FSTYPE_BLOCKACK 0x9
98 #define WLAN_FSTYPE_PSPOLL 0x0a
99 #define WLAN_FSTYPE_RTS 0x0b
100 #define WLAN_FSTYPE_CTS 0x0c
101 #define WLAN_FSTYPE_ACK 0x0d
102 #define WLAN_FSTYPE_CFEND 0x0e
103 #define WLAN_FSTYPE_CFENDCFACK 0x0f
106 #define WLAN_FSTYPE_DATAONLY 0x00
107 #define WLAN_FSTYPE_DATA_CFACK 0x01
108 #define WLAN_FSTYPE_DATA_CFPOLL 0x02
109 #define WLAN_FSTYPE_DATA_CFACK_CFPOLL 0x03
110 #define WLAN_FSTYPE_NULL 0x04
111 #define WLAN_FSTYPE_CFACK 0x05
112 #define WLAN_FSTYPE_CFPOLL 0x06
113 #define WLAN_FSTYPE_CFACK_CFPOLL 0x07
134 #define WLAN_GET_FC_FTYPE(n) ((((u16)(n)) & (BIT(2) | BIT(3))) >> 2)
135 #define WLAN_GET_FC_FSTYPE(n) ((((u16)(n)) & (BIT(4)|BIT(5)|BIT(6)|BIT(7))) >> 4)
136 #define WLAN_GET_FC_TODS(n) ((((u16)(n)) & (BIT(8))) >> 8)
137 #define WLAN_GET_FC_FROMDS(n) ((((u16)(n)) & (BIT(9))) >> 9)
138 #define WLAN_GET_FC_ISWEP(n) ((((u16)(n)) & (BIT(14))) >> 14)
140 #define WLAN_SET_FC_FTYPE(n) (((u16)(n)) << 2)
141 #define WLAN_SET_FC_FSTYPE(n) (((u16)(n)) << 4)
142 #define WLAN_SET_FC_TODS(n) (((u16)(n)) << 8)
143 #define WLAN_SET_FC_FROMDS(n) (((u16)(n)) << 9)
144 #define WLAN_SET_FC_ISWEP(n) (((u16)(n)) << 14)
146 #define DOT11_RATE5_ISBASIC_GET(r) (((u8)(r)) & BIT(7))
176 #define WLAN_CTL_FRAMELEN(fstype) (\
177 (fstype) == WLAN_FSTYPE_BLOCKACKREQ ? 24 : \
178 (fstype) == WLAN_FSTYPE_BLOCKACK ? 152 : \
179 (fstype) == WLAN_FSTYPE_PSPOLL ? 20 : \
180 (fstype) == WLAN_FSTYPE_RTS ? 20 : \
181 (fstype) == WLAN_FSTYPE_CTS ? 14 : \
182 (fstype) == WLAN_FSTYPE_ACK ? 14 : \
183 (fstype) == WLAN_FSTYPE_CFEND ? 20 : \
184 (fstype) == WLAN_FSTYPE_CFENDCFACK ? 20 : 4)
186 #define WLAN_FCS_LEN 4