Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
80211mgr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  *
20  * File: 80211mgr.h
21  *
22  * Purpose: 802.11 management frames pre-defines.
23  *
24  *
25  * Author: Lyndon Chen
26  *
27  * Date: May 8, 2002
28  *
29  */
30 
31 #ifndef __80211MGR_H__
32 #define __80211MGR_H__
33 
34 #include "ttype.h"
35 #include "80211hdr.h"
36 
37 /*--------------------- Export Definitions -------------------------*/
38 
39 #define WLAN_MIN_ARRAY 1
40 
41 // Information Element ID value
42 #define WLAN_EID_SSID 0
43 #define WLAN_EID_SUPP_RATES 1
44 #define WLAN_EID_FH_PARMS 2
45 #define WLAN_EID_DS_PARMS 3
46 #define WLAN_EID_CF_PARMS 4
47 #define WLAN_EID_TIM 5
48 #define WLAN_EID_IBSS_PARMS 6
49 #define WLAN_EID_COUNTRY 7
50 #define WLAN_EID_CHALLENGE 16
51 #define WLAN_EID_PWR_CONSTRAINT 32
52 #define WLAN_EID_PWR_CAPABILITY 33
53 #define WLAN_EID_TPC_REQ 34
54 #define WLAN_EID_TPC_REP 35
55 #define WLAN_EID_SUPP_CH 36
56 #define WLAN_EID_CH_SWITCH 37
57 #define WLAN_EID_MEASURE_REQ 38
58 #define WLAN_EID_MEASURE_REP 39
59 #define WLAN_EID_QUIET 40
60 #define WLAN_EID_IBSS_DFS 41
61 #define WLAN_EID_ERP 42
62 // reference 802.11i 7.3.2 table 20
63 #define WLAN_EID_RSN 48
64 #define WLAN_EID_EXTSUPP_RATES 50
65 // reference WiFi WPA spec.
66 #define WLAN_EID_RSN_WPA 221
67 
68 #ifdef Cisco_ccx
69 #define WLAN_EID_CCX 133
70 #define WLAN_EID_CCX_IP 149
71 #define WLAN_EID_CCX_Ver 221
72 #endif
73 
74 #define WLAN_EID_ERP_NONERP_PRESENT 0x01
75 #define WLAN_EID_ERP_USE_PROTECTION 0x02
76 #define WLAN_EID_ERP_BARKER_MODE 0x04
77 
78 // Reason Codes
79 #define WLAN_MGMT_REASON_RSVD 0
80 #define WLAN_MGMT_REASON_UNSPEC 1
81 #define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2
82 #define WLAN_MGMT_REASON_DEAUTH_LEAVING 3
83 #define WLAN_MGMT_REASON_DISASSOC_INACTIVE 4
84 #define WLAN_MGMT_REASON_DISASSOC_AP_BUSY 5
85 #define WLAN_MGMT_REASON_CLASS2_NONAUTH 6
86 #define WLAN_MGMT_REASON_CLASS3_NONASSOC 7
87 #define WLAN_MGMT_REASON_DISASSOC_STA_HASLEFT 8
88 #define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9
89 #define WLAN_MGMT_REASON_DISASSOC_PWR_CAP_UNACCEPT 10
90 #define WLAN_MGMT_REASON_DISASSOC_SUPP_CH_UNACCEPT 11
91 #define WLAN_MGMT_REASON_INVALID_IE 13
92 #define WLAN_MGMT_REASON_MIC_FAILURE 14
93 #define WLAN_MGMT_REASON_4WAY_HANDSHAKE_TIMEOUT 15
94 #define WLAN_MGMT_REASON_GRPKEY_UPDATE_TIMEOUT 16
95 #define WLAN_MGMT_REASON_4WAY_INFO_DIFFERENT 17
96 #define WLAN_MGMT_REASON_MULTCAST_CIPHER_INVALID 18
97 #define WLAN_MGMT_REASON_UNCAST_CIPHER_INVALID 19
98 #define WLAN_MGMT_REASON_AKMP_INVALID 20
99 #define WLAN_MGMT_REASON_RSNE_UNSUPPORTED 21
100 #define WLAN_MGMT_REASON_RSNE_CAP_INVALID 22
101 #define WLAN_MGMT_REASON_80211X_AUTH_FAILED 23
102 
103 // Status Codes
104 #define WLAN_MGMT_STATUS_SUCCESS 0
105 #define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1
106 #define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10
107 #define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC 11
108 #define WLAN_MGMT_STATUS_ASSOC_DENIED_UNSPEC 12
109 #define WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG 13
110 #define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ 14
111 #define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15
112 #define WLAN_MGMT_STATUS_AUTH_TIMEOUT 16
113 #define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY 17
114 #define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18
115 #define WLAN_MGMT_STATUS_ASSOC_DENIED_SHORTPREAMBLE 19
116 #define WLAN_MGMT_STATUS_ASSOC_DENIED_PBCC 20
117 #define WLAN_MGMT_STATUS_ASSOC_DENIED_AGILITY 21
118 
119 // reference 802.11h 7.3.1.9
120 //
121 #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_SPECTRUM_MNG 22
122 #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_PWR_CAP 23
123 #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_SUPP_CH 24
124 //
125 // reference 802.11g 7.3.1.9
126 //
127 #define WLAN_MGMT_STATUS_SHORTSLOTTIME_UNSUPPORTED 25
128 #define WLAN_MGMT_STATUS_DSSSOFDM_UNSUPPORTED 26
129 //
130 // reference 802.11i 7.3.1.9 table 19
131 //
132 #define WLAN_MGMT_STATUS_INVALID_IE 40
133 #define WLAN_MGMT_STATUS_GROUP_CIPHER_INVALID 41
134 #define WLAN_MGMT_STATUS_PAIRWISE_CIPHER_INVALID 42
135 #define WLAN_MGMT_STATUS_AKMP_INVALID 43
136 #define WLAN_MGMT_STATUS_UNSUPPORT_RSN_IE_VER 44
137 #define WLAN_MGMT_STATUS_INVALID_RSN_IE_CAP 45
138 #define WLAN_MGMT_STATUS_CIPHER_REJECT 46
139 
140 
141 
142 // Auth Algorithm
143 #define WLAN_AUTH_ALG_OPENSYSTEM 0
144 #define WLAN_AUTH_ALG_SHAREDKEY 1
145 
146 
147 
148 // Management Frame Field Offsets
149 // Note: Not all fields are listed because of variable lengths.
150 // Note: These offsets are from the start of the frame data
151 
152 #define WLAN_BEACON_OFF_TS 0
153 #define WLAN_BEACON_OFF_BCN_INT 8
154 #define WLAN_BEACON_OFF_CAPINFO 10
155 #define WLAN_BEACON_OFF_SSID 12
156 
157 #define WLAN_DISASSOC_OFF_REASON 0
158 
159 #define WLAN_ASSOCREQ_OFF_CAP_INFO 0
160 #define WLAN_ASSOCREQ_OFF_LISTEN_INT 2
161 #define WLAN_ASSOCREQ_OFF_SSID 4
162 
163 #define WLAN_ASSOCRESP_OFF_CAP_INFO 0
164 #define WLAN_ASSOCRESP_OFF_STATUS 2
165 #define WLAN_ASSOCRESP_OFF_AID 4
166 #define WLAN_ASSOCRESP_OFF_SUPP_RATES 6
167 
168 #define WLAN_REASSOCREQ_OFF_CAP_INFO 0
169 #define WLAN_REASSOCREQ_OFF_LISTEN_INT 2
170 #define WLAN_REASSOCREQ_OFF_CURR_AP 4
171 #define WLAN_REASSOCREQ_OFF_SSID 10
172 
173 #define WLAN_REASSOCRESP_OFF_CAP_INFO 0
174 #define WLAN_REASSOCRESP_OFF_STATUS 2
175 #define WLAN_REASSOCRESP_OFF_AID 4
176 #define WLAN_REASSOCRESP_OFF_SUPP_RATES 6
177 
178 #define WLAN_PROBEREQ_OFF_SSID 0
179 
180 #define WLAN_PROBERESP_OFF_TS 0
181 #define WLAN_PROBERESP_OFF_BCN_INT 8
182 #define WLAN_PROBERESP_OFF_CAP_INFO 10
183 #define WLAN_PROBERESP_OFF_SSID 12
184 
185 #define WLAN_AUTHEN_OFF_AUTH_ALG 0
186 #define WLAN_AUTHEN_OFF_AUTH_SEQ 2
187 #define WLAN_AUTHEN_OFF_STATUS 4
188 #define WLAN_AUTHEN_OFF_CHALLENGE 6
189 
190 #define WLAN_DEAUTHEN_OFF_REASON 0
191 
192 
193 //
194 // Cipher Suite Selectors defined in 802.11i
195 //
196 #define WLAN_11i_CSS_USE_GROUP 0
197 #define WLAN_11i_CSS_WEP40 1
198 #define WLAN_11i_CSS_TKIP 2
199 #define WLAN_11i_CSS_CCMP 4
200 #define WLAN_11i_CSS_WEP104 5
201 #define WLAN_11i_CSS_UNKNOWN 255
202 
203 //
204 // Authentication and Key Management Suite Selectors defined in 802.11i
205 //
206 #define WLAN_11i_AKMSS_802_1X 1
207 #define WLAN_11i_AKMSS_PSK 2
208 #define WLAN_11i_AKMSS_UNKNOWN 255
209 
210 // Measurement type definitions reference ieee 802.11h Table 20b
211 #define MEASURE_TYPE_BASIC 0
212 #define MEASURE_TYPE_CCA 1
213 #define MEASURE_TYPE_RPI 2
214 
215 // Measurement request mode definitions reference ieee 802.11h Figure 46h
216 #define MEASURE_MODE_ENABLE 0x02
217 #define MEASURE_MODE_REQ 0x04
218 #define MEASURE_MODE_REP 0x08
219 
220 // Measurement report mode definitions reference ieee 802.11h Figure 46m
221 #define MEASURE_MODE_LATE 0x01
222 #define MEASURE_MODE_INCAPABLE 0x02
223 #define MEASURE_MODE_REFUSED 0x04
224 
225 /*--------------------- Export Classes ----------------------------*/
226 
227 /*--------------------- Export Variables --------------------------*/
228 
229 /*--------------------- Export Types ------------------------------*/
230 
231 // Information Element Types
232 
233 #pragma pack(1)
234 typedef struct tagWLAN_IE {
237 } __attribute__ ((__packed__))
238 WLAN_IE, *PWLAN_IE;
240 // Service Set Identity (SSID)
241 #pragma pack(1)
242 typedef struct tagWLAN_IE_SSID {
246 } __attribute__ ((__packed__))
247 WLAN_IE_SSID, *PWLAN_IE_SSID;
248 
249 // Supported Rates
250 #pragma pack(1)
251 typedef struct tagWLAN_IE_SUPP_RATES {
255 } __attribute__ ((__packed__))
256 WLAN_IE_SUPP_RATES, *PWLAN_IE_SUPP_RATES;
257 
258 // FH Parameter Set
259 #pragma pack(1)
260 typedef struct _WLAN_IE_FH_PARMS {
268 
269 // DS Parameter Set
270 #pragma pack(1)
271 typedef struct tagWLAN_IE_DS_PARMS {
275 } __attribute__ ((__packed__))
276 WLAN_IE_DS_PARMS, *PWLAN_IE_DS_PARMS;
277 
278 // CF Parameter Set
279 #pragma pack(1)
280 typedef struct tagWLAN_IE_CF_PARMS {
287 } __attribute__ ((__packed__))
288 WLAN_IE_CF_PARMS, *PWLAN_IE_CF_PARMS;
289 
290 // TIM
291 #pragma pack(1)
292 typedef struct tagWLAN_IE_TIM {
299 } __attribute__ ((__packed__))
300 WLAN_IE_TIM, *PWLAN_IE_TIM;
301 
302 // IBSS Parameter Set
303 #pragma pack(1)
304 typedef struct tagWLAN_IE_IBSS_PARMS {
308 } __attribute__ ((__packed__))
309 WLAN_IE_IBSS_PARMS, *PWLAN_IE_IBSS_PARMS;
310 
311 // Challenge Text
312 #pragma pack(1)
313 typedef struct tagWLAN_IE_CHALLENGE {
317 } __attribute__ ((__packed__))
318 WLAN_IE_CHALLENGE, *PWLAN_IE_CHALLENGE;
319 
320 #pragma pack(1)
321 typedef struct tagWLAN_IE_RSN_EXT {
328  struct {
329  BYTE abyOUI[4];
330  } PKSList[1]; // the rest is variable so need to
331  // overlay ieauth structure
333 
334 #pragma pack(1)
335 typedef struct tagWLAN_IE_RSN_AUTH {
337  struct {
339  } AuthKSList[1];
341 
342 // RSN Identity
343 #pragma pack(1)
344 typedef struct tagWLAN_IE_RSN {
350 
351 
352 // CCX Identity DavidWang
353 #pragma pack(1)
354 typedef struct tagWLAN_IE_CCX {
359 #pragma pack(1)
360 typedef struct tagWLAN_IE_CCX_IP {
367 #pragma pack(1)
368 typedef struct tagWLAN_IE_CCX_Ver {
373 
374 
375 
376 // ERP
377 #pragma pack(1)
378 typedef struct tagWLAN_IE_ERP {
382 } __attribute__ ((__packed__))
383 WLAN_IE_ERP, *PWLAN_IE_ERP;
384 
385 #pragma pack(1)
386 typedef struct _MEASEURE_REQ {
394 
395 typedef struct _MEASEURE_REP_BASIC {
401 
402 typedef struct _MEASEURE_REP_CCA {
408 
409 typedef struct _MEASEURE_REP_RPI {
415 
416 typedef union _MEASEURE_REP {
417 
421 
423 
424 typedef struct _WLAN_IE_MEASURE_REQ {
432 
433 typedef struct _WLAN_IE_MEASURE_REP {
441 
442 typedef struct _WLAN_IE_CH_SW {
449 
450 typedef struct _WLAN_IE_QUIET {
458 
459 typedef struct _WLAN_IE_COUNTRY {
465 
466 typedef struct _WLAN_IE_PW_CONST {
471 
472 typedef struct _WLAN_IE_PW_CAP {
478 
479 typedef struct _WLAN_IE_SUPP_CH {
484 
485 typedef struct _WLAN_IE_TPC_REQ {
489 
490 typedef struct _WLAN_IE_TPC_REP {
496 
497 
498 typedef struct _WLAN_IE_IBSS_DFS {
505 
506 #pragma pack()
507 
508 
509 
510 // Frame Types
511 // prototype structure, all mgmt frame types will start with these members
512 typedef struct tagWLAN_FR_MGMT {
513 
514  unsigned int uType;
515  unsigned int len;
518 
520 
521 // Beacon frame
522 typedef struct tagWLAN_FR_BEACON {
523 
524  unsigned int uType;
525  unsigned int len;
528  // fixed fields
532  /*-- info elements ----------*/
535 // PWLAN_IE_FH_PARMS pFHParms;
540  PWLAN_IE_RSN pRSN;
541  PWLAN_IE_RSN_EXT pRSNWPA;
544  PWLAN_IE_COUNTRY pIE_Country;
545  PWLAN_IE_PW_CONST pIE_PowerConstraint;
546  PWLAN_IE_CH_SW pIE_CHSW;
547  PWLAN_IE_IBSS_DFS pIE_IBSSDFS;
548  PWLAN_IE_QUIET pIE_Quiet;
549 
551 
552 
553 // IBSS ATIM frame
554 typedef struct tagWLAN_FR_IBSSATIM {
555 
556  unsigned int uType;
557  unsigned int len;
560 
561  // fixed fields
562  // info elements
563  // this frame type has a null body
564 
566 
567 // Disassociation
568 typedef struct tagWLAN_FR_DISASSOC {
569 
570  unsigned int uType;
571  unsigned int len;
574  /*-- fixed fields -----------*/
576  /*-- info elements ----------*/
577 
579 
580 // Association Request
581 typedef struct tagWLAN_FR_ASSOCREQ {
582 
583  unsigned int uType;
584  unsigned int len;
587  /*-- fixed fields -----------*/
590  /*-- info elements ----------*/
593  PWLAN_IE_RSN pRSN;
594  PWLAN_IE_CCX pCCX;
595  PWLAN_IE_CCX_IP pCCXIP;
596  PWLAN_IE_CCX_Ver pCCXVER;
597  PWLAN_IE_RSN_EXT pRSNWPA;
599  PWLAN_IE_PW_CAP pCurrPowerCap;
600  PWLAN_IE_SUPP_CH pCurrSuppCh;
601 
603 
604 // Association Response
605 typedef struct tagWLAN_FR_ASSOCRESP {
606 
607  unsigned int uType;
608  unsigned int len;
611  /*-- fixed fields -----------*/
615  /*-- info elements ----------*/
618 
620 
621 // Reassociation Request
622 typedef struct tagWLAN_FR_REASSOCREQ {
623 
624  unsigned int uType;
625  unsigned int len;
628 
629  /*-- fixed fields -----------*/
633 
634  /*-- info elements ----------*/
637  PWLAN_IE_RSN pRSN;
638  PWLAN_IE_CCX pCCX;
639  PWLAN_IE_CCX_IP pCCXIP;
640  PWLAN_IE_CCX_Ver pCCXVER;
641  PWLAN_IE_RSN_EXT pRSNWPA;
643 
645 
646 // Reassociation Response
647 typedef struct tagWLAN_FR_REASSOCRESP {
648 
649  unsigned int uType;
650  unsigned int len;
653  /*-- fixed fields -----------*/
657  /*-- info elements ----------*/
660 
662 
663 // Probe Request
664 typedef struct tagWLAN_FR_PROBEREQ {
665 
666  unsigned int uType;
667  unsigned int len;
670  /*-- fixed fields -----------*/
671  /*-- info elements ----------*/
675 
677 
678 // Probe Response
679 typedef struct tagWLAN_FR_PROBERESP {
680 
681  unsigned int uType;
682  unsigned int len;
685  /*-- fixed fields -----------*/
689  /*-- info elements ----------*/
695  PWLAN_IE_RSN pRSN;
696  PWLAN_IE_RSN_EXT pRSNWPA;
699  PWLAN_IE_COUNTRY pIE_Country;
700  PWLAN_IE_PW_CONST pIE_PowerConstraint;
701  PWLAN_IE_CH_SW pIE_CHSW;
702  PWLAN_IE_IBSS_DFS pIE_IBSSDFS;
703  PWLAN_IE_QUIET pIE_Quiet;
704 
706 
707 // Authentication
708 typedef struct tagWLAN_FR_AUTHEN {
709 
710  unsigned int uType;
711  unsigned int len;
714  /*-- fixed fields -----------*/
718  /*-- info elements ----------*/
720 
722 
723 // Deauthentication
724 typedef struct tagWLAN_FR_DEAUTHEN {
725 
726  unsigned int uType;
727  unsigned int len;
730  /*-- fixed fields -----------*/
732 
733  /*-- info elements ----------*/
734 
736 
737 /*--------------------- Export Functions --------------------------*/
738 void
740  PWLAN_FR_BEACON pFrame
741  );
742 
743 void
745  PWLAN_FR_BEACON pFrame
746  );
747 
748 void
750  PWLAN_FR_IBSSATIM pFrame
751  );
752 
753 void
755  PWLAN_FR_IBSSATIM pFrame
756  );
757 
758 void
760  PWLAN_FR_DISASSOC pFrame
761  );
762 
763 void
765  PWLAN_FR_DISASSOC pFrame
766  );
767 
768 void
770  PWLAN_FR_ASSOCREQ pFrame
771  );
772 
773 void
775  PWLAN_FR_ASSOCREQ pFrame
776  );
777 
778 void
780  PWLAN_FR_ASSOCRESP pFrame
781  );
782 
783 void
785  PWLAN_FR_ASSOCRESP pFrame
786  );
787 
788 void
790  PWLAN_FR_REASSOCREQ pFrame
791  );
792 
793 void
795  PWLAN_FR_REASSOCREQ pFrame
796  );
797 
798 void
800  PWLAN_FR_PROBEREQ pFrame
801  );
802 
803 void
805  PWLAN_FR_PROBEREQ pFrame
806  );
807 
808 void
810  PWLAN_FR_PROBERESP pFrame
811  );
812 
813 void
815  PWLAN_FR_PROBERESP pFrame
816  );
817 
818 void
820  PWLAN_FR_AUTHEN pFrame
821  );
822 
823 void
825  PWLAN_FR_AUTHEN pFrame
826  );
827 
828 void
830  PWLAN_FR_DEAUTHEN pFrame
831  );
832 
833 void
835  PWLAN_FR_DEAUTHEN pFrame
836  );
837 
838 void
840  PWLAN_FR_REASSOCRESP pFrame
841  );
842 
843 void
845  PWLAN_FR_REASSOCRESP pFrame
846  );
847 
848 #endif// __80211MGR_H__