blob: c875ab02000c9e53920e417d49c3fa721a33bf43 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
Jeff Johnson295189b2012-06-20 16:38:30 -070041/*
42 * Airgo Networks, Inc proprietary. All rights reserved.
43 * This file sirMacProtDef.h contains the MAC/PHY protocol
44 * definitions used across various projects.
45 * Author: Chandra Modumudi
46 * Date: 02/27/02
47 * History:-
48 * Date Modified by Modification Information
49 * --------------------------------------------------------------------
50 *
51 */
52#ifndef __MAC_PROT_DEFS_H
53#define __MAC_PROT_DEFS_H
54
55#include "palTypes.h"
56#include "sirTypes.h"
Jeff Johnson62c27982013-02-27 17:53:55 -080057#include "wniCfgSta.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070058#include "aniCompiler.h"
59
60
61///Capability information related
62#define CAPABILITY_INFO_DELAYED_BA_BIT 14
63#define CAPABILITY_INFO_IMMEDIATE_BA_BIT 15
64
65/// 11d MAC defaults
66#define SIR_11B_CHANNEL_ID_BEGIN 1
67#define SIR_TOTAL_NUM_11B_CHANNELS 14
68#define SIR_11B_DEFAULT_MAX_TRANSMIT_POWER 20
69#define SIR_11A_CHANNEL_ID_BEGIN 240
70#define SIR_TOTAL_NUM_11A_CHANNELS 34
71#define SIR_11A_DEFAULT_MAX_TRANSMIT_POWER 16
72
73/// 11h MAC defaults
74#define SIR_11A_CHANNEL_BEGIN 34
75#define SIR_11A_CHANNEL_END 165
76#define SIR_11B_CHANNEL_BEGIN 1
77#define SIR_11B_CHANNEL_END 14
78#define SIR_11A_FREQUENCY_OFFSET 4
79#define SIR_11B_FREQUENCY_OFFSET 1
80
81
82#define PRIM_DEVICE_LEN (8)
83
84/// Maximum fragment size
85#define SIR_MAC_MAX_FRAG_SIZE 2398
86
87// maximum 802.11 PDU size
88#define SIR_MAC_MAX_PDU_SIZE 2346
89
90/// Length of the Frame Check Sum field at the end of every MAC frame
91#define SIR_MAC_FCS_LENGTH 4
92
93// Sizes of control frames
94#define SIR_MAC_ACK_SIZE 14
95#define SIR_MAC_CTS_SIZE 14
96#define SIR_MAC_RTS_SIZE 20
97#define SIR_MAC_BRQ_SIZE 24
98#define SIR_MAC_BACK_SIZE 26
99
100/// Current version of 802.11
101#define SIR_MAC_PROTOCOL_VERSION 0
102
103// Frame Type definitions
104
105#define SIR_MAC_MGMT_FRAME 0x0
106#define SIR_MAC_CTRL_FRAME 0x1
107#define SIR_MAC_DATA_FRAME 0x2
108
109#define SIR_MAC_FRAME_TYPE_START 0x0
110#define SIR_MAC_FRAME_TYPE_END 0x3
111
112// Control frame subtype definitions
113
114#define SIR_MAC_CTRL_RR 4
115#define SIR_MAC_CTRL_BAR 8
116#define SIR_MAC_CTRL_BA 9
117#define SIR_MAC_CTRL_PS_POLL 10
118#define SIR_MAC_CTRL_RTS 11
119#define SIR_MAC_CTRL_CTS 12
120#define SIR_MAC_CTRL_ACK 13
121#define SIR_MAC_CTRL_CF_END 14
122#define SIR_MAC_CTRL_CF_END_ACK 15
123
124#define GEN4_SCAN 1
125#ifdef GEN4_SCAN
126#define SIR_MAC_MAX_DURATION_MICRO_SECONDS 32767
127#endif // GEN4_SCAN
128
129// Data frame subtype definitions
130#define SIR_MAC_DATA_DATA 0
131#define SIR_MAC_DATA_DATA_ACK 1
132#define SIR_MAC_DATA_DATA_POLL 2
133#define SIR_MAC_DATA_DATA_ACK_POLL 3
134#define SIR_MAC_DATA_NULL 4
135#define SIR_MAC_DATA_NULL_ACK 5
136#define SIR_MAC_DATA_NULL_POLL 6
137#define SIR_MAC_DATA_NULL_ACK_POLL 7
138#define SIR_MAC_DATA_QOS_DATA 8
139#define SIR_MAC_DATA_QOS_DATA_ACK 9
140#define SIR_MAC_DATA_QOS_DATA_POLL 10
141#define SIR_MAC_DATA_QOS_DATA_ACK_POLL 11
142#define SIR_MAC_DATA_QOS_NULL 12
143#define SIR_MAC_DATA_QOS_NULL_ACK 13
144#define SIR_MAC_DATA_QOS_NULL_POLL 14
145#define SIR_MAC_DATA_QOS_NULL_ACK_POLL 15
146
147#define SIR_MAC_FRAME_SUBTYPE_START 0
148#define SIR_MAC_FRAME_SUBTYPE_END 16
149
150#define SIR_MAC_DATA_QOS_MASK 8
151#define SIR_MAC_DATA_NULL_MASK 4
152#define SIR_MAC_DATA_POLL_MASK 2
153#define SIR_MAC_DATA_ACK_MASK 1
154
155// Management frame subtype definitions
156
157#define SIR_MAC_MGMT_ASSOC_REQ 0x0
158#define SIR_MAC_MGMT_ASSOC_RSP 0x1
159#define SIR_MAC_MGMT_REASSOC_REQ 0x2
160#define SIR_MAC_MGMT_REASSOC_RSP 0x3
161#define SIR_MAC_MGMT_PROBE_REQ 0x4
162#define SIR_MAC_MGMT_PROBE_RSP 0x5
163#define SIR_MAC_MGMT_BEACON 0x8
164#define SIR_MAC_MGMT_ATIM 0x9
165#define SIR_MAC_MGMT_DISASSOC 0xA
166#define SIR_MAC_MGMT_AUTH 0xB
167#define SIR_MAC_MGMT_DEAUTH 0xC
168#define SIR_MAC_MGMT_ACTION 0xD
169#define SIR_MAC_MGMT_RESERVED15 0xF
170
171// Action frame categories
172
173#define SIR_MAC_ACTION_SPECTRUM_MGMT 0
174#define SIR_MAC_ACTION_QOS_MGMT 1
175#define SIR_MAC_ACTION_DLP 2
176#define SIR_MAC_ACTION_BLKACK 3
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800177#define SIR_MAC_ACTION_PUBLIC_USAGE 4
Jeff Johnson295189b2012-06-20 16:38:30 -0700178#if defined WLAN_FEATURE_VOWIFI
179#define SIR_MAC_ACTION_RRM 5
180#endif
181#define SIR_MAC_ACTION_HT 7
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800182#ifdef FEATURE_WLAN_TDLS
183#define SIR_MAC_ACTION_TDLS 12
Jeff Johnson295189b2012-06-20 16:38:30 -0700184#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800185#define SIR_MAC_ACTION_WME 17
Mohit Khanna4a70d262012-09-11 16:30:12 -0700186#ifdef WLAN_FEATURE_11AC
187#define SIR_MAC_ACTION_VHT 21
188#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700189
190// QoS management action codes
191
192#define SIR_MAC_QOS_ADD_TS_REQ 0
193#define SIR_MAC_QOS_ADD_TS_RSP 1
194#define SIR_MAC_QOS_DEL_TS_REQ 2
195#define SIR_MAC_QOS_SCHEDULE 3
196// and these are proprietary
197#define SIR_MAC_QOS_DEF_BA_REQ 4
198#define SIR_MAC_QOS_DEF_BA_RSP 5
199#define SIR_MAC_QOS_DEL_BA_REQ 6
200#define SIR_MAC_QOS_DEL_BA_RSP 7
201
202#ifdef ANI_SUPPORT_11H
203// Spectrum management action codes
204#define SIR_MAC_ACTION_MEASURE_REQUEST_ID 0
205#define SIR_MAC_ACTION_MEASURE_REPORT_ID 1
206#define SIR_MAC_ACTION_TPC_REQUEST_ID 2
207#define SIR_MAC_ACTION_TPC_REPORT_ID 3
208#endif //ANI_SUPPORT_11H
209#define SIR_MAC_ACTION_CHANNEL_SWITCH_ID 4
210
211
212#ifdef ANI_SUPPORT_11H
213// Measurement Request/Report Type
214#define SIR_MAC_BASIC_MEASUREMENT_TYPE 0
215#define SIR_MAC_CCA_MEASUREMENT_TYPE 1
216#define SIR_MAC_RPI_MEASUREMENT_TYPE 2
217#endif //ANI_SUPPORT_11H
218
219//RRM related.
220//Refer IEEE Std 802.11k-2008, Section 7.3.2.21, table 7.29
221#if defined WLAN_FEATURE_VOWIFI
222
223#define SIR_MAC_RRM_CHANNEL_LOAD_TYPE 3
224#define SIR_MAC_RRM_NOISE_HISTOGRAM_BEACON 4
225#define SIR_MAC_RRM_BEACON_TYPE 5
226#define SIR_MAC_RRM_FRAME_TYPE 6
227#define SIR_MAC_RRM_STA_STATISTICS_TYPE 7
228#define SIR_MAC_RRM_LCI_TYPE 8
229#define SIR_MAC_RRM_TSM_TYPE 9
230
231//RRM action codes
232#define SIR_MAC_RRM_RADIO_MEASURE_REQ 0
233#define SIR_MAC_RRM_RADIO_MEASURE_RPT 1
234#define SIR_MAC_RRM_LINK_MEASUREMENT_REQ 2
235#define SIR_MAC_RRM_LINK_MEASUREMENT_RPT 3
236#define SIR_MAC_RRM_NEIGHBOR_REQ 4
237#define SIR_MAC_RRM_NEIGHBOR_RPT 5
238
239#endif
240
Mohit Khanna4a70d262012-09-11 16:30:12 -0700241//VHT Action Field
242#ifdef WLAN_FEATURE_11AC
243#define SIR_MAC_VHT_OPMODE_NOTIFICATION 2
244#endif
245
Jeff Johnson295189b2012-06-20 16:38:30 -0700246// HT Action Field Codes
247#define SIR_MAC_SM_POWER_SAVE 1
248
249// DLP action frame types
250#define SIR_MAC_DLP_REQ 0
251#define SIR_MAC_DLP_RSP 1
252#define SIR_MAC_DLP_TEARDOWN 2
253
254// block acknowledgement action frame types
255#define SIR_MAC_BLKACK_ADD_REQ 0
256#define SIR_MAC_BLKACK_ADD_RSP 1
257#define SIR_MAC_BLKACK_DEL 2
258#if defined WLAN_FEATURE_P2P
259#define SIR_MAC_ACTION_VENDOR_SPECIFIC 9
260#define SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY 0x7F
261#define SIR_MAC_ACTION_P2P_SUBTYPE_PRESENCE_RSP 2
262#endif
263
264#ifdef WLAN_FEATURE_11W
265//11w SA query request/response action frame category code
266#define SIR_MAC_ACTION_SA_QUERY 8
267#endif
268
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800269#ifdef FEATURE_WLAN_TDLS
270#define SIR_MAC_TDLS_SETUP_REQ 0
271#define SIR_MAC_TDLS_SETUP_RSP 1
272#define SIR_MAC_TDLS_SETUP_CNF 2
273#define SIR_MAC_TDLS_TEARDOWN 3
274#define SIR_MAC_TDLS_PEER_TRAFFIC_IND 4
275#define SIR_MAC_TDLS_CH_SWITCH_REQ 5
276#define SIR_MAC_TDLS_CH_SWITCH_RSP 6
277#define SIR_MAC_TDLS_PEER_TRAFFIC_RSP 9
278#define SIR_MAC_TDLS_DIS_REQ 10
279#define SIR_MAC_TDLS_DIS_RSP 14
280#endif
281
Jeff Johnson295189b2012-06-20 16:38:30 -0700282#define SIR_MAC_MAX_RANDOM_LENGTH 2306
283
284//-----------------------------------------------------------------------------
285// EID (Element ID) definitions
286// and their min/max lengths
287//-----------------------------------------------------------------------------
288
289#define SIR_MAC_SSID_EID 0
290#define SIR_MAC_SSID_EID_MIN 0
291#define SIR_MAC_SSID_EID_MAX 32
292#define SIR_MAC_RATESET_EID 1
293#define SIR_MAC_RATESET_EID_MIN 1
294#define SIR_MAC_RATESET_EID_MAX 12
295#define SIR_MAC_FH_PARAM_SET_EID 2
296#define SIR_MAC_FH_PARAM_SET_EID_MIN 5
297#define SIR_MAC_FH_PARAM_SET_EID_MAX 5
298#define SIR_MAC_DS_PARAM_SET_EID 3
299#define SIR_MAC_DS_PARAM_SET_EID_MIN 1
300#define SIR_MAC_DS_PARAM_SET_EID_MAX 1
301#define SIR_MAC_CF_PARAM_SET_EID 4
302#define SIR_MAC_CF_PARAM_SET_EID_MIN 6
303#define SIR_MAC_CF_PARAM_SET_EID_MAX 6
304#define SIR_MAC_TIM_EID 5
305#define SIR_MAC_TIM_EID_MIN 3
306#define SIR_MAC_TIM_EID_MAX 254
307#define SIR_MAC_IBSS_PARAM_SET_EID 6
308#define SIR_MAC_IBSS_PARAM_SET_EID_MIN 2
309#define SIR_MAC_IBSS_PARAM_SET_EID_MAX 2
310#define SIR_MAC_COUNTRY_EID 7
311#define SIR_MAC_COUNTRY_EID_MIN 6
312#define SIR_MAC_COUNTRY_EID_MAX 254
313#define SIR_MAC_FH_PARAMS_EID 8
314#define SIR_MAC_FH_PARAMS_EID_MIN 4
315#define SIR_MAC_FH_PARAMS_EID_MAX 4
316#define SIR_MAC_FH_PATTERN_EID 9
317#define SIR_MAC_FH_PATTERN_EID_MIN 4
318#define SIR_MAC_FH_PATTERN_EID_MAX 254
319#define SIR_MAC_REQUEST_EID 10
320#define SIR_MAC_REQUEST_EID_MIN 1
321#define SIR_MAC_REQUEST_EID_MAX 255
322#define SIR_MAC_QBSS_LOAD_EID 11
323#define SIR_MAC_QBSS_LOAD_EID_MIN 5
324#define SIR_MAC_QBSS_LOAD_EID_MAX 5
325#define SIR_MAC_EDCA_PARAM_SET_EID 12 // EDCA parameter set
326#define SIR_MAC_EDCA_PARAM_SET_EID_MIN 18
327#define SIR_MAC_EDCA_PARAM_SET_EID_MAX 20 // TBD temp - change backto 18
328#define SIR_MAC_TSPEC_EID 13
329#define SIR_MAC_TSPEC_EID_MIN 55
330#define SIR_MAC_TSPEC_EID_MAX 55
331#define SIR_MAC_TCLAS_EID 14
332#define SIR_MAC_TCLAS_EID_MIN 4
333#define SIR_MAC_TCLAS_EID_MAX 255
334#define SIR_MAC_QOS_SCHEDULE_EID 15
335#define SIR_MAC_QOS_SCHEDULE_EID_MIN 14
336#define SIR_MAC_QOS_SCHEDULE_EID_MAX 14
337#define SIR_MAC_CHALLENGE_TEXT_EID 16
338#define SIR_MAC_CHALLENGE_TEXT_EID_MIN 1
339#define SIR_MAC_CHALLENGE_TEXT_EID_MAX 253
340// reserved 17-31
341#define SIR_MAC_PWR_CONSTRAINT_EID 32
342#define SIR_MAC_PWR_CONSTRAINT_EID_MIN 1
343#define SIR_MAC_PWR_CONSTRAINT_EID_MAX 1
344#define SIR_MAC_PWR_CAPABILITY_EID 33
345#define SIR_MAC_PWR_CAPABILITY_EID_MIN 2
346#define SIR_MAC_PWR_CAPABILITY_EID_MAX 2
347#define SIR_MAC_TPC_REQ_EID 34
348#define SIR_MAC_TPC_REQ_EID_MIN 0
349#define SIR_MAC_TPC_REQ_EID_MAX 255
350// SIR_MAC_EXTENDED_CAP_EID 35
351#define SIR_MAC_TPC_RPT_EID 35
352#define SIR_MAC_TPC_RPT_EID_MIN 2
353#define SIR_MAC_TPC_RPT_EID_MAX 2
354#define SIR_MAC_SPRTD_CHNLS_EID 36
355#define SIR_MAC_SPRTD_CHNLS_EID_MIN 2
356#define SIR_MAC_SPRTD_CHNLS_EID_MAX 254
357#define SIR_MAC_CHNL_SWITCH_ANN_EID 37
358#define SIR_MAC_CHNL_SWITCH_ANN_EID_MIN 3
359#define SIR_MAC_CHNL_SWITCH_ANN_EID_MAX 3
360#define SIR_MAC_MEAS_REQ_EID 38
361#define SIR_MAC_MEAS_REQ_EID_MIN 3
362#define SIR_MAC_MEAS_REQ_EID_MAX 255
363#define SIR_MAC_MEAS_RPT_EID 39
364#define SIR_MAC_MEAS_RPT_EID_MIN 3
365#define SIR_MAC_MEAS_RPT_EID_MAX 255
366#define SIR_MAC_QUIET_EID 40
367#define SIR_MAC_QUIET_EID_MIN 6
368#define SIR_MAC_QUIET_EID_MAX 6
369#define SIR_MAC_IBSS_DFS_EID 41
370#define SIR_MAC_IBSS_DFS_EID_MIN 7
371#define SIR_MAC_IBSS_DFS_EID_MAX 255
372#define SIR_MAC_ERP_INFO_EID 42
373#define SIR_MAC_ERP_INFO_EID_MIN 0
374#define SIR_MAC_ERP_INFO_EID_MAX 255
375#define SIR_MAC_TS_DELAY_EID 43
376#define SIR_MAC_TS_DELAY_EID_MIN 4
377#define SIR_MAC_TS_DELAY_EID_MAX 4
378#define SIR_MAC_TCLAS_PROC_EID 44
379#define SIR_MAC_TCLAS_PROC_EID_MIN 1
380#define SIR_MAC_TCLAS_PROC_EID_MAX 1
381#define SIR_MAC_QOS_CAPABILITY_EID 46
382#define SIR_MAC_QOS_CAPABILITY_EID_MIN 1
383#define SIR_MAC_QOS_CAPABILITY_EID_MAX 1
384#define SIR_MAC_RSN_EID 48
385#define SIR_MAC_RSN_EID_MIN 4
386#define SIR_MAC_RSN_EID_MAX 254
387
388//using reserved EID for Qos Action IE for now,
389//need to check 11e spec for the actual EID
390#define SIR_MAC_QOS_ACTION_EID 49
391#define SIR_MAC_QOS_ACTION_EID_MIN 4
392#define SIR_MAC_QOS_ACTION_EID_MAX 255
393#define SIR_MAC_EXTENDED_RATE_EID 50
394#define SIR_MAC_EXTENDED_RATE_EID_MIN 0
395#define SIR_MAC_EXTENDED_RATE_EID_MAX 255
396// reserved 51-220
397#define SIR_MAC_WPA_EID 221
398#define SIR_MAC_WPA_EID_MIN 0
399#define SIR_MAC_WPA_EID_MAX 255
400
401#define SIR_MAC_EID_VENDOR 221
402
403// reserved 222-254
404#define SIR_MAC_HT_CAPABILITIES_EID 45
405#define SIR_MAC_HT_CAPABILITIES_EID_MIN 0
406#define SIR_MAC_HT_CAPABILITIES_EID_MAX 255
407#define SIR_MAC_HT_INFO_EID 61
408#define SIR_MAC_HT_INFO_EID_MIN 0
409#define SIR_MAC_HT_INFO_EID_MAX 255
410
Jeff Johnsone7245742012-09-05 17:12:55 -0700411#ifdef WLAN_FEATURE_11AC
412#define SIR_MAC_VHT_CAPABILITIES_EID 191
413#define SIR_MAC_VHT_OPERATION_EID 192
414#define SIR_MAC_VHT_EXT_BSS_LOAD_EID 193
Mohit Khanna4a70d262012-09-11 16:30:12 -0700415#define SIR_MAC_VHT_OPMODE_EID 199
Jeff Johnsone7245742012-09-05 17:12:55 -0700416#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700417#define SIR_MAC_MAX_SUPPORTED_MCS_SET 16
418
419/// Workaround IE to change beacon length when it is 4*n+1
420#define SIR_MAC_ANI_WORKAROUND_EID 255
421#define SIR_MAC_ANI_WORKAROUND_EID_MIN 0
422#define SIR_MAC_ANI_WORKAROUND_EID_MAX 255
423
424/// Maximum length of each IE
425#define SIR_MAC_MAX_IE_LENGTH 255
426
427/// Maximum length of each IE
428#define SIR_MAC_RSN_IE_MAX_LENGTH 255
429#define SIR_MAC_WPA_IE_MAX_LENGTH 255
430/// Minimum length of each IE
431#define SIR_MAC_RSN_IE_MIN_LENGTH 2
432#define SIR_MAC_WPA_IE_MIN_LENGTH 6
433
434#ifdef FEATURE_WLAN_CCX
435#define CCX_VERSION_4 4
436#define CCX_VERSION_SUPPORTED CCX_VERSION_4
437
438// When station sends Radio Management Cap.
439// State should be normal=1
440// Mbssid Mask should be 0
441#define RM_STATE_NORMAL 1
442#endif
443
444#define SIR_MAC_OUI_VERSION_1 1
445
446// OUI and type definition for WPA IE in network byte order
447#define SIR_MAC_WPA_OUI 0x01F25000
448#define SIR_MAC_WME_OUI 0x02F25000
449#define SIR_MAC_WSM_OUI SIR_MAC_WME_OUI
450#define SIR_MAC_WSC_OUI "\x00\x50\xf2\x04"
451#define SIR_MAC_WSC_OUI_SIZE 4
452#ifdef WLAN_FEATURE_P2P
453#define SIR_MAC_P2P_OUI "\x50\x6f\x9a\x09"
454#define SIR_MAC_P2P_OUI_SIZE 4
455#define SIR_P2P_NOA_ATTR 12
456#define SIR_MAX_NOA_ATTR_LEN 31
457#define SIR_MAX_NOA_DESCR 2
458#define SIR_P2P_IE_HEADER_LEN 6
459#endif
460
461// min size of wme oui header: oui(3) + type + subtype + version
462#define SIR_MAC_OUI_WME_HDR_MIN 6
463
464// OUI subtype and their lengths
465#define SIR_MAC_OUI_SUBTYPE_WME_INFO 0
466#define SIR_MAC_OUI_WME_INFO_MIN 7
467#define SIR_MAC_OUI_WME_INFO_MAX 7
468
469#define SIR_MAC_OUI_SUBTYPE_WME_PARAM 1
470#define SIR_MAC_OUI_WME_PARAM_MIN 24
471#define SIR_MAC_OUI_WME_PARAM_MAX 24
472
473#define SIR_MAC_OUI_SUBTYPE_WME_TSPEC 2
474#define SIR_MAC_OUI_WME_TSPEC_MIN 61
475#define SIR_MAC_OUI_WME_TSPEC_MAX 61
476
477#define SIR_MAC_OUI_SUBTYPE_WSM_TSPEC 2 // same as WME TSPEC
478#define SIR_MAC_OUI_WSM_TSPEC_MIN 61
479#define SIR_MAC_OUI_WSM_TSPEC_MAX 61
480
481// reserved subtypes 3-4
482// WSM capability
483#define SIR_MAC_OUI_SUBTYPE_WSM_CAPABLE 5
484#define SIR_MAC_OUI_WSM_CAPABLE_MIN 7
485#define SIR_MAC_OUI_WSM_CAPABLE_MAX 7
486// WSM classifier
487#define SIR_MAC_OUI_SUBTYPE_WSM_TCLAS 6
488#define SIR_MAC_OUI_WSM_TCLAS_MIN 10
489#define SIR_MAC_OUI_WSM_TCLAS_MAX 255
490// classifier processing element
491#define SIR_MAC_OUI_SUBTYPE_WSM_TCLASPROC 7
492#define SIR_MAC_OUI_WSM_TCLASPROC_MIN 7
493#define SIR_MAC_OUI_WSM_TCLASPROC_MAX 7
494// tspec delay element
495#define SIR_MAC_OUI_SUBTYPE_WSM_TSDELAY 8
496#define SIR_MAC_OUI_WSM_TSDELAY_MIN 10
497#define SIR_MAC_OUI_WSM_TSDELAY_MAX 10
498// schedule element
499#define SIR_MAC_OUI_SUBTYPE_WSM_SCHEDULE 9
500#define SIR_MAC_OUI_WSM_SCHEDULE_MIN 20
501#define SIR_MAC_OUI_WSM_SCHEDULE_MAX 20
502
503#ifdef WLAN_NS_OFFLOAD
504#define SIR_MAC_NS_OFFLOAD_SIZE 1 //support only one IPv6 offload
505#define SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA 2 //Number of target IP in NA frames. It must be at least 2
506#endif //WLAN_NS_OFFLOAD
507#define SIR_MAC_ARP_OFFLOAD_SIZE 1
508
509// total length of an Info element including T/L fields
510#define EID_LEN(eid) (2 + (eid))
511
512// support for radar Detect, Channel Switch
513#define CHANNEL_SWITCH_MAX_FRAME_SIZE 256
514
515
516// Length of Channel Switch related message
Jeff Johnsone7245742012-09-05 17:12:55 -0700517#define SIR_SME_CHANNEL_SWITCH_SIZE (sizeof(tANI_U8) + 2 *sizeof(tANI_U16) + sizeof(tANI_U32) + sizeof(ePhyChanBondState))
Jeff Johnson295189b2012-06-20 16:38:30 -0700518#define SIR_CHANNEL_SWITCH_IE_SIZE EID_LEN(SIR_MAC_CHNL_SWITCH_ANN_EID_MIN)
519
520//Measurement Request/Report messages
521#define SIR_MEAS_REQ_FIELD_SIZE 11
522#define SIR_MEAS_REQ_IE_SIZE (5 + SIR_MEAS_REQ_FIELD_SIZE)
523#define SIR_MEAS_REQ_ACTION_FRAME_SIZE (3 + SIR_MEAS_REQ_IE_SIZE)
524#define SIR_MEAS_MAX_FRAME_SIZE 256
525#define SIR_MEAS_REPORT_MIN_FRAME_SIZE (3 + EID_LEN(SIR_MAC_MEAS_RPT_EID_MIN))
526
527#define SIR_MAC_SET_MEAS_REQ_ENABLE(x) (((tANI_U8) x) | 2)
528#define SIR_MAC_SET_MEAS_REQ_REQUEST(x) (((tANI_U8) x) | 4)
529#define SIR_MAC_SET_MEAS_REQ_REPORT(x) (((tANI_U8) x) | 8)
530
531#define SIR_MAC_SET_MEAS_REPORT_LATE(x) (((tANI_U8) x) | 1)
532#define SIR_MAC_SET_MEAS_REPORT_INCAPABLE(x) (((tANI_U8) x) | 2)
533#define SIR_MAC_SET_MEAS_REPORT_REFUSE(x) (((tANI_U8) x) | 4)
534
535// Length of TPC Request Action Frame
536#define SIR_TPC_REQ_ACTION_FRAME_SIZE (3 + EID_LEN(SIR_MAC_TPC_REQ_EID_MIN))
537#define SIR_TPC_REPORT_ACTION_FRAME_SIZE (3 + EID_LEN(SIR_MAC_TPC_RPT_EID_MIN))
538#define SIR_TPC_MAX_FRAME_SIZE 256
539//-----------------------------------------------------------------------------
540
541// OFFSET definitions for fixed fields in Management frames
542
543// Beacon/Probe Response offsets
544#define SIR_MAC_TS_OFFSET 0
545#define SIR_MAC_BEACON_INT_OFFSET 8 // Beacon Interval offset
546#define SIR_MAC_B_PR_CAPAB_OFFSET 10
547#define SIR_MAC_B_PR_SSID_OFFSET 12
548
549// Association/Reassociation offsets
550#define SIR_MAC_ASSOC_CAPAB_OFFSET 0
551#define SIR_MAC_LISTEN_INT_OFFSET 2 // Listen Interval offset
552#define SIR_MAC_ASSOC_SSID_OFFSET 4
553#define SIR_MAC_CURRENT_AP_OFFSET 4
554#define SIR_MAC_REASSOC_SSID_OFFSET 10
555#define SIR_MAC_ASSOC_STATUS_CODE_OFFSET 2
556#define SIR_MAC_ASSOC_AID_OFFSET 4
557#define SIR_MAC_ASSOC_RSP_RATE_OFFSET 6
558
559// Disassociation/Deauthentication offsets
560#define SIR_MAC_REASON_CODE_OFFSET 0
561
562// Probe Request offset
563#define SIR_MAC_PROBE_REQ_SSID_OFFSET 0
564
565// Authentication offsets
566#define SIR_MAC_AUTH_ALGO_OFFSET 0
567#define SIR_MAC_AUTH_XACT_SEQNUM_OFFSET 2
568#define SIR_MAC_AUTH_STATUS_CODE_OFFSET 4
569#define SIR_MAC_AUTH_CHALLENGE_OFFSET 6
570
571/// Transaction sequence number definitions (used in Authentication frames)
572#define SIR_MAC_AUTH_FRAME_1 1
573#define SIR_MAC_AUTH_FRAME_2 2
574#define SIR_MAC_AUTH_FRAME_3 3
575#define SIR_MAC_AUTH_FRAME_4 4
576
577/// Protocol defined MAX definitions
578#define SIR_MAC_ADDR_LENGTH 6
579#define SIR_MAC_MAX_SSID_LENGTH 32
580#define SIR_MAC_MAX_NUMBER_OF_RATES 12
581#define SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS 4
582#define SIR_MAC_KEY_LENGTH 13 // WEP Maximum key length size
583#define SIR_MAC_AUTH_CHALLENGE_LENGTH 128
584#define SIR_MAC_WEP_IV_LENGTH 4
585#define SIR_MAC_WEP_ICV_LENGTH 4
586
587/// MAX key length when ULA is used
588#define SIR_MAC_MAX_KEY_LENGTH 32
589
590/// Macro definitions for get/set on FC fields
591#define SIR_MAC_GET_PROT_VERSION(x) ((((tANI_U16) x) & 0x0300) >> 8)
592#define SIR_MAC_GET_FRAME_TYPE(x) ((((tANI_U16) x) & 0x0C00) >> 8)
593#define SIR_MAC_GET_FRAME_SUB_TYPE(x) ((((tANI_U16) x) & 0xF000) >> 12)
594#define SIR_MAC_GET_WEP_BIT_IN_FC(x) (((tANI_U16) x) & 0x0040)
595#define SIR_MAC_SET_PROT_VERSION(x) ((tANI_U16) x)
596#define SIR_MAC_SET_FRAME_TYPE(x) (((tANI_U16) x) << 2)
597#define SIR_MAC_SET_FRAME_SUB_TYPE(x) (((tANI_U16) x) << 4)
598#define SIR_MAC_SET_WEP_BIT_IN_FC(x) (((tANI_U16) x) << 14)
599
600/// Macro definitions for get/set on capabilityInfo bits
601#define SIR_MAC_GET_ESS(x) (((tANI_U16) x) & 0x0001)
602#define SIR_MAC_GET_IBSS(x) ((((tANI_U16) x) & 0x0002) >> 1)
603#define SIR_MAC_GET_CF_POLLABLE(x) ((((tANI_U16) x) & 0x0004) >> 2)
604#define SIR_MAC_GET_CF_POLL_REQ(x) ((((tANI_U16) x) & 0x0008) >> 3)
605#define SIR_MAC_GET_PRIVACY(x) ((((tANI_U16) x) & 0x0010) >> 4)
606#define SIR_MAC_GET_SHORT_PREAMBLE(x) ((((tANI_U16) x) & 0x0020) >> 5)
607#define SIR_MAC_GET_SPECTRUM_MGMT(x) ((((tANI_U16) x) & 0x0100) >> 8)
608#define SIR_MAC_GET_QOS(x) ((((tANI_U16) x) & 0x0200) >> 9)
609#define SIR_MAC_GET_SHORT_SLOT_TIME(x) ((((tANI_U16) x) & 0x0400) >> 10)
610#define SIR_MAC_GET_APSD(x) ((((tANI_U16) x) & 0x0800) >> 11)
611#if defined WLAN_FEATURE_VOWIFI
612#define SIR_MAC_GET_RRM(x) ((((tANI_U16) x) & 0x1000) >> 12)
613#endif
614#define SIR_MAC_GET_BLOCK_ACK(x) ((((tANI_U16) x) & 0xc000) >> CAPABILITY_INFO_DELAYED_BA_BIT)
615#define SIR_MAC_SET_ESS(x) (((tANI_U16) x) | 0x0001)
616#define SIR_MAC_SET_IBSS(x) (((tANI_U16) x) | 0x0002)
617#define SIR_MAC_SET_CF_POLLABLE(x) (((tANI_U16) x) | 0x0004)
618#define SIR_MAC_SET_CF_POLL_REQ(x) (((tANI_U16) x) | 0x0008)
619#define SIR_MAC_SET_PRIVACY(x) (((tANI_U16) x) | 0x0010)
620#define SIR_MAC_SET_SHORT_PREAMBLE(x) (((tANI_U16) x) | 0x0020)
621#define SIR_MAC_SET_SPECTRUM_MGMT(x) (((tANI_U16) x) | 0x0100)
622#define SIR_MAC_SET_QOS(x) (((tANI_U16) x) | 0x0200)
623#define SIR_MAC_SET_SHORT_SLOT_TIME(x) (((tANI_U16) x) | 0x0400)
624#define SIR_MAC_SET_APSD(x) (((tANI_U16) x) | 0x0800)
625#if defined WLAN_FEATURE_VOWIFI
626#define SIR_MAC_SET_RRM(x) (((tANI_U16) x) | 0x1000)
627#endif
628#define SIR_MAC_SET_GROUP_ACK(x) (((tANI_U16) x) | 0x4000)
629
630// bitname must be one of the above, eg ESS, CF_POLLABLE, etc.
631#define SIR_MAC_CLEAR_CAPABILITY(u16value, bitname) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800632 ((u16value) &= (~(SIR_MAC_SET_##bitname(0))))
Jeff Johnson295189b2012-06-20 16:38:30 -0700633
634/// Status Code (present in Management response frames) enum
635
636typedef enum eSirMacStatusCodes
637{
638 eSIR_MAC_SUCCESS_STATUS = 0, //Reserved
639 eSIR_MAC_UNSPEC_FAILURE_STATUS = 1, //Unspecified reason
640 // 802.11 reserved 2-9
641 /*
642 WMM status codes(standard 1.1 table 9)
643 Table 9 ADDTS Response Status Codes
644 Value Operation
645 0 Admission accepted
646 1 Invalid parameters
647 2 Reserved
648 3 Refused
649 4-255 Reserved
650 */
651 eSIR_MAC_WME_INVALID_PARAMS_STATUS = 1, // ??
652 eSIR_MAC_WME_REFUSED_STATUS = 3, // ??
653 eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS = 10, //Cannot support all requested capabilities in the Capability Information field
654 eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS = 11, //Reassociation denied due to inability to confirm that association exists
655 eSIR_MAC_OUTSIDE_SCOPE_OF_SPEC_STATUS = 12, //Association denied due to reason outside the scope of this standard
656 eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS = 13, //Responding station does not support the specified authentication algorithm
657 eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS = 14, //Received an Authentication frame with authentication transaction sequence number
658 //out of expected sequence
659 eSIR_MAC_CHALLENGE_FAILURE_STATUS = 15, //Authentication rejected because of challenge failure
660 eSIR_MAC_AUTH_RSP_TIMEOUT_STATUS = 16, //Authentication rejected due to timeout waiting for next frame in sequence
661 eSIR_MAC_MAX_ASSOC_STA_REACHED_STATUS = 17, //Association denied because AP is unable to handle additional associated stations
662 eSIR_MAC_BASIC_RATES_NOT_SUPPORTED_STATUS = 18, //Association denied due to requesting station not supporting all of the data rates in the
663 //BSSBasicRateSet parameter
664 eSIR_MAC_SHORT_PREAMBLE_NOT_SUPPORTED_STATUS = 19, //Association denied due to requesting station not supporting the short preamble
665 //option
666 eSIR_MAC_PBCC_NOT_SUPPORTED_STATUS = 20, //Association denied due to requesting station not supporting the PBCC modulation
667 //option
668 eSIR_MAC_CHANNEL_AGILITY_NOT_SUPPORTED_STATUS = 21, //Association denied due to requesting station not supporting the Channel Agility
669 //option
670 eSIR_MAC_SPECTRUM_MGMT_REQD_STATUS = 22, //Association request rejected because Spectrum Management capability is required
671 eSIR_MAC_PWR_CAPABILITY_BAD_STATUS = 23, //Association request rejected because the information in the Power Capability
672 //element is unacceptable
673 eSIR_MAC_SPRTD_CHANNELS_BAD_STATUS = 24, //Association request rejected because the information in the Supported Channels
674 //element is unacceptable
675 eSIR_MAC_SHORT_SLOT_NOT_SUPORTED_STATUS = 25, //Association denied due to requesting station not supporting the Short Slot Time
676 //option
677 eSIR_MAC_DSSS_OFDM_NOT_SUPPORTED_STATUS = 26, //Association denied due to requesting station not supporting the DSSS-OFDM option
678 // reserved 27-31
679 eSIR_MAC_QOS_UNSPECIFIED_FAILURE_STATUS = 32, //Unspecified, QoS-related failure
680 eSIR_MAC_QAP_NO_BANDWIDTH_STATUS = 33, //Association denied because QoS AP has insufficient bandwidth to handle another
681 //QoS STA
682 eSIR_MAC_XS_FRAME_LOSS_STATUS = 34, //Association denied due to excessive frame loss rates and/or poor conditions on cur-
683 //rent operating channel
684 eSIR_MAC_STA_QOS_NOT_SUPPORTED_STATUS = 35, //Association (with QoS BSS) denied because the requesting STA does not support the
685 //QoS facility
686 eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS = 36, //Reserved
687 eSIR_MAC_REQ_DECLINED_STATUS = 37, //The request has been declined
688 eSIR_MAC_INVALID_PARAM_STATUS = 38, //The request has not been successful as one or more parameters have invalid values
689 eSIR_MAC_TS_NOT_HONOURED_STATUS = 39, //The TS has not been created because the request cannot be honored; however, a suggested
690 //TSPEC is provided so that the initiating STA may attempt to set another TS
691 //with the suggested changes to the TSPEC
692 eSIR_MAC_INVALID_INFORMATION_ELEMENT_STATUS = 40, //Invalid information element, i.e., an information element defined in this standard for
693 //which the content does not meet the specifications in Clause 7
694 eSIR_MAC_INVALID_GROUP_CIPHER_STATUS = 41, //Invalid group cipher
695 eSIR_MAC_INVALID_PAIRWISE_CIPHER_STATUS = 42, //Invalid pairwise cipher
696 eSIR_MAC_INVALID_AKMP_STATUS = 43, //Invalid AKMP
697 eSIR_MAC_UNSUPPORTED_RSN_IE_VERSION_STATUS = 44, //Unsupported RSN information element version
698 eSIR_MAC_INVALID_RSN_IE_CAPABILITIES_STATUS = 45, //Invalid RSN information element capabilities
699 eSIR_MAC_CIPHER_SUITE_REJECTED_STATUS = 46, //Cipher suite rejected because of security policy
700 eSIR_MAC_TS_NOT_CREATED_STATUS = 47, //The TS has not been created; however, the HC may be capable of creating a TS, in
701 //response to a request, after the time indicated in the TS Delay element
702 eSIR_MAC_DL_NOT_ALLOWED_STATUS = 48, //Direct link is not allowed in the BSS by policy
703 eSIR_MAC_DEST_STA_NOT_KNOWN_STATUS = 49, //The Destination STA is not present within this BSS
704 eSIR_MAC_DEST_STA_NOT_QSTA_STATUS = 50, //The Destination STA is not a QoS STA
705 eSIR_MAC_INVALID_LISTEN_INTERVAL_STATUS = 51, //Association denied because the ListenInterval is too large
706
707 eSIR_MAC_DSSS_CCK_RATE_MUST_SUPPORT_STATUS = 52, //FIXME:
708 eSIR_MAC_DSSS_CCK_RATE_NOT_SUPPORT_STATUS = 53,
709 eSIR_MAC_PSMP_CONTROLLED_ACCESS_ONLY_STATUS = 54,
710#ifdef FEATURE_WLAN_CCX
711 eSIR_MAC_CCX_UNSPECIFIED_QOS_FAILURE_STATUS = 200, //CCX-Unspecified, QoS related failure in (Re)Assoc response frames
712 eSIR_MAC_CCX_TSPEC_REQ_REFUSED_STATUS = 201, //CCX-TSPEC request refused due to AP's policy configuration in AddTs Rsp, (Re)Assoc Rsp.
713 eSIR_MAC_CCX_ASSOC_DENIED_INSUFF_BW_STATUS = 202, //CCX-Assoc denied due to insufficient bandwidth to handle new TS in (Re)Assoc Rsp.
714 eSIR_MAC_CCX_INVALID_PARAMETERS_STATUS = 203, //CCX-Invalid parameters. (Re)Assoc request had one or more TSPEC parameters with
715 //invalid values.
716#endif
717
718} tSirMacStatusCodes;
719
720/**
721 * Reason Code (present in Deauthentication/Disassociation
722 * Management frames) enum
723 */
724typedef enum eSirMacReasonCodes
725{
726 eSIR_MAC_UNSPEC_FAILURE_REASON = 1, //Unspecified reason
727 eSIR_MAC_PREV_AUTH_NOT_VALID_REASON = 2, //Previous authentication no longer valid
728 eSIR_MAC_DEAUTH_LEAVING_BSS_REASON = 3, //Deauthenticated because sending station is leaving (or has left) IBSS or ESS
729 eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON = 4, //Disassociated due to inactivity
730 eSIR_MAC_DISASSOC_DUE_TO_DISABILITY_REASON = 5, //Disassociated because AP is unable to handle all currently associated stations
731 eSIR_MAC_CLASS2_FRAME_FROM_NON_AUTH_STA_REASON = 6, //Class 2 frame received from nonauthenticated station
732 eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON = 7, //Class 3 frame received from nonassociated station
733 eSIR_MAC_DISASSOC_LEAVING_BSS_REASON = 8, //Disassociated because sending station is leaving (or has left) BSS
734 eSIR_MAC_STA_NOT_PRE_AUTHENTICATED_REASON = 9, //Station requesting (re)association is not authenticated with responding station
735 eSIR_MAC_PWR_CAPABILITY_BAD_REASON = 10, //Disassociated because the information in the Power Capability element is unacceptable
736 eSIR_MAC_SPRTD_CHANNELS_BAD_REASON = 11, //Disassociated because the information in the Supported Channels element is unacceptable
737 // reserved 12
738 eSIR_MAC_INVALID_IE_REASON = 13, //Invalid information element, i.e., an information element defined in this standard for
739 //which the content does not meet the specifications in Clause 7
740 eSIR_MAC_MIC_FAILURE_REASON = 14, //Message integrity code (MIC) failure
741 eSIR_MAC_4WAY_HANDSHAKE_TIMEOUT_REASON = 15, //4-Way Handshake timeout
742 eSIR_MAC_GR_KEY_UPDATE_TIMEOUT_REASON = 16, //Group Key Handshake timeout
743 eSIR_MAC_RSN_IE_MISMATCH_REASON = 17, //Information element in 4-Way Handshake different from (Re)Association Request/Probe
744 //Response/Beacon frame
745 eSIR_MAC_INVALID_MC_CIPHER_REASON = 18, //Invalid group cipher
746 eSIR_MAC_INVALID_UC_CIPHER_REASON = 19, //Invalid pairwise cipher
747 eSIR_MAC_INVALID_AKMP_REASON = 20, //Invalid AKMP
748 eSIR_MAC_UNSUPPORTED_RSN_IE_VER_REASON = 21, //Unsupported RSN information element version
749 eSIR_MAC_INVALID_RSN_CAPABILITIES_REASON = 22, //Invalid RSN information element capabilities
750 eSIR_MAC_1X_AUTH_FAILURE_REASON = 23, //IEEE 802.1X authentication failed
751 eSIR_MAC_CIPHER_SUITE_REJECTED_REASON = 24, //Cipher suite rejected because of the security policy
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800752#ifdef FEATURE_WLAN_TDLS
753 eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE = 25, //TDLS direct link teardown due to TDLS peer STA unreachable via the TDLS direct link
754 eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON = 26, //TDLS direct link teardown for unspecified reason
755#endif
756 // reserved 27 - 31
Jeff Johnson295189b2012-06-20 16:38:30 -0700757 eSIR_MAC_QOS_UNSPECIFIED_REASON = 32, //Disassociated for unspecified, QoS-related reason
758 eSIR_MAC_QAP_NO_BANDWIDTH_REASON = 33, //Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA
759 eSIR_MAC_XS_UNACKED_FRAMES_REASON = 34, //Disassociated because excessive number of frames need to be acknowledged, but are not
760 //acknowledged due to AP transmissions and/or poor channel conditions
761 eSIR_MAC_BAD_TXOP_USE_REASON = 35, //Disassociated because STA is transmitting outside the limits of its TXOPs
762 eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON = 36, //Requested from peer STA as the STA is leaving the BSS (or resetting)
763 eSIR_MAC_PEER_REJECT_MECHANISIM_REASON = 37, //Requested from peer STA as it does not want to use the mechanism
764 eSIR_MAC_MECHANISM_NOT_SETUP_REASON = 38, //Requested from peer STA as the STA received frames using the mechanism for which a
765 //setup is required
766 eSIR_MAC_PEER_TIMEDOUT_REASON = 39, //Requested from peer STA due to timeout
767 eSIR_MAC_CIPHER_NOT_SUPPORTED_REASON = 45, //Peer STA does not support the requested cipher suite
768 eSIR_MAC_DISASSOC_DUE_TO_FTHANDOFF_REASON = 46, //FT reason
769 //reserved 47 - 65535.
770 eSIR_BEACON_MISSED = 65534, //We invented this to tell beacon missed case
771} tSirMacReasonCodes;
772
773
774typedef enum eSirMacChannelType
775{
776 eSIR_MAC_11A_BAND,
777 eSIR_MAC_11B_BAND,
778 eSIR_MAC_UNKNOWN_BAND
779} tSirMacChannelType;
780
781// BA Initiator v/s Recipient
782typedef enum eBADirection
783{
784 eBA_RECIPIENT,
785 eBA_INITIATOR
786} tBADirection;
787
788// A-MPDU/BA Enable/Disable in Tx/Rx direction
789typedef enum eBAEnable
790{
791 eBA_DISABLE,
792 eBA_ENABLE
793} tBAEnable;
794
795// A-MPDU/BA Policy
796typedef enum eBAPolicy
797{
798 eBA_UNCOMPRESSED,
799 eBA_COMPRESSED
800} tBAPolicy;
801
802// A-MPDU/BA Policy
803typedef enum eBAPolicyType
804{
805 eBA_POLICY_DELAYED,
806 eBA_POLICY_IMMEDIATE
807} tBAPolicyType;
808
809#ifdef WLAN_FEATURE_VOWIFI
810/* Based on table 7-43a from 802.11k Spec */
811typedef enum eRrmNeighborReachability
812{
813 eREACHABILITY_RESERVED,
814 eREACHABILITY_NOT_REACHABLE,
815 eREACHABILITY_UNKNOWN,
816 eREACHABILITY_REACHABLE,
817} tRrmNeighborReachability;
818#endif /* WLAN_FEATURE_VOWIFI */
819
820/// Frame control field format (2 bytes)
821typedef __ani_attr_pre_packed struct sSirMacFrameCtl
822{
823
824#ifndef ANI_LITTLE_BIT_ENDIAN
825
826 tANI_U8 subType :4;
827 tANI_U8 type :2;
828 tANI_U8 protVer :2;
829
830 tANI_U8 order :1;
831 tANI_U8 wep :1;
832 tANI_U8 moreData :1;
833 tANI_U8 powerMgmt :1;
834 tANI_U8 retry :1;
835 tANI_U8 moreFrag :1;
836 tANI_U8 fromDS :1;
837 tANI_U8 toDS :1;
838
839#else
840
841 tANI_U8 protVer :2;
842 tANI_U8 type :2;
843 tANI_U8 subType :4;
844
845 tANI_U8 toDS :1;
846 tANI_U8 fromDS :1;
847 tANI_U8 moreFrag :1;
848 tANI_U8 retry :1;
849 tANI_U8 powerMgmt :1;
850 tANI_U8 moreData :1;
851 tANI_U8 wep :1;
852 tANI_U8 order :1;
853
854#endif
855
856} __ani_attr_packed tSirMacFrameCtl, *tpSirMacFrameCtl;
857
858/// Sequence control field
859typedef __ani_attr_pre_packed struct sSirMacSeqCtl
860{
861
862#ifndef ANI_LITTLE_BIT_ENDIAN
863
864 tANI_U8 seqNumLo : 4;
865 tANI_U8 fragNum : 4;
866
867 tANI_U8 seqNumHi : 8;
868
869#else
870
871 tANI_U8 fragNum : 4;
872 tANI_U8 seqNumLo : 4;
873 tANI_U8 seqNumHi : 8;
874
875#endif
876} __ani_attr_packed tSirMacSeqCtl, *tpSirMacSeqCtl;
877
878// ACK policies
879
880typedef enum eSirMacAckPolicy
881{
882 eSIR_MAC_IMMEDIATE_ACK=0 ,
883 eSIR_MAC_NO_ACK,
884 eSIR_MAC_NO_EXPLICIT_ACK,
885 eSIR_MAC_BURST_ACK
886} tSirMacAckPolicy;
887
888/// QoS control field
889typedef __ani_attr_pre_packed struct sSirMacQosCtl
890{
891
892#ifndef ANI_LITTLE_BIT_ENDIAN
893
894 tANI_U8 rsvd : 1;
895 tANI_U8 ackPolicy : 2;
896 tANI_U8 esop_txopUnit : 1;
897 tANI_U8 tid : 4;
898
899 tANI_U8 txop : 8;
900
901#else
902
903 tANI_U8 tid : 4;
904 tANI_U8 esop_txopUnit : 1;
905 tANI_U8 ackPolicy : 2;
906 tANI_U8 rsvd : 1;
907
908 tANI_U8 txop : 8;
909
910#endif
911} __ani_attr_packed tSirMacQosCtl, *tpSirMacQosCtl;
912
913/// Length (in bytes) of MAC header in 3 address format
914#define SIR_MAC_HDR_LEN_3A 24
915
916/// Length (in bytes) of MAC header in 4 address format
917#define SIR_MAC_HDR_LEN_4A 30
918
919/// Length (in bytes) of the QoS control field in the MAC header
920#define SIR_MAC_QOS_CTL_LEN 2
921
922/// 3 address MAC data header format (24/26 bytes)
923typedef __ani_attr_pre_packed struct sSirMacDot3Hdr
924{
925 tANI_U8 da[6];
926 tANI_U8 sa[6];
927 tANI_U16 length;
928} __ani_attr_packed tSirMacDot3Hdr, *tpSirMacDot3Hdr;
929
930
931/// 3 address MAC data header format (24/26 bytes)
932typedef __ani_attr_pre_packed struct sSirMacDataHdr3a
933{
934 tSirMacFrameCtl fc;
935 tANI_U8 durationLo;
936 tANI_U8 durationHi;
937 tANI_U8 addr1[6];
938 tANI_U8 addr2[6];
939 tANI_U8 addr3[6];
940 tSirMacSeqCtl seqControl;
941 tSirMacQosCtl qosControl;
942} __ani_attr_packed tSirMacDataHdr3a, *tpSirMacDataHdr3a;
943
944/// 4 address MAC data header format (30/32 bytes)
945typedef __ani_attr_pre_packed struct sSirMacDataHdr4a
946{
947 tSirMacFrameCtl fc;
948 tANI_U8 durationLo;
949 tANI_U8 durationHi;
950 tANI_U8 addr1[6];
951 tANI_U8 addr2[6];
952 tANI_U8 addr3[6];
953 tSirMacSeqCtl seqControl;
954 tANI_U8 addr4[6];
955 tSirMacQosCtl qosControl;
956} __ani_attr_packed tSirMacDataHdr4a, *tpSirMacDataHdr4a;
957
958/// Management header format
959typedef __ani_attr_pre_packed struct sSirMacMgmtHdr
960{
961 tSirMacFrameCtl fc;
962 tANI_U8 durationLo;
963 tANI_U8 durationHi;
964 tANI_U8 da[6];
965 tANI_U8 sa[6];
966 tANI_U8 bssId[6];
967 tSirMacSeqCtl seqControl;
968} __ani_attr_packed tSirMacMgmtHdr, *tpSirMacMgmtHdr;
969
970/// PS-poll header format
971typedef __ani_attr_pre_packed struct sSirMacPSpoll
972{
973 tSirMacFrameCtl fc;
974 tANI_U8 aidLo;
975 tANI_U8 aidHi;
976 tANI_U8 bssId[6];
977 tANI_U8 ta[6];
978 tANI_U8 fcs[4];
979} __ani_attr_packed tSirMacPSpoll, *tpSirMacPSpoll;
980
981/// ERP information field
982typedef __ani_attr_pre_packed struct sSirMacErpInfo
983{
984#ifndef ANI_LITTLE_BIT_ENDIAN
985 tANI_U8 reserved:5;
986 tANI_U8 barkerPreambleMode:1;
987 tANI_U8 useProtection:1;
988 tANI_U8 nonErpPresent:1;
989#else
990 tANI_U8 nonErpPresent:1;
991 tANI_U8 useProtection:1;
992 tANI_U8 barkerPreambleMode:1;
993 tANI_U8 reserved:5;
994#endif
995} __ani_attr_packed tSirMacErpInfo, *tpSirMacErpInfo;
996
997/// Capability information field
998typedef __ani_attr_pre_packed struct sSirMacCapabilityInfo
999{
1000#ifndef ANI_LITTLE_BIT_ENDIAN
1001 tANI_U16 immediateBA:1;
1002 tANI_U16 delayedBA:1;
1003 tANI_U16 dsssOfdm:1;
1004 tANI_U16 rrm:1;
1005 tANI_U16 apsd:1;
1006 tANI_U16 shortSlotTime:1;
1007 tANI_U16 qos:1;
1008 tANI_U16 spectrumMgt:1;
1009 tANI_U16 channelAgility:1;
1010 tANI_U16 pbcc:1;
1011 tANI_U16 shortPreamble:1;
1012 tANI_U16 privacy:1;
1013 tANI_U16 cfPollReq:1;
1014 tANI_U16 cfPollable:1;
1015 tANI_U16 ibss:1;
1016 tANI_U16 ess:1;
1017#else
1018 tANI_U16 ess:1;
1019 tANI_U16 ibss:1;
1020 tANI_U16 cfPollable:1;
1021 tANI_U16 cfPollReq:1;
1022 tANI_U16 privacy:1;
1023 tANI_U16 shortPreamble:1;
1024 tANI_U16 pbcc:1;
1025 tANI_U16 channelAgility:1;
1026 tANI_U16 spectrumMgt:1;
1027 tANI_U16 qos:1;
1028 tANI_U16 shortSlotTime:1;
1029 tANI_U16 apsd:1;
1030 tANI_U16 rrm:1;
1031 tANI_U16 dsssOfdm:1;
1032 tANI_U16 delayedBA:1;
1033 tANI_U16 immediateBA:1;
1034#endif
1035} __ani_attr_packed tSirMacCapabilityInfo, *tpSirMacCapabilityInfo;
1036
1037typedef __ani_attr_pre_packed struct sSirMacCfParamSet
1038{
1039 tANI_U8 cfpCount;
1040 tANI_U8 cfpPeriod;
1041 tANI_U16 cfpMaxDuration;
1042 tANI_U16 cfpDurRemaining;
1043} __ani_attr_packed tSirMacCfParamSet;
1044
1045typedef __ani_attr_pre_packed struct sSirMacTim
1046{
1047 tANI_U8 dtimCount;
1048 tANI_U8 dtimPeriod;
1049 tANI_U8 bitmapControl;
1050 tANI_U8 bitmapLength;
1051 tANI_U8 bitmap[251];
1052} __ani_attr_packed tSirMacTim;
1053
1054//12 Bytes long because this structure can be used to represent rate
1055//and extended rate set IEs
1056//The parser assume this to be at least 12
1057typedef __ani_attr_pre_packed struct sSirMacRateSet
1058{
1059 tANI_U8 numRates;
1060 tANI_U8 rate[SIR_MAC_RATESET_EID_MAX];
1061} __ani_attr_packed tSirMacRateSet;
1062
1063
1064typedef __ani_attr_pre_packed struct sSirMacSSid
1065{
1066 tANI_U8 length;
1067 tANI_U8 ssId[32];
1068} __ani_attr_packed tSirMacSSid;
1069
1070typedef __ani_attr_pre_packed struct sSirMacWpaInfo
1071{
1072 tANI_U8 length;
1073 tANI_U8 info[SIR_MAC_MAX_IE_LENGTH];
1074} __ani_attr_packed tSirMacWpaInfo, *tpSirMacWpaInfo, tSirMacRsnInfo, *tpSirMacRsnInfo;
1075
1076
1077/* ----------------
1078 * EDCA Profiles
1079 * ---------------
1080 */
1081
1082#define EDCA_AC_BE 0
1083#define EDCA_AC_BK 1
1084#define EDCA_AC_VI 2
1085#define EDCA_AC_VO 3
1086#define AC_MGMT_LO 4
1087#define AC_MGMT_HI 5
1088#define MAX_NUM_AC 4
1089#define TOT_NUM_AC (MAX_NUM_AC + 2) /* +2 for AC_MGMT_xx */
1090
1091/*
1092#define EDCA_INDEX_0_RSVD 0
1093#define EDCA_INDEX_1_BEACON 1
1094#define EDCA_INDEX_2_MGMT_PROBERSP 2
1095#define EDCA_INDEX_3_MGMT_OTHER 3
1096#define EDCA_INDEX_4_AC_VO 4
1097#define EDCA_INDEX_5_AC_VI 5
1098#define EDCA_INDEX_6_AC_BE 6
1099#define EDCA_INDEX_7_AC_BK 7
1100*/
1101// access categories
1102#define SIR_MAC_EDCAACI_BESTEFFORT (EDCA_AC_BE)
1103#define SIR_MAC_EDCAACI_BACKGROUND (EDCA_AC_BK)
1104#define SIR_MAC_EDCAACI_VIDEO (EDCA_AC_VI)
1105#define SIR_MAC_EDCAACI_VOICE (EDCA_AC_VO)
1106
1107// access category record
1108typedef __ani_attr_pre_packed struct sSirMacAciAifsn
1109{
1110#ifndef ANI_LITTLE_BIT_ENDIAN
1111 tANI_U8 rsvd : 1;
1112 tANI_U8 aci : 2;
1113 tANI_U8 acm : 1;
1114 tANI_U8 aifsn : 4;
1115#else
1116 tANI_U8 aifsn : 4;
1117 tANI_U8 acm : 1;
1118 tANI_U8 aci : 2;
1119 tANI_U8 rsvd : 1;
1120#endif
1121} __ani_attr_packed tSirMacAciAifsn;
1122
1123// contention window size
1124typedef __ani_attr_pre_packed struct sSirMacCW
1125{
1126#ifndef ANI_LITTLE_BIT_ENDIAN
1127 tANI_U8 max : 4;
1128 tANI_U8 min : 4;
1129#else
1130 tANI_U8 min : 4;
1131 tANI_U8 max : 4;
1132#endif
1133} __ani_attr_packed tSirMacCW;
1134
1135typedef __ani_attr_pre_packed struct sSirMacEdcaParamRecord
1136{
1137 tSirMacAciAifsn aci;
1138 tSirMacCW cw;
1139 tANI_U16 txoplimit;
1140} __ani_attr_packed tSirMacEdcaParamRecord;
1141
1142typedef __ani_attr_pre_packed struct sSirMacQosInfo
1143{
1144#ifndef ANI_LITTLE_BIT_ENDIAN
1145 tANI_U8 uapsd : 1;
1146 tANI_U8 txopreq : 1;
1147 tANI_U8 qreq : 1;
1148 tANI_U8 qack : 1;
1149 tANI_U8 count : 4;
1150#else
1151 tANI_U8 count : 4;
1152 tANI_U8 qack : 1;
1153 tANI_U8 qreq : 1;
1154 tANI_U8 txopreq : 1;
1155 tANI_U8 uapsd : 1;
1156#endif
1157} __ani_attr_packed tSirMacQosInfo;
1158
1159
1160typedef __ani_attr_pre_packed struct sSirMacQosInfoStation
1161{
1162#ifdef ANI_LITTLE_BIT_ENDIAN
1163 tANI_U8 acvo_uapsd:1;
1164 tANI_U8 acvi_uapsd:1;
1165 tANI_U8 acbk_uapsd:1;
1166 tANI_U8 acbe_uapsd:1;
1167 tANI_U8 qack:1;
1168 tANI_U8 maxSpLen:2;
1169 tANI_U8 moreDataAck:1;
1170#else
1171 tANI_U8 moreDataAck:1;
1172 tANI_U8 maxSpLen:2;
1173 tANI_U8 qack:1;
1174 tANI_U8 acbe_uapsd:1;
1175 tANI_U8 acbk_uapsd:1;
1176 tANI_U8 acvi_uapsd:1;
1177 tANI_U8 acvo_uapsd:1;
1178#endif
1179} __ani_attr_packed tSirMacQosInfoStation, *tpSirMacQosInfoStation;
1180
1181
1182
1183typedef __ani_attr_pre_packed struct sSirMacEdcaParamSetIE
1184{
1185 tANI_U8 type;
1186 tANI_U8 length;
1187 tSirMacQosInfo qosInfo;
1188 tANI_U8 rsvd;
1189 tSirMacEdcaParamRecord acbe; // best effort
1190 tSirMacEdcaParamRecord acbk; // background
1191 tSirMacEdcaParamRecord acvi; // video
1192 tSirMacEdcaParamRecord acvo; // voice
1193} __ani_attr_packed tSirMacEdcaParamSetIE;
1194
1195#if 1
1196typedef __ani_attr_pre_packed struct sSirMacQoSParams
1197{
1198 tANI_U8 count;
1199 tANI_U16 limit;
1200 tANI_U8 CWmin[8];
1201 tANI_U8 AIFS[8];
1202} __ani_attr_packed tSirMacQoSParams;
1203#endif
1204
1205typedef __ani_attr_pre_packed struct sSirMacQbssLoadIE
1206{
1207 tANI_U8 type;
1208 tANI_U8 length;
1209 tANI_U16 staCount;
1210 tANI_U8 chnlUtil;
1211 tANI_U16 admitCapacity;
1212} __ani_attr_packed tSirMacQbssLoadIE;
1213
1214// ts info direction field can take any of these values
1215#define SIR_MAC_DIRECTION_UPLINK 0
1216#define SIR_MAC_DIRECTION_DNLINK 1
1217#define SIR_MAC_DIRECTION_DIRECT 2
1218#define SIR_MAC_DIRECTION_BIDIR 3
1219
1220// access policy
1221// reserved 0
1222#define SIR_MAC_ACCESSPOLICY_EDCA 1
1223#define SIR_MAC_ACCESSPOLICY_HCCA 2
1224#define SIR_MAC_ACCESSPOLICY_BOTH 3
1225
1226#define SIR_MAC_HCCA_TSID_MIN 8 // valid HCCA tsid's are 8 or higher
1227#define SIR_MAC_TID_MAX 15
1228#define MAC_BA_TID_MAX 8
1229
1230typedef __ani_attr_pre_packed struct sSirMacTSInfoTfc
1231{
1232#ifndef ANI_LITTLE_BIT_ENDIAN
1233 tANI_U8 burstSizeDefn : 1;
1234 tANI_U8 reserved :7;
1235#else
1236 tANI_U8 reserved :7;
1237 tANI_U8 burstSizeDefn : 1;
1238#endif
1239
1240#ifndef ANI_LITTLE_BIT_ENDIAN
1241 tANI_U16 ackPolicy : 2;
1242 tANI_U16 userPrio : 3;
1243 tANI_U16 psb : 1;
1244 tANI_U16 aggregation : 1;
1245 tANI_U16 accessPolicy : 2;
1246 tANI_U16 direction : 2;
1247 tANI_U16 tsid : 4;
1248 tANI_U16 trafficType : 1;
1249#else
1250 tANI_U16 trafficType : 1;
1251 tANI_U16 tsid : 4;
1252 tANI_U16 direction : 2;
1253 tANI_U16 accessPolicy : 2;
1254 tANI_U16 aggregation : 1;
1255 tANI_U16 psb : 1;
1256 tANI_U16 userPrio : 3;
1257 tANI_U16 ackPolicy : 2;
1258#endif
1259} __ani_attr_packed tSirMacTSInfoTfc;
1260
1261typedef __ani_attr_pre_packed struct sSirMacTSInfoSch
1262{
1263#ifndef ANI_LITTLE_BIT_ENDIAN
1264 tANI_U8 rsvd : 7;
1265 tANI_U8 schedule : 1;
1266#else
1267 tANI_U8 schedule : 1;
1268 tANI_U8 rsvd : 7;
1269#endif
1270} __ani_attr_packed tSirMacTSInfoSch;
1271
1272typedef __ani_attr_pre_packed struct sSirMacTSInfo
1273{
1274 tSirMacTSInfoTfc traffic;
1275 tSirMacTSInfoSch schedule;
1276} __ani_attr_packed tSirMacTSInfo;
1277
1278typedef __ani_attr_pre_packed struct sSirMacTspecIE
1279{
1280 tANI_U8 type;
1281 tANI_U8 length;
1282 tSirMacTSInfo tsinfo;
1283 tANI_U16 nomMsduSz;
1284 tANI_U16 maxMsduSz;
1285 tANI_U32 minSvcInterval;
1286 tANI_U32 maxSvcInterval;
1287 tANI_U32 inactInterval;
1288 tANI_U32 suspendInterval;
1289 tANI_U32 svcStartTime;
1290 tANI_U32 minDataRate;
1291 tANI_U32 meanDataRate;
1292 tANI_U32 peakDataRate;
1293 tANI_U32 maxBurstSz;
1294 tANI_U32 delayBound;
1295 tANI_U32 minPhyRate;
1296 tANI_U16 surplusBw;
1297 tANI_U16 mediumTime;
1298}
Jeff Johnson3368d4a2013-02-13 12:23:50 -08001299__ani_attr_packed tSirMacTspecIE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001300
1301// max size of the classifier params in the tclas IE
1302#define SIR_MAC_CLSPARAM_LEN 253
1303
1304// frame classifier types
1305#define SIR_MAC_TCLASTYPE_ETHERNET 0
1306#define SIR_MAC_TCLASTYPE_TCPUDPIP 1
1307#define SIR_MAC_TCLASTYPE_8021DQ 2
1308// reserved 3-255
1309
1310#define SIR_MAC_TCLAS_PARAM_ETHERNET_MIN 14
1311typedef __ani_attr_pre_packed struct sSirMacTclasParamEthernet
1312{
1313 tANI_U8 srcAddr[6];
1314 tANI_U8 dstAddr[6];
1315 tANI_U16 type;
1316}__ani_attr_packed tSirMacTclasParamEthernet;
1317
1318#define SIR_MAC_TCLAS_PARAM_IPV4_MIN 16
1319typedef __ani_attr_pre_packed struct sSirMacTclasParamIPv4
1320{
1321 tANI_U8 version;
1322 tANI_U32 srcIpAddr;
1323 tANI_U32 dstIpAddr;
1324 tANI_U16 srcPort;
1325 tANI_U16 dstPort;
1326 tANI_U8 dscp;
1327 tANI_U8 protocol;
1328 tANI_U8 rsvd;
1329} __ani_attr_packed tSirMacTclasParamIPv4;
1330
1331#define SIR_MAC_TCLAS_IPV4 4
1332#define SIR_MAC_TCLAS_IPV6 6
1333
1334#define SIR_MAC_TCLAS_PARAM_IPV6_MIN 40
1335typedef __ani_attr_pre_packed struct sSirMacTclasParamIPv6
1336{
1337 tANI_U8 version;
1338 tANI_U8 srcIpAddr[16];
1339 tANI_U8 dstIpAddr[16];
1340 tANI_U16 srcPort;
1341 tANI_U16 dstPort;
1342 tANI_U8 flowLabel[3];
1343} __ani_attr_packed tSirMacTclasParamIPv6;
1344
1345#define SIR_MAC_TCLAS_PARAM_8021DQ_MIN 2
1346typedef __ani_attr_pre_packed struct sSirMacTclasParam8021dq
1347{
1348 tANI_U16 tag;
1349} __ani_attr_packed tSirMacTclasParam8021dq;
1350
1351typedef __ani_attr_pre_packed struct sSirMacTclasIE
1352{
1353 tANI_U8 type;
1354 tANI_U8 length;
1355 tANI_U8 userPrio;
1356 tANI_U8 classifierType;
1357 tANI_U8 classifierMask;
1358} __ani_attr_packed tSirMacTclasIE;
1359
1360typedef __ani_attr_pre_packed struct sSirMacTsDelayIE
1361{
1362 tANI_U8 type;
1363 tANI_U8 length;
1364 tANI_U32 delay;
1365} __ani_attr_packed tSirMacTsDelayIE;
1366
1367typedef __ani_attr_pre_packed struct sSirMacTclasProcIE
1368{
1369 tANI_U8 type;
1370 tANI_U8 length;
1371 tANI_U8 processing;
1372} __ani_attr_packed tSirMacTclasProcIE;
1373
1374typedef __ani_attr_pre_packed struct sSirMacScheduleInfo
1375{
1376#ifndef ANI_LITTLE_BIT_ENDIAN
1377 tANI_U16 rsvd : 9;
1378 tANI_U16 direction : 2;
1379 tANI_U16 tsid : 4;
1380 tANI_U16 aggregation : 1;
1381#else
1382 tANI_U16 aggregation : 1;
1383 tANI_U16 tsid : 4;
1384 tANI_U16 direction : 2;
1385 tANI_U16 rsvd : 9;
1386#endif
1387} __ani_attr_packed tSirMacScheduleInfo;
1388
1389typedef __ani_attr_pre_packed struct sSirMacScheduleIE
1390{
1391 tANI_U8 type;
1392 tANI_U8 length;
1393 tSirMacScheduleInfo info;
1394 tANI_U32 svcStartTime;
1395 tANI_U32 svcInterval;
1396 tANI_U16 maxSvcDuration;
1397 tANI_U16 specInterval;
1398} __ani_attr_packed tSirMacScheduleIE;
1399
1400typedef __ani_attr_pre_packed struct sSirMacQosCapabilityIE
1401{
1402 tANI_U8 type;
1403 tANI_U8 length;
1404 tSirMacQosInfo qosInfo;
1405} __ani_attr_packed tSirMacQosCapabilityIE;
1406
1407typedef __ani_attr_pre_packed struct sSirMacQosCapabilityStaIE
1408{
1409 tANI_U8 type;
1410 tANI_U8 length;
1411 tSirMacQosInfoStation qosInfo;
1412} __ani_attr_packed tSirMacQosCapabilityStaIE;
1413
1414
1415#define ADDTS
1416typedef __ani_attr_pre_packed struct sSirMacQosActionIE
1417{
1418 tANI_U8 type;
1419 tANI_U8 length;
1420 tANI_U8 qosAction;
1421 tANI_U8 qosBody[1];
1422} __ani_attr_packed tSirMacQosActionIE;
1423
1424typedef tANI_U32 tSirMacTimeStamp[2];
1425
1426typedef tANI_U16 tSirMacBeaconInterval;
1427
1428typedef tANI_U16 tSirMacListenInterval;
1429
1430typedef tANI_U8 tSirMacChanNum;
1431
1432typedef tANI_U8 tSirMacAddr[6];
1433
1434
1435// IE definitions
1436typedef __ani_attr_pre_packed struct sSirMacIE
1437{
1438 tANI_U8 elementID;
1439 tANI_U8 length;
1440 tANI_U8 info[1];
1441} __ani_attr_packed tSirMacIE;
1442
1443typedef __ani_attr_pre_packed struct sSirMacSSidIE
1444{
1445 tANI_U8 type;
1446 tSirMacSSid ssId;
1447} __ani_attr_packed tSirMacSSidIE;
1448
1449typedef __ani_attr_pre_packed struct sSirMacRateSetIE
1450{
1451 tANI_U8 type;
1452 tSirMacRateSet supportedRateSet;
1453} __ani_attr_packed tSirMacRateSetIE;
1454
1455typedef __ani_attr_pre_packed struct sSirMacDsParamSetIE
1456{
1457 tANI_U8 type;
1458 tANI_U8 length;
1459 tSirMacChanNum channelNumber;
1460} __ani_attr_packed tSirMacDsParamSetIE;
1461
1462typedef __ani_attr_pre_packed struct sSirMacCfParamSetIE
1463{
1464 tANI_U8 type;
1465 tANI_U8 length;
1466 tSirMacCfParamSet cfParams;
1467} __ani_attr_packed tSirMacCfParamSetIE;
1468
1469typedef __ani_attr_pre_packed struct sSirMacChanInfo
1470{
1471 tSirMacChanNum firstChanNum;
1472 tANI_U8 numChannels;
1473 tANI_S8 maxTxPower;
1474} __ani_attr_packed tSirMacChanInfo;
1475
1476typedef __ani_attr_pre_packed struct sSirMacCountry
1477{
1478 tANI_U8 countryString[3]; // This from CFG_COUNTRY_STRING
1479 tANI_U8 numChanInfo;
1480 tSirMacChanInfo chanInfo[1];
1481} __ani_attr_packed tSirMacCountry;
1482
1483typedef __ani_attr_pre_packed struct sSirMacCountryIE
1484{
1485 tANI_U8 type;
1486 tANI_U8 length;
1487 tSirMacCountry country;
1488} __ani_attr_packed tSirMacCountryIE;
1489
1490typedef __ani_attr_pre_packed struct sSirMacNonErpPresentIE
1491{
1492 tANI_U8 type;
1493 tANI_U8 length;
1494 tANI_U8 erp;
1495} __ani_attr_packed tSirMacNonErpPresentIE;
1496
1497typedef __ani_attr_pre_packed struct sSirMacWpaIE
1498{
1499 tANI_U8 type;
1500 tSirMacWpaInfo wpa;
1501} __ani_attr_packed tSirMacWpaIE;
1502
1503typedef struct sSirMacPowerCapabilityIE
1504{
1505 tANI_U8 type;
1506 tANI_U8 length;
1507 tANI_U8 minTxPower;
1508 tANI_U8 maxTxPower;
1509} tSirMacPowerCapabilityIE;
1510
1511typedef struct sSirMacSupportedChannelIE
1512{
1513 tANI_U8 type;
1514 tANI_U8 length;
1515 tANI_U8 supportedChannels[96];
1516} tSirMacSupportedChannelIE;
1517
1518typedef struct sSirMacMeasReqField
1519{
1520 tANI_U8 channelNumber;
1521 tANI_U8 measStartTime[8];
1522 tANI_U16 measDuration;
1523} tSirMacMeasReqField, *tpSirMacMeasReqField;
1524
1525typedef struct sSirMacMeasReqIE
1526{
1527 tANI_U8 type;
1528 tANI_U8 length;
1529 tANI_U8 measToken;
1530 tANI_U8 measReqMode;
1531 tANI_U8 measType;
1532 tSirMacMeasReqField measReqField;
1533} tSirMacMeasReqIE, *tpSirMacMeasReqIE;
1534
1535// Basic Measurement Report
1536typedef struct sSirMacBasicReport
1537{
1538 tANI_U8 channelNumber;
1539 tANI_U8 measStartTime[8];
1540 tANI_U16 measDuration;
1541 tANI_U8 mapField;
1542} tSirMacBasicReport, *tpSirMacBasicReport;
1543
1544typedef struct sSirMacBasicReportIE
1545{
1546 tANI_U8 type;
1547 tANI_U8 length;
1548 tANI_U8 measToken;
1549 tANI_U8 measReportMode;
1550 tANI_U8 measType;
1551 tSirMacBasicReport basicReport;
1552} tSirMacBasicReportIE, *tpSirMacBasicReportIE;
1553
1554// CCA Measurement Report
1555typedef struct sSirMacCcaReport
1556{
1557 tANI_U8 channelNumber;
1558 tANI_U8 measStartTime[8];
1559 tANI_U16 measDuration;
1560 tANI_U8 ccaBusyFraction;
1561} tSirMacCcaReport, *tpSirMacCcaReport;
1562
1563typedef struct sSirMacCcaReportIE
1564{
1565 tANI_U8 type;
1566 tANI_U8 length;
1567 tANI_U8 measToken;
1568 tANI_U8 measReportMode;
1569 tANI_U8 measType;
1570 tSirMacCcaReport ccaReport;
1571} tSirMacCcaReportIE, *tpSirMacCcaReportIE;
1572
1573// RPI Histogram Measurement Report
1574typedef struct sSirMacRpiReport
1575{
1576 tANI_U8 channelNumber;
1577 tANI_U8 measStartTime[8];
1578 tANI_U16 measDuration;
1579 tANI_U8 rpiDensity[8];
1580} tSirMacRpiReport, *tpSirMacRpiReport;
1581
1582typedef struct sSirMacRpiReportIE
1583{
1584 tANI_U8 type;
1585 tANI_U8 length;
1586 tANI_U8 measToken;
1587 tANI_U8 measReportMode;
1588 tANI_U8 measType;
1589 tSirMacRpiReport rpiReport;
1590} tSirMacRpiReportIE, *tpSirMacRpiReportIE;
1591
1592
1593// HT Cap and HT IE Size defines
1594#define HT_CAPABILITY_IE_SIZE 28
1595#define HT_INFO_IE_SIZE 24
1596
1597//
1598// Determines the current operating mode of the 802.11n STA
1599//
1600typedef enum eSirMacHTOperatingMode
1601{
1602 eSIR_HT_OP_MODE_PURE, // No Protection
1603 eSIR_HT_OP_MODE_OVERLAP_LEGACY, // Overlap Legacy device present, protection is optional
1604 eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT, // No legacy device, but 20 MHz HT present
1605 eSIR_HT_OP_MODE_MIXED // Protetion is required
1606} tSirMacHTOperatingMode;
1607
1608
1609// Spatial Multiplexing(SM) Power Save mode
1610typedef enum eSirMacHTMIMOPowerSaveState
1611{
1612 eSIR_HT_MIMO_PS_STATIC = 0, // Static SM Power Save mode
1613 eSIR_HT_MIMO_PS_DYNAMIC = 1, // Dynamic SM Power Save mode
1614 eSIR_HT_MIMO_PS_NA = 2, // reserved
1615 eSIR_HT_MIMO_PS_NO_LIMIT = 3 // SM Power Save disabled
1616} tSirMacHTMIMOPowerSaveState;
1617
1618
Jeff Johnson295189b2012-06-20 16:38:30 -07001619typedef enum eSirMacHTChannelWidth
1620{
1621 eHT_CHANNEL_WIDTH_20MHZ = 0,
Jeff Johnsone7245742012-09-05 17:12:55 -07001622 eHT_CHANNEL_WIDTH_40MHZ = 1,
1623#ifdef WLAN_FEATURE_11AC
1624 eHT_CHANNEL_WIDTH_80MHZ = 2,
1625#endif
1626 eHT_MAX_CHANNEL_WIDTH
Jeff Johnson295189b2012-06-20 16:38:30 -07001627} tSirMacHTChannelWidth;
1628
1629//Packet struct for HT capability
1630typedef __ani_attr_pre_packed struct sHtCaps {
1631 tANI_U16 advCodingCap: 1;
1632 tANI_U16 supportedChannelWidthSet: 1;
1633 tANI_U16 mimoPowerSave: 2;
1634 tANI_U16 greenField: 1;
1635 tANI_U16 shortGI20MHz: 1;
1636 tANI_U16 shortGI40MHz: 1;
1637 tANI_U16 txSTBC: 1;
1638 tANI_U16 rxSTBC: 2;
1639 tANI_U16 delayedBA: 1;
1640 tANI_U16 maximalAMSDUsize: 1;
1641 tANI_U16 dsssCckMode40MHz: 1;
1642 tANI_U16 psmp: 1;
1643 tANI_U16 stbcControlFrame: 1;
1644 tANI_U16 lsigTXOPProtection: 1;
1645 tANI_U8 maxRxAMPDUFactor: 2;
1646 tANI_U8 mpduDensity: 3;
1647 tANI_U8 reserved1: 3;
1648 tANI_U8 supportedMCSSet[16];
1649 tANI_U16 pco: 1;
1650 tANI_U16 transitionTime: 2;
1651 tANI_U16 reserved2: 5;
1652 tANI_U16 mcsFeedback: 2;
1653 tANI_U16 reserved3: 6;
1654 tANI_U32 txBF: 1;
1655 tANI_U32 rxStaggeredSounding: 1;
1656 tANI_U32 txStaggeredSounding: 1;
1657 tANI_U32 rxZLF: 1;
1658 tANI_U32 txZLF: 1;
1659 tANI_U32 implicitTxBF: 1;
1660 tANI_U32 calibration: 2;
1661 tANI_U32 explicitCSITxBF: 1;
1662 tANI_U32 explicitUncompressedSteeringMatrix: 1;
1663 tANI_U32 explicitBFCSIFeedback: 3;
1664 tANI_U32 explicitUncompressedSteeringMatrixFeedback: 3;
1665 tANI_U32 explicitCompressedSteeringMatrixFeedback: 3;
1666 tANI_U32 csiNumBFAntennae: 2;
1667 tANI_U32 uncompressedSteeringMatrixBFAntennae: 2;
1668 tANI_U32 compressedSteeringMatrixBFAntennae: 2;
1669 tANI_U32 reserved4: 7;
1670 tANI_U8 antennaSelection: 1;
1671 tANI_U8 explicitCSIFeedbackTx: 1;
1672 tANI_U8 antennaIndicesFeedbackTx: 1;
1673 tANI_U8 explicitCSIFeedback: 1;
1674 tANI_U8 antennaIndicesFeedback: 1;
1675 tANI_U8 rxAS: 1;
1676 tANI_U8 txSoundingPPDUs: 1;
1677 tANI_U8 reserved5: 1;
1678
1679} __ani_attr_packed tHtCaps;
1680
1681/* During 11h channel switch, the AP can indicate if the
1682 * STA needs to stop the transmission or continue until the
1683 * channel-switch.
1684 * eSIR_CHANSW_MODE_NORMAL - STA can continue transmission
1685 * eSIR_CHANSW_MODE_SILENT - STA should stop transmission
1686 */
1687typedef enum eSirMacChanSwMode
1688{
1689 eSIR_CHANSW_MODE_NORMAL = 0,
1690 eSIR_CHANSW_MODE_SILENT = 1
1691} tSirMacChanSwitchMode;
1692
1693
1694typedef __ani_attr_pre_packed struct _BarControl {
1695
1696#ifndef ANI_BIG_BYTE_ENDIAN
1697
1698 tANI_U16 barAckPolicy:1;
1699 tANI_U16 multiTID:1;
1700 tANI_U16 bitMap:1;
1701 tANI_U16 rsvd:9;
1702 tANI_U16 numTID:4;
1703
1704#else
1705 tANI_U16 numTID:4;
1706 tANI_U16 rsvd:9;
1707 tANI_U16 bitMap:1;
1708 tANI_U16 multiTID:1;
1709 tANI_U16 barAckPolicy:1;
1710
1711#endif
1712
1713}__ani_attr_packed barCtrlType;
1714
1715typedef __ani_attr_pre_packed struct _BARFrmStruct {
1716 tSirMacFrameCtl fc;
1717 tANI_U16 duration;
1718 tSirMacAddr rxAddr;
1719 tSirMacAddr txAddr;
1720 barCtrlType barControl;
1721 tSirMacSeqCtl ssnCtrl;
1722}__ani_attr_packed BARFrmType;
1723
1724
1725#if 0
1726// Typedef for HT Capability IE
1727// Typedef for HT Capability Info Field
1728#define SUPPORT_ADVANCE_CODING_1 1
1729#define NOT_SUPPORT_ADVANCE_CODING_0 0
1730#define SUPPORT_CHANNEL_WIDTH_SET_20_40_MHZ 1
1731#define NOT_SUPPORT_CHANNEL_WIDTH_SET_20_MHZ_ONLY 0
1732#define DO_NOT_SEND_MIMO_SEQ_STATIC_POWER_SAVE 0
1733#define RTS_PRECEDE_MIMO_SEQ_DYN_POWER_SAVE 1
1734#define MIMO_POWER_SAVE_NA 2
1735#define NO_LIMIT_ON_MIMO_SEQ 3
1736#define DEVICE_IS_ABLE_TO_RCVE_PPDU_WITH_GF_PREAMBLE 1
1737#define DEVICE_NOT_ABLE_TO_RCVE_PPDU_WITH_GF_PREAMBLE 0
1738#define SUPPORT_SHORT_GI_FOR_20_MHZ 1
1739#define NOT_SUPPORT_SHORT_GI_FOR_20_MHZ 0
1740#define SUPPORT_SHORT_GI_FOR_40_MHZ 1
1741#define NOT_SUPPORT_SHORT_GI_FOR_40_MHZ 0
1742#define TRANSMITTER_SUPPORT_STBC 1
1743#define TRANSMITTER_NOT_SUPPORT_STBC 0
1744#define RX_NOT_SUPPORT_STBC 0
1745#define RX_SUPPORT_STBC_ONE_SPATIAL_STREAM 1
1746#define RX_SUPPORT_STBC_ONE_AND_TWO_SPATIAL_STREAM 2
1747#define RX_SUPPORT_STBC_ONE_TWO_THREE_SPATIAL_STREAM 3
1748#define SUPPORT_DELAYED_BA 1
1749#define NOT_SUPPORT_DELAYED_BA 0
1750#define RECEIVER_MAX_A_MSDU_SIZE_7935 1
1751#define RECEIVER_MAX_A_MSDU_SIZE_3839 0
1752#define BSS_OR_DEVICE_ALLOW_USE_DSSS_CCK 1
1753#define BSS_OR_DEVICE_NOT_ALLOW_USE_DSSS_CCK 0
1754#define BSS_OR_DEVICE_SUPPORT_USE_PSMP 1
1755#define BSS_OR_DEVICE_NOT_SUPPORT_USE_PSMP 0
1756#define BSS_OR_DEVICE_SUPPORT_USE_STBC_CONTROL_FRAME 1
1757#define BSS_OR_DEVICE_NOT_SUPPORT_USE_STBC_CONTROL_FRAME 0
1758#define SUPPORT_L_SIG_TXOP_PROTECTION 1
1759#define NOT_SUPPORT_L_SIG_TXOP_PROTECTION 0
1760
1761// Typedef for HT Parameters Info Field
1762#define MAX_RX_AMPDU_FACTOR_0 0
1763#define MAX_RX_AMPDU_FACTOR_1 1
1764#define MAX_RX_AMPDU_FACTOR_2 2
1765#define MAX_RX_AMPDU_FACTOR_3 3
1766#define MPDU_DENSITY_NO_RESTRICTION 0
1767#define MPDU_DENSITY_ONE_EIGHTH_USECOND 1
1768#define MPDU_DENSITY_ONE_FOURTH_USECOND 2
1769#define MPDU_DENSITY_ONE_HALF_USECOND 3
1770#define MPDU_DENSITY_ONE_USECOND 4
1771#define MPDU_DENSITY_TWO_USECOND 5
1772#define MPDU_DENSITY_FOUR_USECOND 6
1773#define MPDU_DENSITY_EIGHT_USECOND 7
1774#endif
1775
1776// Supported MCS set
1777#define SIZE_OF_SUPPORTED_MCS_SET 16
1778#define SIZE_OF_BASIC_MCS_SET 16
1779#define VALID_MCS_SIZE 77 //0-76
1780#define MCS_RX_HIGHEST_SUPPORTED_RATE_BYTE_OFFSET 10
1781// This is not clear, Count 8 based from NV supported MCS count
1782#define VALID_MAX_MCS_INDEX 8
1783
1784#if 0
1785// Typedef Extended HT Capability Info Field
1786#define SUPPORT_PCO 1
1787#define NOT_SUPPORT_PCO 0
1788#define TRANSITION_TIME_0 0
1789#define STA_DOES_NOT_PROVIDE_MCS_FEEDBACK 0
1790#define RESERVE_VALUE_FOR_STA_MCS_FEEDBACK 1
1791#define STA_PROVIDE_UNSOLICITED_MCS_FEEDBACK 2
1792#define STA_PROVIDE_ON_MRQ_AND_UNSOLICITED_MCS_FEEDBACK 3
1793
1794// Typedef Transmit Beamforming Capability
1795#define TX_BEAMFORMING_CAPABLE 1
1796#define TX_BEAMFORMING_INCAPABLE 0
1797#define CAPABLE_RECEIVE_STAGGERED_SOUNDING 1
1798#define NOT_CAPABLE_RECEIVE_STAGGERED_SOUNDING 0
1799#define CAPABLE_TRANSMIT_STAGGERED_SOUNDING 1
1800#define NOT_CAPABLE_TRANSMIT_STAGGERED_SOUNDING 0
1801#define CAPABLE_RECEIVE_ZLF 1
1802#define NOT_CAPABLE_RECEIVE_ZLF 0
1803#define CAPABLE_TRANSMIT_ZLF 1
1804#define NOT_CAPABLE_TRANSMIT_ZLF 0
1805#define CAPABLE_IMPLICIT_TXBF 1
1806#define NOT_CAPABLE_IMPLICIT_TXBF 0
1807#define INCAPABLE_CALIBRATION 0
1808#define LIMITED_CALIBRATION_CANNOT_INITIATE 1
1809#define LIMITED_CALIBRATION_CAN_INITIATE 2
1810#define FULLT_CAPABLE_CALIBRATION 3
1811#define CAPABLE_EXPLICIT_CSI_TXBF 1
1812#define INCAPABLE_EXPLICIT_CSI_TXBF 0
1813#define CAPABLE_EXPLICIT_UNCOMPRESSED_STEERING_MATRIX 1
1814#define INCAPABLE_EXPLICIT_UNCOMPRESSED_STEERING_MATRIX 0
1815#define INCAPABLE_EXPLICIT_BFCI_FEEDBACK 0
1816#define CAPABLE_UNSOLICITED_BFCI_FEEDBACK 1
1817#define CAPABLE_IMMEDIATE_BFCI_FEEDBACK 2
1818#define CAPABLE_AGGREGATE_BFCI_FEEDBACK 4
1819#define INCAPABLE_EXPLICIT_UNCOMPRESSED_STEERING_MATRIX_FEEDBAC 0
1820#define CAPABLE_UNSOLICITED_UNCOMPRESSED_STEERING_MATRIX 1
1821#define CAPABLE_IMMEDIATE_UNCOMPRESSED_STEERING_MATRIX 2
1822#define CAPABLE_AGGREGATED_UNCOMPRESSED_STEERING_MATRIX 4
1823#define INCAPABLE_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBAC 0
1824#define CAPABLE_UNSOLICITED_COMPRESSED_STEERING_MATRIX 1
1825#define CAPABLE_IMMEDIATE_COMPRESSED_STEERING_MATRIX 2
1826#define CAPABLE_AGGREGATED_COMPRESSED_STEERING_MATRIX 4
1827#define SUPPORT_CSI_BEAMFORMING_SINGLE_TX_ANTENNA_SOUNDING 0
1828#define SUPPORT_CSI_BEAMFORMING_2_TX_ANTENNA_SOUNDING 1
1829#define SUPPORT_CSI_BEAMFORMING_3_TX_ANTENNA_SOUNDING 2
1830#define SUPPORT_CSI_BEAMFORMING_4_TX_ANTENNA_SOUNDING 3
1831#define SUPPORT_UNCOMPRESSED_STEERING_MATRIX_1_TX_ANTENNA_SOUNDING 0
1832#define SUPPORT_UNCOMPRESSED_STEERING_MATRIX_2_TX_ANTENNA_SOUNDING 1
1833#define SUPPORT_UNCOMPRESSED_STEERING_MATRIX_3_TX_ANTENNA_SOUNDING 2
1834#define SUPPORT_UNCOMPRESSED_STEERING_MATRIX_4_TX_ANTENNA_SOUNDING 3
1835#define SUPPORT_COMPRESSED_STEERING_MATRIX_1_TX_ANTENNA_SOUNDING 0
1836#define SUPPORT_COMPRESSED_STEERING_MATRIX_2_TX_ANTENNA_SOUNDING 1
1837#define SUPPORT_COMPRESSED_STEERING_MATRIX_3_TX_ANTENNA_SOUNDING 2
1838#define SUPPORT_COMPRESSED_STEERING_MATRIX_4_TX_ANTENNA_SOUNDING 3
1839
1840// Typedef Antenna Selection Capability
1841#define CAPABLE_ANTENNA_SELECTION 1
1842#define INCAPABLE_ANTENNA_SELECTION 0
1843#define CAPABLE_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS 1
1844#define INCAPABLE_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS 0
1845#define CAPABLE_ANTENNA_INDICES_FEEDBACK_BASED_TX_AS 1
1846#define INCAPABLE_ANTENNA_INDICES_FEEDBACK_BASED_TX_AS 0
1847#define CAPABLE_EXPLICIT_CSI_FEEDBACK 1
1848#define INCAPABLE_EXPLICIT_CSI_FEEDBACK 0
1849#define CAPABLE_ANTENNA_INDICES_FEEDBACK_BASED_TX_AS 1
1850#define INCAPABLE_ANTENNA_INDICES_FEEDBACK_BASED_TX_AS 0
1851#define CAPABLE_RX_AS 1
1852#define INCAPABLE_RX_AS 0
1853#define CAPABLE_TRANSMIT_SOUNDING_PPDU 1
1854#define INCAPABLE_TRANSMIT_SOUNDING_PPDU 0
1855
1856// Typedef Additional HT Infomation Elements
1857#define CONTROL_CHANNEL_1 1
1858
1859#define OFFSET_NO_EXTENSION_CHANNEL_IS_PRESENT 0
1860#define OFFSET_EXTENSION_CHANNEL_ABOVE_CONTROL_CHANNEL 1
1861#define OFFSET_EXTENSION_CHANNEL_BELOW_CONTROL_CHANNEL 3
1862#define USE_20_MHZ_CONTROL_CHANNEL 0
1863#define USE_ANY_SUPPORTED_CHANNEL_WIDTH 1
1864#define USE_RIFS_MODE_PROHIBITED 0
1865#define USE_RIFS_MODE_PERMITTED 1
1866#define CONTROLLED_ACCESS_NOT_ONLY_PSMP 0
1867#define CONTROLLED_ACCESS_ONLY_PSMP 1
1868#define SERVICE_INTERVAL_GRANULARITY_5MS 0
1869#define SERVICE_INTERVAL_GRANULARITY_10MS 1
1870#define SERVICE_INTERVAL_GRANULARITY_15MS 2
1871#define SERVICE_INTERVAL_GRANULARITY_20MS 3
1872#define SERVICE_INTERVAL_GRANULARITY_25MS 4
1873#define SERVICE_INTERVAL_GRANULARITY_30MS 5
1874#define SERVICE_INTERVAL_GRANULARITY_35MS 6
1875#define SERVICE_INTERVAL_GRANULARITY_40MS 7
1876
1877#define OPERATION_MODE_PURE_NO_PROTECTION 0
1878#define OPERATION_MODE_OPTIONAL_PROTECTION 1
1879#define OPERATION_MODE_NO_LEGACY_STA_40MHZ_PROTECTED 2
1880#define OPERATION_MODE_MIXED_PROTECTION 3
1881
1882#define DUAL_CTS_PROTECTION_IS_USED 1
1883#define REGULAR_RTS_CTS_IS_USED 0
1884#define SECONDARY_BEACON 1
1885#define PRIMARY_BEACON 0
1886#define LSIG_TXOP_PROTECTION_FULL_SUPPORT 1
1887#define LSIG_TXOP_PROTECTION_NOT_FULL_SUPPORT 0
1888#define PCO_IS_ACTIVATED_IN_BSS 1
1889#define PCO_IS_NOT_ACTIVATED_IN_BSS 0
1890#define PCO_PHASE_REQUEST_SWITCH_KEEP_TO_20MHZ 0
1891#define PCO_PHASE_REQUEST_SWITCH_KEEP_TO_40MHZ 1
1892#endif
1893
1894//
1895// The following enums will be used to get the "current" HT Capabilities of
1896// the local STA in a generic fashion. In other words, the following enums
1897// identify the HT capabilities that can be queried or set.
1898//
1899typedef enum eHTCapability
1900{
1901 eHT_LSIG_TXOP_PROTECTION,
1902 eHT_STBC_CONTROL_FRAME,
1903 eHT_PSMP,
1904 eHT_DSSS_CCK_MODE_40MHZ,
1905 eHT_MAX_AMSDU_LENGTH,
1906 eHT_DELAYED_BA,
1907 eHT_RX_STBC,
1908 eHT_TX_STBC,
1909 eHT_SHORT_GI_40MHZ,
1910 eHT_SHORT_GI_20MHZ,
1911 eHT_GREENFIELD,
1912 eHT_MIMO_POWER_SAVE,
1913 eHT_SUPPORTED_CHANNEL_WIDTH_SET,
1914 eHT_ADVANCED_CODING,
1915 eHT_MAX_RX_AMPDU_FACTOR,
1916 eHT_MPDU_DENSITY,
1917 eHT_PCO,
1918 eHT_TRANSITION_TIME,
1919 eHT_MCS_FEEDBACK,
1920 eHT_TX_BEAMFORMING,
1921 eHT_ANTENNA_SELECTION,
1922 // The following come under Additional HT Capabilities
1923 eHT_SI_GRANULARITY,
1924 eHT_CONTROLLED_ACCESS,
1925 eHT_RIFS_MODE,
1926 eHT_RECOMMENDED_TX_WIDTH_SET,
1927 eHT_EXTENSION_CHANNEL_OFFSET,
1928 eHT_OP_MODE,
1929 eHT_BASIC_STBC_MCS,
1930 eHT_DUAL_CTS_PROTECTION,
1931 eHT_LSIG_TXOP_PROTECTION_FULL_SUPPORT,
1932 eHT_PCO_ACTIVE,
1933 eHT_PCO_PHASE
1934} tHTCapability;
1935
1936// HT Capabilities Info
1937typedef __ani_attr_pre_packed struct sSirMacHTCapabilityInfo
1938{
1939#ifndef ANI_LITTLE_BIT_ENDIAN
1940 tANI_U16 lsigTXOPProtection:1; // Dynamic state
1941 tANI_U16 stbcControlFrame:1; // Static via CFG
1942 tANI_U16 psmp:1; // Static via CFG
1943 tANI_U16 dsssCckMode40MHz:1; // Static via CFG
1944 tANI_U16 maximalAMSDUsize:1; // Static via CFG
1945 tANI_U16 delayedBA:1; // Static via CFG
1946 tANI_U16 rxSTBC:2; // Static via CFG
1947 tANI_U16 txSTBC:1; // Static via CFG
1948 tANI_U16 shortGI40MHz:1; // Static via CFG
1949 tANI_U16 shortGI20MHz:1; // Static via CFG
1950 tANI_U16 greenField:1; // Static via CFG
1951 tANI_U16 mimoPowerSave:2; // Dynamic state
1952 tANI_U16 supportedChannelWidthSet:1; // Static via CFG
1953 tANI_U16 advCodingCap:1; // Static via CFG
1954#else
1955 tANI_U16 advCodingCap:1;
1956 tANI_U16 supportedChannelWidthSet:1;
1957 tANI_U16 mimoPowerSave:2;
1958 tANI_U16 greenField:1;
1959 tANI_U16 shortGI20MHz:1;
1960 tANI_U16 shortGI40MHz:1;
1961 tANI_U16 txSTBC:1;
1962 tANI_U16 rxSTBC:2;
1963 tANI_U16 delayedBA:1;
1964 tANI_U16 maximalAMSDUsize:1;
1965 tANI_U16 dsssCckMode40MHz:1;
1966 tANI_U16 psmp:1;
1967 tANI_U16 stbcControlFrame:1;
1968 tANI_U16 lsigTXOPProtection:1;
1969#endif
1970} __ani_attr_packed tSirMacHTCapabilityInfo;
1971
1972// HT Parameters Info
1973typedef __ani_attr_pre_packed struct sSirMacHTParametersInfo
1974{
1975#ifndef ANI_LITTLE_BIT_ENDIAN
1976 tANI_U8 reserved:3;
1977 tANI_U8 mpduDensity:3; // Dynamic state
1978 tANI_U8 maxRxAMPDUFactor:2; // Dynamic state
1979#else
1980 tANI_U8 maxRxAMPDUFactor:2;
1981 tANI_U8 mpduDensity:3;
1982 tANI_U8 reserved:3;
1983#endif
1984} __ani_attr_packed tSirMacHTParametersInfo;
1985
1986// Extended HT Capabilities Info
1987typedef __ani_attr_pre_packed struct sSirMacExtendedHTCapabilityInfo
1988{
1989#ifndef ANI_LITTLE_BIT_ENDIAN
1990 tANI_U16 reserved2:6;
1991 tANI_U16 mcsFeedback:2; // Static via CFG
1992 tANI_U16 reserved1:5;
1993 tANI_U16 transitionTime:2; // Static via CFG
1994 tANI_U16 pco:1; // Static via CFG
1995#else
1996 tANI_U16 pco:1;
1997 tANI_U16 transitionTime:2;
1998 tANI_U16 reserved1:5;
1999 tANI_U16 mcsFeedback:2;
2000 tANI_U16 reserved2:6;
2001#endif
2002} __ani_attr_packed tSirMacExtendedHTCapabilityInfo;
2003
2004//IEEE 802.11n/D7.0 - 7.3.2.57.4
2005//Part of the "supported MCS set field"
2006typedef __ani_attr_pre_packed struct sSirMacRxHighestSupportRate
2007{
2008#ifndef ANI_LITTLE_BIT_ENDIAN
2009 tANI_U16 reserved : 6;
2010 tANI_U16 rate : 10;
2011#else
2012 tANI_U16 rate : 10;
2013 tANI_U16 reserved : 6;
2014#endif
2015} __ani_attr_packed tSirMacRxHighestSupportRate, *tpSirMacRxHighestSupportRate;
2016
2017
2018// Transmit Beam Forming Capabilities Info
2019typedef __ani_attr_pre_packed struct sSirMacTxBFCapabilityInfo
2020{
2021#ifndef ANI_LITTLE_BIT_ENDIAN
2022 tANI_U32 reserved:7;
2023 tANI_U32 compressedSteeringMatrixBFAntennae:2; // Static via CFG
2024 tANI_U32 uncompressedSteeringMatrixBFAntennae:2; // Static via CFG
2025 tANI_U32 csiNumBFAntennae:2; // Static via CFG
2026 tANI_U32 explicitCompressedSteeringMatrixFeedback:3; // Static via CFG
2027 tANI_U32 explicitUncompressedSteeringMatrixFeedback:3; // Static via CFG
2028 tANI_U32 explicitBFCSIFeedback:3; // Static via CFG
2029 tANI_U32 explicitUncompressedSteeringMatrix:1; // Static via CFG
2030 tANI_U32 explicitCSITxBF:1; // Static via CFG
2031 tANI_U32 calibration:2; // Static via CFG
2032 tANI_U32 implicitTxBF:1; // Static via CFG
2033 tANI_U32 txZLF:1; // Static via CFG
2034 tANI_U32 rxZLF:1; // Static via CFG
2035 tANI_U32 txStaggeredSounding:1; // Static via CFG
2036 tANI_U32 rxStaggeredSounding:1; // Static via CFG
2037 tANI_U32 txBF:1; // Static via CFG
2038#else
2039 tANI_U32 txBF:1;
2040 tANI_U32 rxStaggeredSounding:1;
2041 tANI_U32 txStaggeredSounding:1;
2042 tANI_U32 rxZLF:1;
2043 tANI_U32 txZLF:1;
2044 tANI_U32 implicitTxBF:1;
2045 tANI_U32 calibration:2;
2046 tANI_U32 explicitCSITxBF:1;
2047 tANI_U32 explicitUncompressedSteeringMatrix:1;
2048 tANI_U32 explicitBFCSIFeedback:3;
2049 tANI_U32 explicitUncompressedSteeringMatrixFeedback:3;
2050 tANI_U32 explicitCompressedSteeringMatrixFeedback:3;
2051 tANI_U32 csiNumBFAntennae:2;
2052 tANI_U32 uncompressedSteeringMatrixBFAntennae:2;
2053 tANI_U32 compressedSteeringMatrixBFAntennae:2;
2054 tANI_U32 reserved:7;
2055#endif
2056} __ani_attr_packed tSirMacTxBFCapabilityInfo;
2057
2058// Antenna Selection Capability Info
2059typedef __ani_attr_pre_packed struct sSirMacASCapabilityInfo
2060{
2061#ifndef ANI_LITTLE_BIT_ENDIAN
2062 tANI_U8 reserved2:1;
2063 tANI_U8 txSoundingPPDUs:1; // Static via CFG
2064 tANI_U8 rxAS:1; // Static via CFG
2065 tANI_U8 antennaIndicesFeedback:1; // Static via CFG
2066 tANI_U8 explicitCSIFeedback:1; // Static via CFG
2067 tANI_U8 antennaIndicesFeedbackTx:1; // Static via CFG
2068 tANI_U8 explicitCSIFeedbackTx:1; // Static via CFG
2069 tANI_U8 antennaSelection:1; // Static via CFG
2070#else
2071 tANI_U8 antennaSelection:1;
2072 tANI_U8 explicitCSIFeedbackTx:1;
2073 tANI_U8 antennaIndicesFeedbackTx:1;
2074 tANI_U8 explicitCSIFeedback:1;
2075 tANI_U8 antennaIndicesFeedback:1;
2076 tANI_U8 rxAS:1;
2077 tANI_U8 txSoundingPPDUs:1;
2078 tANI_U8 reserved2:1;
2079#endif
2080} __ani_attr_packed tSirMacASCapabilityInfo;
2081
2082// Additional HT IE Field1
2083typedef __ani_attr_pre_packed struct sSirMacHTInfoField1
2084{
2085#ifndef ANI_LITTLE_BIT_ENDIAN
2086 tANI_U8 serviceIntervalGranularity:3; // Dynamic state
2087 tANI_U8 controlledAccessOnly:1; // Static via CFG
2088 tANI_U8 rifsMode:1; // Dynamic state
2089 tANI_U8 recommendedTxWidthSet:1; // Dynamic state
2090 tANI_U8 secondaryChannelOffset:2; // Dynamic state
2091#else
2092 tANI_U8 secondaryChannelOffset:2;
2093 tANI_U8 recommendedTxWidthSet:1;
2094 tANI_U8 rifsMode:1;
2095 tANI_U8 controlledAccessOnly:1;
2096 tANI_U8 serviceIntervalGranularity:3;
2097#endif
2098} __ani_attr_packed tSirMacHTInfoField1;
2099
2100// Additional HT IE Field2
2101typedef __ani_attr_pre_packed struct sSirMacHTInfoField2
2102{
2103#ifndef ANI_LITTLE_BIT_ENDIAN
2104 tANI_U16 reserved:11;
2105 tANI_U16 obssNonHTStaPresent:1; /*added for Obss */
2106 tANI_U16 transmitBurstLimit: 1;
2107 tANI_U16 nonGFDevicesPresent:1;
2108 tANI_U16 opMode:2; // Dynamic state
2109#else
2110 tANI_U16 opMode:2;
2111 tANI_U16 nonGFDevicesPresent:1;
2112 tANI_U16 transmitBurstLimit: 1;
2113 tANI_U16 obssNonHTStaPresent:1; /*added for Obss */
2114 tANI_U16 reserved:11;
2115#endif
2116} __ani_attr_packed tSirMacHTInfoField2;
2117
2118// Additional HT IE Field3
2119typedef __ani_attr_pre_packed struct sSirMacHTInfoField3
2120{
2121#ifndef ANI_LITTLE_BIT_ENDIAN
2122 tANI_U16 reserved:4;
2123 tANI_U16 pcoPhase:1; // Dynamic state
2124 tANI_U16 pcoActive:1; // Dynamic state
2125 tANI_U16 lsigTXOPProtectionFullSupport:1; // Dynamic state
2126 tANI_U16 secondaryBeacon:1; // Dynamic state
2127 tANI_U16 dualCTSProtection:1; // Dynamic state
2128 tANI_U16 basicSTBCMCS:7; // Dynamic state
2129#else
2130 tANI_U16 basicSTBCMCS:7;
2131 tANI_U16 dualCTSProtection:1;
2132 tANI_U16 secondaryBeacon:1;
2133 tANI_U16 lsigTXOPProtectionFullSupport:1;
2134 tANI_U16 pcoActive:1;
2135 tANI_U16 pcoPhase:1;
2136 tANI_U16 reserved:4;
2137#endif
2138} __ani_attr_packed tSirMacHTInfoField3;
2139
2140typedef __ani_attr_pre_packed struct sSirMacProbeReqFrame
2141{
2142 tSirMacSSidIE ssIdIE;
2143 tSirMacRateSetIE rateSetIE;
2144 tSirMacRateSetIE extendedRateSetIE;
2145} __ani_attr_packed tSirMacProbeReqFrame, *tpSirMacProbeReqFrame;
2146
2147typedef __ani_attr_pre_packed struct sSirMacProbeRspFrame
2148{
2149 tSirMacTimeStamp ts;
2150 tSirMacBeaconInterval beaconInterval;
2151 tSirMacCapabilityInfo capabilityInfo;
2152 tSirMacSSidIE ssIdIE;
2153 tSirMacRateSetIE rateSetIE;
2154 tSirMacRateSetIE extendedRateSetIE;
2155 tSirMacNonErpPresentIE nonErpPresent;
2156 tSirMacDsParamSetIE dsParamsIE;
2157 tSirMacCfParamSetIE cfParamsIE;
2158} __ani_attr_packed tSirMacProbeRspFrame, *tpSirMacProbeRspFrame;
2159
2160typedef __ani_attr_pre_packed struct sSirMacAuthFrameBody
2161{
2162 tANI_U16 authAlgoNumber;
2163 tANI_U16 authTransactionSeqNumber;
2164 tANI_U16 authStatusCode;
2165 tANI_U8 type; // = SIR_MAC_CHALLENGE_TEXT_EID
2166 tANI_U8 length; // = SIR_MAC_AUTH_CHALLENGE_LENGTH
2167 tANI_U8 challengeText[SIR_MAC_AUTH_CHALLENGE_LENGTH];
2168} __ani_attr_packed tSirMacAuthFrameBody, *tpSirMacAuthFrameBody;
2169
2170typedef __ani_attr_pre_packed struct sSirMacAuthenticationFrame
2171{
2172 tSirMacAuthFrameBody authFrameBody;
2173} __ani_attr_packed tSirMacAuthFrame, *tpSirMacAuthFrame;
2174
2175typedef __ani_attr_pre_packed struct sSirMacAssocReqFrame
2176{
2177 tSirMacCapabilityInfo capabilityInfo;
2178 tANI_U16 listenInterval;
2179 tSirMacSSidIE ssIdIE;
2180 tSirMacRateSetIE rateSetIE;
2181 tSirMacRateSetIE extendedRateSetIE;
2182} __ani_attr_packed tSirMacAssocReqFrame, *tpSirMacAssocReqFrame;
2183
2184typedef __ani_attr_pre_packed struct sSirMacAssocRspFrame
2185{
2186 tSirMacCapabilityInfo capabilityInfo;
2187 tANI_U16 statusCode;
2188 tANI_U16 aid;
2189 tSirMacRateSetIE supportedRates;
2190 tSirMacRateSetIE extendedRateSetIE;
2191} __ani_attr_packed tSirMacAssocRspFrame, *tpSirMacAssocRspFrame;
2192
2193typedef __ani_attr_pre_packed struct sSirMacDisassocFrame
2194{
2195 tANI_U16 reasonCode;
2196} __ani_attr_packed tSirMacDisassocFrame, *tpSirMacDisassocFrame;
2197
2198typedef __ani_attr_pre_packed struct sDSirMacDeauthFrame
2199{
2200 tANI_U16 reasonCode;
2201} __ani_attr_packed tSirMacDeauthFrame, *tpSirMacDeauthFrame;
2202
2203/// Common header for all action frames
2204typedef __ani_attr_pre_packed struct sSirMacActionFrameHdr
2205{
2206 tANI_U8 category;
2207 tANI_U8 actionID;
2208} __ani_attr_packed tSirMacActionFrameHdr, *tpSirMacActionFrameHdr;
2209
2210#if defined WLAN_FEATURE_P2P
2211typedef __ani_attr_pre_packed struct sSirMacVendorSpecificPublicActionFrameHdr
2212{
2213 tANI_U8 category;
2214 tANI_U8 actionID;
2215 tANI_U8 Oui[4];
2216 tANI_U8 OuiSubType;
2217 tANI_U8 dialogToken;
2218} __ani_attr_packed tSirMacVendorSpecificPublicActionFrameHdr, *tpSirMacVendorSpecificPublicActionFrameHdr;
2219
2220typedef __ani_attr_pre_packed struct sSirMacP2PActionFrameHdr
2221{
2222 tANI_U8 category;
2223 tANI_U8 Oui[4];
2224 tANI_U8 OuiSubType;
2225 tANI_U8 dialogToken;
2226} __ani_attr_packed tSirMacP2PActionFrameHdr, *tpSirMacP2PActionFrameHdr;
2227
2228
2229#endif
2230
2231typedef struct sSirMacMeasActionFrameHdr
2232{
2233 tANI_U8 category;
2234 tANI_U8 actionID;
2235 tANI_U8 dialogToken;
2236} tSirMacMeasActionFrameHdr, *tpSirMacMeasActionFrameHdr;
2237
2238
2239#ifdef ANI_SUPPORT_11H
2240typedef struct sSirMacTpcReqActionFrame
2241{
2242 tSirMacMeasActionFrameHdr actionHeader;
2243 tANI_U8 type;
2244 tANI_U8 length;
2245} tSirMacTpcReqActionFrame, *tpSirMacTpcReqActionFrame;
2246
2247typedef struct sSirMacMeasReqActionFrame
2248{
2249 tSirMacMeasActionFrameHdr actionHeader;
2250 tSirMacMeasReqIE measReqIE;
2251} tSirMacMeasReqActionFrame, *tpSirMacMeasReqActionFrame;
2252#endif
2253
2254typedef struct sSirMacBasicMeasReportActionFrame
2255{
2256 tSirMacMeasActionFrameHdr actionHeader;
2257 tSirMacBasicReportIE measReportIE;
2258} tSirMacBasicMeasReportActionFrame, *tpSirMacBasicMeasReportActionFrame;
2259
2260typedef struct sSirMacCcaMeasReportActionFrame
2261{
2262 tSirMacMeasActionFrameHdr actionHeader;
2263 tSirMacCcaReportIE measReportIE;
2264} tSirMacCcaMeasReportActionFrame, *tpSirMacCcaMeasReportActionFrame;
2265
2266typedef struct sSirMacRpiMeasReportActionFrame
2267{
2268 tSirMacMeasActionFrameHdr actionHeader;
2269 tSirMacRpiReportIE measReportIE;
2270} tSirMacRpiMeasReportActionFrame, *tpSirMacRpiMeasReportActionFrame;
2271
2272#if defined WLAN_FEATURE_VOWIFI
2273
2274typedef struct sSirMacNeighborReportReq
2275{
2276 tANI_U8 dialogToken;
2277 tANI_U8 ssid_present;
2278 tSirMacSSid ssid;
2279} tSirMacNeighborReportReq, *tpSirMacNeighborReportReq;
2280
2281typedef struct sSirMacLinkReport
2282{
2283 tANI_U8 dialogToken;
2284 tANI_U8 txPower;
2285 tANI_U8 rxAntenna;
2286 tANI_U8 txAntenna;
2287 tANI_U8 rcpi;
2288 tANI_U8 rsni;
2289} tSirMacLinkReport, *tpSirMacLinkReport;
2290
2291#define BEACON_REPORT_MAX_IES 224 //Refer IEEE 802.11k-2008, Table 7-31d
2292typedef struct sSirMacBeaconReport
2293{
2294 tANI_U8 regClass;
2295 tANI_U8 channel;
2296 tANI_U8 measStartTime[8];
2297 tANI_U8 measDuration;
2298 tANI_U8 phyType;
2299 tANI_U8 bcnProbeRsp;
2300 tANI_U8 rsni;
2301 tANI_U8 rcpi;
2302 tSirMacAddr bssid;
2303 tANI_U8 antennaId;
2304 tANI_U32 parentTSF;
2305 tANI_U8 numIes;
2306 tANI_U8 Ies[BEACON_REPORT_MAX_IES];
2307
2308} tSirMacBeaconReport, *tpSirMacBeaconReport;
2309
2310#define RADIO_REPORTS_MAX_IN_A_FRAME 4
2311typedef struct sSirMacRadioMeasureReport
2312{
2313 tANI_U8 token;
2314 tANI_U8 refused;
2315 tANI_U8 incapable;
2316 tANI_U8 type;
2317 union
2318 {
2319 tSirMacBeaconReport beaconReport;
2320 }report;
2321
2322}tSirMacRadioMeasureReport, *tpSirMacRadioMeasureReport;
2323
2324#endif
2325
2326// QOS action frame definitions
2327
2328// max number of possible tclas elements in any frame
2329#define SIR_MAC_TCLASIE_MAXNUM 2
2330
2331// ADDTS request
2332typedef __ani_attr_pre_packed struct sSirMacQosAddtsReqAF
2333{
2334 tSirMacActionFrameHdr afHdr;
2335 tANI_U8 dlgToken;
2336 tSirMacTspecIE tspec;
2337 tANI_U8 tclas[1]; // variable length element
2338} __ani_attr_packed tSirMacQosAddtsReqAF;
2339
2340// ADDTS response
2341typedef __ani_attr_pre_packed struct sSirMacQosAddtsRspAF
2342{
2343 tSirMacActionFrameHdr afHdr;
2344 tANI_U8 dlgToken;
2345 tSirMacStatusCodes status;
2346 tSirMacTsDelayIE delay;
2347 tSirMacTspecIE tspec;
2348 tANI_U8 tclas[1];
2349} __ani_attr_packed tSirMacQosAddtsRspAF;
2350
2351// DELTS frame
2352typedef __ani_attr_pre_packed struct sSirMacQosDeltsAF
2353{
2354 tSirMacActionFrameHdr afHdr;
2355 tSirMacTSInfo tsinfo;
2356} __ani_attr_packed tSirMacQosDeltsAF;
2357
2358// Schedule frame
2359typedef __ani_attr_pre_packed struct sSirMacQosScheduleAF
2360{
2361 tSirMacActionFrameHdr afHdr;
2362 tSirMacScheduleIE schedule;
2363} __ani_attr_packed tSirMacQosScheduleAF;
2364
2365// DLP action frame definitions
2366
2367// DLP request
2368typedef __ani_attr_pre_packed struct sSirMacQosDlpReqAF
2369{
2370 tSirMacActionFrameHdr afHdr;
2371 tANI_U8 dstMAC[6];
2372 tANI_U8 srcMAC[6];
2373 tSirMacQosCapabilityIE qosCapability;
2374 tANI_U16 dlpTimeout;
2375 tSirMacRateSetIE supportedRates;
2376} __ani_attr_packed tSirMacQosDlpReqAF;
2377
2378// DLP response
2379typedef __ani_attr_pre_packed struct sSirMacQosDlpRspAF
2380{
2381 tSirMacActionFrameHdr afHdr;
2382 tANI_U8 dstMAC[6];
2383 tANI_U8 srcMAC[6];
2384 tSirMacStatusCodes status;
2385 tSirMacQosCapabilityIE qosCapability;
2386 tSirMacRateSetIE supportedRates;
2387} __ani_attr_packed tSirMacQosDlpRspAF;
2388
2389// DLP teardown
2390typedef __ani_attr_pre_packed struct sSirMacQosDlpTdnAF
2391{
2392 tSirMacActionFrameHdr afHdr;
2393 tANI_U8 dstMAC[6];
2394 tANI_U8 srcMAC[6];
2395} __ani_attr_packed tSirMacQosDlpTdnAF;
2396
2397
2398
2399
2400//
2401/// Common header for all ANI proprietary action frames
2402typedef __ani_attr_pre_packed struct sSirMacAniActionFrame
2403{
2404 tSirMacActionFrameHdr afHdr;
2405 tANI_U8 aniOui[3]; // 00 0A F5
2406 tANI_U8 type; // 0 - request; 1 - report; 2 - snr
2407} __ani_attr_packed tSirMacAniActionFrame, *tpSirMacAniActionFrame;
2408
2409
2410typedef __ani_attr_pre_packed struct sSirMacLinkTestReqData
2411{
2412 tSirMacAniActionFrame hdr;
2413 tANI_U8 frameStatus; // bit0 - first frame
2414 // bit1 - last frame;
2415 // if both bit0/1 are on,
2416 // intermediate frame
2417 // bit2-7 - reserved
2418 tANI_U8 rate;
2419 tANI_U8 randomData[SIR_MAC_MAX_RANDOM_LENGTH];
2420} __ani_attr_packed tSirMacLinkTestReqData, *tpSirMacLinkTestReqData;
2421
2422/// SNR report specific fields
2423typedef __ani_attr_pre_packed struct sSirMacSnrReport
2424{
2425 tSirMacAniActionFrame hdr;
2426 tANI_U32 numSamples;
2427 tANI_U32 snr;
2428 tANI_U32 snrComp;
2429 tANI_U32 sq;
2430 tANI_U32 rssi;
2431} __ani_attr_packed tSirMacSnrReport, *tpSirMacSnrReport;
2432
2433typedef __ani_attr_pre_packed struct sSirMacStaCbLegacyBssDetect
2434{
2435 tSirMacAniActionFrame hdr;
2436 tANI_U8 channelNum;
2437 tANI_U8 numLegacyBssid;
2438 /* Below is declared as a place holder. Don't add anything after it since LegacyBssidList will take up memory after it */
2439 tANI_U8 LegacyBssidList[1]; /* Need to declare size 1 cause win build doesn't like size 0 */
2440} __ani_attr_packed tSirMacStaCbLegacyBssDetect, *tpSirMacStaCbLegacyBssDetect;
2441
2442typedef __ani_attr_pre_packed struct sSirMacQoSDefBAReq
2443{
2444 tSirMacActionFrameHdr hdr;
2445
2446 tANI_U8 rsvd1;
2447
2448#ifdef ANI_LITTLE_BIT_ENDIAN
2449 tANI_U8 tid: 4;
2450 tANI_U8 rsvd2: 4;
2451#else
2452 tANI_U8 rsvd2: 4;
2453 tANI_U8 tid: 4;
2454#endif
2455} __ani_attr_packed tSirMacQoSDefBAReq, *tpSirMacQoSDefBAReq;
2456
2457typedef __ani_attr_pre_packed struct sSirMacQoSDefBARsp
2458{
2459 tSirMacActionFrameHdr hdr;
2460
2461#ifdef ANI_LITTLE_BIT_ENDIAN
2462 tANI_U8 tid: 4;
2463 tANI_U8 policy: 1;
2464 tANI_U8 reject: 1;
2465 tANI_U8 rsvd1: 2;
2466#else
2467 tANI_U8 rsvd1: 2;
2468 tANI_U8 reject: 1;
2469 tANI_U8 policy: 1;
2470 tANI_U8 tid: 4;
2471#endif
2472
2473 tANI_U8 bufferSize;
2474} __ani_attr_packed tSirMacQoSDefBARsp, *tpSirMacQoSDefBARsp;
2475
2476typedef __ani_attr_pre_packed struct sSirMacQoSDelBAReq
2477{
2478 tSirMacActionFrameHdr hdr;
2479 tANI_U8 rsvd1;
2480
2481#ifdef ANI_LITTLE_BIT_ENDIAN
2482 tANI_U8 rsvd2: 3;
2483 tANI_U8 direction: 1;
2484 tANI_U8 tid: 4;
2485#else
2486 tANI_U8 tid: 4;
2487 tANI_U8 direction: 1;
2488 tANI_U8 rsvd2: 3;
2489#endif
2490} __ani_attr_packed tSirMacQoSDelBAReq, *tpSirMacQoSDelBAReq;
2491
2492typedef __ani_attr_pre_packed struct sSirMacQoSDelBARsp
2493{
2494 tSirMacActionFrameHdr hdr;
2495
2496#ifdef ANI_LITTLE_BIT_ENDIAN
2497 tANI_U8 tid: 4;
2498 tANI_U8 policy: 1;
2499 tANI_U8 reject: 1;
2500 tANI_U8 rsvd1: 2;
2501#else
2502 tANI_U8 rsvd1: 2;
2503 tANI_U8 reject: 1;
2504 tANI_U8 policy: 1;
2505 tANI_U8 tid: 4;
2506#endif
2507
2508} __ani_attr_packed tSirMacQoSDelBARsp, *tpSirMacQoSDelBARsp;
2509
2510
2511
2512// 11b rate encoding in MAC format
2513
2514#define SIR_MAC_RATE_1 0x02
2515#define SIR_MAC_RATE_2 0x04
2516#define SIR_MAC_RATE_5_5 0x0B
2517#define SIR_MAC_RATE_11 0x16
2518
2519// 11a/g rate encoding in MAC format
2520
2521#define SIR_MAC_RATE_6 0x0C
2522#define SIR_MAC_RATE_9 0x12
2523#define SIR_MAC_RATE_12 0x18
2524#define SIR_MAC_RATE_18 0x24
2525#define SIR_MAC_RATE_24 0x30
2526#define SIR_MAC_RATE_36 0x48
2527#define SIR_MAC_RATE_48 0x60
2528#define SIR_MAC_RATE_54 0x6C
2529
2530// ANI legacy supported rates
2531#define SIR_MAC_RATE_72 0x01
2532#define SIR_MAC_RATE_96 0x03
2533#define SIR_MAC_RATE_108 0x05
2534
2535// ANI enhanced rates
2536#define SIR_MAC_RATE_42 1000
2537#define SIR_MAC_RATE_84 1001
2538#define SIR_MAC_RATE_126 1002
2539#define SIR_MAC_RATE_144 1003
2540#define SIR_MAC_RATE_168 1004
2541#define SIR_MAC_RATE_192 1005
2542#define SIR_MAC_RATE_216 1006
2543#define SIR_MAC_RATE_240 1007
2544
2545
2546#define sirIsArate(x) ((((tANI_U8)x)==SIR_MAC_RATE_6) || \
2547 (((tANI_U8)x)==SIR_MAC_RATE_9) || \
2548 (((tANI_U8)x)==SIR_MAC_RATE_12)|| \
2549 (((tANI_U8)x)==SIR_MAC_RATE_18)|| \
2550 (((tANI_U8)x)==SIR_MAC_RATE_24)|| \
2551 (((tANI_U8)x)==SIR_MAC_RATE_36)|| \
2552 (((tANI_U8)x)==SIR_MAC_RATE_48)|| \
2553 (((tANI_U8)x)==SIR_MAC_RATE_54))
2554
2555#define sirIsBrate(x) ((((tANI_U8)x)==SIR_MAC_RATE_1) || \
2556 (((tANI_U8)x)==SIR_MAC_RATE_2) || \
2557 (((tANI_U8)x)==SIR_MAC_RATE_5_5)|| \
2558 (((tANI_U8)x)==SIR_MAC_RATE_11))
2559
2560#define sirIsGrate(x) ((((tANI_U8)x)==SIR_MAC_RATE_1) || \
2561 (((tANI_U8)x)==SIR_MAC_RATE_2) || \
2562 (((tANI_U8)x)==SIR_MAC_RATE_5_5)|| \
2563 (((tANI_U8)x)==SIR_MAC_RATE_11) || \
2564 (((tANI_U8)x)==SIR_MAC_RATE_6) || \
2565 (((tANI_U8)x)==SIR_MAC_RATE_9) || \
2566 (((tANI_U8)x)==SIR_MAC_RATE_12) || \
2567 (((tANI_U8)x)==SIR_MAC_RATE_18) || \
2568 (((tANI_U8)x)==SIR_MAC_RATE_24) || \
2569 (((tANI_U8)x)==SIR_MAC_RATE_36) || \
2570 (((tANI_U8)x)==SIR_MAC_RATE_48) || \
2571 (((tANI_U8)x)==SIR_MAC_RATE_54))
2572
2573#define sirIsProprate(x) ((((tANI_U8)x)==SIR_MAC_RATE_72) || \
2574 (((tANI_U8)x)==SIR_MAC_RATE_96) || \
2575 (((tANI_U8)x)==SIR_MAC_RATE_108))
2576
2577#define sirIsEnhancedRate(x) \
2578 (((x)==SIR_MAC_RATE_42) || \
2579 ((x)==SIR_MAC_RATE_84) || \
2580 ((x)==SIR_MAC_RATE_126) || \
2581 ((x)==SIR_MAC_RATE_144) || \
2582 ((x)==SIR_MAC_RATE_168) || \
2583 ((x)==SIR_MAC_RATE_192) || \
2584 ((x)==SIR_MAC_RATE_216) || \
2585 ((x)==SIR_MAC_RATE_240))
2586
2587/// Table that has MAC<-->PHY rate encodings
2588typedef __ani_attr_pre_packed struct sSirMacPhyRates
2589{
2590 tANI_U8 rateId;
2591 tANI_U8 phyRate; // Rate in PHY encoding format
2592 tANI_U16 macRate; // Rate in MAC encoding format
2593} __ani_attr_packed tSirMacPhyRates, *tpSirMacPhyRates;
2594
2595
2596typedef __ani_attr_pre_packed struct sSirPhy11aHdr
2597{
2598
2599#ifndef ANI_LITTLE_BIT_ENDIAN
2600
2601 tANI_U8 lengthLo : 3;
2602 tANI_U8 reserved : 1;
2603 tANI_U8 rate : 4;
2604
2605 tANI_U8 lengthMid : 8;
2606
2607 tANI_U8 tail: 6;
2608 tANI_U8 parity : 1;
2609 tANI_U8 lengthHi : 1;
2610
2611 tANI_U8 serviceLo;
2612 tANI_U8 serviceHi;
2613#else
2614 tANI_U8 rate : 4;
2615 tANI_U8 reserved : 1;
2616 tANI_U8 lengthLo : 3;
2617
2618 tANI_U8 lengthMid : 8;
2619
2620 tANI_U8 lengthHi : 1;
2621 tANI_U8 parity : 1;
2622 tANI_U8 tail: 6;
2623
2624 tANI_U8 serviceLo;
2625 tANI_U8 serviceHi;
2626#endif
2627} __ani_attr_packed tSirPhy11aHdr, *tpSirPhy11aHdr;
2628
Leela V Kiran Kumar Reddy Chirala6a458752013-02-16 15:41:27 -08002629#define SIR_MAC_MIN_IE_LEN 2 // Minimum IE length for IE validation
Jeff Johnson295189b2012-06-20 16:38:30 -07002630#endif /* __MAC_PROT_DEFS_H */