blob: 6235fe7f235c0235b22696426002d27c3ff5553f [file] [log] [blame]
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -07001/* p80211mgmt.h
2*
3* Macros, types, and functions to handle 802.11 mgmt frames
4*
5* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
6* --------------------------------------------------------------------
7*
8* linux-wlan
9*
10* The contents of this file are subject to the Mozilla Public
11* License Version 1.1 (the "License"); you may not use this file
12* except in compliance with the License. You may obtain a copy of
13* the License at http://www.mozilla.org/MPL/
14*
15* Software distributed under the License is distributed on an "AS
16* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17* implied. See the License for the specific language governing
18* rights and limitations under the License.
19*
20* Alternatively, the contents of this file may be used under the
21* terms of the GNU Public License version 2 (the "GPL"), in which
22* case the provisions of the GPL are applicable instead of the
23* above. If you wish to allow the use of your version of this file
24* only under the terms of the GPL and not to allow others to use
25* your version of this file under the MPL, indicate your decision
26* by deleting the provisions above and replace them with the notice
27* and other provisions required by the GPL. If you do not delete
28* the provisions above, a recipient may use your version of this
29* file under either the MPL or the GPL.
30*
31* --------------------------------------------------------------------
32*
33* Inquiries regarding the linux-wlan Open Source project can be
34* made directly to:
35*
36* AbsoluteValue Systems Inc.
37* info@linux-wlan.com
38* http://www.linux-wlan.com
39*
40* --------------------------------------------------------------------
41*
42* Portions of the development of this software were funded by
43* Intersil Corporation as part of PRISM(R) chipset product development.
44*
45* --------------------------------------------------------------------
46*
47* This file declares the constants and types used in the interface
48* between a wlan driver and the user mode utilities.
49*
50* Notes:
51* - Constant values are always in HOST byte order. To assign
52* values to multi-byte fields they _must_ be converted to
53* ieee byte order. To retrieve multi-byte values from incoming
54* frames, they must be converted to host order.
55*
56* - The len member of the frame structure does NOT!!! include
57* the MAC CRC. Therefore, the len field on rx'd frames should
58* have 4 subtracted from it.
59*
60* All functions declared here are implemented in p80211.c
61*
62* The types, macros, and functions defined here are primarily
63* used for encoding and decoding management frames. They are
64* designed to follow these patterns of use:
65*
66* DECODE:
67* 1) a frame of length len is received into buffer b
68* 2) using the hdr structure and macros, we determine the type
69* 3) an appropriate mgmt frame structure, mf, is allocated and zeroed
70* 4) mf.hdr = b
71* mf.buf = b
72* mf.len = len
73* 5) call mgmt_decode( mf )
74* 6) the frame field pointers in mf are now set. Note that any
75* multi-byte frame field values accessed using the frame field
76* pointers are in ieee byte order and will have to be converted
77* to host order.
78*
79* ENCODE:
80* 1) Library client allocates buffer space for maximum length
81* frame of the desired type
82* 2) Library client allocates a mgmt frame structure, called mf,
83* of the desired type
84* 3) Set the following:
85* mf.type = <desired type>
86* mf.buf = <allocated buffer address>
87* 4) call mgmt_encode( mf )
88* 5) all of the fixed field pointers and fixed length information element
89* pointers in mf are now set to their respective locations in the
90* allocated space (fortunately, all variable length information elements
91* fall at the end of their respective frames).
92* 5a) The length field is set to include the last of the fixed and fixed
93* length fields. It may have to be updated for optional or variable
94* length information elements.
95* 6) Optional and variable length information elements are special cases
96* and must be handled individually by the client code.
97* --------------------------------------------------------------------
98*/
99
100#ifndef _P80211MGMT_H
101#define _P80211MGMT_H
102
103/*================================================================*/
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700104/* Project Includes */
105
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700106
107#ifndef _P80211HDR_H
108#include "p80211hdr.h"
109#endif
110
111
112/*================================================================*/
113/* Constants */
114
115/*-- Information Element IDs --------------------*/
116#define WLAN_EID_SSID 0
117#define WLAN_EID_SUPP_RATES 1
118#define WLAN_EID_FH_PARMS 2
119#define WLAN_EID_DS_PARMS 3
120#define WLAN_EID_CF_PARMS 4
121#define WLAN_EID_TIM 5
122#define WLAN_EID_IBSS_PARMS 6
123/*-- values 7-15 reserved --*/
124#define WLAN_EID_CHALLENGE 16
125/*-- values 17-31 reserved for challenge text extension --*/
126/*-- values 32-255 reserved --*/
127
128/*-- Reason Codes -------------------------------*/
129#define WLAN_MGMT_REASON_RSVD 0
130#define WLAN_MGMT_REASON_UNSPEC 1
131#define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2
132#define WLAN_MGMT_REASON_DEAUTH_LEAVING 3
133#define WLAN_MGMT_REASON_DISASSOC_INACTIVE 4
134#define WLAN_MGMT_REASON_DISASSOC_AP_BUSY 5
135#define WLAN_MGMT_REASON_CLASS2_NONAUTH 6
136#define WLAN_MGMT_REASON_CLASS3_NONASSOC 7
137#define WLAN_MGMT_REASON_DISASSOC_STA_HASLEFT 8
138#define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9
139
140/*-- Status Codes -------------------------------*/
141#define WLAN_MGMT_STATUS_SUCCESS 0
142#define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1
143#define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10
144#define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC 11
145#define WLAN_MGMT_STATUS_ASSOC_DENIED_UNSPEC 12
146#define WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG 13
147#define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ 14
148#define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15
149#define WLAN_MGMT_STATUS_AUTH_TIMEOUT 16
150#define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY 17
151#define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18
152 /* p80211b additions */
153#define WLAN_MGMT_STATUS_ASSOC_DENIED_NOSHORT 19
154#define WLAN_MGMT_STATUS_ASSOC_DENIED_NOPBCC 20
155#define WLAN_MGMT_STATUS_ASSOC_DENIED_NOAGILITY 21
156
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700157/*-- Auth Algorithm Field ---------------------------*/
158#define WLAN_AUTH_ALG_OPENSYSTEM 0
159#define WLAN_AUTH_ALG_SHAREDKEY 1
160
161/*-- Management Frame Field Offsets -------------*/
162/* Note: Not all fields are listed because of variable lengths, */
163/* see the code in p80211.c to see how we search for fields */
164/* Note: These offsets are from the start of the frame data */
165
166#define WLAN_BEACON_OFF_TS 0
Solomon Peachyaaad4302008-10-29 10:42:53 -0400167#define WLAN_BEACON_OFF_BCN_int 8
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700168#define WLAN_BEACON_OFF_CAPINFO 10
169#define WLAN_BEACON_OFF_SSID 12
170
171#define WLAN_DISASSOC_OFF_REASON 0
172
173#define WLAN_ASSOCREQ_OFF_CAP_INFO 0
Solomon Peachyaaad4302008-10-29 10:42:53 -0400174#define WLAN_ASSOCREQ_OFF_LISTEN_int 2
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700175#define WLAN_ASSOCREQ_OFF_SSID 4
176
177#define WLAN_ASSOCRESP_OFF_CAP_INFO 0
178#define WLAN_ASSOCRESP_OFF_STATUS 2
179#define WLAN_ASSOCRESP_OFF_AID 4
180#define WLAN_ASSOCRESP_OFF_SUPP_RATES 6
181
182#define WLAN_REASSOCREQ_OFF_CAP_INFO 0
Solomon Peachyaaad4302008-10-29 10:42:53 -0400183#define WLAN_REASSOCREQ_OFF_LISTEN_int 2
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700184#define WLAN_REASSOCREQ_OFF_CURR_AP 4
185#define WLAN_REASSOCREQ_OFF_SSID 10
186
187#define WLAN_REASSOCRESP_OFF_CAP_INFO 0
188#define WLAN_REASSOCRESP_OFF_STATUS 2
189#define WLAN_REASSOCRESP_OFF_AID 4
190#define WLAN_REASSOCRESP_OFF_SUPP_RATES 6
191
192#define WLAN_PROBEREQ_OFF_SSID 0
193
194#define WLAN_PROBERESP_OFF_TS 0
Solomon Peachyaaad4302008-10-29 10:42:53 -0400195#define WLAN_PROBERESP_OFF_BCN_int 8
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700196#define WLAN_PROBERESP_OFF_CAP_INFO 10
197#define WLAN_PROBERESP_OFF_SSID 12
198
199#define WLAN_AUTHEN_OFF_AUTH_ALG 0
200#define WLAN_AUTHEN_OFF_AUTH_SEQ 2
201#define WLAN_AUTHEN_OFF_STATUS 4
202#define WLAN_AUTHEN_OFF_CHALLENGE 6
203
204#define WLAN_DEAUTHEN_OFF_REASON 0
205
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700206/*-- Capability Field ---------------------------*/
Moritz Muehlenhoff7f6e0e42009-01-25 21:54:55 +0100207#define WLAN_GET_MGMT_CAP_INFO_ESS(n) ((n) & BIT(0))
208#define WLAN_GET_MGMT_CAP_INFO_IBSS(n) (((n) & BIT(1)) >> 1)
209#define WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(n) (((n) & BIT(2)) >> 2)
210#define WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(n) (((n) & BIT(3)) >> 3)
211#define WLAN_GET_MGMT_CAP_INFO_PRIVACY(n) (((n) & BIT(4)) >> 4)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700212 /* p80211b additions */
Moritz Muehlenhoff7f6e0e42009-01-25 21:54:55 +0100213#define WLAN_GET_MGMT_CAP_INFO_SHORT(n) (((n) & BIT(5)) >> 5)
214#define WLAN_GET_MGMT_CAP_INFO_PBCC(n) (((n) & BIT(6)) >> 6)
215#define WLAN_GET_MGMT_CAP_INFO_AGILITY(n) (((n) & BIT(7)) >> 7)
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700216
217#define WLAN_SET_MGMT_CAP_INFO_ESS(n) (n)
218#define WLAN_SET_MGMT_CAP_INFO_IBSS(n) ((n) << 1)
219#define WLAN_SET_MGMT_CAP_INFO_CFPOLLABLE(n) ((n) << 2)
220#define WLAN_SET_MGMT_CAP_INFO_CFPOLLREQ(n) ((n) << 3)
221#define WLAN_SET_MGMT_CAP_INFO_PRIVACY(n) ((n) << 4)
222 /* p80211b additions */
223#define WLAN_SET_MGMT_CAP_INFO_SHORT(n) ((n) << 5)
224#define WLAN_SET_MGMT_CAP_INFO_PBCC(n) ((n) << 6)
225#define WLAN_SET_MGMT_CAP_INFO_AGILITY(n) ((n) << 7)
226
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700227/*-- Information Element Types --------------------*/
228/* prototype structure, all IEs start with these members */
229
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100230typedef struct wlan_ie {
231 u8 eid;
232 u8 len;
233} __attribute__ ((packed)) wlan_ie_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700234
235/*-- Service Set Identity (SSID) -----------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100236typedef struct wlan_ie_ssid {
237 u8 eid;
238 u8 len;
239 u8 ssid[1]; /* may be zero, ptrs may overlap */
240} __attribute__ ((packed)) wlan_ie_ssid_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700241
242/*-- Supported Rates -----------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100243typedef struct wlan_ie_supp_rates {
244 u8 eid;
245 u8 len;
246 u8 rates[1]; /* had better be at LEAST one! */
247} __attribute__ ((packed)) wlan_ie_supp_rates_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700248
249/*-- FH Parameter Set ----------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100250typedef struct wlan_ie_fh_parms {
251 u8 eid;
252 u8 len;
253 u16 dwell;
254 u8 hopset;
255 u8 hoppattern;
256 u8 hopindex;
257} __attribute__ ((packed)) wlan_ie_fh_parms_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700258
259/*-- DS Parameter Set ----------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100260typedef struct wlan_ie_ds_parms {
261 u8 eid;
262 u8 len;
263 u8 curr_ch;
264} __attribute__ ((packed)) wlan_ie_ds_parms_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700265
266/*-- CF Parameter Set ----------------------------*/
267
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100268typedef struct wlan_ie_cf_parms {
269 u8 eid;
270 u8 len;
271 u8 cfp_cnt;
272 u8 cfp_period;
273 u16 cfp_maxdur;
274 u16 cfp_durremaining;
275} __attribute__ ((packed)) wlan_ie_cf_parms_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700276
277/*-- TIM ------------------------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100278typedef struct wlan_ie_tim {
279 u8 eid;
280 u8 len;
281 u8 dtim_cnt;
282 u8 dtim_period;
283 u8 bitmap_ctl;
284 u8 virt_bm[1];
285} __attribute__ ((packed)) wlan_ie_tim_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700286
287/*-- IBSS Parameter Set ---------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100288typedef struct wlan_ie_ibss_parms {
289 u8 eid;
290 u8 len;
291 u16 atim_win;
292} __attribute__ ((packed)) wlan_ie_ibss_parms_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700293
294/*-- Challenge Text ------------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100295typedef struct wlan_ie_challenge {
296 u8 eid;
297 u8 len;
298 u8 challenge[1];
299} __attribute__ ((packed)) wlan_ie_challenge_t;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700300
301/*-------------------------------------------------*/
302/* Frame Types */
303
304/* prototype structure, all mgmt frame types will start with these members */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100305typedef struct wlan_fr_mgmt {
306 u16 type;
307 u16 len; /* DOES NOT include CRC !!!! */
308 u8 *buf;
309 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700310 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100311 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700312 /*-- fixed fields -----------*/
313 /*-- info elements ----------*/
314} wlan_fr_mgmt_t;
315
316/*-- Beacon ---------------------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100317typedef struct wlan_fr_beacon {
318 u16 type;
319 u16 len;
320 u8 *buf;
321 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700322 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100323 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700324 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100325 u64 *ts;
326 u16 *bcn_int;
327 u16 *cap_info;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700328 /*-- info elements ----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100329 wlan_ie_ssid_t *ssid;
330 wlan_ie_supp_rates_t *supp_rates;
331 wlan_ie_fh_parms_t *fh_parms;
332 wlan_ie_ds_parms_t *ds_parms;
333 wlan_ie_cf_parms_t *cf_parms;
334 wlan_ie_ibss_parms_t *ibss_parms;
335 wlan_ie_tim_t *tim;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700336
337} wlan_fr_beacon_t;
338
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700339/*-- IBSS ATIM ------------------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100340typedef struct wlan_fr_ibssatim {
341 u16 type;
342 u16 len;
343 u8 *buf;
344 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700345 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100346 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700347
348 /*-- fixed fields -----------*/
349 /*-- info elements ----------*/
350
351 /* this frame type has a null body */
352
353} wlan_fr_ibssatim_t;
354
355/*-- Disassociation -------------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100356typedef struct wlan_fr_disassoc {
357 u16 type;
358 u16 len;
359 u8 *buf;
360 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700361 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100362 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700363 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100364 u16 *reason;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700365
366 /*-- info elements ----------*/
367
368} wlan_fr_disassoc_t;
369
370/*-- Association Request --------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100371typedef struct wlan_fr_assocreq {
372 u16 type;
373 u16 len;
374 u8 *buf;
375 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700376 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100377 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700378 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100379 u16 *cap_info;
380 u16 *listen_int;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700381 /*-- info elements ----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100382 wlan_ie_ssid_t *ssid;
383 wlan_ie_supp_rates_t *supp_rates;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700384
385} wlan_fr_assocreq_t;
386
387/*-- Association Response -------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100388typedef struct wlan_fr_assocresp {
389 u16 type;
390 u16 len;
391 u8 *buf;
392 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700393 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100394 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700395 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100396 u16 *cap_info;
397 u16 *status;
398 u16 *aid;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700399 /*-- info elements ----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100400 wlan_ie_supp_rates_t *supp_rates;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700401
402} wlan_fr_assocresp_t;
403
404/*-- Reassociation Request ------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100405typedef struct wlan_fr_reassocreq {
406 u16 type;
407 u16 len;
408 u8 *buf;
409 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700410 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100411 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700412 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100413 u16 *cap_info;
414 u16 *listen_int;
415 u8 *curr_ap;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700416 /*-- info elements ----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100417 wlan_ie_ssid_t *ssid;
418 wlan_ie_supp_rates_t *supp_rates;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700419
420} wlan_fr_reassocreq_t;
421
422/*-- Reassociation Response -----------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100423typedef struct wlan_fr_reassocresp {
424 u16 type;
425 u16 len;
426 u8 *buf;
427 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700428 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100429 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700430 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100431 u16 *cap_info;
432 u16 *status;
433 u16 *aid;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700434 /*-- info elements ----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100435 wlan_ie_supp_rates_t *supp_rates;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700436
437} wlan_fr_reassocresp_t;
438
439/*-- Probe Request --------------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100440typedef struct wlan_fr_probereq {
441 u16 type;
442 u16 len;
443 u8 *buf;
444 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700445 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100446 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700447 /*-- fixed fields -----------*/
448 /*-- info elements ----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100449 wlan_ie_ssid_t *ssid;
450 wlan_ie_supp_rates_t *supp_rates;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700451
452} wlan_fr_probereq_t;
453
454/*-- Probe Response -------------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100455typedef struct wlan_fr_proberesp {
456 u16 type;
457 u16 len;
458 u8 *buf;
459 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700460 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100461 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700462 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100463 u64 *ts;
464 u16 *bcn_int;
465 u16 *cap_info;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700466 /*-- info elements ----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100467 wlan_ie_ssid_t *ssid;
468 wlan_ie_supp_rates_t *supp_rates;
469 wlan_ie_fh_parms_t *fh_parms;
470 wlan_ie_ds_parms_t *ds_parms;
471 wlan_ie_cf_parms_t *cf_parms;
472 wlan_ie_ibss_parms_t *ibss_parms;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700473} wlan_fr_proberesp_t;
474
475/*-- Authentication -------------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100476typedef struct wlan_fr_authen {
477 u16 type;
478 u16 len;
479 u8 *buf;
480 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700481 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100482 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700483 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100484 u16 *auth_alg;
485 u16 *auth_seq;
486 u16 *status;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700487 /*-- info elements ----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100488 wlan_ie_challenge_t *challenge;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700489
490} wlan_fr_authen_t;
491
492/*-- Deauthenication -----------------------------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100493typedef struct wlan_fr_deauthen {
494 u16 type;
495 u16 len;
496 u8 *buf;
497 p80211_hdr_t *hdr;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700498 /* used for target specific data, skb in Linux */
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100499 void *priv;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700500 /*-- fixed fields -----------*/
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100501 u16 *reason;
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700502
503 /*-- info elements ----------*/
504
505} wlan_fr_deauthen_t;
506
Moritz Muehlenhoffbb127932009-02-08 02:21:02 +0100507void wlan_mgmt_encode_beacon(wlan_fr_beacon_t *f);
508void wlan_mgmt_decode_beacon(wlan_fr_beacon_t *f);
509void wlan_mgmt_encode_disassoc(wlan_fr_disassoc_t *f);
510void wlan_mgmt_decode_disassoc(wlan_fr_disassoc_t *f);
511void wlan_mgmt_encode_assocreq(wlan_fr_assocreq_t *f);
512void wlan_mgmt_decode_assocreq(wlan_fr_assocreq_t *f);
513void wlan_mgmt_encode_assocresp(wlan_fr_assocresp_t *f);
514void wlan_mgmt_decode_assocresp(wlan_fr_assocresp_t *f);
515void wlan_mgmt_encode_reassocreq(wlan_fr_reassocreq_t *f);
516void wlan_mgmt_decode_reassocreq(wlan_fr_reassocreq_t *f);
517void wlan_mgmt_encode_reassocresp(wlan_fr_reassocresp_t *f);
518void wlan_mgmt_decode_reassocresp(wlan_fr_reassocresp_t *f);
519void wlan_mgmt_encode_probereq(wlan_fr_probereq_t *f);
520void wlan_mgmt_decode_probereq(wlan_fr_probereq_t *f);
521void wlan_mgmt_encode_proberesp(wlan_fr_proberesp_t *f);
522void wlan_mgmt_decode_proberesp(wlan_fr_proberesp_t *f);
523void wlan_mgmt_encode_authen(wlan_fr_authen_t *f);
524void wlan_mgmt_decode_authen(wlan_fr_authen_t *f);
525void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t *f);
526void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t *f);
Greg Kroah-Hartman00b3ed12008-10-02 11:29:28 -0700527
528#endif /* _P80211MGMT_H */