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 ******************************************************************************/
20 #ifndef __IEEE80211_EXT_H
21 #define __IEEE80211_EXT_H
23 #include <osdep_service.h>
24 #include <drv_types.h>
26 #define WMM_OUI_TYPE 2
27 #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
28 #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
29 #define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
32 #define WPA_PROTO_WPA BIT(0)
33 #define WPA_PROTO_RSN BIT(1)
35 #define WPA_KEY_MGMT_IEEE8021X BIT(0)
36 #define WPA_KEY_MGMT_PSK BIT(1)
37 #define WPA_KEY_MGMT_NONE BIT(2)
38 #define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
39 #define WPA_KEY_MGMT_WPA_NONE BIT(4)
42 #define WPA_CAPABILITY_PREAUTH BIT(0)
43 #define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6)
44 #define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
53 u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
54 u8 version[2]; /* little endian */
58 u8 elem_id; /* WLAN_EID_RSN */
60 u8 version[2]; /* little endian */
63 struct wme_ac_parameter {
64 #if defined(__LITTLE_ENDIAN)
74 #elif defined(__BIG_ENDIAN)
85 #error "Please fix <endian.h>"
92 struct wme_parameter_element {
93 /* required fields for WME version 1 */
100 struct wme_ac_parameter ac[4];
104 #define WPA_PUT_LE16(a, val) \
106 (a)[1] = ((u16)(val)) >> 8; \
107 (a)[0] = ((u16)(val)) & 0xff; \
110 #define WPA_PUT_BE32(a, val) \
112 (a)[0] = (u8)((((u32) (val)) >> 24) & 0xff); \
113 (a)[1] = (u8)((((u32) (val)) >> 16) & 0xff); \
114 (a)[2] = (u8)((((u32) (val)) >> 8) & 0xff); \
115 (a)[3] = (u8)(((u32) (val)) & 0xff); \
118 #define WPA_PUT_LE32(a, val) \
120 (a)[3] = (u8)((((u32) (val)) >> 24) & 0xff); \
121 (a)[2] = (u8)((((u32) (val)) >> 16) & 0xff); \
122 (a)[1] = (u8)((((u32) (val)) >> 8) & 0xff); \
123 (a)[0] = (u8)(((u32) (val)) & 0xff); \
126 #define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *)(a), (val))
128 /* Action category code */
129 enum ieee80211_category {
130 WLAN_CATEGORY_SPECTRUM_MGMT = 0,
131 WLAN_CATEGORY_QOS = 1,
132 WLAN_CATEGORY_DLS = 2,
133 WLAN_CATEGORY_BACK = 3,
134 WLAN_CATEGORY_HT = 7,
135 WLAN_CATEGORY_WMM = 17,
138 /* SPECTRUM_MGMT action code */
139 enum ieee80211_spectrum_mgmt_actioncode {
140 WLAN_ACTION_SPCT_MSR_REQ = 0,
141 WLAN_ACTION_SPCT_MSR_RPRT = 1,
142 WLAN_ACTION_SPCT_TPC_REQ = 2,
143 WLAN_ACTION_SPCT_TPC_RPRT = 3,
144 WLAN_ACTION_SPCT_CHL_SWITCH = 4,
145 WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5,
148 /* BACK action code */
149 enum ieee80211_back_actioncode {
150 WLAN_ACTION_ADDBA_REQ = 0,
151 WLAN_ACTION_ADDBA_RESP = 1,
152 WLAN_ACTION_DELBA = 2,
155 /* HT features action code */
156 enum ieee80211_ht_actioncode {
157 WLAN_ACTION_NOTIFY_CH_WIDTH = 0,
158 WLAN_ACTION_SM_PS = 1,
159 WLAN_ACTION_PSPM = 2,
160 WLAN_ACTION_PCO_PHASE = 3,
161 WLAN_ACTION_MIMO_CSI_MX = 4,
162 WLAN_ACTION_MIMO_NONCP_BF = 5,
163 WLAN_ACTION_MIMP_CP_BF = 6,
164 WLAN_ACTION_ASEL_INDICATES_FB = 7,
165 WLAN_ACTION_HI_INFO_EXCHG = 8,
168 /* BACK (block-ack) parties */
169 enum ieee80211_back_parties {
170 WLAN_BACK_RECIPIENT = 0,
171 WLAN_BACK_INITIATOR = 1,
175 struct ieee80211_mgmt {
185 u16 auth_transaction;
187 /* possibly followed by Challenge text */
196 /* followed by SSID and Supported rates */
198 } __packed assoc_req;
203 /* followed by Supported rates */
205 } __packed assoc_resp, reassoc_resp;
210 /* followed by SSID and Supported rates */
212 } __packed reassoc_req;
220 /* followed by some of SSID, Supported rates,
221 * FH Params, DS Params, CF Params, IBSS Params, TIM */
225 /* only variable items: SSID, Supported rates */
227 } __packed probe_req;
232 /* followed by some of SSID, Supported rates,
233 * FH Params, DS Params, CF Params, IBSS Params */
235 } __packed probe_resp;
244 } __packed wme_action;
251 } __packed addba_req;
258 } __packed addba_resp;
266 /* capab_info for open and confirm,
270 /* Followed in plink_confirm by status
271 * code, AID and supported rates,
272 * and directly by supported rates in
273 * plink_open and plink_close
276 } __packed plink_action;
280 } __packed mesh_action;
286 /* mgmt header + 1 byte category code */
287 #define IEEE80211_MIN_ACTION_SIZE \
288 FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)