• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * 802_11Defs.h
3  *
4  * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  *  * Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *  * Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *  * Neither the name Texas Instruments nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 
35 /****************************************************************************
36  *
37  *   MODULE:  802_11Defs.h
38  *   PURPOSE: Contains 802.11 defines/structures
39  *
40  ****************************************************************************/
41 
42 #ifndef _802_11_INFO_DEFS_H
43 #define _802_11_INFO_DEFS_H
44 
45 #include "tidef.h"
46 #include "osDot11.h"
47 #ifdef XCC_MODULE_INCLUDED
48 #include "osDot11XCC.h"
49 #endif
50 
51 #define DOT11_OUI_LEN                       4
52 #define DOT11_COUNTRY_STRING_LEN            3
53 #define DOT11_MAX_SUPPORTED_RATES           32
54 
55 /* Maximum size of beacon or probe-request information element */
56 #define DOT11_WSC_PROBE_REQ_MAX_LENGTH 80
57 
58 
59 typedef enum
60 {
61     DOT11_B_MODE    = 1,
62     DOT11_A_MODE    = 2,
63     DOT11_G_MODE    = 3,
64     DOT11_DUAL_MODE = 4,
65     DOT11_N_MODE    = 5,
66 
67     DOT11_MAX_MODE
68 
69 } EDot11Mode;
70 
71 
72 /* FrameControl field of the 802.11 header  */
73 
74 /**/
75 /* bit 15    14     13     12     11     10      9     8     7-4     3-2      1-0*/
76 /* +-------+-----+------+-----+-------+------+------+----+---------+------+----------+*/
77 /* | Order | WEP | More | Pwr | Retry | More | From | To | Subtype | Type | Protocol |*/
78 /* |       |     | Data | Mgmt|       | Frag | DS   | DS |         |      | Version  |*/
79 /* +-------+-----+------+-----+-------+------+------+----+---------+------+----------+*/
80 /*     1      1      1     1      1       1      1     1       4       2        2*/
81 
82 
83 #define DOT11_FC_PROT_VERSION_MASK   ( 3 << 0 )
84 #define DOT11_FC_PROT_VERSION        ( 0 << 0 )
85 
86 #define DOT11_FC_TYPE_MASK           ( 3 << 2 )
87 typedef enum
88 {
89   DOT11_FC_TYPE_MGMT         = ( 0 << 2 ),
90   DOT11_FC_TYPE_CTRL         = ( 1 << 2 ),
91   DOT11_FC_TYPE_DATA         = ( 2 << 2 )
92 } dot11_Fc_Type_e;
93 
94 #define DOT11_FC_SUB_MASK           ( 0x0f << 4 )
95 typedef enum
96 {
97   /* Management subtypes */
98   DOT11_FC_SUB_ASSOC_REQ     = (    0 << 4 ),
99   DOT11_FC_SUB_ASSOC_RESP    = (    1 << 4 ),
100   DOT11_FC_SUB_REASSOC_REQ   = (    2 << 4 ),
101   DOT11_FC_SUB_REASSOC_RESP  = (    3 << 4 ),
102   DOT11_FC_SUB_PROBE_REQ     = (    4 << 4 ),
103   DOT11_FC_SUB_PROBE_RESP    = (    5 << 4 ),
104   DOT11_FC_SUB_BEACON        = (    8 << 4 ),
105   DOT11_FC_SUB_ATIM          = (    9 << 4 ),
106   DOT11_FC_SUB_DISASSOC      = (   10 << 4 ),
107   DOT11_FC_SUB_AUTH          = (   11 << 4 ),
108   DOT11_FC_SUB_DEAUTH        = (   12 << 4 ),
109   DOT11_FC_SUB_ACTION        = (   13 << 4 ),
110 
111   /* Control subtypes */
112   DOT11_FC_SUB_BAR                    = (    8 << 4 ),
113   DOT11_FC_SUB_BA                     = (    9 << 4 ),
114   DOT11_FC_SUB_PS_POLL                = (   10 << 4 ),
115   DOT11_FC_SUB_RTS                    = (   11 << 4 ),
116   DOT11_FC_SUB_CTS                    = (   12 << 4 ),
117   DOT11_FC_SUB_ACK                    = (   13 << 4 ),
118   DOT11_FC_SUB_CF_END                 = (   14 << 4 ),
119   DOT11_FC_SUB_CF_END_CF_ACK          = (   15 << 4 ),
120 
121   /* Data subtypes */
122   DOT11_FC_SUB_DATA                   = (    0 << 4 ),
123   DOT11_FC_SUB_DATA_CF_ACK            = (    1 << 4 ),
124   DOT11_FC_SUB_DATA_CF_POLL           = (    2 << 4 ),
125   DOT11_FC_SUB_DATA_CF_ACK_CF_POLL    = (    3 << 4 ),
126   DOT11_FC_SUB_NULL_FUNCTION          = (    4 << 4 ),
127   DOT11_FC_SUB_CF_ACK                 = (    5 << 4 ),
128   DOT11_FC_SUB_CF_POLL                = (    6 << 4 ),
129   DOT11_FC_SUB_CF_ACK_CF_POLL         = (    7 << 4 ),
130   DOT11_FC_SUB_DATA_QOS               = (    8 << 4 ),
131   DOT11_FC_SUB_DATA_NULL_QOS          = (   12 << 4 )
132 } dot11_Fc_Sub_Type_e;
133 
134 #define  DOT11_FC_TYPESUBTYPE_MASK    ( DOT11_FC_TYPE_MASK | DOT11_FC_SUB_MASK )
135 typedef enum
136 {
137   DOT11_FC_ASSOC_REQ           = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_ASSOC_REQ           ),
138   DOT11_FC_ASSOC_RESP          = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_ASSOC_RESP          ),
139   DOT11_FC_REASSOC_REQ         = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_REASSOC_REQ         ),
140   DOT11_FC_REASSOC_RESP        = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_REASSOC_RESP        ),
141   DOT11_FC_PROBE_REQ           = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_PROBE_REQ           ),
142   DOT11_FC_PROBE_RESP          = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_PROBE_RESP          ),
143   DOT11_FC_BEACON              = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_BEACON              ),
144   DOT11_FC_ATIM                = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_ATIM                ),
145   DOT11_FC_DISASSOC            = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_DISASSOC            ),
146   DOT11_FC_AUTH                = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_AUTH                ),
147   DOT11_FC_DEAUTH              = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_DEAUTH              ),
148   DOT11_FC_ACTION              = ( DOT11_FC_TYPE_MGMT | DOT11_FC_SUB_ACTION              ),
149   DOT11_FC_PS_POLL             = ( DOT11_FC_TYPE_CTRL | DOT11_FC_SUB_PS_POLL             ),
150   DOT11_FC_RTS                 = ( DOT11_FC_TYPE_CTRL | DOT11_FC_SUB_RTS                 ),
151   DOT11_FC_CTS                 = ( DOT11_FC_TYPE_CTRL | DOT11_FC_SUB_CTS                 ),
152   DOT11_FC_ACK                 = ( DOT11_FC_TYPE_CTRL | DOT11_FC_SUB_ACK                 ),
153   DOT11_FC_CF_END              = ( DOT11_FC_TYPE_CTRL | DOT11_FC_SUB_CF_END              ),
154   DOT11_FC_CF_END_CF_ACK       = ( DOT11_FC_TYPE_CTRL | DOT11_FC_SUB_CF_END_CF_ACK       ),
155   DOT11_FC_DATA                = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_DATA                ),
156   DOT11_FC_DATA_CF_ACK         = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_DATA_CF_ACK         ),
157   DOT11_FC_DATA_CF_POLL        = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_DATA_CF_POLL        ),
158   DOT11_FC_DATA_CF_ACK_CF_POLL = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_DATA_CF_ACK_CF_POLL ),
159   DOT11_FC_DATA_NULL_FUNCTION  = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_NULL_FUNCTION       ),
160   DOT11_FC_CF_ACK              = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_CF_ACK              ),
161   DOT11_FC_CF_POLL             = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_CF_POLL             ),
162   DOT11_FC_CF_ACK_CF_POLL      = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_CF_ACK_CF_POLL      ),
163   DOT11_FC_DATA_QOS            = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_DATA_QOS            ),
164   DOT11_FC_DATA_NULL_QOS       = ( DOT11_FC_TYPE_DATA | DOT11_FC_SUB_DATA_NULL_QOS       )
165 } dot11_Fc_Type_Sub_Type_e;
166 
167 typedef enum
168 {
169   DOT11_FC_TO_DS               = ( 1 << 8  ),
170   DOT11_FC_FROM_DS             = ( 1 << 9  ),
171   DOT11_FC_MORE_FRAG           = ( 1 << 10 ),
172   DOT11_FC_RETRY               = ( 1 << 11 ),
173   DOT11_FC_PWR_MGMT            = ( 1 << 12 ),
174   DOT11_FC_MORE_DATA           = ( 1 << 13 ),
175   DOT11_FC_WEP                 = ( 1 << 14 ),
176   DOT11_FC_ORDER               = ( 1 << 15 )
177 } dot11_Fc_Other_e;
178 
179 typedef enum
180 {
181   DOT11_CAPABILITY_ESS               = ( 1 ),
182   DOT11_CAPABILITY_IESS              = ( 1 << 1 ),
183   DOT11_CAPABILITY_CF_POLLABE        = ( 1 << 2 ),
184   DOT11_CAPABILITY_CF_POLL_REQ       = ( 1 << 3 ),
185   DOT11_CAPABILITY_PRIVACY           = ( 1 << 4 ),
186   DOT11_CAPABILITY_PREAMBLE          = ( 1 << 5 ),
187   DOT11_CAPABILITY_PBCC              = ( 1 << 6 ),
188   DOT11_CAPABILITY_AGILE             = ( 1 << 7 )
189 } dot11_Capability_e;
190 
191 #define  DOT11_FC_TO_DS_SHIFT        8
192 #define  DOT11_FC_FROM_DS_SHIFT      9
193 #define  DOT11_FC_MORE_FRAG_SHIFT   10
194 #define  DOT11_FC_RETRY_SHIFT       11
195 #define  DOT11_FC_PWR_MGMT_SHIFT    12
196 #define  DOT11_FC_MORE_DATA_SHIFT   13
197 #define  DOT11_FC_WEP_SHIFT         14
198 #define  DOT11_FC_ORDER_SHIFT       15
199 
200 #define IS_WEP_ON(fc)       ((1 << DOT11_FC_WEP_SHIFT) & (fc))
201 #define IS_DATA(fc)         (((DOT11_FC_TYPE_MASK) & (fc)) == DOT11_FC_TYPE_DATA)
202 #define IS_CTRL(fc)         (((DOT11_FC_TYPE_MASK) & (fc)) == DOT11_FC_TYPE_CTRL)
203 #define IS_MGMT(fc)         (((DOT11_FC_TYPE_MASK) & (fc)) == DOT11_FC_TYPE_MGMT)
204 #define IS_LEGACY_DATA(fc)  (((DOT11_FC_TYPESUBTYPE_MASK) & (fc)) == DOT11_FC_DATA)
205 #define IS_AUTH(fc)         (((DOT11_FC_AUTH) & (fc)) == DOT11_FC_AUTH)
206 #define IS_QOS_FRAME(fc)    ((((fc) & (DOT11_FC_TYPESUBTYPE_MASK)) == DOT11_FC_DATA_QOS)   ||   \
207                              (((fc) & (DOT11_FC_TYPESUBTYPE_MASK)) == DOT11_FC_DATA_NULL_QOS) )
208 #define IS_HT_FRAME(fc)     ((fc) & (DOT11_FC_ORDER))
209 
210 
211 
212 #define TUs_TO_MSECs(x)     (((x) << 10) / 1000)
213 
214 #define TIME_STAMP_LEN  8
215 
216 /* SequenceControl field of the 802.11 header */
217 /**/
218 /* bit    15 - 4           3 - 0*/
219 /* +-------------------+-----------+*/
220 /* |  Sequence Number  | Fragment  |*/
221 /* |                   |  Number   |*/
222 /* +-------------------+-----------+*/
223 /*         12                4*/
224 
225 typedef enum
226 {
227   DOT11_SC_FRAG_NUM_MASK = ( 0xf   << 0 ),
228   DOT11_SC_SEQ_NUM_MASK  = ( 0xfff << 4 )
229 } dot11_Sc_t;
230 
231 /* QoS Control field of the 802.11 header */
232 #define DOT11_QOS_CONTROL_FIELD_TID_BITS    0x000f
233 #define DOT11_QOS_CONTROL_FIELD_A_MSDU_BITS 0x0080
234 
235 #define DOT11_QOS_CONTROL_ACK        0x0000
236 #define DOT11_QOS_CONTROL_DONT_ACK   0x0020
237 
238 typedef struct
239 {
240   TI_UINT16        fc;
241   TI_UINT16        duration;
242   TMacAddr         address1;
243   TMacAddr         address2;
244   TMacAddr         address3;
245   TI_UINT16        seqCtrl;
246   TI_UINT16        qosControl;
247 /*  TMacAddr    address4;*/
248 }  dot11_header_t;
249 
250 typedef struct
251 {
252   TI_UINT16        fc;
253   TI_UINT16        duration;
254   TMacAddr         address1;
255   TMacAddr         address2;
256   TMacAddr         address3;
257   TI_UINT16        seqCtrl;
258 } legacy_dot11_header_t;
259 
260 
261 
262 typedef struct
263 {
264   TI_UINT16        fc;
265   TI_UINT16        duration;
266   TMacAddr         DA;
267   TMacAddr         SA;
268   TMacAddr         BSSID;
269   TI_UINT16        seqCtrl;
270 } dot11_mgmtHeader_t;
271 
272 typedef struct
273 {
274   TI_UINT8     DSAP;
275   TI_UINT8     SSAP;
276   TI_UINT8     Control;
277   TI_UINT8     OUI[3];
278   TI_UINT16    Type;
279 } Wlan_LlcHeader_T;
280 
281 typedef struct
282 {
283   TI_UINT16        fc;
284   TI_UINT16        AID;
285   TMacAddr         BSSID;
286   TMacAddr         TA;
287 } dot11_PsPollFrameHeader_t;
288 
289 typedef struct
290 {
291   TI_UINT16        fc;
292   TI_UINT16        duration;
293   TMacAddr         RA;
294   TMacAddr         TA;
295 } dot11_BarFrameHeader_t;
296 
297 
298 #define FCS_SIZE    4
299 
300 #define WLAN_HDR_LEN                            24
301 #define WLAN_HT_HDR_LEN                         28
302 #define WLAN_QOS_HDR_LEN                        26
303 #define WLAN_QOS_HT_HDR_LEN                     30
304 #define WLAN_QOS_HT_CONTROL_FIELD_LEN           4
305 #define WLAN_SNAP_HDR_LEN                       8
306 #define WLAN_WITH_SNAP_HEADER_MAX_SIZE          (WLAN_HDR_LEN + WLAN_SNAP_HDR_LEN)
307 #define WLAN_WITH_SNAP_QOS_HEADER_MAX_SIZE      (WLAN_QOS_HDR_LEN + WLAN_SNAP_HDR_LEN)
308 
309 #define GET_MAX_HEADER_SIZE(macHeaderPointer,headerSize)    \
310     if (IS_QOS_FRAME(*(TI_UINT16*)(macHeaderPointer)))      \
311     {\
312        if (IS_HT_FRAME(*(TI_UINT16*)(macHeaderPointer)))    \
313            *headerSize = WLAN_QOS_HT_HDR_LEN;               \
314        else                                                 \
315            *headerSize = WLAN_QOS_HDR_LEN;                  \
316      }\
317      else                                                   \
318      {\
319        if (IS_HT_FRAME(*(TI_UINT16*)(macHeaderPointer)))    \
320            *headerSize = WLAN_HT_HDR_LEN;                   \
321        else                                                 \
322            *headerSize = WLAN_HDR_LEN;                      \
323      }
324 
325 /****************************************************************************************
326     The next table is defined in 802.11 spec section 7.2.2 for the address field contents :
327     To DS   From DS     Address 1    Address 2  Address 3    Address 4
328     -------------------------------------------------------------------
329     0           0           DA          SA          BSSID       N/A
330     0           1           DA          BSSID       SA          N/A
331     1           0           BSSID       SA          DA          N/A
332     1           1           RA          TA          DA          SA
333 
334 NOTE: We only support packets coming from within the DS (i.e. From DS = 0)
335 *****************************************************************************************/
336 /* return the destination address used in *dot11_header_t */
337 #define GET_DA_FROM_DOT11_HEADER_T(pDot11Hdr)   ((pDot11Hdr->fc & DOT11_FC_TO_DS) ? (pDot11Hdr->address3) : (pDot11Hdr->address1))
338 
339 
340 /*
341  * MANAGEMENT
342  * -----------------
343  */
344 
345 /* mgmt body max length */
346 #define MAX_MGMT_BODY_LENGTH                2312
347 /* maximal length of beacon body - note that actual beacons may actually be longer
348    than this size, at least according to the spec, but so far no larger beacon was seen */
349 #define MAX_BEACON_BODY_LENGTH              350
350 
351 /* general mgmt frame structure */
352 typedef struct
353 {
354     dot11_mgmtHeader_t  hdr;
355     TI_UINT8                body[MAX_MGMT_BODY_LENGTH];
356 } dot11_mgmtFrame_t;
357 
358 /* Capabilities Information Field - IN THE AIR */
359 /**/
360 /*  bit  15      14       13         12        11         10      9      8      7   -   0*/
361 /* +----------+------+----------+---------+----------+---------+------+-----+---------------+*/
362 /* |  Channel |      |  Short   | Privacy | CF Poll  |   CF    |      |     |   RESERVED    |   */
363 /* |  Agility | PBCC | Preamble |         | Request  | Pollable| IBSS | ESS |               |*/
364 /* +----------+------+----------+---------+----------+---------+------+-----+---------------+   */
365 /*       1        1       1          1         1          1       1      1*/
366 
367 
368 /* Capabilities Information Field - IN THE MGMT SOFTWARE AFTER THE SWAP */
369 /**/
370 /* bit 15 - 8         7        6       5          4         3          2       1      0*/
371 /* +------------+----------+------+----------+---------+----------+---------+------+-----+*/
372 /* |            |  Channel |      |  Short   | Privacy | CF Poll  |   CF    |      |     |*/
373 /* |  Reserved  |  Agility | PBCC | Preamble |         | Request  | Pollable| IBSS | ESS |*/
374 /* +------------+----------+------+----------+---------+----------+---------+------+-----+*/
375 /*       8            1        1       1          1         1          1       1      1*/
376 
377 
378 
379 typedef enum
380 {
381   DOT11_CAPS_ESS             = ( 1 << 0 ),
382   DOT11_CAPS_IBSS            = ( 1 << 1 ),
383   DOT11_CAPS_CF_POLLABLE     = ( 1 << 2 ),
384   DOT11_CAPS_CF_POLL_REQUEST = ( 1 << 3 ),
385   DOT11_CAPS_PRIVACY         = ( 1 << 4 ),
386   DOT11_CAPS_SHORT_PREAMBLE  = ( 1 << 5 ),
387   DOT11_CAPS_PBCC            = ( 1 << 6 ),
388   DOT11_CAPS_CHANNEL_AGILITY = ( 1 << 7 ),
389   DOT11_SPECTRUM_MANAGEMENT  = ( 1 << 8 ),
390   DOT11_CAPS_QOS_SUPPORTED   = ( 1 << 9 ),
391   DOT11_CAPS_SHORT_SLOT_TIME = (1  << 10),
392 
393   DOT11_CAPS_APSD_SUPPORT    = ( 1 << 11),
394 
395   DOT11_CAPS_DELAYED_BA      = ( 1 << 14),
396   DOT11_CAPS_IMMEDIATE_BA    = ( 1 << 15)
397 
398 } dot11_capabilities_e;
399 
400 typedef enum
401 {
402     /* ESS */
403     CAP_ESS_MASK            = 1,
404     CAP_ESS_SHIFT           = 0,
405 
406     /* IBSS */
407     CAP_IBSS_MASK           = 1,
408     CAP_IBSS_SHIFT          = 1,
409 
410     /* CF Pollable */
411     CAP_CF_POLL_MASK        = 1,
412     CAP_CF_POLL_SHIFT       = 2,
413 
414     /* CF Poll request */
415     CAP_CF_REQ_MASK         = 1,
416     CAP_CF_REQ_SHIFT        = 3,
417 
418     /* Privacy */
419     CAP_PRIVACY_MASK        = 1,
420     CAP_PRIVACY_SHIFT       = 4,
421 
422     /* Short Preamble*/
423     CAP_PREAMBLE_MASK       = 1,
424     CAP_PREAMBLE_SHIFT      = 5,
425 
426     /* PBCC */
427     CAP_PBCC_MASK           = 1,
428     CAP_PBCC_SHIFT          = 6,
429 
430     /* Agile */
431     CAP_AGILE_MASK          = 1,
432     CAP_AGILE_SHIFT         = 7,
433 
434     /* Slot time */
435     CAP_SLOT_TIME_MASK      = 1,
436     CAP_SLOT_TIME_SHIFT     = 10,
437 
438     /* APSD */
439     CAP_APSD_MASK           = 1,
440     CAP_APSD_SHIFT          = 11
441 
442 
443 } wdrv_mgmtCapabilities_e;
444 
445 
446 /*
447  * 802.11 Information elements
448  * ---------------------------
449  */
450 
451 typedef TI_UINT8 dot11_eleHdr_t[2];  /* Byte-0: IE-ID,  Byte-1: IE-Length  */
452 
453 /* fixed fields lengths, except of currentAP & timestamp*/
454 #define FIX_FIELD_LEN       2
455 
456 /* SSID Information Element */
457 #define DOT11_SSID_ELE_ID   0
458 
459 /* Max SSID length */
460 #define MAX_SSID_LEN        32
461 
462 typedef struct
463 {
464     dot11_eleHdr_t    hdr;
465     char              serviceSetId[MAX_SSID_LEN];
466 }  dot11_SSID_t;
467 
468 
469 /* Supportted rates Information Element */
470 #define DOT11_SUPPORTED_RATES_ELE_ID        1
471 #define DOT11_EXT_SUPPORTED_RATES_ELE_ID        50
472 typedef struct
473 {
474   dot11_eleHdr_t hdr;
475   TI_UINT8 rates[DOT11_MAX_SUPPORTED_RATES];
476 }  dot11_RATES_t;
477 
478 
479 #define ERP_IE_NON_ERP_PRESENT_MASK         0x1
480 #define ERP_IE_USE_PROTECTION_MASK          0x2
481 #define ERP_IE_BARKER_PREAMBLE_MODE_MASK    0x4
482 #define DOT11_ERP_IE_ID 42
483 typedef struct
484 {
485     dot11_eleHdr_t  hdr;
486     TI_UINT8           ctrl;
487 }  dot11_ERP_t;
488 
489 /* RSN Information Element */
490 #define MAX_RSN_IE                          3
491 #define DOT11_RSN_MAX                       255
492 typedef struct
493 {
494   dot11_eleHdr_t hdr;
495   TI_UINT8 rsnIeData[DOT11_RSN_MAX];
496 }  dot11_RSN_t;
497 
498 /* General definitions needed by rsn.c */
499 #define IV_FIELD_SIZE   4
500 #define ICV_FIELD_SIZE  4
501 #define MIC_FIELD_SIZE  8
502 #define EIV_FIELD_SIZE  4
503 #define WEP_AFTER_HEADER_FIELD_SIZE  IV_FIELD_SIZE
504 #define TKIP_AFTER_HEADER_FIELD_SIZE (IV_FIELD_SIZE + EIV_FIELD_SIZE)
505 #define AES_AFTER_HEADER_FIELD_SIZE  8
506 
507 /* DS params Information Element */
508 #define DOT11_DS_PARAMS_ELE_ID      3
509 #define DOT11_DS_PARAMS_ELE_LEN     1
510 typedef struct
511 {
512   dot11_eleHdr_t hdr;
513   TI_UINT8  currChannel;
514 }  dot11_DS_PARAMS_t;
515 
516 
517 /* DS params Information Element */
518 #define DOT11_IBSS_PARAMS_ELE_ID    6
519 #define DOT11_IBSS_PARAMS_ELE_LEN   2
520 typedef struct
521 {
522     dot11_eleHdr_t  hdr;
523     TI_UINT16          atimWindow;
524 } dot11_IBSS_PARAMS_t;
525 
526 #define DOT11_FH_PARAMS_ELE_ID      2
527 #define DOT11_FH_PARAMS_ELE_LEN     5
528 typedef struct
529 {
530     dot11_eleHdr_t  hdr;
531     TI_UINT16          dwellTime;
532     TI_UINT8           hopSet;
533     TI_UINT8           hopPattern;
534     TI_UINT8           hopIndex;
535 }  dot11_FH_PARAMS_t;
536 
537 /* tim Information Element */
538 #define DOT11_TIM_ELE_ID    5
539 #define DOT11_PARTIAL_VIRTUAL_BITMAP_MAX    251
540 typedef struct
541 {
542     dot11_eleHdr_t  hdr;
543     TI_UINT8           dtimCount;
544     TI_UINT8           dtimPeriod;
545     TI_UINT8           bmapControl;
546     TI_UINT8           partialVirtualBmap[DOT11_PARTIAL_VIRTUAL_BITMAP_MAX];
547 }  dot11_TIM_t;
548 
549 /* tim Information Element */
550 #define DOT11_CF_ELE_ID             4
551 #define DOT11_CF_PARAMS_ELE_LEN     6
552 typedef struct
553 {
554     dot11_eleHdr_t  hdr;
555     TI_UINT8           cfpCount;
556     TI_UINT8           cfpPeriod;
557     TI_UINT16          cfpMaxDuration;
558     TI_UINT16          cfpDurRemain;
559 } dot11_CF_PARAMS_t;
560 
561 /* Challenge text Information Element */
562 #define DOT11_CHALLENGE_TEXT_ELE_ID     16
563 #define DOT11_CHALLENGE_TEXT_MAX        253
564 typedef struct
565 {
566     dot11_eleHdr_t  hdr;
567     TI_UINT8           text[ DOT11_CHALLENGE_TEXT_MAX ];
568 }  dot11_CHALLENGE_t;
569 
570 
571 #define DOT11_NUM_OF_MAX_TRIPLET_CHANNEL    37
572 
573 typedef struct
574 {
575     TI_UINT8           firstChannelNumber;
576     TI_UINT8           numberOfChannels;
577     TI_UINT8           maxTxPowerLevel;
578 } dot11_TripletChannel_t;
579 
580 typedef struct
581 {
582     TI_UINT8                CountryString[DOT11_COUNTRY_STRING_LEN];
583     dot11_TripletChannel_t  tripletChannels[DOT11_NUM_OF_MAX_TRIPLET_CHANNEL];
584 } dot11_countryIE_t;
585 
586 
587 /* Country Inforamtion Element */
588 #define DOT11_COUNTRY_ELE_ID        7
589 #define DOT11_COUNTRY_ELE_LEN_MAX   ( ((DOT11_NUM_OF_MAX_TRIPLET_CHANNEL+1)*3) + !((DOT11_NUM_OF_MAX_TRIPLET_CHANNEL&0x1)))
590 typedef struct
591 {
592     dot11_eleHdr_t    hdr;
593     dot11_countryIE_t countryIE;
594 }  dot11_COUNTRY_t;
595 
596 
597 /* Power Constraint Information Element */
598 #define DOT11_POWER_CONSTRAINT_ELE_ID       (32)
599 #define DOT11_POWER_CONSTRAINT_ELE_LEN      (1)
600 typedef struct
601 {
602     dot11_eleHdr_t  hdr;
603     TI_UINT8           powerConstraint;
604 }  dot11_POWER_CONSTRAINT_t;
605 
606 
607 
608 /* Power Capability Information Element */
609 #define DOT11_CAPABILITY_ELE_ID         (33)
610 #define DOT11_CAPABILITY_ELE_LEN        (2)
611 typedef struct
612 {
613     dot11_eleHdr_t  hdr;
614     TI_UINT8           minTxPower;
615     TI_UINT8           maxTxPower;
616 } dot11_CAPABILITY_t;
617 
618 /* TPC request Information Element */
619 #define DOT11_TPC_REQUEST_ELE_ID        (34)
620 #define DOT11_TPC_REQUEST_ELE_LEN       (0)
621 typedef struct
622 {
623     dot11_eleHdr_t  hdr;
624 }  dot11_TPC_REQUEST_t;
625 
626 /* TPC report Information Element */
627 #define DOT11_TPC_REPORT_ELE_ID         (35)
628 #define DOT11_TPC_REPORT_ELE_LEN        (2)
629 typedef struct
630 {
631     dot11_eleHdr_t  hdr;
632     TI_UINT8           transmitPower;
633     TI_UINT8           linkMargin;
634 } dot11_TPC_REPORT_t;
635 
636 
637 #ifdef  XCC_MODULE_INCLUDED
638 
639 /* Cell Transmit Power Information Element */
640 #define DOT11_CELL_TP_ELE_ID            (150)
641 #define DOT11_CELL_TP_ELE_LEN           (6)
642 
643 typedef struct
644 {
645     dot11_eleHdr_t  hdr;
646     TI_UINT8           oui[4];
647     TI_UINT8           power;
648     TI_UINT8           reserved;
649 } dot11_CELL_TP_t;
650 
651 #define   DOT11_CELL_TP \
652     dot11_CELL_TP_t         *cellTP;
653 
654 #else   /* XCC_MODULE_INCLUDED */
655 
656 #define   DOT11_CELL_TP
657 
658 #endif  /* XCC_MODULE_INCLUDED */
659 
660 
661 /* Channel Supported Information Element */
662 #define DOT11_CHANNEL_SUPPORTED_ELE_ID  (36)
663 #define DOT11_CHANNEL_SUPPORTED_ELE_LEN (26)
664 typedef struct
665 {
666     dot11_eleHdr_t  hdr;
667     TI_UINT8           supportedChannel[DOT11_CHANNEL_SUPPORTED_ELE_LEN];
668 
669 } dot11_CHANNEL_SUPPORTED_t;
670 
671 /* Channel Switch Announcement Information Element */
672 #define DOT11_CHANNEL_SWITCH_ELE_ID     (37)
673 #define DOT11_CHANNEL_SWITCH_ELE_LEN    (3)
674 typedef struct
675 {
676     dot11_eleHdr_t  hdr;
677     TI_UINT8           channelSwitchMode;
678     TI_UINT8           channelNumber;
679     TI_UINT8           channelSwitchCount;
680 }  dot11_CHANNEL_SWITCH_t;
681 
682 #define MAX_NUM_REQ (16)
683 
684 /* Measurement request Information Element */
685 #define DOT11_MEASUREMENT_REQUEST_ELE_ID        (38)
686 #define DOT11_MEASUREMENT_REQUEST_LEN           (2)
687 #define DOT11_MEASUREMENT_REQUEST_ELE_LEN       (3 + DOT11_MEASUREMENT_REQUEST_LEN*MAX_NUM_REQ)
688 typedef struct
689 {
690     dot11_eleHdr_t  hdr;
691     TI_UINT8           measurementToken;
692     TI_UINT8           measurementMode;
693     TI_UINT8           measurementType;
694     TI_UINT8           measurementRequests[DOT11_MEASUREMENT_REQUEST_LEN*MAX_NUM_REQ];
695 }  dot11_MEASUREMENT_REQUEST_t;
696 
697 
698 /* Quiet Information Element */
699 #define DOT11_QUIET_ELE_ID              (40)
700 #define DOT11_QUIET_ELE_LEN             (6)
701 typedef struct
702 {
703     dot11_eleHdr_t  hdr;
704     TI_UINT8           quietCount;
705     TI_UINT8           quietPeriod;
706     TI_UINT16          quietDuration;
707     TI_UINT16          quietOffset;
708 } dot11_QUIET_t;
709 
710 
711 /* QoS Capability Information Element */
712 #define DOT11_QOS_CAPABILITY_ELE_ID     (46)
713 #define DOT11_QOS_CAPABILITY_ELE_LEN    (1)
714 
715 #define AC_APSD_FLAGS_MASK              (1)
716 #define Q_ACK_BITG_MASK                 (1)
717 #define MAX_SP_LENGTH_MASK              (3)
718 #define MORE_DATA_ACK_MASK              (1)
719 
720 #define AC_VO_APSD_FLAGS_SHIFT          (0)
721 #define AC_VI_APSD_FLAGS_SHIFT          (1)
722 #define AC_BK_APSD_FLAGS_SHIFT          (2)
723 #define AC_BE_APSD_FLAGS_SHIFT          (3)
724 #define Q_ACK_FLAGS_SHIFT               (4)
725 #define MAX_SP_LENGTH_SHIFT             (5)
726 #define MORE_DATA_ACK_SHIFT             (7)
727 
728 #define QOS_CONTROL_UP_SHIFT            (0)
729 
730 #define AP_QOS_INFO_UAPSD_MASK          (1)
731 #define AP_QOS_INFO_UAPSD_SHIFT         (7)
732 
733 typedef struct
734 {
735     dot11_eleHdr_t  hdr;
736     TI_UINT8           QosInfoField;
737 }  dot11_QOS_CAPABILITY_IE_t;
738 
739 /* WPS Information Element */
740 #define DOT11_WPS_ELE_ID    (221)
741 #define DOT11_WPS_OUI       {0x00, 0x50, 0xF2, 0x04}
742 #define DOT11_WPS_OUI_LEN   4
743 
744 /* WME Information Element */
745 #define DOT11_WME_ELE_ID                (221)
746 #define DOT11_WME_ELE_LEN               (7)
747 typedef struct
748 {
749     dot11_eleHdr_t  hdr;
750     TI_UINT8           OUI[3];
751     TI_UINT8           OUIType;
752     TI_UINT8           OUISubType;
753     TI_UINT8           version;
754     TI_UINT8           ACInfoField;
755 }  dot11_WME_IE_t;
756 
757 
758 typedef struct
759 {
760     TI_UINT8           ACI_AIFSN;
761     TI_UINT8           ECWmin_ECWmax;
762     TI_UINT16          TXOPLimit;
763 } dot11_QOS_AC_IE_ParametersRecord_t;
764 
765 typedef struct
766 {
767     dot11_QOS_AC_IE_ParametersRecord_t        ACBEParametersRecord;
768     dot11_QOS_AC_IE_ParametersRecord_t        ACBKParametersRecord;
769     dot11_QOS_AC_IE_ParametersRecord_t        ACVIParametersRecord;
770     dot11_QOS_AC_IE_ParametersRecord_t        ACVOParametersRecord;
771 } dot11_ACParameters_t;
772 
773 
774 /* WME Parameter Information Element */
775 #define DOT11_WME_PARAM_ELE_ID          (221)
776 #define DOT11_WME_PARAM_ELE_LEN         (24)
777 typedef struct
778 {
779     dot11_eleHdr_t      hdr;
780     TI_UINT8               OUI[3];
781     TI_UINT8               OUIType;
782     TI_UINT8               OUISubType;
783     TI_UINT8               version;
784     TI_UINT8               ACInfoField;
785     TI_UINT8               reserved;
786     dot11_ACParameters_t   WME_ACParameteres;
787 }  dot11_WME_PARAM_t;
788 
789 
790 /* 802.11n HT Information Element */
791 #define DOT11_HT_CAPABILITIES_ELE_LEN    (26)
792 #define DOT11_HT_INFORMATION_ELE_LEN    (22)
793 
794 #define DOT11_HT_CAPABILITIES_MCS_RATE_OFFSET   (3)
795 #define DOT11_HT_INFORMATION_MCS_RATE_OFFSET    (6)
796 
797 typedef struct
798 {
799     dot11_eleHdr_t  tHdr;
800     TI_UINT8        aHtCapabilitiesIe[DOT11_HT_CAPABILITIES_ELE_LEN];   /* HT capabilities IE unparsed */
801 }  Tdot11HtCapabilitiesUnparse;
802 
803 typedef struct
804 {
805     dot11_eleHdr_t  tHdr;
806     TI_UINT8        aHtInformationIe[DOT11_HT_INFORMATION_ELE_LEN];     /* HT Information IE unparsed */
807 }  Tdot11HtInformationUnparse;
808 
809 /* BA session bits mask */
810 #define DOT11_BAR_CONTROL_FIELD_TID_BITS            0xf000
811 #define DOT11_BA_PARAMETER_SET_FIELD_TID_BITS       0x003C
812 #define DOT11_BA_PARAMETER_SET_FIELD_WINSIZE_BITS   0xffC0
813 #define DOT11_DELBA_PARAMETER_FIELD_TID_BITS        0xf000
814 
815 /* action field BA frames */
816 typedef enum
817 {
818     DOT11_BA_ACTION_ADDBA           = 0,
819     DOT11_BA_ACTION_DELBA           = 2
820 } Edot11BaAction;
821 
822 
823 /* WiFi Simple Config Information Element */
824 #define DOT11_WSC_PARAM_ELE_ID          (221)
825 
826 #define DOT11_WSC_SELECTED_REGISTRAR_CONFIG_METHODS      0x1053
827 #define DOT11_WSC_SELECTED_REGISTRAR_CONFIG_METHODS_PIN  0xC
828 #define DOT11_WSC_SELECTED_REGISTRAR_CONFIG_METHODS_PBC  0x80
829 
830 #define DOT11_WSC_DEVICE_PASSWORD_ID      0x1012
831 #define DOT11_WSC_DEVICE_PASSWORD_ID_PIN  0x0000
832 #define DOT11_WSC_DEVICE_PASSWORD_ID_PBC  0x0004
833 
834 /* WiFi Simple Config Parameter Information Element */
835 #define DOT11_WSC_PROBE_REQ_PARAM_ELE_LEN           (22)
836 #define DOT11_WSC_BEACON_MAX_LENGTH 160
837 
838 typedef struct
839 {
840     dot11_eleHdr_t              hdr;
841     TI_UINT8                        OUI[3];
842     TI_UINT8                        OUIType;
843     TI_UINT8 WSCBeaconOrProbIE[DOT11_WSC_BEACON_MAX_LENGTH];
844 }  dot11_WSC_t;
845 
846 #define dot11_WPA_OUI_TYPE                  (1)
847 #define dot11_WME_OUI_TYPE                  (2)
848 #define dot11_WSC_OUI_TYPE                  (4)
849 #define dot11_WME_OUI_SUB_TYPE_IE           (0)
850 #define dot11_WME_OUI_SUB_TYPE_PARAMS_IE    (1)
851 #define dot11_WME_VERSION                   (1)
852 #define dot11_WME_ACINFO_MASK               0x0f
853 
854 /* -------------------- TSPEC ----------------- */
855 
856 typedef struct
857 {
858     TI_UINT8   tsInfoArr[3];
859 
860 }  tsInfo_t;
861 
862 
863 
864 /* This structure is part of the TSPEC structure. It was seperated since there are some cases (such as DEL_TS), which we dont need
865 to send ALL the TSPEC structure, but only as far as TsInfo. The TSPEC structure contains this smaller structure */
866 typedef struct
867 {
868     dot11_eleHdr_t  hdr;
869 
870     TI_UINT8   OUI[3];
871     TI_UINT8   oui_type;
872     TI_UINT8   oui_subtype;
873     TI_UINT8   version;
874 
875     tsInfo_t tsInfoField;
876 }  dot11_WME_TSPEC_IE_hdr_t;
877 
878 typedef struct
879 {
880 
881     dot11_WME_TSPEC_IE_hdr_t tHdr;
882 
883     TI_UINT16  nominalMSDUSize;
884     TI_UINT16  maximumMSDUSize;
885     TI_UINT32  minimumServiceInterval;
886     TI_UINT32  maximumServiceInterval;
887     TI_UINT32  inactivityInterval;
888     TI_UINT32  suspensionInterval;
889     TI_UINT32  serviceStartTime;
890     TI_UINT32  minimumDataRate;
891     TI_UINT32  meanDataRate;
892     TI_UINT32  peakDataRate;
893     TI_UINT32  maximumBurstSize;
894     TI_UINT32  delayBound;
895     TI_UINT32  minimumPHYRate;
896     TI_UINT16  surplusBandwidthAllowance;
897     TI_UINT16  mediumTime;
898 
899 } dot11_WME_TSPEC_IE_t;
900 
901 
902 #define WME_TSPEC_IE_ID                         221
903 #define WME_TSPEC_IE_LEN                        61
904 #define WME_TSPEC_IE_TSINFO_LEN                 9
905 #define WME_TSPEC_IE_OUI_TYPE                   0x02
906 #define WME_TSPEC_IE_OUI_SUB_TYPE               0x02
907 #define WME_TSPEC_IE_VERSION                    0x01
908 
909 /* OUI TYPE values that can be present in management packets inside Cisco vendor specific IE */
910 typedef enum
911 {
912     TS_METRIX_OUI_TYPE = 0x07,
913     TS_RATE_SET_OUI_TYPE = 0x08,
914     EDCA_LIFETIME_OUI_TYPE = 0x09
915 } XCC_IE_OUI_TYPE_t;
916 
917 #define ADDTS_REQUEST_ACTION                    0x00
918 #define ADDTS_RESPONSE_ACTION                   0x01
919 #define DELTS_ACTION                            0x02
920 
921 #define ADDTS_STATUS_CODE_SUCCESS               0x00
922 #define DELTS_CODE_SUCCESS                      0x00
923 
924 
925 #define TS_INFO_0_TRAFFIC_TYPE_MASK             0x01
926 #define TS_INFO_0_TSID_MASK                     0x1E
927 #define TS_INFO_0_DIRECTION_MASK                0x60
928 #define TS_INFO_0_ACCESS_POLICY_MASK            0x80
929 
930 #define TS_INFO_1_ACCESS_POLICY_MASK            0x01
931 #define TS_INFO_1_AGGREGATION_MASK              0x02
932 #define TS_INFO_1_APSD_MASK                     0x04
933 #define TS_INFO_1_USER_PRIORITY_MASK            0x38
934 #define TS_INFO_1_TSINFO_ACK_POLICY_MASK        0xC0
935 
936 #define TS_INFO_2_SCHEDULE_MASK                 0x01
937 #define TS_INFO_2_RESERVED_MASK                 0xF7
938 
939 #define TRAFFIC_TYPE_SHIFT                      0
940 #define TSID_SHIFT                              1
941 #define DIRECTION_SHIFT                         5
942 #define ACCESS_POLICY_SHIFT                     7
943 #define AGGREGATION_SHIFT                       1
944 #define APSD_SHIFT                              2
945 #define USER_PRIORITY_SHIFT                     3
946 #define TSINFO_ACK_POLICY_SHIFT                 6
947 #define SCHEDULE_SHIFT                          0
948 #define RESERVED_SHIFT                          1
949 #define SURPLUS_BANDWIDTH_ALLOW                 13
950 
951 #define TS_INFO_0_ACCESS_POLICY_EDCA            0x1
952 #define NORMAL_ACKNOWLEDGEMENT                  0x00
953 #define NO_SCHEDULE                             0x00
954 #define PS_UPSD                                 0x01
955 #define EDCA_MODE                               0x08
956 #define FIX_MSDU_SIZE                           0x8000
957 
958 #define WPA_IE_OUI                              {0x00, 0x50, 0xf2}
959 #define XCC_OUI                                 {0x00, 0x40, 0x96}
960 
961 /* Action field structure
962     used for extended management action such as spectrum management */
963 typedef TI_UINT8 dot11_ACTION_FIELD_t[2];
964 
965 
966 /* Management frames sub types */
967 typedef enum
968 {
969     ASSOC_REQUEST       = 0,
970     ASSOC_RESPONSE      = 1,
971     RE_ASSOC_REQUEST    = 2,
972     RE_ASSOC_RESPONSE   = 3,
973     PROBE_REQUEST       = 4,
974     PROBE_RESPONSE      = 5,
975     BEACON              = 8,
976     ATIM                = 9,
977     DIS_ASSOC           = 10,
978     AUTH                = 11,
979     DE_AUTH             = 12,
980     ACTION              = 13
981 } dot11MgmtSubType_e;
982 
983 /* Management frames element IDs */
984 typedef enum
985 {
986     SSID_IE_ID                          = 0,
987     SUPPORTED_RATES_IE_ID               = 1,
988     FH_PARAMETER_SET_IE_ID              = 2,
989     DS_PARAMETER_SET_IE_ID              = 3,
990     CF_PARAMETER_SET_IE_ID              = 4,
991     TIM_IE_ID                           = 5,
992     IBSS_PARAMETER_SET_IE_ID            = 6,
993     COUNTRY_IE_ID                       = 7,
994     CHALLANGE_TEXT_IE_ID                = 16,
995     POWER_CONSTRAINT_IE_ID              = 32,
996     TPC_REPORT_IE_ID                    = 35,
997     CHANNEL_SWITCH_ANNOUNCEMENT_IE_ID   = 37,
998     QUIET_IE_ID                         = 40,
999     ERP_IE_ID                           = 42,
1000     HT_CAPABILITIES_IE_ID               = 45,
1001     QOS_CAPABILITY_IE_ID                = 46,
1002     RSN_IE_ID                           = 48,
1003     EXT_SUPPORTED_RATES_IE_ID           = 50,
1004     HT_INFORMATION_IE_ID                = 61,
1005     XCC_EXT_1_IE_ID                     = 133,
1006     XCC_EXT_2_IE_ID                     = 149,
1007     CELL_POWER_IE                       = 150, /*XCC*/
1008     WPA_IE_ID                           = 221
1009 
1010 } dot11MgmtIeId_e;
1011 
1012 /* Spectrum Management Action fields */
1013 typedef enum
1014 {
1015     MEASUREMENT_REQUEST             = 0,
1016     MEASUREMENT_REPORT              = 1,
1017     TPC_REQUEST                     = 2,
1018     TPC_REPORT                      = 3,
1019     CHANNEL_SWITCH_ANNOUNCEMENT     = 4
1020 } dot11ActionFrameTypes_e;
1021 
1022 /* Category fields (such as apectrum management)*/
1023 typedef enum
1024 {
1025     CATAGORY_SPECTRUM_MANAGEMENT        = 0,
1026     CATAGORY_QOS                        = 1,
1027     WME_CATAGORY_QOS                    = 17,
1028     CATAGORY_SPECTRUM_MANAGEMENT_ERROR  = 128
1029 } dot11CategoryTypes_e;
1030 
1031 
1032 /*
1033  * Management templates to set to the HAL:
1034  */
1035 
1036 #ifdef XCC_MODULE_INCLUDED
1037 
1038     typedef struct
1039     {
1040         dot11_mgmtHeader_t  hdr;
1041         char                infoElements[sizeof( dot11_SSID_t ) +
1042                                          sizeof( dot11_RATES_t ) +
1043                                          sizeof( dot11_RATES_t ) +
1044                                          sizeof( Tdot11HtCapabilitiesUnparse ) +
1045                                          DOT11_WSC_PROBE_REQ_MAX_LENGTH +
1046                                          sizeof( XCC_radioManagmentCapability_IE_t )
1047                                         ];
1048     } probeReqTemplate_t;
1049 
1050 #else /* XCC_MODULE_INCLUDED */
1051 
1052     typedef struct
1053     {
1054         dot11_mgmtHeader_t  hdr;
1055         char                infoElements[sizeof( dot11_SSID_t ) +
1056                                          sizeof( dot11_RATES_t ) +
1057                                          sizeof( dot11_RATES_t ) +
1058                                          sizeof( Tdot11HtCapabilitiesUnparse ) +
1059                                          DOT11_WSC_PROBE_REQ_MAX_LENGTH
1060                                         ];
1061     } probeReqTemplate_t;
1062 
1063 #endif /* XCC_MODULE_INCLUDED */
1064 
1065 
1066 typedef struct
1067 {
1068     dot11_mgmtHeader_t  hdr;
1069     TI_UINT8               timeStamp[TIME_STAMP_LEN];
1070     TI_UINT16              beaconInterval;
1071     TI_UINT16              capabilities;
1072     char                infoElements[ sizeof( dot11_SSID_t ) +
1073                                       sizeof( dot11_RATES_t ) +
1074                                       sizeof( dot11_RATES_t ) +
1075                                       sizeof( dot11_DS_PARAMS_t ) +
1076                                       sizeof( dot11_COUNTRY_t)      ];
1077 }  probeRspTemplate_t;
1078 
1079 typedef struct
1080 {
1081     dot11_mgmtHeader_t  hdr;
1082 } nullDataTemplate_t;
1083 
1084 typedef struct
1085 {
1086     dot11_mgmtHeader_t  hdr;
1087     TI_UINT16 disconnReason;
1088 } disconnTemplate_t; /* Deauth or Disassoc */
1089 
1090 typedef struct
1091 {
1092     dot11_header_t   hdr;
1093 	TI_UINT8 	securityOverhead[AES_AFTER_HEADER_FIELD_SIZE];
1094     Wlan_LlcHeader_T LLC;
1095     TI_UINT16 hardType;
1096     TI_UINT16 protType;
1097     TI_UINT8  hardSize;
1098     TI_UINT8  protSize;
1099     TI_UINT16 op;
1100     TMacAddr  StaMac;
1101     TIpAddr   StaIp;
1102     TMacAddr  TargMac;
1103     TIpAddr   TargIp;
1104 } ArpRspTemplate_t; /* for auto ArpRsp sending by FW */
1105 
1106 typedef struct
1107 {
1108    dot11_PsPollFrameHeader_t   hdr;
1109 } psPollTemplate_t;
1110 
1111 typedef struct
1112 {
1113    dot11_header_t   hdr;
1114 }  QosNullDataTemplate_t;
1115 
1116 /* Traffic Stream Rate Set (TSRS) info-elements */
1117 typedef struct
1118 {
1119     dot11_eleHdr_t  hdr;
1120     TI_UINT8           OUI[3];
1121     TI_UINT8           oui_type;
1122     TI_UINT8           tsid;
1123     TI_UINT8           tsNominalRate;
1124 } dot11_TSRS_STA_IE_t;
1125 
1126 typedef struct
1127 {
1128     dot11_eleHdr_t  hdr;
1129     TI_UINT8           OUI[3];
1130     TI_UINT8           oui_type;
1131     TI_UINT8           tsid;
1132     TI_UINT8           tsRates[8];
1133 }  dot11_TSRS_IE_t;
1134 
1135 /* MSDU lifetime info-element */
1136 typedef struct
1137 {
1138     dot11_eleHdr_t  hdr;
1139     TI_UINT8           OUI[3];
1140     TI_UINT8           oui_type;
1141     TI_UINT8           tsid;
1142     TI_UINT16          msduLifeTime;
1143 }  dot11_MSDU_LIFE_TIME_IE_t;
1144 
1145 typedef struct
1146 {
1147     dot11_eleHdr_t  hdr;
1148     TI_UINT8           OUI[3];
1149     TI_UINT8           oui_type;
1150     TI_UINT8           tsid;
1151     TI_UINT8           state;
1152     TI_UINT16          measureInterval;
1153 }  dot11_TS_METRICS_IE_t;
1154 
1155 typedef struct
1156 {
1157     dot11_TSRS_IE_t             *trafficStreamParameter;
1158     dot11_MSDU_LIFE_TIME_IE_t   *edcaLifetimeParameter;
1159     dot11_TS_METRICS_IE_t       *tsMetrixParameter;
1160 } XCCv4IEs_t;
1161 
1162 
1163 /* Measurement Report message frame structure */
1164 #define DOT11_MEASUREMENT_REPORT_ELE_ID     (39)
1165 #define DOT11_MAX_MEASUREMENT_REPORT_LEN    (4)
1166 #define DOT11_MIN_MEASUREMENT_REPORT_IE_LEN (3)
1167 #define DOT11_MEASUREMENT_REPORT_ELE_IE_LEN (DOT11_MIN_MEASUREMENT_REPORT_IE_LEN + DOT11_MAX_MEASUREMENT_REPORT_LEN*MAX_NUM_REQ)
1168 
1169 typedef struct
1170 {
1171     dot11_ACTION_FIELD_t    actionField;
1172     TI_UINT8   dialogToken;
1173 
1174     dot11_eleHdr_t  hdr;
1175     TI_UINT8            measurementToken;
1176     TI_UINT8            measurementMode;
1177     TI_UINT8            measurementType;
1178     TI_UINT8            measurementReports[DOT11_MAX_MEASUREMENT_REPORT_LEN*MAX_NUM_REQ];
1179 }  MeasurementReportFrame_t;
1180 
1181 
1182 
1183 typedef enum
1184 {
1185     STATUS_SUCCESSFUL = 0,
1186     STATUS_UNSPECIFIED,
1187     STATUS_AUTH_REJECT,
1188     STATUS_ASSOC_REJECT,
1189     STATUS_SECURITY_FAILURE,
1190     STATUS_AP_DEAUTHENTICATE,
1191     STATUS_AP_DISASSOCIATE,
1192     STATUS_ROAMING_TRIGGER,
1193     STATUS_DISCONNECT_DURING_CONNECT,
1194     STATUS_SG_RESELECT,
1195 	STATUS_MIC_FAILURE = 14,
1196     MGMT_STATUS_MAX_NUM = 15
1197 } mgmtStatus_e;
1198 
1199 /* Used as a status code in case of STATUS_AUTH_REJECT or STATUS_ASSOC_REJECT that was not received at all */
1200 #define STATUS_PACKET_REJ_TIMEOUT   0xFFFF
1201 
1202 /* As defined in 802.11 spec section 7.3.1 - status codes for deAuth packet */
1203 #define STATUS_CODE_802_1X_AUTHENTICATION_FAILED 23
1204 
1205 /* map field included in measurement report IE (only in basic report) */
1206 typedef enum
1207 {
1208   DOT11_BSS_ONLY                    = (0x01),
1209   DOT11_OFDM_ONLY                   = (0x02),
1210   DOT11_RADAR_AND_UNIDENTIFIED      = (0x0C)
1211 } dot11_Map_Sub_Field_e;
1212 
1213 
1214 typedef struct
1215 {
1216    legacy_dot11_header_t dot11Header;
1217    Wlan_LlcHeader_T  snapHeader;
1218 }  legacy_dot11_DataMsduHeader_t;
1219 
1220 
1221 #define WLAN_HEADER_TYPE_CONCATENATION 0x01
1222 #define WLAN_CONCAT_HEADER_LEN 2
1223 
1224 
1225 #endif   /* _802_11_INFO_DEFS_H */
1226