1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
\r
20 #ifndef __IEEE80211_EXT_H
\r
21 #define __IEEE80211_EXT_H
\r
23 #include <drv_conf.h>
\r
24 #include <osdep_service.h>
\r
25 #include <drv_types.h>
\r
27 #define WMM_OUI_TYPE 2
\r
28 #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
\r
29 #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
\r
30 #define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
\r
31 #define WMM_VERSION 1
\r
33 #define WPA_PROTO_WPA BIT(0)
\r
34 #define WPA_PROTO_RSN BIT(1)
\r
36 #define WPA_KEY_MGMT_IEEE8021X BIT(0)
\r
37 #define WPA_KEY_MGMT_PSK BIT(1)
\r
38 #define WPA_KEY_MGMT_NONE BIT(2)
\r
39 #define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
\r
40 #define WPA_KEY_MGMT_WPA_NONE BIT(4)
\r
43 #define WPA_CAPABILITY_PREAUTH BIT(0)
\r
44 #define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6)
\r
45 #define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
\r
48 #define PMKID_LEN 16
\r
51 #ifdef PLATFORM_LINUX
\r
55 u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
\r
56 u8 version[2]; /* little endian */
\r
57 }__attribute__ ((packed));
\r
60 u8 elem_id; /* WLAN_EID_RSN */
\r
62 u8 version[2]; /* little endian */
\r
63 }__attribute__ ((packed));
\r
65 struct wme_ac_parameter {
\r
66 #if defined(CONFIG_LITTLE_ENDIAN)
\r
76 #elif defined(CONFIG_BIG_ENDIAN)
\r
87 #error "Please fix <endian.h>"
\r
92 } __attribute__ ((packed));
\r
94 struct wme_parameter_element {
\r
95 /* required fields for WME version 1 */
\r
102 struct wme_ac_parameter ac[4];
\r
104 } __attribute__ ((packed));
\r
108 #ifdef PLATFORM_WINDOWS
\r
112 struct wpa_ie_hdr {
\r
115 u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
\r
116 u8 version[2]; /* little endian */
\r
119 struct rsn_ie_hdr {
\r
120 u8 elem_id; /* WLAN_EID_RSN */
\r
122 u8 version[2]; /* little endian */
\r
129 #define WPA_PUT_LE16(a, val) \
\r
131 (a)[1] = ((u16) (val)) >> 8; \
\r
132 (a)[0] = ((u16) (val)) & 0xff; \
\r
135 #define WPA_PUT_BE32(a, val) \
\r
137 (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \
\r
138 (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \
\r
139 (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \
\r
140 (a)[3] = (u8) (((u32) (val)) & 0xff); \
\r
143 #define WPA_PUT_LE32(a, val) \
\r
145 (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
\r
146 (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
\r
147 (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
\r
148 (a)[0] = (u8) (((u32) (val)) & 0xff); \
\r
151 #define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
\r
152 //#define RSN_SELECTOR_PUT(a, val) WPA_PUT_LE32((u8 *) (a), (val))
\r
156 /* Action category code */
\r
157 enum ieee80211_category {
\r
158 WLAN_CATEGORY_SPECTRUM_MGMT = 0,
\r
159 WLAN_CATEGORY_QOS = 1,
\r
160 WLAN_CATEGORY_DLS = 2,
\r
161 WLAN_CATEGORY_BACK = 3,
\r
162 WLAN_CATEGORY_HT = 7,
\r
163 WLAN_CATEGORY_WMM = 17,
\r
166 /* SPECTRUM_MGMT action code */
\r
167 enum ieee80211_spectrum_mgmt_actioncode {
\r
168 WLAN_ACTION_SPCT_MSR_REQ = 0,
\r
169 WLAN_ACTION_SPCT_MSR_RPRT = 1,
\r
170 WLAN_ACTION_SPCT_TPC_REQ = 2,
\r
171 WLAN_ACTION_SPCT_TPC_RPRT = 3,
\r
172 WLAN_ACTION_SPCT_CHL_SWITCH = 4,
\r
173 WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5,
\r
176 /* BACK action code */
\r
177 enum ieee80211_back_actioncode {
\r
178 WLAN_ACTION_ADDBA_REQ = 0,
\r
179 WLAN_ACTION_ADDBA_RESP = 1,
\r
180 WLAN_ACTION_DELBA = 2,
\r
183 /* HT features action code */
\r
184 enum ieee80211_ht_actioncode {
\r
185 WLAN_ACTION_NOTIFY_CH_WIDTH = 0,
\r
186 WLAN_ACTION_SM_PS = 1,
\r
187 WLAN_ACTION_PSPM = 2,
\r
188 WLAN_ACTION_PCO_PHASE = 3,
\r
189 WLAN_ACTION_MIMO_CSI_MX = 4,
\r
190 WLAN_ACTION_MIMO_NONCP_BF = 5,
\r
191 WLAN_ACTION_MIMP_CP_BF = 6,
\r
192 WLAN_ACTION_ASEL_INDICATES_FB = 7,
\r
193 WLAN_ACTION_HI_INFO_EXCHG = 8,
\r
196 /* BACK (block-ack) parties */
\r
197 enum ieee80211_back_parties {
\r
198 WLAN_BACK_RECIPIENT = 0,
\r
199 WLAN_BACK_INITIATOR = 1,
\r
200 WLAN_BACK_TIMER = 2,
\r
203 #ifdef PLATFORM_LINUX
\r
205 struct ieee80211_mgmt {
\r
215 u16 auth_transaction;
\r
217 /* possibly followed by Challenge text */
\r
219 } __attribute__ ((packed)) auth;
\r
222 } __attribute__ ((packed)) deauth;
\r
225 u16 listen_interval;
\r
226 /* followed by SSID and Supported rates */
\r
228 } __attribute__ ((packed)) assoc_req;
\r
233 /* followed by Supported rates */
\r
235 } __attribute__ ((packed)) assoc_resp, reassoc_resp;
\r
238 u16 listen_interval;
\r
240 /* followed by SSID and Supported rates */
\r
242 } __attribute__ ((packed)) reassoc_req;
\r
245 } __attribute__ ((packed)) disassoc;
\r
250 /* followed by some of SSID, Supported rates,
\r
251 * FH Params, DS Params, CF Params, IBSS Params, TIM */
\r
253 } __attribute__ ((packed)) beacon;
\r
255 /* only variable items: SSID, Supported rates */
\r
257 } __attribute__ ((packed)) probe_req;
\r
262 /* followed by some of SSID, Supported rates,
\r
263 * FH Params, DS Params, CF Params, IBSS Params */
\r
265 } __attribute__ ((packed)) probe_resp;
\r
274 } __attribute__ ((packed)) wme_action;
\r
280 struct ieee80211_channel_sw_ie sw_elem;
\r
281 } __attribute__ ((packed)) chan_switch;
\r
287 struct ieee80211_msrment_ie msr_elem;
\r
288 } __attribute__ ((packed)) measurement;
\r
296 } __attribute__ ((packed)) addba_req;
\r
303 } __attribute__ ((packed)) addba_resp;
\r
308 } __attribute__ ((packed)) delba;
\r
311 /* capab_info for open and confirm,
\r
315 /* Followed in plink_confirm by status
\r
316 * code, AID and supported rates,
\r
317 * and directly by supported rates in
\r
318 * plink_open and plink_close
\r
321 } __attribute__ ((packed)) plink_action;
\r
325 } __attribute__ ((packed)) mesh_action;
\r
326 } __attribute__ ((packed)) u;
\r
327 } __attribute__ ((packed)) action;
\r
328 } __attribute__ ((packed)) u;
\r
329 }__attribute__ ((packed));
\r
334 #ifdef PLATFORM_WINDOWS
\r
338 struct ieee80211_mgmt {
\r
348 u16 auth_transaction;
\r
350 /* possibly followed by Challenge text */
\r
358 u16 listen_interval;
\r
359 /* followed by SSID and Supported rates */
\r
366 /* followed by Supported rates */
\r
368 } assoc_resp, reassoc_resp;
\r
371 u16 listen_interval;
\r
373 /* followed by SSID and Supported rates */
\r
384 /* followed by some of SSID, Supported rates,
\r
385 * FH Params, DS Params, CF Params, IBSS Params, TIM */
\r
389 /* only variable items: SSID, Supported rates */
\r
397 /* followed by some of SSID, Supported rates,
\r
398 * FH Params, DS Params, CF Params, IBSS Params */
\r
416 struct ieee80211_channel_sw_ie sw_elem;
\r
423 struct ieee80211_msrment_ie msr_elem;
\r
447 /* capab_info for open and confirm,
\r
451 /* Followed in plink_confirm by status
\r
452 * code, AID and supported rates,
\r
453 * and directly by supported rates in
\r
454 * plink_open and plink_close
\r
471 /* mgmt header + 1 byte category code */
\r
472 #define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)
\r