blob: 7463076292ccc9836a0983267e99186ae387c98d [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
Jeff Johnson295189b2012-06-20 16:38:30 -0700258#define SIR_MAC_ACTION_VENDOR_SPECIFIC 9
259#define SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY 0x7F
260#define SIR_MAC_ACTION_P2P_SUBTYPE_PRESENCE_RSP 2
Jeff Johnson295189b2012-06-20 16:38:30 -0700261
262#ifdef WLAN_FEATURE_11W
263//11w SA query request/response action frame category code
Chet Lanctot186b5732013-03-18 10:26:30 -0700264#define SIR_MAC_ACTION_SA_QUERY 8
265#define SIR_MAC_SA_QUERY_REQ 0
266#define SIR_MAC_SA_QUERY_RSP 1
Jeff Johnson295189b2012-06-20 16:38:30 -0700267#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
Jeff Johnson295189b2012-06-20 16:38:30 -0700452#define SIR_MAC_P2P_OUI "\x50\x6f\x9a\x09"
453#define SIR_MAC_P2P_OUI_SIZE 4
454#define SIR_P2P_NOA_ATTR 12
455#define SIR_MAX_NOA_ATTR_LEN 31
456#define SIR_MAX_NOA_DESCR 2
457#define SIR_P2P_IE_HEADER_LEN 6
Jeff Johnson295189b2012-06-20 16:38:30 -0700458
459// min size of wme oui header: oui(3) + type + subtype + version
460#define SIR_MAC_OUI_WME_HDR_MIN 6
461
462// OUI subtype and their lengths
463#define SIR_MAC_OUI_SUBTYPE_WME_INFO 0
464#define SIR_MAC_OUI_WME_INFO_MIN 7
465#define SIR_MAC_OUI_WME_INFO_MAX 7
466
467#define SIR_MAC_OUI_SUBTYPE_WME_PARAM 1
468#define SIR_MAC_OUI_WME_PARAM_MIN 24
469#define SIR_MAC_OUI_WME_PARAM_MAX 24
470
471#define SIR_MAC_OUI_SUBTYPE_WME_TSPEC 2
472#define SIR_MAC_OUI_WME_TSPEC_MIN 61
473#define SIR_MAC_OUI_WME_TSPEC_MAX 61
474
475#define SIR_MAC_OUI_SUBTYPE_WSM_TSPEC 2 // same as WME TSPEC
476#define SIR_MAC_OUI_WSM_TSPEC_MIN 61
477#define SIR_MAC_OUI_WSM_TSPEC_MAX 61
478
479// reserved subtypes 3-4
480// WSM capability
481#define SIR_MAC_OUI_SUBTYPE_WSM_CAPABLE 5
482#define SIR_MAC_OUI_WSM_CAPABLE_MIN 7
483#define SIR_MAC_OUI_WSM_CAPABLE_MAX 7
484// WSM classifier
485#define SIR_MAC_OUI_SUBTYPE_WSM_TCLAS 6
486#define SIR_MAC_OUI_WSM_TCLAS_MIN 10
487#define SIR_MAC_OUI_WSM_TCLAS_MAX 255
488// classifier processing element
489#define SIR_MAC_OUI_SUBTYPE_WSM_TCLASPROC 7
490#define SIR_MAC_OUI_WSM_TCLASPROC_MIN 7
491#define SIR_MAC_OUI_WSM_TCLASPROC_MAX 7
492// tspec delay element
493#define SIR_MAC_OUI_SUBTYPE_WSM_TSDELAY 8
494#define SIR_MAC_OUI_WSM_TSDELAY_MIN 10
495#define SIR_MAC_OUI_WSM_TSDELAY_MAX 10
496// schedule element
497#define SIR_MAC_OUI_SUBTYPE_WSM_SCHEDULE 9
498#define SIR_MAC_OUI_WSM_SCHEDULE_MIN 20
499#define SIR_MAC_OUI_WSM_SCHEDULE_MAX 20
500
501#ifdef WLAN_NS_OFFLOAD
502#define SIR_MAC_NS_OFFLOAD_SIZE 1 //support only one IPv6 offload
503#define SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA 2 //Number of target IP in NA frames. It must be at least 2
504#endif //WLAN_NS_OFFLOAD
505#define SIR_MAC_ARP_OFFLOAD_SIZE 1
506
507// total length of an Info element including T/L fields
508#define EID_LEN(eid) (2 + (eid))
509
510// support for radar Detect, Channel Switch
511#define CHANNEL_SWITCH_MAX_FRAME_SIZE 256
512
513
514// Length of Channel Switch related message
Jeff Johnsone7245742012-09-05 17:12:55 -0700515#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 -0700516#define SIR_CHANNEL_SWITCH_IE_SIZE EID_LEN(SIR_MAC_CHNL_SWITCH_ANN_EID_MIN)
517
518//Measurement Request/Report messages
519#define SIR_MEAS_REQ_FIELD_SIZE 11
520#define SIR_MEAS_REQ_IE_SIZE (5 + SIR_MEAS_REQ_FIELD_SIZE)
521#define SIR_MEAS_REQ_ACTION_FRAME_SIZE (3 + SIR_MEAS_REQ_IE_SIZE)
522#define SIR_MEAS_MAX_FRAME_SIZE 256
523#define SIR_MEAS_REPORT_MIN_FRAME_SIZE (3 + EID_LEN(SIR_MAC_MEAS_RPT_EID_MIN))
524
525#define SIR_MAC_SET_MEAS_REQ_ENABLE(x) (((tANI_U8) x) | 2)
526#define SIR_MAC_SET_MEAS_REQ_REQUEST(x) (((tANI_U8) x) | 4)
527#define SIR_MAC_SET_MEAS_REQ_REPORT(x) (((tANI_U8) x) | 8)
528
529#define SIR_MAC_SET_MEAS_REPORT_LATE(x) (((tANI_U8) x) | 1)
530#define SIR_MAC_SET_MEAS_REPORT_INCAPABLE(x) (((tANI_U8) x) | 2)
531#define SIR_MAC_SET_MEAS_REPORT_REFUSE(x) (((tANI_U8) x) | 4)
532
533// Length of TPC Request Action Frame
534#define SIR_TPC_REQ_ACTION_FRAME_SIZE (3 + EID_LEN(SIR_MAC_TPC_REQ_EID_MIN))
535#define SIR_TPC_REPORT_ACTION_FRAME_SIZE (3 + EID_LEN(SIR_MAC_TPC_RPT_EID_MIN))
536#define SIR_TPC_MAX_FRAME_SIZE 256
537//-----------------------------------------------------------------------------
538
539// OFFSET definitions for fixed fields in Management frames
540
541// Beacon/Probe Response offsets
542#define SIR_MAC_TS_OFFSET 0
543#define SIR_MAC_BEACON_INT_OFFSET 8 // Beacon Interval offset
544#define SIR_MAC_B_PR_CAPAB_OFFSET 10
545#define SIR_MAC_B_PR_SSID_OFFSET 12
546
547// Association/Reassociation offsets
548#define SIR_MAC_ASSOC_CAPAB_OFFSET 0
549#define SIR_MAC_LISTEN_INT_OFFSET 2 // Listen Interval offset
550#define SIR_MAC_ASSOC_SSID_OFFSET 4
551#define SIR_MAC_CURRENT_AP_OFFSET 4
552#define SIR_MAC_REASSOC_SSID_OFFSET 10
553#define SIR_MAC_ASSOC_STATUS_CODE_OFFSET 2
554#define SIR_MAC_ASSOC_AID_OFFSET 4
555#define SIR_MAC_ASSOC_RSP_RATE_OFFSET 6
556
557// Disassociation/Deauthentication offsets
558#define SIR_MAC_REASON_CODE_OFFSET 0
559
560// Probe Request offset
561#define SIR_MAC_PROBE_REQ_SSID_OFFSET 0
562
563// Authentication offsets
564#define SIR_MAC_AUTH_ALGO_OFFSET 0
565#define SIR_MAC_AUTH_XACT_SEQNUM_OFFSET 2
566#define SIR_MAC_AUTH_STATUS_CODE_OFFSET 4
567#define SIR_MAC_AUTH_CHALLENGE_OFFSET 6
568
569/// Transaction sequence number definitions (used in Authentication frames)
570#define SIR_MAC_AUTH_FRAME_1 1
571#define SIR_MAC_AUTH_FRAME_2 2
572#define SIR_MAC_AUTH_FRAME_3 3
573#define SIR_MAC_AUTH_FRAME_4 4
574
575/// Protocol defined MAX definitions
576#define SIR_MAC_ADDR_LENGTH 6
577#define SIR_MAC_MAX_SSID_LENGTH 32
578#define SIR_MAC_MAX_NUMBER_OF_RATES 12
579#define SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS 4
580#define SIR_MAC_KEY_LENGTH 13 // WEP Maximum key length size
581#define SIR_MAC_AUTH_CHALLENGE_LENGTH 128
582#define SIR_MAC_WEP_IV_LENGTH 4
583#define SIR_MAC_WEP_ICV_LENGTH 4
584
585/// MAX key length when ULA is used
586#define SIR_MAC_MAX_KEY_LENGTH 32
587
588/// Macro definitions for get/set on FC fields
589#define SIR_MAC_GET_PROT_VERSION(x) ((((tANI_U16) x) & 0x0300) >> 8)
590#define SIR_MAC_GET_FRAME_TYPE(x) ((((tANI_U16) x) & 0x0C00) >> 8)
591#define SIR_MAC_GET_FRAME_SUB_TYPE(x) ((((tANI_U16) x) & 0xF000) >> 12)
592#define SIR_MAC_GET_WEP_BIT_IN_FC(x) (((tANI_U16) x) & 0x0040)
593#define SIR_MAC_SET_PROT_VERSION(x) ((tANI_U16) x)
594#define SIR_MAC_SET_FRAME_TYPE(x) (((tANI_U16) x) << 2)
595#define SIR_MAC_SET_FRAME_SUB_TYPE(x) (((tANI_U16) x) << 4)
596#define SIR_MAC_SET_WEP_BIT_IN_FC(x) (((tANI_U16) x) << 14)
597
598/// Macro definitions for get/set on capabilityInfo bits
599#define SIR_MAC_GET_ESS(x) (((tANI_U16) x) & 0x0001)
600#define SIR_MAC_GET_IBSS(x) ((((tANI_U16) x) & 0x0002) >> 1)
601#define SIR_MAC_GET_CF_POLLABLE(x) ((((tANI_U16) x) & 0x0004) >> 2)
602#define SIR_MAC_GET_CF_POLL_REQ(x) ((((tANI_U16) x) & 0x0008) >> 3)
603#define SIR_MAC_GET_PRIVACY(x) ((((tANI_U16) x) & 0x0010) >> 4)
604#define SIR_MAC_GET_SHORT_PREAMBLE(x) ((((tANI_U16) x) & 0x0020) >> 5)
605#define SIR_MAC_GET_SPECTRUM_MGMT(x) ((((tANI_U16) x) & 0x0100) >> 8)
606#define SIR_MAC_GET_QOS(x) ((((tANI_U16) x) & 0x0200) >> 9)
607#define SIR_MAC_GET_SHORT_SLOT_TIME(x) ((((tANI_U16) x) & 0x0400) >> 10)
608#define SIR_MAC_GET_APSD(x) ((((tANI_U16) x) & 0x0800) >> 11)
609#if defined WLAN_FEATURE_VOWIFI
610#define SIR_MAC_GET_RRM(x) ((((tANI_U16) x) & 0x1000) >> 12)
611#endif
612#define SIR_MAC_GET_BLOCK_ACK(x) ((((tANI_U16) x) & 0xc000) >> CAPABILITY_INFO_DELAYED_BA_BIT)
613#define SIR_MAC_SET_ESS(x) (((tANI_U16) x) | 0x0001)
614#define SIR_MAC_SET_IBSS(x) (((tANI_U16) x) | 0x0002)
615#define SIR_MAC_SET_CF_POLLABLE(x) (((tANI_U16) x) | 0x0004)
616#define SIR_MAC_SET_CF_POLL_REQ(x) (((tANI_U16) x) | 0x0008)
617#define SIR_MAC_SET_PRIVACY(x) (((tANI_U16) x) | 0x0010)
618#define SIR_MAC_SET_SHORT_PREAMBLE(x) (((tANI_U16) x) | 0x0020)
619#define SIR_MAC_SET_SPECTRUM_MGMT(x) (((tANI_U16) x) | 0x0100)
620#define SIR_MAC_SET_QOS(x) (((tANI_U16) x) | 0x0200)
621#define SIR_MAC_SET_SHORT_SLOT_TIME(x) (((tANI_U16) x) | 0x0400)
622#define SIR_MAC_SET_APSD(x) (((tANI_U16) x) | 0x0800)
623#if defined WLAN_FEATURE_VOWIFI
624#define SIR_MAC_SET_RRM(x) (((tANI_U16) x) | 0x1000)
625#endif
626#define SIR_MAC_SET_GROUP_ACK(x) (((tANI_U16) x) | 0x4000)
627
628// bitname must be one of the above, eg ESS, CF_POLLABLE, etc.
629#define SIR_MAC_CLEAR_CAPABILITY(u16value, bitname) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800630 ((u16value) &= (~(SIR_MAC_SET_##bitname(0))))
Jeff Johnson295189b2012-06-20 16:38:30 -0700631
Srinivas Girigowda100eb322013-03-15 16:48:20 -0700632#define IS_WES_MODE_ENABLED(x) \
633 ((x)->roam.configParam.isWESModeEnabled)
634
Jeff Johnson295189b2012-06-20 16:38:30 -0700635/// Status Code (present in Management response frames) enum
636
637typedef enum eSirMacStatusCodes
638{
639 eSIR_MAC_SUCCESS_STATUS = 0, //Reserved
640 eSIR_MAC_UNSPEC_FAILURE_STATUS = 1, //Unspecified reason
641 // 802.11 reserved 2-9
642 /*
643 WMM status codes(standard 1.1 table 9)
644 Table 9 ADDTS Response Status Codes
645 Value Operation
646 0 Admission accepted
647 1 Invalid parameters
648 2 Reserved
649 3 Refused
650 4-255 Reserved
651 */
652 eSIR_MAC_WME_INVALID_PARAMS_STATUS = 1, // ??
653 eSIR_MAC_WME_REFUSED_STATUS = 3, // ??
654 eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS = 10, //Cannot support all requested capabilities in the Capability Information field
655 eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS = 11, //Reassociation denied due to inability to confirm that association exists
656 eSIR_MAC_OUTSIDE_SCOPE_OF_SPEC_STATUS = 12, //Association denied due to reason outside the scope of this standard
657 eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS = 13, //Responding station does not support the specified authentication algorithm
658 eSIR_MAC_AUTH_FRAME_OUT_OF_SEQ_STATUS = 14, //Received an Authentication frame with authentication transaction sequence number
659 //out of expected sequence
660 eSIR_MAC_CHALLENGE_FAILURE_STATUS = 15, //Authentication rejected because of challenge failure
661 eSIR_MAC_AUTH_RSP_TIMEOUT_STATUS = 16, //Authentication rejected due to timeout waiting for next frame in sequence
662 eSIR_MAC_MAX_ASSOC_STA_REACHED_STATUS = 17, //Association denied because AP is unable to handle additional associated stations
663 eSIR_MAC_BASIC_RATES_NOT_SUPPORTED_STATUS = 18, //Association denied due to requesting station not supporting all of the data rates in the
664 //BSSBasicRateSet parameter
665 eSIR_MAC_SHORT_PREAMBLE_NOT_SUPPORTED_STATUS = 19, //Association denied due to requesting station not supporting the short preamble
666 //option
667 eSIR_MAC_PBCC_NOT_SUPPORTED_STATUS = 20, //Association denied due to requesting station not supporting the PBCC modulation
668 //option
669 eSIR_MAC_CHANNEL_AGILITY_NOT_SUPPORTED_STATUS = 21, //Association denied due to requesting station not supporting the Channel Agility
670 //option
671 eSIR_MAC_SPECTRUM_MGMT_REQD_STATUS = 22, //Association request rejected because Spectrum Management capability is required
672 eSIR_MAC_PWR_CAPABILITY_BAD_STATUS = 23, //Association request rejected because the information in the Power Capability
673 //element is unacceptable
674 eSIR_MAC_SPRTD_CHANNELS_BAD_STATUS = 24, //Association request rejected because the information in the Supported Channels
675 //element is unacceptable
676 eSIR_MAC_SHORT_SLOT_NOT_SUPORTED_STATUS = 25, //Association denied due to requesting station not supporting the Short Slot Time
677 //option
678 eSIR_MAC_DSSS_OFDM_NOT_SUPPORTED_STATUS = 26, //Association denied due to requesting station not supporting the DSSS-OFDM option
679 // reserved 27-31
680 eSIR_MAC_QOS_UNSPECIFIED_FAILURE_STATUS = 32, //Unspecified, QoS-related failure
681 eSIR_MAC_QAP_NO_BANDWIDTH_STATUS = 33, //Association denied because QoS AP has insufficient bandwidth to handle another
682 //QoS STA
683 eSIR_MAC_XS_FRAME_LOSS_STATUS = 34, //Association denied due to excessive frame loss rates and/or poor conditions on cur-
684 //rent operating channel
685 eSIR_MAC_STA_QOS_NOT_SUPPORTED_STATUS = 35, //Association (with QoS BSS) denied because the requesting STA does not support the
686 //QoS facility
687 eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS = 36, //Reserved
688 eSIR_MAC_REQ_DECLINED_STATUS = 37, //The request has been declined
689 eSIR_MAC_INVALID_PARAM_STATUS = 38, //The request has not been successful as one or more parameters have invalid values
690 eSIR_MAC_TS_NOT_HONOURED_STATUS = 39, //The TS has not been created because the request cannot be honored; however, a suggested
691 //TSPEC is provided so that the initiating STA may attempt to set another TS
692 //with the suggested changes to the TSPEC
693 eSIR_MAC_INVALID_INFORMATION_ELEMENT_STATUS = 40, //Invalid information element, i.e., an information element defined in this standard for
694 //which the content does not meet the specifications in Clause 7
695 eSIR_MAC_INVALID_GROUP_CIPHER_STATUS = 41, //Invalid group cipher
696 eSIR_MAC_INVALID_PAIRWISE_CIPHER_STATUS = 42, //Invalid pairwise cipher
697 eSIR_MAC_INVALID_AKMP_STATUS = 43, //Invalid AKMP
698 eSIR_MAC_UNSUPPORTED_RSN_IE_VERSION_STATUS = 44, //Unsupported RSN information element version
699 eSIR_MAC_INVALID_RSN_IE_CAPABILITIES_STATUS = 45, //Invalid RSN information element capabilities
700 eSIR_MAC_CIPHER_SUITE_REJECTED_STATUS = 46, //Cipher suite rejected because of security policy
701 eSIR_MAC_TS_NOT_CREATED_STATUS = 47, //The TS has not been created; however, the HC may be capable of creating a TS, in
702 //response to a request, after the time indicated in the TS Delay element
703 eSIR_MAC_DL_NOT_ALLOWED_STATUS = 48, //Direct link is not allowed in the BSS by policy
704 eSIR_MAC_DEST_STA_NOT_KNOWN_STATUS = 49, //The Destination STA is not present within this BSS
705 eSIR_MAC_DEST_STA_NOT_QSTA_STATUS = 50, //The Destination STA is not a QoS STA
706 eSIR_MAC_INVALID_LISTEN_INTERVAL_STATUS = 51, //Association denied because the ListenInterval is too large
707
708 eSIR_MAC_DSSS_CCK_RATE_MUST_SUPPORT_STATUS = 52, //FIXME:
709 eSIR_MAC_DSSS_CCK_RATE_NOT_SUPPORT_STATUS = 53,
710 eSIR_MAC_PSMP_CONTROLLED_ACCESS_ONLY_STATUS = 54,
711#ifdef FEATURE_WLAN_CCX
712 eSIR_MAC_CCX_UNSPECIFIED_QOS_FAILURE_STATUS = 200, //CCX-Unspecified, QoS related failure in (Re)Assoc response frames
713 eSIR_MAC_CCX_TSPEC_REQ_REFUSED_STATUS = 201, //CCX-TSPEC request refused due to AP's policy configuration in AddTs Rsp, (Re)Assoc Rsp.
714 eSIR_MAC_CCX_ASSOC_DENIED_INSUFF_BW_STATUS = 202, //CCX-Assoc denied due to insufficient bandwidth to handle new TS in (Re)Assoc Rsp.
715 eSIR_MAC_CCX_INVALID_PARAMETERS_STATUS = 203, //CCX-Invalid parameters. (Re)Assoc request had one or more TSPEC parameters with
716 //invalid values.
717#endif
718
719} tSirMacStatusCodes;
720
721/**
722 * Reason Code (present in Deauthentication/Disassociation
723 * Management frames) enum
724 */
725typedef enum eSirMacReasonCodes
726{
727 eSIR_MAC_UNSPEC_FAILURE_REASON = 1, //Unspecified reason
728 eSIR_MAC_PREV_AUTH_NOT_VALID_REASON = 2, //Previous authentication no longer valid
729 eSIR_MAC_DEAUTH_LEAVING_BSS_REASON = 3, //Deauthenticated because sending station is leaving (or has left) IBSS or ESS
730 eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON = 4, //Disassociated due to inactivity
731 eSIR_MAC_DISASSOC_DUE_TO_DISABILITY_REASON = 5, //Disassociated because AP is unable to handle all currently associated stations
732 eSIR_MAC_CLASS2_FRAME_FROM_NON_AUTH_STA_REASON = 6, //Class 2 frame received from nonauthenticated station
733 eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON = 7, //Class 3 frame received from nonassociated station
734 eSIR_MAC_DISASSOC_LEAVING_BSS_REASON = 8, //Disassociated because sending station is leaving (or has left) BSS
735 eSIR_MAC_STA_NOT_PRE_AUTHENTICATED_REASON = 9, //Station requesting (re)association is not authenticated with responding station
736 eSIR_MAC_PWR_CAPABILITY_BAD_REASON = 10, //Disassociated because the information in the Power Capability element is unacceptable
737 eSIR_MAC_SPRTD_CHANNELS_BAD_REASON = 11, //Disassociated because the information in the Supported Channels element is unacceptable
738 // reserved 12
739 eSIR_MAC_INVALID_IE_REASON = 13, //Invalid information element, i.e., an information element defined in this standard for
740 //which the content does not meet the specifications in Clause 7
741 eSIR_MAC_MIC_FAILURE_REASON = 14, //Message integrity code (MIC) failure
742 eSIR_MAC_4WAY_HANDSHAKE_TIMEOUT_REASON = 15, //4-Way Handshake timeout
743 eSIR_MAC_GR_KEY_UPDATE_TIMEOUT_REASON = 16, //Group Key Handshake timeout
744 eSIR_MAC_RSN_IE_MISMATCH_REASON = 17, //Information element in 4-Way Handshake different from (Re)Association Request/Probe
745 //Response/Beacon frame
746 eSIR_MAC_INVALID_MC_CIPHER_REASON = 18, //Invalid group cipher
747 eSIR_MAC_INVALID_UC_CIPHER_REASON = 19, //Invalid pairwise cipher
748 eSIR_MAC_INVALID_AKMP_REASON = 20, //Invalid AKMP
749 eSIR_MAC_UNSUPPORTED_RSN_IE_VER_REASON = 21, //Unsupported RSN information element version
750 eSIR_MAC_INVALID_RSN_CAPABILITIES_REASON = 22, //Invalid RSN information element capabilities
751 eSIR_MAC_1X_AUTH_FAILURE_REASON = 23, //IEEE 802.1X authentication failed
752 eSIR_MAC_CIPHER_SUITE_REJECTED_REASON = 24, //Cipher suite rejected because of the security policy
Mohit Khanna698ba2a2012-12-04 15:08:18 -0800753#ifdef FEATURE_WLAN_TDLS
754 eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE = 25, //TDLS direct link teardown due to TDLS peer STA unreachable via the TDLS direct link
755 eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON = 26, //TDLS direct link teardown for unspecified reason
756#endif
757 // reserved 27 - 31
Jeff Johnson295189b2012-06-20 16:38:30 -0700758 eSIR_MAC_QOS_UNSPECIFIED_REASON = 32, //Disassociated for unspecified, QoS-related reason
759 eSIR_MAC_QAP_NO_BANDWIDTH_REASON = 33, //Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA
760 eSIR_MAC_XS_UNACKED_FRAMES_REASON = 34, //Disassociated because excessive number of frames need to be acknowledged, but are not
761 //acknowledged due to AP transmissions and/or poor channel conditions
762 eSIR_MAC_BAD_TXOP_USE_REASON = 35, //Disassociated because STA is transmitting outside the limits of its TXOPs
763 eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON = 36, //Requested from peer STA as the STA is leaving the BSS (or resetting)
764 eSIR_MAC_PEER_REJECT_MECHANISIM_REASON = 37, //Requested from peer STA as it does not want to use the mechanism
765 eSIR_MAC_MECHANISM_NOT_SETUP_REASON = 38, //Requested from peer STA as the STA received frames using the mechanism for which a
766 //setup is required
767 eSIR_MAC_PEER_TIMEDOUT_REASON = 39, //Requested from peer STA due to timeout
768 eSIR_MAC_CIPHER_NOT_SUPPORTED_REASON = 45, //Peer STA does not support the requested cipher suite
769 eSIR_MAC_DISASSOC_DUE_TO_FTHANDOFF_REASON = 46, //FT reason
770 //reserved 47 - 65535.
771 eSIR_BEACON_MISSED = 65534, //We invented this to tell beacon missed case
772} tSirMacReasonCodes;
773
774
775typedef enum eSirMacChannelType
776{
777 eSIR_MAC_11A_BAND,
778 eSIR_MAC_11B_BAND,
779 eSIR_MAC_UNKNOWN_BAND
780} tSirMacChannelType;
781
782// BA Initiator v/s Recipient
783typedef enum eBADirection
784{
785 eBA_RECIPIENT,
786 eBA_INITIATOR
787} tBADirection;
788
789// A-MPDU/BA Enable/Disable in Tx/Rx direction
790typedef enum eBAEnable
791{
792 eBA_DISABLE,
793 eBA_ENABLE
794} tBAEnable;
795
796// A-MPDU/BA Policy
797typedef enum eBAPolicy
798{
799 eBA_UNCOMPRESSED,
800 eBA_COMPRESSED
801} tBAPolicy;
802
803// A-MPDU/BA Policy
804typedef enum eBAPolicyType
805{
806 eBA_POLICY_DELAYED,
807 eBA_POLICY_IMMEDIATE
808} tBAPolicyType;
809
810#ifdef WLAN_FEATURE_VOWIFI
811/* Based on table 7-43a from 802.11k Spec */
812typedef enum eRrmNeighborReachability
813{
814 eREACHABILITY_RESERVED,
815 eREACHABILITY_NOT_REACHABLE,
816 eREACHABILITY_UNKNOWN,
817 eREACHABILITY_REACHABLE,
818} tRrmNeighborReachability;
819#endif /* WLAN_FEATURE_VOWIFI */
820
821/// Frame control field format (2 bytes)
822typedef __ani_attr_pre_packed struct sSirMacFrameCtl
823{
824
825#ifndef ANI_LITTLE_BIT_ENDIAN
826
827 tANI_U8 subType :4;
828 tANI_U8 type :2;
829 tANI_U8 protVer :2;
830
831 tANI_U8 order :1;
832 tANI_U8 wep :1;
833 tANI_U8 moreData :1;
834 tANI_U8 powerMgmt :1;
835 tANI_U8 retry :1;
836 tANI_U8 moreFrag :1;
837 tANI_U8 fromDS :1;
838 tANI_U8 toDS :1;
839
840#else
841
842 tANI_U8 protVer :2;
843 tANI_U8 type :2;
844 tANI_U8 subType :4;
845
846 tANI_U8 toDS :1;
847 tANI_U8 fromDS :1;
848 tANI_U8 moreFrag :1;
849 tANI_U8 retry :1;
850 tANI_U8 powerMgmt :1;
851 tANI_U8 moreData :1;
852 tANI_U8 wep :1;
853 tANI_U8 order :1;
854
855#endif
856
857} __ani_attr_packed tSirMacFrameCtl, *tpSirMacFrameCtl;
858
859/// Sequence control field
860typedef __ani_attr_pre_packed struct sSirMacSeqCtl
861{
862
863#ifndef ANI_LITTLE_BIT_ENDIAN
864
865 tANI_U8 seqNumLo : 4;
866 tANI_U8 fragNum : 4;
867
868 tANI_U8 seqNumHi : 8;
869
870#else
871
872 tANI_U8 fragNum : 4;
873 tANI_U8 seqNumLo : 4;
874 tANI_U8 seqNumHi : 8;
875
876#endif
877} __ani_attr_packed tSirMacSeqCtl, *tpSirMacSeqCtl;
878
879// ACK policies
880
881typedef enum eSirMacAckPolicy
882{
883 eSIR_MAC_IMMEDIATE_ACK=0 ,
884 eSIR_MAC_NO_ACK,
885 eSIR_MAC_NO_EXPLICIT_ACK,
886 eSIR_MAC_BURST_ACK
887} tSirMacAckPolicy;
888
889/// QoS control field
890typedef __ani_attr_pre_packed struct sSirMacQosCtl
891{
892
893#ifndef ANI_LITTLE_BIT_ENDIAN
894
895 tANI_U8 rsvd : 1;
896 tANI_U8 ackPolicy : 2;
897 tANI_U8 esop_txopUnit : 1;
898 tANI_U8 tid : 4;
899
900 tANI_U8 txop : 8;
901
902#else
903
904 tANI_U8 tid : 4;
905 tANI_U8 esop_txopUnit : 1;
906 tANI_U8 ackPolicy : 2;
907 tANI_U8 rsvd : 1;
908
909 tANI_U8 txop : 8;
910
911#endif
912} __ani_attr_packed tSirMacQosCtl, *tpSirMacQosCtl;
913
914/// Length (in bytes) of MAC header in 3 address format
915#define SIR_MAC_HDR_LEN_3A 24
916
917/// Length (in bytes) of MAC header in 4 address format
918#define SIR_MAC_HDR_LEN_4A 30
919
920/// Length (in bytes) of the QoS control field in the MAC header
921#define SIR_MAC_QOS_CTL_LEN 2
922
923/// 3 address MAC data header format (24/26 bytes)
924typedef __ani_attr_pre_packed struct sSirMacDot3Hdr
925{
926 tANI_U8 da[6];
927 tANI_U8 sa[6];
928 tANI_U16 length;
929} __ani_attr_packed tSirMacDot3Hdr, *tpSirMacDot3Hdr;
930
931
932/// 3 address MAC data header format (24/26 bytes)
933typedef __ani_attr_pre_packed struct sSirMacDataHdr3a
934{
935 tSirMacFrameCtl fc;
936 tANI_U8 durationLo;
937 tANI_U8 durationHi;
938 tANI_U8 addr1[6];
939 tANI_U8 addr2[6];
940 tANI_U8 addr3[6];
941 tSirMacSeqCtl seqControl;
942 tSirMacQosCtl qosControl;
943} __ani_attr_packed tSirMacDataHdr3a, *tpSirMacDataHdr3a;
944
945/// 4 address MAC data header format (30/32 bytes)
946typedef __ani_attr_pre_packed struct sSirMacDataHdr4a
947{
948 tSirMacFrameCtl fc;
949 tANI_U8 durationLo;
950 tANI_U8 durationHi;
951 tANI_U8 addr1[6];
952 tANI_U8 addr2[6];
953 tANI_U8 addr3[6];
954 tSirMacSeqCtl seqControl;
955 tANI_U8 addr4[6];
956 tSirMacQosCtl qosControl;
957} __ani_attr_packed tSirMacDataHdr4a, *tpSirMacDataHdr4a;
958
959/// Management header format
960typedef __ani_attr_pre_packed struct sSirMacMgmtHdr
961{
962 tSirMacFrameCtl fc;
963 tANI_U8 durationLo;
964 tANI_U8 durationHi;
965 tANI_U8 da[6];
966 tANI_U8 sa[6];
967 tANI_U8 bssId[6];
968 tSirMacSeqCtl seqControl;
969} __ani_attr_packed tSirMacMgmtHdr, *tpSirMacMgmtHdr;
970
971/// PS-poll header format
972typedef __ani_attr_pre_packed struct sSirMacPSpoll
973{
974 tSirMacFrameCtl fc;
975 tANI_U8 aidLo;
976 tANI_U8 aidHi;
977 tANI_U8 bssId[6];
978 tANI_U8 ta[6];
979 tANI_U8 fcs[4];
980} __ani_attr_packed tSirMacPSpoll, *tpSirMacPSpoll;
981
982/// ERP information field
983typedef __ani_attr_pre_packed struct sSirMacErpInfo
984{
985#ifndef ANI_LITTLE_BIT_ENDIAN
986 tANI_U8 reserved:5;
987 tANI_U8 barkerPreambleMode:1;
988 tANI_U8 useProtection:1;
989 tANI_U8 nonErpPresent:1;
990#else
991 tANI_U8 nonErpPresent:1;
992 tANI_U8 useProtection:1;
993 tANI_U8 barkerPreambleMode:1;
994 tANI_U8 reserved:5;
995#endif
996} __ani_attr_packed tSirMacErpInfo, *tpSirMacErpInfo;
997
998/// Capability information field
999typedef __ani_attr_pre_packed struct sSirMacCapabilityInfo
1000{
1001#ifndef ANI_LITTLE_BIT_ENDIAN
1002 tANI_U16 immediateBA:1;
1003 tANI_U16 delayedBA:1;
1004 tANI_U16 dsssOfdm:1;
1005 tANI_U16 rrm:1;
1006 tANI_U16 apsd:1;
1007 tANI_U16 shortSlotTime:1;
1008 tANI_U16 qos:1;
1009 tANI_U16 spectrumMgt:1;
1010 tANI_U16 channelAgility:1;
1011 tANI_U16 pbcc:1;
1012 tANI_U16 shortPreamble:1;
1013 tANI_U16 privacy:1;
1014 tANI_U16 cfPollReq:1;
1015 tANI_U16 cfPollable:1;
1016 tANI_U16 ibss:1;
1017 tANI_U16 ess:1;
1018#else
1019 tANI_U16 ess:1;
1020 tANI_U16 ibss:1;
1021 tANI_U16 cfPollable:1;
1022 tANI_U16 cfPollReq:1;
1023 tANI_U16 privacy:1;
1024 tANI_U16 shortPreamble:1;
1025 tANI_U16 pbcc:1;
1026 tANI_U16 channelAgility:1;
1027 tANI_U16 spectrumMgt:1;
1028 tANI_U16 qos:1;
1029 tANI_U16 shortSlotTime:1;
1030 tANI_U16 apsd:1;
1031 tANI_U16 rrm:1;
1032 tANI_U16 dsssOfdm:1;
1033 tANI_U16 delayedBA:1;
1034 tANI_U16 immediateBA:1;
1035#endif
1036} __ani_attr_packed tSirMacCapabilityInfo, *tpSirMacCapabilityInfo;
1037
1038typedef __ani_attr_pre_packed struct sSirMacCfParamSet
1039{
1040 tANI_U8 cfpCount;
1041 tANI_U8 cfpPeriod;
1042 tANI_U16 cfpMaxDuration;
1043 tANI_U16 cfpDurRemaining;
1044} __ani_attr_packed tSirMacCfParamSet;
1045
1046typedef __ani_attr_pre_packed struct sSirMacTim
1047{
1048 tANI_U8 dtimCount;
1049 tANI_U8 dtimPeriod;
1050 tANI_U8 bitmapControl;
1051 tANI_U8 bitmapLength;
1052 tANI_U8 bitmap[251];
1053} __ani_attr_packed tSirMacTim;
1054
1055//12 Bytes long because this structure can be used to represent rate
1056//and extended rate set IEs
1057//The parser assume this to be at least 12
1058typedef __ani_attr_pre_packed struct sSirMacRateSet
1059{
1060 tANI_U8 numRates;
1061 tANI_U8 rate[SIR_MAC_RATESET_EID_MAX];
1062} __ani_attr_packed tSirMacRateSet;
1063
1064
1065typedef __ani_attr_pre_packed struct sSirMacSSid
1066{
1067 tANI_U8 length;
1068 tANI_U8 ssId[32];
1069} __ani_attr_packed tSirMacSSid;
1070
1071typedef __ani_attr_pre_packed struct sSirMacWpaInfo
1072{
1073 tANI_U8 length;
1074 tANI_U8 info[SIR_MAC_MAX_IE_LENGTH];
1075} __ani_attr_packed tSirMacWpaInfo, *tpSirMacWpaInfo, tSirMacRsnInfo, *tpSirMacRsnInfo;
1076
1077
1078/* ----------------
1079 * EDCA Profiles
1080 * ---------------
1081 */
1082
1083#define EDCA_AC_BE 0
1084#define EDCA_AC_BK 1
1085#define EDCA_AC_VI 2
1086#define EDCA_AC_VO 3
1087#define AC_MGMT_LO 4
1088#define AC_MGMT_HI 5
1089#define MAX_NUM_AC 4
1090#define TOT_NUM_AC (MAX_NUM_AC + 2) /* +2 for AC_MGMT_xx */
1091
1092/*
1093#define EDCA_INDEX_0_RSVD 0
1094#define EDCA_INDEX_1_BEACON 1
1095#define EDCA_INDEX_2_MGMT_PROBERSP 2
1096#define EDCA_INDEX_3_MGMT_OTHER 3
1097#define EDCA_INDEX_4_AC_VO 4
1098#define EDCA_INDEX_5_AC_VI 5
1099#define EDCA_INDEX_6_AC_BE 6
1100#define EDCA_INDEX_7_AC_BK 7
1101*/
1102// access categories
1103#define SIR_MAC_EDCAACI_BESTEFFORT (EDCA_AC_BE)
1104#define SIR_MAC_EDCAACI_BACKGROUND (EDCA_AC_BK)
1105#define SIR_MAC_EDCAACI_VIDEO (EDCA_AC_VI)
1106#define SIR_MAC_EDCAACI_VOICE (EDCA_AC_VO)
1107
1108// access category record
1109typedef __ani_attr_pre_packed struct sSirMacAciAifsn
1110{
1111#ifndef ANI_LITTLE_BIT_ENDIAN
1112 tANI_U8 rsvd : 1;
1113 tANI_U8 aci : 2;
1114 tANI_U8 acm : 1;
1115 tANI_U8 aifsn : 4;
1116#else
1117 tANI_U8 aifsn : 4;
1118 tANI_U8 acm : 1;
1119 tANI_U8 aci : 2;
1120 tANI_U8 rsvd : 1;
1121#endif
1122} __ani_attr_packed tSirMacAciAifsn;
1123
1124// contention window size
1125typedef __ani_attr_pre_packed struct sSirMacCW
1126{
1127#ifndef ANI_LITTLE_BIT_ENDIAN
1128 tANI_U8 max : 4;
1129 tANI_U8 min : 4;
1130#else
1131 tANI_U8 min : 4;
1132 tANI_U8 max : 4;
1133#endif
1134} __ani_attr_packed tSirMacCW;
1135
1136typedef __ani_attr_pre_packed struct sSirMacEdcaParamRecord
1137{
1138 tSirMacAciAifsn aci;
1139 tSirMacCW cw;
1140 tANI_U16 txoplimit;
1141} __ani_attr_packed tSirMacEdcaParamRecord;
1142
1143typedef __ani_attr_pre_packed struct sSirMacQosInfo
1144{
1145#ifndef ANI_LITTLE_BIT_ENDIAN
1146 tANI_U8 uapsd : 1;
1147 tANI_U8 txopreq : 1;
1148 tANI_U8 qreq : 1;
1149 tANI_U8 qack : 1;
1150 tANI_U8 count : 4;
1151#else
1152 tANI_U8 count : 4;
1153 tANI_U8 qack : 1;
1154 tANI_U8 qreq : 1;
1155 tANI_U8 txopreq : 1;
1156 tANI_U8 uapsd : 1;
1157#endif
1158} __ani_attr_packed tSirMacQosInfo;
1159
1160
1161typedef __ani_attr_pre_packed struct sSirMacQosInfoStation
1162{
1163#ifdef ANI_LITTLE_BIT_ENDIAN
1164 tANI_U8 acvo_uapsd:1;
1165 tANI_U8 acvi_uapsd:1;
1166 tANI_U8 acbk_uapsd:1;
1167 tANI_U8 acbe_uapsd:1;
1168 tANI_U8 qack:1;
1169 tANI_U8 maxSpLen:2;
1170 tANI_U8 moreDataAck:1;
1171#else
1172 tANI_U8 moreDataAck:1;
1173 tANI_U8 maxSpLen:2;
1174 tANI_U8 qack:1;
1175 tANI_U8 acbe_uapsd:1;
1176 tANI_U8 acbk_uapsd:1;
1177 tANI_U8 acvi_uapsd:1;
1178 tANI_U8 acvo_uapsd:1;
1179#endif
1180} __ani_attr_packed tSirMacQosInfoStation, *tpSirMacQosInfoStation;
1181
1182
1183
1184typedef __ani_attr_pre_packed struct sSirMacEdcaParamSetIE
1185{
1186 tANI_U8 type;
1187 tANI_U8 length;
1188 tSirMacQosInfo qosInfo;
1189 tANI_U8 rsvd;
1190 tSirMacEdcaParamRecord acbe; // best effort
1191 tSirMacEdcaParamRecord acbk; // background
1192 tSirMacEdcaParamRecord acvi; // video
1193 tSirMacEdcaParamRecord acvo; // voice
1194} __ani_attr_packed tSirMacEdcaParamSetIE;
1195
1196#if 1
1197typedef __ani_attr_pre_packed struct sSirMacQoSParams
1198{
1199 tANI_U8 count;
1200 tANI_U16 limit;
1201 tANI_U8 CWmin[8];
1202 tANI_U8 AIFS[8];
1203} __ani_attr_packed tSirMacQoSParams;
1204#endif
1205
1206typedef __ani_attr_pre_packed struct sSirMacQbssLoadIE
1207{
1208 tANI_U8 type;
1209 tANI_U8 length;
1210 tANI_U16 staCount;
1211 tANI_U8 chnlUtil;
1212 tANI_U16 admitCapacity;
1213} __ani_attr_packed tSirMacQbssLoadIE;
1214
1215// ts info direction field can take any of these values
1216#define SIR_MAC_DIRECTION_UPLINK 0
1217#define SIR_MAC_DIRECTION_DNLINK 1
1218#define SIR_MAC_DIRECTION_DIRECT 2
1219#define SIR_MAC_DIRECTION_BIDIR 3
1220
1221// access policy
1222// reserved 0
1223#define SIR_MAC_ACCESSPOLICY_EDCA 1
1224#define SIR_MAC_ACCESSPOLICY_HCCA 2
1225#define SIR_MAC_ACCESSPOLICY_BOTH 3
1226
1227#define SIR_MAC_HCCA_TSID_MIN 8 // valid HCCA tsid's are 8 or higher
1228#define SIR_MAC_TID_MAX 15
1229#define MAC_BA_TID_MAX 8
1230
1231typedef __ani_attr_pre_packed struct sSirMacTSInfoTfc
1232{
1233#ifndef ANI_LITTLE_BIT_ENDIAN
1234 tANI_U8 burstSizeDefn : 1;
1235 tANI_U8 reserved :7;
1236#else
1237 tANI_U8 reserved :7;
1238 tANI_U8 burstSizeDefn : 1;
1239#endif
1240
1241#ifndef ANI_LITTLE_BIT_ENDIAN
1242 tANI_U16 ackPolicy : 2;
1243 tANI_U16 userPrio : 3;
1244 tANI_U16 psb : 1;
1245 tANI_U16 aggregation : 1;
1246 tANI_U16 accessPolicy : 2;
1247 tANI_U16 direction : 2;
1248 tANI_U16 tsid : 4;
1249 tANI_U16 trafficType : 1;
1250#else
1251 tANI_U16 trafficType : 1;
1252 tANI_U16 tsid : 4;
1253 tANI_U16 direction : 2;
1254 tANI_U16 accessPolicy : 2;
1255 tANI_U16 aggregation : 1;
1256 tANI_U16 psb : 1;
1257 tANI_U16 userPrio : 3;
1258 tANI_U16 ackPolicy : 2;
1259#endif
1260} __ani_attr_packed tSirMacTSInfoTfc;
1261
1262typedef __ani_attr_pre_packed struct sSirMacTSInfoSch
1263{
1264#ifndef ANI_LITTLE_BIT_ENDIAN
1265 tANI_U8 rsvd : 7;
1266 tANI_U8 schedule : 1;
1267#else
1268 tANI_U8 schedule : 1;
1269 tANI_U8 rsvd : 7;
1270#endif
1271} __ani_attr_packed tSirMacTSInfoSch;
1272
1273typedef __ani_attr_pre_packed struct sSirMacTSInfo
1274{
1275 tSirMacTSInfoTfc traffic;
1276 tSirMacTSInfoSch schedule;
1277} __ani_attr_packed tSirMacTSInfo;
1278
1279typedef __ani_attr_pre_packed struct sSirMacTspecIE
1280{
1281 tANI_U8 type;
1282 tANI_U8 length;
1283 tSirMacTSInfo tsinfo;
1284 tANI_U16 nomMsduSz;
1285 tANI_U16 maxMsduSz;
1286 tANI_U32 minSvcInterval;
1287 tANI_U32 maxSvcInterval;
1288 tANI_U32 inactInterval;
1289 tANI_U32 suspendInterval;
1290 tANI_U32 svcStartTime;
1291 tANI_U32 minDataRate;
1292 tANI_U32 meanDataRate;
1293 tANI_U32 peakDataRate;
1294 tANI_U32 maxBurstSz;
1295 tANI_U32 delayBound;
1296 tANI_U32 minPhyRate;
1297 tANI_U16 surplusBw;
1298 tANI_U16 mediumTime;
1299}
Jeff Johnson3368d4a2013-02-13 12:23:50 -08001300__ani_attr_packed tSirMacTspecIE;
Jeff Johnson295189b2012-06-20 16:38:30 -07001301
1302// max size of the classifier params in the tclas IE
1303#define SIR_MAC_CLSPARAM_LEN 253
1304
1305// frame classifier types
1306#define SIR_MAC_TCLASTYPE_ETHERNET 0
1307#define SIR_MAC_TCLASTYPE_TCPUDPIP 1
1308#define SIR_MAC_TCLASTYPE_8021DQ 2
1309// reserved 3-255
1310
1311#define SIR_MAC_TCLAS_PARAM_ETHERNET_MIN 14
1312typedef __ani_attr_pre_packed struct sSirMacTclasParamEthernet
1313{
1314 tANI_U8 srcAddr[6];
1315 tANI_U8 dstAddr[6];
1316 tANI_U16 type;
1317}__ani_attr_packed tSirMacTclasParamEthernet;
1318
1319#define SIR_MAC_TCLAS_PARAM_IPV4_MIN 16
1320typedef __ani_attr_pre_packed struct sSirMacTclasParamIPv4
1321{
1322 tANI_U8 version;
1323 tANI_U32 srcIpAddr;
1324 tANI_U32 dstIpAddr;
1325 tANI_U16 srcPort;
1326 tANI_U16 dstPort;
1327 tANI_U8 dscp;
1328 tANI_U8 protocol;
1329 tANI_U8 rsvd;
1330} __ani_attr_packed tSirMacTclasParamIPv4;
1331
1332#define SIR_MAC_TCLAS_IPV4 4
1333#define SIR_MAC_TCLAS_IPV6 6
1334
1335#define SIR_MAC_TCLAS_PARAM_IPV6_MIN 40
1336typedef __ani_attr_pre_packed struct sSirMacTclasParamIPv6
1337{
1338 tANI_U8 version;
1339 tANI_U8 srcIpAddr[16];
1340 tANI_U8 dstIpAddr[16];
1341 tANI_U16 srcPort;
1342 tANI_U16 dstPort;
1343 tANI_U8 flowLabel[3];
1344} __ani_attr_packed tSirMacTclasParamIPv6;
1345
1346#define SIR_MAC_TCLAS_PARAM_8021DQ_MIN 2
1347typedef __ani_attr_pre_packed struct sSirMacTclasParam8021dq
1348{
1349 tANI_U16 tag;
1350} __ani_attr_packed tSirMacTclasParam8021dq;
1351
1352typedef __ani_attr_pre_packed struct sSirMacTclasIE
1353{
1354 tANI_U8 type;
1355 tANI_U8 length;
1356 tANI_U8 userPrio;
1357 tANI_U8 classifierType;
1358 tANI_U8 classifierMask;
1359} __ani_attr_packed tSirMacTclasIE;
1360
1361typedef __ani_attr_pre_packed struct sSirMacTsDelayIE
1362{
1363 tANI_U8 type;
1364 tANI_U8 length;
1365 tANI_U32 delay;
1366} __ani_attr_packed tSirMacTsDelayIE;
1367
1368typedef __ani_attr_pre_packed struct sSirMacTclasProcIE
1369{
1370 tANI_U8 type;
1371 tANI_U8 length;
1372 tANI_U8 processing;
1373} __ani_attr_packed tSirMacTclasProcIE;
1374
1375typedef __ani_attr_pre_packed struct sSirMacScheduleInfo
1376{
1377#ifndef ANI_LITTLE_BIT_ENDIAN
1378 tANI_U16 rsvd : 9;
1379 tANI_U16 direction : 2;
1380 tANI_U16 tsid : 4;
1381 tANI_U16 aggregation : 1;
1382#else
1383 tANI_U16 aggregation : 1;
1384 tANI_U16 tsid : 4;
1385 tANI_U16 direction : 2;
1386 tANI_U16 rsvd : 9;
1387#endif
1388} __ani_attr_packed tSirMacScheduleInfo;
1389
1390typedef __ani_attr_pre_packed struct sSirMacScheduleIE
1391{
1392 tANI_U8 type;
1393 tANI_U8 length;
1394 tSirMacScheduleInfo info;
1395 tANI_U32 svcStartTime;
1396 tANI_U32 svcInterval;
1397 tANI_U16 maxSvcDuration;
1398 tANI_U16 specInterval;
1399} __ani_attr_packed tSirMacScheduleIE;
1400
1401typedef __ani_attr_pre_packed struct sSirMacQosCapabilityIE
1402{
1403 tANI_U8 type;
1404 tANI_U8 length;
1405 tSirMacQosInfo qosInfo;
1406} __ani_attr_packed tSirMacQosCapabilityIE;
1407
1408typedef __ani_attr_pre_packed struct sSirMacQosCapabilityStaIE
1409{
1410 tANI_U8 type;
1411 tANI_U8 length;
1412 tSirMacQosInfoStation qosInfo;
1413} __ani_attr_packed tSirMacQosCapabilityStaIE;
1414
1415
1416#define ADDTS
1417typedef __ani_attr_pre_packed struct sSirMacQosActionIE
1418{
1419 tANI_U8 type;
1420 tANI_U8 length;
1421 tANI_U8 qosAction;
1422 tANI_U8 qosBody[1];
1423} __ani_attr_packed tSirMacQosActionIE;
1424
1425typedef tANI_U32 tSirMacTimeStamp[2];
1426
1427typedef tANI_U16 tSirMacBeaconInterval;
1428
1429typedef tANI_U16 tSirMacListenInterval;
1430
1431typedef tANI_U8 tSirMacChanNum;
1432
1433typedef tANI_U8 tSirMacAddr[6];
1434
1435
1436// IE definitions
1437typedef __ani_attr_pre_packed struct sSirMacIE
1438{
1439 tANI_U8 elementID;
1440 tANI_U8 length;
1441 tANI_U8 info[1];
1442} __ani_attr_packed tSirMacIE;
1443
1444typedef __ani_attr_pre_packed struct sSirMacSSidIE
1445{
1446 tANI_U8 type;
1447 tSirMacSSid ssId;
1448} __ani_attr_packed tSirMacSSidIE;
1449
1450typedef __ani_attr_pre_packed struct sSirMacRateSetIE
1451{
1452 tANI_U8 type;
1453 tSirMacRateSet supportedRateSet;
1454} __ani_attr_packed tSirMacRateSetIE;
1455
1456typedef __ani_attr_pre_packed struct sSirMacDsParamSetIE
1457{
1458 tANI_U8 type;
1459 tANI_U8 length;
1460 tSirMacChanNum channelNumber;
1461} __ani_attr_packed tSirMacDsParamSetIE;
1462
1463typedef __ani_attr_pre_packed struct sSirMacCfParamSetIE
1464{
1465 tANI_U8 type;
1466 tANI_U8 length;
1467 tSirMacCfParamSet cfParams;
1468} __ani_attr_packed tSirMacCfParamSetIE;
1469
1470typedef __ani_attr_pre_packed struct sSirMacChanInfo
1471{
1472 tSirMacChanNum firstChanNum;
1473 tANI_U8 numChannels;
1474 tANI_S8 maxTxPower;
1475} __ani_attr_packed tSirMacChanInfo;
1476
1477typedef __ani_attr_pre_packed struct sSirMacCountry
1478{
1479 tANI_U8 countryString[3]; // This from CFG_COUNTRY_STRING
1480 tANI_U8 numChanInfo;
1481 tSirMacChanInfo chanInfo[1];
1482} __ani_attr_packed tSirMacCountry;
1483
1484typedef __ani_attr_pre_packed struct sSirMacCountryIE
1485{
1486 tANI_U8 type;
1487 tANI_U8 length;
1488 tSirMacCountry country;
1489} __ani_attr_packed tSirMacCountryIE;
1490
1491typedef __ani_attr_pre_packed struct sSirMacNonErpPresentIE
1492{
1493 tANI_U8 type;
1494 tANI_U8 length;
1495 tANI_U8 erp;
1496} __ani_attr_packed tSirMacNonErpPresentIE;
1497
1498typedef __ani_attr_pre_packed struct sSirMacWpaIE
1499{
1500 tANI_U8 type;
1501 tSirMacWpaInfo wpa;
1502} __ani_attr_packed tSirMacWpaIE;
1503
1504typedef struct sSirMacPowerCapabilityIE
1505{
1506 tANI_U8 type;
1507 tANI_U8 length;
1508 tANI_U8 minTxPower;
1509 tANI_U8 maxTxPower;
1510} tSirMacPowerCapabilityIE;
1511
1512typedef struct sSirMacSupportedChannelIE
1513{
1514 tANI_U8 type;
1515 tANI_U8 length;
1516 tANI_U8 supportedChannels[96];
1517} tSirMacSupportedChannelIE;
1518
1519typedef struct sSirMacMeasReqField
1520{
1521 tANI_U8 channelNumber;
1522 tANI_U8 measStartTime[8];
1523 tANI_U16 measDuration;
1524} tSirMacMeasReqField, *tpSirMacMeasReqField;
1525
1526typedef struct sSirMacMeasReqIE
1527{
1528 tANI_U8 type;
1529 tANI_U8 length;
1530 tANI_U8 measToken;
1531 tANI_U8 measReqMode;
1532 tANI_U8 measType;
1533 tSirMacMeasReqField measReqField;
1534} tSirMacMeasReqIE, *tpSirMacMeasReqIE;
1535
1536// Basic Measurement Report
1537typedef struct sSirMacBasicReport
1538{
1539 tANI_U8 channelNumber;
1540 tANI_U8 measStartTime[8];
1541 tANI_U16 measDuration;
1542 tANI_U8 mapField;
1543} tSirMacBasicReport, *tpSirMacBasicReport;
1544
1545typedef struct sSirMacBasicReportIE
1546{
1547 tANI_U8 type;
1548 tANI_U8 length;
1549 tANI_U8 measToken;
1550 tANI_U8 measReportMode;
1551 tANI_U8 measType;
1552 tSirMacBasicReport basicReport;
1553} tSirMacBasicReportIE, *tpSirMacBasicReportIE;
1554
1555// CCA Measurement Report
1556typedef struct sSirMacCcaReport
1557{
1558 tANI_U8 channelNumber;
1559 tANI_U8 measStartTime[8];
1560 tANI_U16 measDuration;
1561 tANI_U8 ccaBusyFraction;
1562} tSirMacCcaReport, *tpSirMacCcaReport;
1563
1564typedef struct sSirMacCcaReportIE
1565{
1566 tANI_U8 type;
1567 tANI_U8 length;
1568 tANI_U8 measToken;
1569 tANI_U8 measReportMode;
1570 tANI_U8 measType;
1571 tSirMacCcaReport ccaReport;
1572} tSirMacCcaReportIE, *tpSirMacCcaReportIE;
1573
1574// RPI Histogram Measurement Report
1575typedef struct sSirMacRpiReport
1576{
1577 tANI_U8 channelNumber;
1578 tANI_U8 measStartTime[8];
1579 tANI_U16 measDuration;
1580 tANI_U8 rpiDensity[8];
1581} tSirMacRpiReport, *tpSirMacRpiReport;
1582
1583typedef struct sSirMacRpiReportIE
1584{
1585 tANI_U8 type;
1586 tANI_U8 length;
1587 tANI_U8 measToken;
1588 tANI_U8 measReportMode;
1589 tANI_U8 measType;
1590 tSirMacRpiReport rpiReport;
1591} tSirMacRpiReportIE, *tpSirMacRpiReportIE;
1592
Gopichand Nakkala681989c2013-03-06 22:27:48 -08001593#define SIR_MAC_MAX_SUPP_RATES 32
1594
1595#define SIR_MAC_MAX_EXTN_CAP 8
1596
1597// VHT Capabilities Info
1598typedef __ani_attr_pre_packed struct sSirMacVHTCapabilityInfo
1599{
1600#ifndef ANI_LITTLE_BIT_ENDIAN
1601 tANI_U32 reserved1: 2;
1602 tANI_U32 txAntPattern: 1;
1603 tANI_U32 rxAntPattern: 1;
1604 tANI_U32 vhtLinkAdaptCap: 2;
1605 tANI_U32 maxAMPDULenExp: 3;
1606 tANI_U32 htcVHTCap: 1;
1607 tANI_U32 vhtTXOPPS: 1;
1608 tANI_U32 muBeamformeeCap: 1;
1609 tANI_U32 muBeamformerCap: 1;
1610 tANI_U32 numSoundingDim: 3;
1611 tANI_U32 csnofBeamformerAntSup: 3;
1612 tANI_U32 suBeamformeeCap: 1;
1613 tANI_U32 suBeamFormerCap: 1;
1614 tANI_U32 rxSTBC: 3;
1615 tANI_U32 txSTBC: 1;
1616 tANI_U32 shortGI160and80plus80MHz: 1;
1617 tANI_U32 shortGI80MHz: 1;
1618 tANI_U32 ldpcCodingCap: 1;
1619 tANI_U32 supportedChannelWidthSet: 2;
1620 tANI_U32 maxMPDULen: 2;
1621#else
1622 tANI_U32 maxMPDULen: 2;
1623 tANI_U32 supportedChannelWidthSet: 2;
1624 tANI_U32 ldpcCodingCap: 1;
1625 tANI_U32 shortGI80MHz: 1;
1626 tANI_U32 shortGI160and80plus80MHz: 1;
1627 tANI_U32 txSTBC: 1;
1628 tANI_U32 rxSTBC: 3;
1629 tANI_U32 suBeamFormerCap: 1;
1630 tANI_U32 suBeamformeeCap: 1;
1631 tANI_U32 csnofBeamformerAntSup: 3;
1632 tANI_U32 numSoundingDim: 3;
1633 tANI_U32 muBeamformerCap: 1;
1634 tANI_U32 muBeamformeeCap: 1;
1635 tANI_U32 vhtTXOPPS: 1;
1636 tANI_U32 htcVHTCap: 1;
1637 tANI_U32 maxAMPDULenExp: 3;
1638 tANI_U32 vhtLinkAdaptCap: 2;
1639 tANI_U32 rxAntPattern: 1;
1640 tANI_U32 txAntPattern: 1;
1641 tANI_U32 reserved1: 2;
1642#endif
1643} __ani_attr_packed tSirMacVHTCapabilityInfo;
1644
1645typedef __ani_attr_pre_packed struct sSirMacVHTTxSupDataRateInfo
1646{
1647#ifndef ANI_LITTLE_BIT_ENDIAN
1648 tANI_U16 reserved: 3;
1649 tANI_U16 txSupDataRate: 13;
1650#else
1651 tANI_U16 txSupDataRate: 13;
1652 tANI_U16 reserved: 3;
1653#endif
1654}__ani_attr_packed tSirMacVHTTxSupDataRateInfo;
1655
1656typedef __ani_attr_pre_packed struct sSirMacVHTRxSupDataRateInfo
1657{
1658#ifndef ANI_LITTLE_BIT_ENDIAN
1659 tANI_U16 reserved: 3;
1660 tANI_U16 rxSupDataRate: 13;
1661#else
1662 tANI_U16 rxSupDataRate: 13;
1663 tANI_U16 reserved: 3;
1664#endif
1665}__ani_attr_packed tSirMacVHTRxSupDataRateInfo;
1666
1667/**
1668 * struct sSirVhtMcsInfo - VHT MCS information
1669 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
1670 * @rx_highest: Indicates highest long GI VHT PPDU data rate
1671 * STA can receive. Rate expressed in units of 1 Mbps.
1672 * If this field is 0 this value should not be used to
1673 * consider the highest RX data rate supported.
1674 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
1675 * @tx_highest: Indicates highest long GI VHT PPDU data rate
1676 * STA can transmit. Rate expressed in units of 1 Mbps.
1677 * If this field is 0 this value should not be used to
1678 * consider the highest TX data rate supported.
1679 */
1680typedef struct sSirVhtMcsInfo {
1681 tANI_U16 rxMcsMap;
1682 tANI_U16 rxHighest;
1683 tANI_U16 txMcsMap;
1684 tANI_U16 txHighest;
1685}tSirVhtMcsInfo;
1686
1687/**
1688 * struct sSirVHtCap - VHT capabilities
1689 *
1690 * This structure is the "VHT capabilities element" as
1691 * described in 802.11ac D3.0 8.4.2.160
1692 * @vht_cap_info: VHT capability info
1693 * @supp_mcs: VHT MCS supported rates
1694 */
1695typedef struct sSirVHtCap {
1696 tANI_U32 vhtCapInfo;
1697 tSirVhtMcsInfo suppMcs;
1698}tSirVHTCap;
1699
1700/**
1701 * struct sSirHtCap - HT capabilities
1702 *
1703 * This structure refers to "HT capabilities element" as
1704 * described in 802.11n draft section 7.3.2.52
1705 */
1706
1707
1708typedef struct sSirHtCap {
1709 tANI_U16 capInfo;
1710 tANI_U8 ampduParamsInfo;
1711 tANI_U8 suppMcsSet[16];
1712 tANI_U16 extendedHtCapInfo;
1713 tANI_U32 txBFCapInfo;
1714 tANI_U8 antennaSelectionInfo;
1715}tSirHTCap;
Jeff Johnson295189b2012-06-20 16:38:30 -07001716
1717// HT Cap and HT IE Size defines
1718#define HT_CAPABILITY_IE_SIZE 28
1719#define HT_INFO_IE_SIZE 24
1720
1721//
1722// Determines the current operating mode of the 802.11n STA
1723//
1724typedef enum eSirMacHTOperatingMode
1725{
1726 eSIR_HT_OP_MODE_PURE, // No Protection
1727 eSIR_HT_OP_MODE_OVERLAP_LEGACY, // Overlap Legacy device present, protection is optional
1728 eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT, // No legacy device, but 20 MHz HT present
1729 eSIR_HT_OP_MODE_MIXED // Protetion is required
1730} tSirMacHTOperatingMode;
1731
1732
1733// Spatial Multiplexing(SM) Power Save mode
1734typedef enum eSirMacHTMIMOPowerSaveState
1735{
1736 eSIR_HT_MIMO_PS_STATIC = 0, // Static SM Power Save mode
1737 eSIR_HT_MIMO_PS_DYNAMIC = 1, // Dynamic SM Power Save mode
1738 eSIR_HT_MIMO_PS_NA = 2, // reserved
1739 eSIR_HT_MIMO_PS_NO_LIMIT = 3 // SM Power Save disabled
1740} tSirMacHTMIMOPowerSaveState;
1741
1742
Jeff Johnson295189b2012-06-20 16:38:30 -07001743typedef enum eSirMacHTChannelWidth
1744{
1745 eHT_CHANNEL_WIDTH_20MHZ = 0,
Jeff Johnsone7245742012-09-05 17:12:55 -07001746 eHT_CHANNEL_WIDTH_40MHZ = 1,
1747#ifdef WLAN_FEATURE_11AC
1748 eHT_CHANNEL_WIDTH_80MHZ = 2,
1749#endif
1750 eHT_MAX_CHANNEL_WIDTH
Jeff Johnson295189b2012-06-20 16:38:30 -07001751} tSirMacHTChannelWidth;
1752
1753//Packet struct for HT capability
1754typedef __ani_attr_pre_packed struct sHtCaps {
1755 tANI_U16 advCodingCap: 1;
1756 tANI_U16 supportedChannelWidthSet: 1;
1757 tANI_U16 mimoPowerSave: 2;
1758 tANI_U16 greenField: 1;
1759 tANI_U16 shortGI20MHz: 1;
1760 tANI_U16 shortGI40MHz: 1;
1761 tANI_U16 txSTBC: 1;
1762 tANI_U16 rxSTBC: 2;
1763 tANI_U16 delayedBA: 1;
1764 tANI_U16 maximalAMSDUsize: 1;
1765 tANI_U16 dsssCckMode40MHz: 1;
1766 tANI_U16 psmp: 1;
1767 tANI_U16 stbcControlFrame: 1;
1768 tANI_U16 lsigTXOPProtection: 1;
1769 tANI_U8 maxRxAMPDUFactor: 2;
1770 tANI_U8 mpduDensity: 3;
1771 tANI_U8 reserved1: 3;
1772 tANI_U8 supportedMCSSet[16];
1773 tANI_U16 pco: 1;
1774 tANI_U16 transitionTime: 2;
1775 tANI_U16 reserved2: 5;
1776 tANI_U16 mcsFeedback: 2;
1777 tANI_U16 reserved3: 6;
1778 tANI_U32 txBF: 1;
1779 tANI_U32 rxStaggeredSounding: 1;
1780 tANI_U32 txStaggeredSounding: 1;
1781 tANI_U32 rxZLF: 1;
1782 tANI_U32 txZLF: 1;
1783 tANI_U32 implicitTxBF: 1;
1784 tANI_U32 calibration: 2;
1785 tANI_U32 explicitCSITxBF: 1;
1786 tANI_U32 explicitUncompressedSteeringMatrix: 1;
1787 tANI_U32 explicitBFCSIFeedback: 3;
1788 tANI_U32 explicitUncompressedSteeringMatrixFeedback: 3;
1789 tANI_U32 explicitCompressedSteeringMatrixFeedback: 3;
1790 tANI_U32 csiNumBFAntennae: 2;
1791 tANI_U32 uncompressedSteeringMatrixBFAntennae: 2;
1792 tANI_U32 compressedSteeringMatrixBFAntennae: 2;
1793 tANI_U32 reserved4: 7;
1794 tANI_U8 antennaSelection: 1;
1795 tANI_U8 explicitCSIFeedbackTx: 1;
1796 tANI_U8 antennaIndicesFeedbackTx: 1;
1797 tANI_U8 explicitCSIFeedback: 1;
1798 tANI_U8 antennaIndicesFeedback: 1;
1799 tANI_U8 rxAS: 1;
1800 tANI_U8 txSoundingPPDUs: 1;
1801 tANI_U8 reserved5: 1;
1802
1803} __ani_attr_packed tHtCaps;
1804
1805/* During 11h channel switch, the AP can indicate if the
1806 * STA needs to stop the transmission or continue until the
1807 * channel-switch.
1808 * eSIR_CHANSW_MODE_NORMAL - STA can continue transmission
1809 * eSIR_CHANSW_MODE_SILENT - STA should stop transmission
1810 */
1811typedef enum eSirMacChanSwMode
1812{
1813 eSIR_CHANSW_MODE_NORMAL = 0,
1814 eSIR_CHANSW_MODE_SILENT = 1
1815} tSirMacChanSwitchMode;
1816
1817
1818typedef __ani_attr_pre_packed struct _BarControl {
1819
1820#ifndef ANI_BIG_BYTE_ENDIAN
1821
1822 tANI_U16 barAckPolicy:1;
1823 tANI_U16 multiTID:1;
1824 tANI_U16 bitMap:1;
1825 tANI_U16 rsvd:9;
1826 tANI_U16 numTID:4;
1827
1828#else
1829 tANI_U16 numTID:4;
1830 tANI_U16 rsvd:9;
1831 tANI_U16 bitMap:1;
1832 tANI_U16 multiTID:1;
1833 tANI_U16 barAckPolicy:1;
1834
1835#endif
1836
1837}__ani_attr_packed barCtrlType;
1838
1839typedef __ani_attr_pre_packed struct _BARFrmStruct {
1840 tSirMacFrameCtl fc;
1841 tANI_U16 duration;
1842 tSirMacAddr rxAddr;
1843 tSirMacAddr txAddr;
1844 barCtrlType barControl;
1845 tSirMacSeqCtl ssnCtrl;
1846}__ani_attr_packed BARFrmType;
1847
1848
1849#if 0
1850// Typedef for HT Capability IE
1851// Typedef for HT Capability Info Field
1852#define SUPPORT_ADVANCE_CODING_1 1
1853#define NOT_SUPPORT_ADVANCE_CODING_0 0
1854#define SUPPORT_CHANNEL_WIDTH_SET_20_40_MHZ 1
1855#define NOT_SUPPORT_CHANNEL_WIDTH_SET_20_MHZ_ONLY 0
1856#define DO_NOT_SEND_MIMO_SEQ_STATIC_POWER_SAVE 0
1857#define RTS_PRECEDE_MIMO_SEQ_DYN_POWER_SAVE 1
1858#define MIMO_POWER_SAVE_NA 2
1859#define NO_LIMIT_ON_MIMO_SEQ 3
1860#define DEVICE_IS_ABLE_TO_RCVE_PPDU_WITH_GF_PREAMBLE 1
1861#define DEVICE_NOT_ABLE_TO_RCVE_PPDU_WITH_GF_PREAMBLE 0
1862#define SUPPORT_SHORT_GI_FOR_20_MHZ 1
1863#define NOT_SUPPORT_SHORT_GI_FOR_20_MHZ 0
1864#define SUPPORT_SHORT_GI_FOR_40_MHZ 1
1865#define NOT_SUPPORT_SHORT_GI_FOR_40_MHZ 0
1866#define TRANSMITTER_SUPPORT_STBC 1
1867#define TRANSMITTER_NOT_SUPPORT_STBC 0
1868#define RX_NOT_SUPPORT_STBC 0
1869#define RX_SUPPORT_STBC_ONE_SPATIAL_STREAM 1
1870#define RX_SUPPORT_STBC_ONE_AND_TWO_SPATIAL_STREAM 2
1871#define RX_SUPPORT_STBC_ONE_TWO_THREE_SPATIAL_STREAM 3
1872#define SUPPORT_DELAYED_BA 1
1873#define NOT_SUPPORT_DELAYED_BA 0
1874#define RECEIVER_MAX_A_MSDU_SIZE_7935 1
1875#define RECEIVER_MAX_A_MSDU_SIZE_3839 0
1876#define BSS_OR_DEVICE_ALLOW_USE_DSSS_CCK 1
1877#define BSS_OR_DEVICE_NOT_ALLOW_USE_DSSS_CCK 0
1878#define BSS_OR_DEVICE_SUPPORT_USE_PSMP 1
1879#define BSS_OR_DEVICE_NOT_SUPPORT_USE_PSMP 0
1880#define BSS_OR_DEVICE_SUPPORT_USE_STBC_CONTROL_FRAME 1
1881#define BSS_OR_DEVICE_NOT_SUPPORT_USE_STBC_CONTROL_FRAME 0
1882#define SUPPORT_L_SIG_TXOP_PROTECTION 1
1883#define NOT_SUPPORT_L_SIG_TXOP_PROTECTION 0
1884
1885// Typedef for HT Parameters Info Field
1886#define MAX_RX_AMPDU_FACTOR_0 0
1887#define MAX_RX_AMPDU_FACTOR_1 1
1888#define MAX_RX_AMPDU_FACTOR_2 2
1889#define MAX_RX_AMPDU_FACTOR_3 3
1890#define MPDU_DENSITY_NO_RESTRICTION 0
1891#define MPDU_DENSITY_ONE_EIGHTH_USECOND 1
1892#define MPDU_DENSITY_ONE_FOURTH_USECOND 2
1893#define MPDU_DENSITY_ONE_HALF_USECOND 3
1894#define MPDU_DENSITY_ONE_USECOND 4
1895#define MPDU_DENSITY_TWO_USECOND 5
1896#define MPDU_DENSITY_FOUR_USECOND 6
1897#define MPDU_DENSITY_EIGHT_USECOND 7
1898#endif
1899
1900// Supported MCS set
1901#define SIZE_OF_SUPPORTED_MCS_SET 16
1902#define SIZE_OF_BASIC_MCS_SET 16
1903#define VALID_MCS_SIZE 77 //0-76
1904#define MCS_RX_HIGHEST_SUPPORTED_RATE_BYTE_OFFSET 10
1905// This is not clear, Count 8 based from NV supported MCS count
1906#define VALID_MAX_MCS_INDEX 8
1907
1908#if 0
1909// Typedef Extended HT Capability Info Field
1910#define SUPPORT_PCO 1
1911#define NOT_SUPPORT_PCO 0
1912#define TRANSITION_TIME_0 0
1913#define STA_DOES_NOT_PROVIDE_MCS_FEEDBACK 0
1914#define RESERVE_VALUE_FOR_STA_MCS_FEEDBACK 1
1915#define STA_PROVIDE_UNSOLICITED_MCS_FEEDBACK 2
1916#define STA_PROVIDE_ON_MRQ_AND_UNSOLICITED_MCS_FEEDBACK 3
1917
1918// Typedef Transmit Beamforming Capability
1919#define TX_BEAMFORMING_CAPABLE 1
1920#define TX_BEAMFORMING_INCAPABLE 0
1921#define CAPABLE_RECEIVE_STAGGERED_SOUNDING 1
1922#define NOT_CAPABLE_RECEIVE_STAGGERED_SOUNDING 0
1923#define CAPABLE_TRANSMIT_STAGGERED_SOUNDING 1
1924#define NOT_CAPABLE_TRANSMIT_STAGGERED_SOUNDING 0
1925#define CAPABLE_RECEIVE_ZLF 1
1926#define NOT_CAPABLE_RECEIVE_ZLF 0
1927#define CAPABLE_TRANSMIT_ZLF 1
1928#define NOT_CAPABLE_TRANSMIT_ZLF 0
1929#define CAPABLE_IMPLICIT_TXBF 1
1930#define NOT_CAPABLE_IMPLICIT_TXBF 0
1931#define INCAPABLE_CALIBRATION 0
1932#define LIMITED_CALIBRATION_CANNOT_INITIATE 1
1933#define LIMITED_CALIBRATION_CAN_INITIATE 2
1934#define FULLT_CAPABLE_CALIBRATION 3
1935#define CAPABLE_EXPLICIT_CSI_TXBF 1
1936#define INCAPABLE_EXPLICIT_CSI_TXBF 0
1937#define CAPABLE_EXPLICIT_UNCOMPRESSED_STEERING_MATRIX 1
1938#define INCAPABLE_EXPLICIT_UNCOMPRESSED_STEERING_MATRIX 0
1939#define INCAPABLE_EXPLICIT_BFCI_FEEDBACK 0
1940#define CAPABLE_UNSOLICITED_BFCI_FEEDBACK 1
1941#define CAPABLE_IMMEDIATE_BFCI_FEEDBACK 2
1942#define CAPABLE_AGGREGATE_BFCI_FEEDBACK 4
1943#define INCAPABLE_EXPLICIT_UNCOMPRESSED_STEERING_MATRIX_FEEDBAC 0
1944#define CAPABLE_UNSOLICITED_UNCOMPRESSED_STEERING_MATRIX 1
1945#define CAPABLE_IMMEDIATE_UNCOMPRESSED_STEERING_MATRIX 2
1946#define CAPABLE_AGGREGATED_UNCOMPRESSED_STEERING_MATRIX 4
1947#define INCAPABLE_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBAC 0
1948#define CAPABLE_UNSOLICITED_COMPRESSED_STEERING_MATRIX 1
1949#define CAPABLE_IMMEDIATE_COMPRESSED_STEERING_MATRIX 2
1950#define CAPABLE_AGGREGATED_COMPRESSED_STEERING_MATRIX 4
1951#define SUPPORT_CSI_BEAMFORMING_SINGLE_TX_ANTENNA_SOUNDING 0
1952#define SUPPORT_CSI_BEAMFORMING_2_TX_ANTENNA_SOUNDING 1
1953#define SUPPORT_CSI_BEAMFORMING_3_TX_ANTENNA_SOUNDING 2
1954#define SUPPORT_CSI_BEAMFORMING_4_TX_ANTENNA_SOUNDING 3
1955#define SUPPORT_UNCOMPRESSED_STEERING_MATRIX_1_TX_ANTENNA_SOUNDING 0
1956#define SUPPORT_UNCOMPRESSED_STEERING_MATRIX_2_TX_ANTENNA_SOUNDING 1
1957#define SUPPORT_UNCOMPRESSED_STEERING_MATRIX_3_TX_ANTENNA_SOUNDING 2
1958#define SUPPORT_UNCOMPRESSED_STEERING_MATRIX_4_TX_ANTENNA_SOUNDING 3
1959#define SUPPORT_COMPRESSED_STEERING_MATRIX_1_TX_ANTENNA_SOUNDING 0
1960#define SUPPORT_COMPRESSED_STEERING_MATRIX_2_TX_ANTENNA_SOUNDING 1
1961#define SUPPORT_COMPRESSED_STEERING_MATRIX_3_TX_ANTENNA_SOUNDING 2
1962#define SUPPORT_COMPRESSED_STEERING_MATRIX_4_TX_ANTENNA_SOUNDING 3
1963
1964// Typedef Antenna Selection Capability
1965#define CAPABLE_ANTENNA_SELECTION 1
1966#define INCAPABLE_ANTENNA_SELECTION 0
1967#define CAPABLE_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS 1
1968#define INCAPABLE_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS 0
1969#define CAPABLE_ANTENNA_INDICES_FEEDBACK_BASED_TX_AS 1
1970#define INCAPABLE_ANTENNA_INDICES_FEEDBACK_BASED_TX_AS 0
1971#define CAPABLE_EXPLICIT_CSI_FEEDBACK 1
1972#define INCAPABLE_EXPLICIT_CSI_FEEDBACK 0
1973#define CAPABLE_ANTENNA_INDICES_FEEDBACK_BASED_TX_AS 1
1974#define INCAPABLE_ANTENNA_INDICES_FEEDBACK_BASED_TX_AS 0
1975#define CAPABLE_RX_AS 1
1976#define INCAPABLE_RX_AS 0
1977#define CAPABLE_TRANSMIT_SOUNDING_PPDU 1
1978#define INCAPABLE_TRANSMIT_SOUNDING_PPDU 0
1979
1980// Typedef Additional HT Infomation Elements
1981#define CONTROL_CHANNEL_1 1
1982
1983#define OFFSET_NO_EXTENSION_CHANNEL_IS_PRESENT 0
1984#define OFFSET_EXTENSION_CHANNEL_ABOVE_CONTROL_CHANNEL 1
1985#define OFFSET_EXTENSION_CHANNEL_BELOW_CONTROL_CHANNEL 3
1986#define USE_20_MHZ_CONTROL_CHANNEL 0
1987#define USE_ANY_SUPPORTED_CHANNEL_WIDTH 1
1988#define USE_RIFS_MODE_PROHIBITED 0
1989#define USE_RIFS_MODE_PERMITTED 1
1990#define CONTROLLED_ACCESS_NOT_ONLY_PSMP 0
1991#define CONTROLLED_ACCESS_ONLY_PSMP 1
1992#define SERVICE_INTERVAL_GRANULARITY_5MS 0
1993#define SERVICE_INTERVAL_GRANULARITY_10MS 1
1994#define SERVICE_INTERVAL_GRANULARITY_15MS 2
1995#define SERVICE_INTERVAL_GRANULARITY_20MS 3
1996#define SERVICE_INTERVAL_GRANULARITY_25MS 4
1997#define SERVICE_INTERVAL_GRANULARITY_30MS 5
1998#define SERVICE_INTERVAL_GRANULARITY_35MS 6
1999#define SERVICE_INTERVAL_GRANULARITY_40MS 7
2000
2001#define OPERATION_MODE_PURE_NO_PROTECTION 0
2002#define OPERATION_MODE_OPTIONAL_PROTECTION 1
2003#define OPERATION_MODE_NO_LEGACY_STA_40MHZ_PROTECTED 2
2004#define OPERATION_MODE_MIXED_PROTECTION 3
2005
2006#define DUAL_CTS_PROTECTION_IS_USED 1
2007#define REGULAR_RTS_CTS_IS_USED 0
2008#define SECONDARY_BEACON 1
2009#define PRIMARY_BEACON 0
2010#define LSIG_TXOP_PROTECTION_FULL_SUPPORT 1
2011#define LSIG_TXOP_PROTECTION_NOT_FULL_SUPPORT 0
2012#define PCO_IS_ACTIVATED_IN_BSS 1
2013#define PCO_IS_NOT_ACTIVATED_IN_BSS 0
2014#define PCO_PHASE_REQUEST_SWITCH_KEEP_TO_20MHZ 0
2015#define PCO_PHASE_REQUEST_SWITCH_KEEP_TO_40MHZ 1
2016#endif
2017
2018//
2019// The following enums will be used to get the "current" HT Capabilities of
2020// the local STA in a generic fashion. In other words, the following enums
2021// identify the HT capabilities that can be queried or set.
2022//
2023typedef enum eHTCapability
2024{
2025 eHT_LSIG_TXOP_PROTECTION,
2026 eHT_STBC_CONTROL_FRAME,
2027 eHT_PSMP,
2028 eHT_DSSS_CCK_MODE_40MHZ,
2029 eHT_MAX_AMSDU_LENGTH,
2030 eHT_DELAYED_BA,
2031 eHT_RX_STBC,
2032 eHT_TX_STBC,
2033 eHT_SHORT_GI_40MHZ,
2034 eHT_SHORT_GI_20MHZ,
2035 eHT_GREENFIELD,
2036 eHT_MIMO_POWER_SAVE,
2037 eHT_SUPPORTED_CHANNEL_WIDTH_SET,
2038 eHT_ADVANCED_CODING,
2039 eHT_MAX_RX_AMPDU_FACTOR,
2040 eHT_MPDU_DENSITY,
2041 eHT_PCO,
2042 eHT_TRANSITION_TIME,
2043 eHT_MCS_FEEDBACK,
2044 eHT_TX_BEAMFORMING,
2045 eHT_ANTENNA_SELECTION,
2046 // The following come under Additional HT Capabilities
2047 eHT_SI_GRANULARITY,
2048 eHT_CONTROLLED_ACCESS,
2049 eHT_RIFS_MODE,
2050 eHT_RECOMMENDED_TX_WIDTH_SET,
2051 eHT_EXTENSION_CHANNEL_OFFSET,
2052 eHT_OP_MODE,
2053 eHT_BASIC_STBC_MCS,
2054 eHT_DUAL_CTS_PROTECTION,
2055 eHT_LSIG_TXOP_PROTECTION_FULL_SUPPORT,
2056 eHT_PCO_ACTIVE,
2057 eHT_PCO_PHASE
2058} tHTCapability;
2059
2060// HT Capabilities Info
2061typedef __ani_attr_pre_packed struct sSirMacHTCapabilityInfo
2062{
2063#ifndef ANI_LITTLE_BIT_ENDIAN
2064 tANI_U16 lsigTXOPProtection:1; // Dynamic state
2065 tANI_U16 stbcControlFrame:1; // Static via CFG
2066 tANI_U16 psmp:1; // Static via CFG
2067 tANI_U16 dsssCckMode40MHz:1; // Static via CFG
2068 tANI_U16 maximalAMSDUsize:1; // Static via CFG
2069 tANI_U16 delayedBA:1; // Static via CFG
2070 tANI_U16 rxSTBC:2; // Static via CFG
2071 tANI_U16 txSTBC:1; // Static via CFG
2072 tANI_U16 shortGI40MHz:1; // Static via CFG
2073 tANI_U16 shortGI20MHz:1; // Static via CFG
2074 tANI_U16 greenField:1; // Static via CFG
2075 tANI_U16 mimoPowerSave:2; // Dynamic state
2076 tANI_U16 supportedChannelWidthSet:1; // Static via CFG
2077 tANI_U16 advCodingCap:1; // Static via CFG
2078#else
2079 tANI_U16 advCodingCap:1;
2080 tANI_U16 supportedChannelWidthSet:1;
2081 tANI_U16 mimoPowerSave:2;
2082 tANI_U16 greenField:1;
2083 tANI_U16 shortGI20MHz:1;
2084 tANI_U16 shortGI40MHz:1;
2085 tANI_U16 txSTBC:1;
2086 tANI_U16 rxSTBC:2;
2087 tANI_U16 delayedBA:1;
2088 tANI_U16 maximalAMSDUsize:1;
2089 tANI_U16 dsssCckMode40MHz:1;
2090 tANI_U16 psmp:1;
2091 tANI_U16 stbcControlFrame:1;
2092 tANI_U16 lsigTXOPProtection:1;
2093#endif
2094} __ani_attr_packed tSirMacHTCapabilityInfo;
2095
2096// HT Parameters Info
2097typedef __ani_attr_pre_packed struct sSirMacHTParametersInfo
2098{
2099#ifndef ANI_LITTLE_BIT_ENDIAN
2100 tANI_U8 reserved:3;
2101 tANI_U8 mpduDensity:3; // Dynamic state
2102 tANI_U8 maxRxAMPDUFactor:2; // Dynamic state
2103#else
2104 tANI_U8 maxRxAMPDUFactor:2;
2105 tANI_U8 mpduDensity:3;
2106 tANI_U8 reserved:3;
2107#endif
2108} __ani_attr_packed tSirMacHTParametersInfo;
2109
2110// Extended HT Capabilities Info
2111typedef __ani_attr_pre_packed struct sSirMacExtendedHTCapabilityInfo
2112{
2113#ifndef ANI_LITTLE_BIT_ENDIAN
2114 tANI_U16 reserved2:6;
2115 tANI_U16 mcsFeedback:2; // Static via CFG
2116 tANI_U16 reserved1:5;
2117 tANI_U16 transitionTime:2; // Static via CFG
2118 tANI_U16 pco:1; // Static via CFG
2119#else
2120 tANI_U16 pco:1;
2121 tANI_U16 transitionTime:2;
2122 tANI_U16 reserved1:5;
2123 tANI_U16 mcsFeedback:2;
2124 tANI_U16 reserved2:6;
2125#endif
2126} __ani_attr_packed tSirMacExtendedHTCapabilityInfo;
2127
2128//IEEE 802.11n/D7.0 - 7.3.2.57.4
2129//Part of the "supported MCS set field"
2130typedef __ani_attr_pre_packed struct sSirMacRxHighestSupportRate
2131{
2132#ifndef ANI_LITTLE_BIT_ENDIAN
2133 tANI_U16 reserved : 6;
2134 tANI_U16 rate : 10;
2135#else
2136 tANI_U16 rate : 10;
2137 tANI_U16 reserved : 6;
2138#endif
2139} __ani_attr_packed tSirMacRxHighestSupportRate, *tpSirMacRxHighestSupportRate;
2140
2141
2142// Transmit Beam Forming Capabilities Info
2143typedef __ani_attr_pre_packed struct sSirMacTxBFCapabilityInfo
2144{
2145#ifndef ANI_LITTLE_BIT_ENDIAN
2146 tANI_U32 reserved:7;
2147 tANI_U32 compressedSteeringMatrixBFAntennae:2; // Static via CFG
2148 tANI_U32 uncompressedSteeringMatrixBFAntennae:2; // Static via CFG
2149 tANI_U32 csiNumBFAntennae:2; // Static via CFG
2150 tANI_U32 explicitCompressedSteeringMatrixFeedback:3; // Static via CFG
2151 tANI_U32 explicitUncompressedSteeringMatrixFeedback:3; // Static via CFG
2152 tANI_U32 explicitBFCSIFeedback:3; // Static via CFG
2153 tANI_U32 explicitUncompressedSteeringMatrix:1; // Static via CFG
2154 tANI_U32 explicitCSITxBF:1; // Static via CFG
2155 tANI_U32 calibration:2; // Static via CFG
2156 tANI_U32 implicitTxBF:1; // Static via CFG
2157 tANI_U32 txZLF:1; // Static via CFG
2158 tANI_U32 rxZLF:1; // Static via CFG
2159 tANI_U32 txStaggeredSounding:1; // Static via CFG
2160 tANI_U32 rxStaggeredSounding:1; // Static via CFG
2161 tANI_U32 txBF:1; // Static via CFG
2162#else
2163 tANI_U32 txBF:1;
2164 tANI_U32 rxStaggeredSounding:1;
2165 tANI_U32 txStaggeredSounding:1;
2166 tANI_U32 rxZLF:1;
2167 tANI_U32 txZLF:1;
2168 tANI_U32 implicitTxBF:1;
2169 tANI_U32 calibration:2;
2170 tANI_U32 explicitCSITxBF:1;
2171 tANI_U32 explicitUncompressedSteeringMatrix:1;
2172 tANI_U32 explicitBFCSIFeedback:3;
2173 tANI_U32 explicitUncompressedSteeringMatrixFeedback:3;
2174 tANI_U32 explicitCompressedSteeringMatrixFeedback:3;
2175 tANI_U32 csiNumBFAntennae:2;
2176 tANI_U32 uncompressedSteeringMatrixBFAntennae:2;
2177 tANI_U32 compressedSteeringMatrixBFAntennae:2;
2178 tANI_U32 reserved:7;
2179#endif
2180} __ani_attr_packed tSirMacTxBFCapabilityInfo;
2181
2182// Antenna Selection Capability Info
2183typedef __ani_attr_pre_packed struct sSirMacASCapabilityInfo
2184{
2185#ifndef ANI_LITTLE_BIT_ENDIAN
2186 tANI_U8 reserved2:1;
2187 tANI_U8 txSoundingPPDUs:1; // Static via CFG
2188 tANI_U8 rxAS:1; // Static via CFG
2189 tANI_U8 antennaIndicesFeedback:1; // Static via CFG
2190 tANI_U8 explicitCSIFeedback:1; // Static via CFG
2191 tANI_U8 antennaIndicesFeedbackTx:1; // Static via CFG
2192 tANI_U8 explicitCSIFeedbackTx:1; // Static via CFG
2193 tANI_U8 antennaSelection:1; // Static via CFG
2194#else
2195 tANI_U8 antennaSelection:1;
2196 tANI_U8 explicitCSIFeedbackTx:1;
2197 tANI_U8 antennaIndicesFeedbackTx:1;
2198 tANI_U8 explicitCSIFeedback:1;
2199 tANI_U8 antennaIndicesFeedback:1;
2200 tANI_U8 rxAS:1;
2201 tANI_U8 txSoundingPPDUs:1;
2202 tANI_U8 reserved2:1;
2203#endif
2204} __ani_attr_packed tSirMacASCapabilityInfo;
2205
2206// Additional HT IE Field1
2207typedef __ani_attr_pre_packed struct sSirMacHTInfoField1
2208{
2209#ifndef ANI_LITTLE_BIT_ENDIAN
2210 tANI_U8 serviceIntervalGranularity:3; // Dynamic state
2211 tANI_U8 controlledAccessOnly:1; // Static via CFG
2212 tANI_U8 rifsMode:1; // Dynamic state
2213 tANI_U8 recommendedTxWidthSet:1; // Dynamic state
2214 tANI_U8 secondaryChannelOffset:2; // Dynamic state
2215#else
2216 tANI_U8 secondaryChannelOffset:2;
2217 tANI_U8 recommendedTxWidthSet:1;
2218 tANI_U8 rifsMode:1;
2219 tANI_U8 controlledAccessOnly:1;
2220 tANI_U8 serviceIntervalGranularity:3;
2221#endif
2222} __ani_attr_packed tSirMacHTInfoField1;
2223
2224// Additional HT IE Field2
2225typedef __ani_attr_pre_packed struct sSirMacHTInfoField2
2226{
2227#ifndef ANI_LITTLE_BIT_ENDIAN
2228 tANI_U16 reserved:11;
2229 tANI_U16 obssNonHTStaPresent:1; /*added for Obss */
2230 tANI_U16 transmitBurstLimit: 1;
2231 tANI_U16 nonGFDevicesPresent:1;
2232 tANI_U16 opMode:2; // Dynamic state
2233#else
2234 tANI_U16 opMode:2;
2235 tANI_U16 nonGFDevicesPresent:1;
2236 tANI_U16 transmitBurstLimit: 1;
2237 tANI_U16 obssNonHTStaPresent:1; /*added for Obss */
2238 tANI_U16 reserved:11;
2239#endif
2240} __ani_attr_packed tSirMacHTInfoField2;
2241
2242// Additional HT IE Field3
2243typedef __ani_attr_pre_packed struct sSirMacHTInfoField3
2244{
2245#ifndef ANI_LITTLE_BIT_ENDIAN
2246 tANI_U16 reserved:4;
2247 tANI_U16 pcoPhase:1; // Dynamic state
2248 tANI_U16 pcoActive:1; // Dynamic state
2249 tANI_U16 lsigTXOPProtectionFullSupport:1; // Dynamic state
2250 tANI_U16 secondaryBeacon:1; // Dynamic state
2251 tANI_U16 dualCTSProtection:1; // Dynamic state
2252 tANI_U16 basicSTBCMCS:7; // Dynamic state
2253#else
2254 tANI_U16 basicSTBCMCS:7;
2255 tANI_U16 dualCTSProtection:1;
2256 tANI_U16 secondaryBeacon:1;
2257 tANI_U16 lsigTXOPProtectionFullSupport:1;
2258 tANI_U16 pcoActive:1;
2259 tANI_U16 pcoPhase:1;
2260 tANI_U16 reserved:4;
2261#endif
2262} __ani_attr_packed tSirMacHTInfoField3;
2263
2264typedef __ani_attr_pre_packed struct sSirMacProbeReqFrame
2265{
2266 tSirMacSSidIE ssIdIE;
2267 tSirMacRateSetIE rateSetIE;
2268 tSirMacRateSetIE extendedRateSetIE;
2269} __ani_attr_packed tSirMacProbeReqFrame, *tpSirMacProbeReqFrame;
2270
2271typedef __ani_attr_pre_packed struct sSirMacProbeRspFrame
2272{
2273 tSirMacTimeStamp ts;
2274 tSirMacBeaconInterval beaconInterval;
2275 tSirMacCapabilityInfo capabilityInfo;
2276 tSirMacSSidIE ssIdIE;
2277 tSirMacRateSetIE rateSetIE;
2278 tSirMacRateSetIE extendedRateSetIE;
2279 tSirMacNonErpPresentIE nonErpPresent;
2280 tSirMacDsParamSetIE dsParamsIE;
2281 tSirMacCfParamSetIE cfParamsIE;
2282} __ani_attr_packed tSirMacProbeRspFrame, *tpSirMacProbeRspFrame;
2283
2284typedef __ani_attr_pre_packed struct sSirMacAuthFrameBody
2285{
2286 tANI_U16 authAlgoNumber;
2287 tANI_U16 authTransactionSeqNumber;
2288 tANI_U16 authStatusCode;
2289 tANI_U8 type; // = SIR_MAC_CHALLENGE_TEXT_EID
2290 tANI_U8 length; // = SIR_MAC_AUTH_CHALLENGE_LENGTH
2291 tANI_U8 challengeText[SIR_MAC_AUTH_CHALLENGE_LENGTH];
2292} __ani_attr_packed tSirMacAuthFrameBody, *tpSirMacAuthFrameBody;
2293
2294typedef __ani_attr_pre_packed struct sSirMacAuthenticationFrame
2295{
2296 tSirMacAuthFrameBody authFrameBody;
2297} __ani_attr_packed tSirMacAuthFrame, *tpSirMacAuthFrame;
2298
2299typedef __ani_attr_pre_packed struct sSirMacAssocReqFrame
2300{
2301 tSirMacCapabilityInfo capabilityInfo;
2302 tANI_U16 listenInterval;
2303 tSirMacSSidIE ssIdIE;
2304 tSirMacRateSetIE rateSetIE;
2305 tSirMacRateSetIE extendedRateSetIE;
2306} __ani_attr_packed tSirMacAssocReqFrame, *tpSirMacAssocReqFrame;
2307
2308typedef __ani_attr_pre_packed struct sSirMacAssocRspFrame
2309{
2310 tSirMacCapabilityInfo capabilityInfo;
2311 tANI_U16 statusCode;
2312 tANI_U16 aid;
2313 tSirMacRateSetIE supportedRates;
2314 tSirMacRateSetIE extendedRateSetIE;
2315} __ani_attr_packed tSirMacAssocRspFrame, *tpSirMacAssocRspFrame;
2316
2317typedef __ani_attr_pre_packed struct sSirMacDisassocFrame
2318{
2319 tANI_U16 reasonCode;
2320} __ani_attr_packed tSirMacDisassocFrame, *tpSirMacDisassocFrame;
2321
2322typedef __ani_attr_pre_packed struct sDSirMacDeauthFrame
2323{
2324 tANI_U16 reasonCode;
2325} __ani_attr_packed tSirMacDeauthFrame, *tpSirMacDeauthFrame;
2326
2327/// Common header for all action frames
2328typedef __ani_attr_pre_packed struct sSirMacActionFrameHdr
2329{
2330 tANI_U8 category;
2331 tANI_U8 actionID;
2332} __ani_attr_packed tSirMacActionFrameHdr, *tpSirMacActionFrameHdr;
2333
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002334#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
2335typedef __ani_attr_pre_packed struct sSirMacVendorSpecificFrameHdr
2336{
2337 tANI_U8 category;
2338 tANI_U8 Oui[4];
2339} __ani_attr_packed tSirMacVendorSpecificFrameHdr, *tpSirMacVendorSpecificFrameHdr;
2340#endif
2341
Jeff Johnson295189b2012-06-20 16:38:30 -07002342typedef __ani_attr_pre_packed struct sSirMacVendorSpecificPublicActionFrameHdr
2343{
2344 tANI_U8 category;
2345 tANI_U8 actionID;
2346 tANI_U8 Oui[4];
2347 tANI_U8 OuiSubType;
2348 tANI_U8 dialogToken;
2349} __ani_attr_packed tSirMacVendorSpecificPublicActionFrameHdr, *tpSirMacVendorSpecificPublicActionFrameHdr;
2350
2351typedef __ani_attr_pre_packed struct sSirMacP2PActionFrameHdr
2352{
2353 tANI_U8 category;
2354 tANI_U8 Oui[4];
2355 tANI_U8 OuiSubType;
2356 tANI_U8 dialogToken;
2357} __ani_attr_packed tSirMacP2PActionFrameHdr, *tpSirMacP2PActionFrameHdr;
2358
2359
Jeff Johnson295189b2012-06-20 16:38:30 -07002360
2361typedef struct sSirMacMeasActionFrameHdr
2362{
2363 tANI_U8 category;
2364 tANI_U8 actionID;
2365 tANI_U8 dialogToken;
2366} tSirMacMeasActionFrameHdr, *tpSirMacMeasActionFrameHdr;
2367
2368
2369#ifdef ANI_SUPPORT_11H
2370typedef struct sSirMacTpcReqActionFrame
2371{
2372 tSirMacMeasActionFrameHdr actionHeader;
2373 tANI_U8 type;
2374 tANI_U8 length;
2375} tSirMacTpcReqActionFrame, *tpSirMacTpcReqActionFrame;
2376
2377typedef struct sSirMacMeasReqActionFrame
2378{
2379 tSirMacMeasActionFrameHdr actionHeader;
2380 tSirMacMeasReqIE measReqIE;
2381} tSirMacMeasReqActionFrame, *tpSirMacMeasReqActionFrame;
2382#endif
2383
2384typedef struct sSirMacBasicMeasReportActionFrame
2385{
2386 tSirMacMeasActionFrameHdr actionHeader;
2387 tSirMacBasicReportIE measReportIE;
2388} tSirMacBasicMeasReportActionFrame, *tpSirMacBasicMeasReportActionFrame;
2389
2390typedef struct sSirMacCcaMeasReportActionFrame
2391{
2392 tSirMacMeasActionFrameHdr actionHeader;
2393 tSirMacCcaReportIE measReportIE;
2394} tSirMacCcaMeasReportActionFrame, *tpSirMacCcaMeasReportActionFrame;
2395
2396typedef struct sSirMacRpiMeasReportActionFrame
2397{
2398 tSirMacMeasActionFrameHdr actionHeader;
2399 tSirMacRpiReportIE measReportIE;
2400} tSirMacRpiMeasReportActionFrame, *tpSirMacRpiMeasReportActionFrame;
2401
2402#if defined WLAN_FEATURE_VOWIFI
2403
2404typedef struct sSirMacNeighborReportReq
2405{
2406 tANI_U8 dialogToken;
2407 tANI_U8 ssid_present;
2408 tSirMacSSid ssid;
2409} tSirMacNeighborReportReq, *tpSirMacNeighborReportReq;
2410
2411typedef struct sSirMacLinkReport
2412{
2413 tANI_U8 dialogToken;
2414 tANI_U8 txPower;
2415 tANI_U8 rxAntenna;
2416 tANI_U8 txAntenna;
2417 tANI_U8 rcpi;
2418 tANI_U8 rsni;
2419} tSirMacLinkReport, *tpSirMacLinkReport;
2420
2421#define BEACON_REPORT_MAX_IES 224 //Refer IEEE 802.11k-2008, Table 7-31d
2422typedef struct sSirMacBeaconReport
2423{
2424 tANI_U8 regClass;
2425 tANI_U8 channel;
2426 tANI_U8 measStartTime[8];
2427 tANI_U8 measDuration;
2428 tANI_U8 phyType;
2429 tANI_U8 bcnProbeRsp;
2430 tANI_U8 rsni;
2431 tANI_U8 rcpi;
2432 tSirMacAddr bssid;
2433 tANI_U8 antennaId;
2434 tANI_U32 parentTSF;
2435 tANI_U8 numIes;
2436 tANI_U8 Ies[BEACON_REPORT_MAX_IES];
2437
2438} tSirMacBeaconReport, *tpSirMacBeaconReport;
2439
2440#define RADIO_REPORTS_MAX_IN_A_FRAME 4
2441typedef struct sSirMacRadioMeasureReport
2442{
2443 tANI_U8 token;
2444 tANI_U8 refused;
2445 tANI_U8 incapable;
2446 tANI_U8 type;
2447 union
2448 {
2449 tSirMacBeaconReport beaconReport;
2450 }report;
2451
2452}tSirMacRadioMeasureReport, *tpSirMacRadioMeasureReport;
2453
2454#endif
2455
2456// QOS action frame definitions
2457
2458// max number of possible tclas elements in any frame
2459#define SIR_MAC_TCLASIE_MAXNUM 2
2460
2461// ADDTS request
2462typedef __ani_attr_pre_packed struct sSirMacQosAddtsReqAF
2463{
2464 tSirMacActionFrameHdr afHdr;
2465 tANI_U8 dlgToken;
2466 tSirMacTspecIE tspec;
2467 tANI_U8 tclas[1]; // variable length element
2468} __ani_attr_packed tSirMacQosAddtsReqAF;
2469
2470// ADDTS response
2471typedef __ani_attr_pre_packed struct sSirMacQosAddtsRspAF
2472{
2473 tSirMacActionFrameHdr afHdr;
2474 tANI_U8 dlgToken;
2475 tSirMacStatusCodes status;
2476 tSirMacTsDelayIE delay;
2477 tSirMacTspecIE tspec;
2478 tANI_U8 tclas[1];
2479} __ani_attr_packed tSirMacQosAddtsRspAF;
2480
2481// DELTS frame
2482typedef __ani_attr_pre_packed struct sSirMacQosDeltsAF
2483{
2484 tSirMacActionFrameHdr afHdr;
2485 tSirMacTSInfo tsinfo;
2486} __ani_attr_packed tSirMacQosDeltsAF;
2487
2488// Schedule frame
2489typedef __ani_attr_pre_packed struct sSirMacQosScheduleAF
2490{
2491 tSirMacActionFrameHdr afHdr;
2492 tSirMacScheduleIE schedule;
2493} __ani_attr_packed tSirMacQosScheduleAF;
2494
2495// DLP action frame definitions
2496
2497// DLP request
2498typedef __ani_attr_pre_packed struct sSirMacQosDlpReqAF
2499{
2500 tSirMacActionFrameHdr afHdr;
2501 tANI_U8 dstMAC[6];
2502 tANI_U8 srcMAC[6];
2503 tSirMacQosCapabilityIE qosCapability;
2504 tANI_U16 dlpTimeout;
2505 tSirMacRateSetIE supportedRates;
2506} __ani_attr_packed tSirMacQosDlpReqAF;
2507
2508// DLP response
2509typedef __ani_attr_pre_packed struct sSirMacQosDlpRspAF
2510{
2511 tSirMacActionFrameHdr afHdr;
2512 tANI_U8 dstMAC[6];
2513 tANI_U8 srcMAC[6];
2514 tSirMacStatusCodes status;
2515 tSirMacQosCapabilityIE qosCapability;
2516 tSirMacRateSetIE supportedRates;
2517} __ani_attr_packed tSirMacQosDlpRspAF;
2518
2519// DLP teardown
2520typedef __ani_attr_pre_packed struct sSirMacQosDlpTdnAF
2521{
2522 tSirMacActionFrameHdr afHdr;
2523 tANI_U8 dstMAC[6];
2524 tANI_U8 srcMAC[6];
2525} __ani_attr_packed tSirMacQosDlpTdnAF;
2526
2527
2528
2529
2530//
2531/// Common header for all ANI proprietary action frames
2532typedef __ani_attr_pre_packed struct sSirMacAniActionFrame
2533{
2534 tSirMacActionFrameHdr afHdr;
2535 tANI_U8 aniOui[3]; // 00 0A F5
2536 tANI_U8 type; // 0 - request; 1 - report; 2 - snr
2537} __ani_attr_packed tSirMacAniActionFrame, *tpSirMacAniActionFrame;
2538
2539
2540typedef __ani_attr_pre_packed struct sSirMacLinkTestReqData
2541{
2542 tSirMacAniActionFrame hdr;
2543 tANI_U8 frameStatus; // bit0 - first frame
2544 // bit1 - last frame;
2545 // if both bit0/1 are on,
2546 // intermediate frame
2547 // bit2-7 - reserved
2548 tANI_U8 rate;
2549 tANI_U8 randomData[SIR_MAC_MAX_RANDOM_LENGTH];
2550} __ani_attr_packed tSirMacLinkTestReqData, *tpSirMacLinkTestReqData;
2551
2552/// SNR report specific fields
2553typedef __ani_attr_pre_packed struct sSirMacSnrReport
2554{
2555 tSirMacAniActionFrame hdr;
2556 tANI_U32 numSamples;
2557 tANI_U32 snr;
2558 tANI_U32 snrComp;
2559 tANI_U32 sq;
2560 tANI_U32 rssi;
2561} __ani_attr_packed tSirMacSnrReport, *tpSirMacSnrReport;
2562
2563typedef __ani_attr_pre_packed struct sSirMacStaCbLegacyBssDetect
2564{
2565 tSirMacAniActionFrame hdr;
2566 tANI_U8 channelNum;
2567 tANI_U8 numLegacyBssid;
2568 /* Below is declared as a place holder. Don't add anything after it since LegacyBssidList will take up memory after it */
2569 tANI_U8 LegacyBssidList[1]; /* Need to declare size 1 cause win build doesn't like size 0 */
2570} __ani_attr_packed tSirMacStaCbLegacyBssDetect, *tpSirMacStaCbLegacyBssDetect;
2571
2572typedef __ani_attr_pre_packed struct sSirMacQoSDefBAReq
2573{
2574 tSirMacActionFrameHdr hdr;
2575
2576 tANI_U8 rsvd1;
2577
2578#ifdef ANI_LITTLE_BIT_ENDIAN
2579 tANI_U8 tid: 4;
2580 tANI_U8 rsvd2: 4;
2581#else
2582 tANI_U8 rsvd2: 4;
2583 tANI_U8 tid: 4;
2584#endif
2585} __ani_attr_packed tSirMacQoSDefBAReq, *tpSirMacQoSDefBAReq;
2586
2587typedef __ani_attr_pre_packed struct sSirMacQoSDefBARsp
2588{
2589 tSirMacActionFrameHdr hdr;
2590
2591#ifdef ANI_LITTLE_BIT_ENDIAN
2592 tANI_U8 tid: 4;
2593 tANI_U8 policy: 1;
2594 tANI_U8 reject: 1;
2595 tANI_U8 rsvd1: 2;
2596#else
2597 tANI_U8 rsvd1: 2;
2598 tANI_U8 reject: 1;
2599 tANI_U8 policy: 1;
2600 tANI_U8 tid: 4;
2601#endif
2602
2603 tANI_U8 bufferSize;
2604} __ani_attr_packed tSirMacQoSDefBARsp, *tpSirMacQoSDefBARsp;
2605
2606typedef __ani_attr_pre_packed struct sSirMacQoSDelBAReq
2607{
2608 tSirMacActionFrameHdr hdr;
2609 tANI_U8 rsvd1;
2610
2611#ifdef ANI_LITTLE_BIT_ENDIAN
2612 tANI_U8 rsvd2: 3;
2613 tANI_U8 direction: 1;
2614 tANI_U8 tid: 4;
2615#else
2616 tANI_U8 tid: 4;
2617 tANI_U8 direction: 1;
2618 tANI_U8 rsvd2: 3;
2619#endif
2620} __ani_attr_packed tSirMacQoSDelBAReq, *tpSirMacQoSDelBAReq;
2621
2622typedef __ani_attr_pre_packed struct sSirMacQoSDelBARsp
2623{
2624 tSirMacActionFrameHdr hdr;
2625
2626#ifdef ANI_LITTLE_BIT_ENDIAN
2627 tANI_U8 tid: 4;
2628 tANI_U8 policy: 1;
2629 tANI_U8 reject: 1;
2630 tANI_U8 rsvd1: 2;
2631#else
2632 tANI_U8 rsvd1: 2;
2633 tANI_U8 reject: 1;
2634 tANI_U8 policy: 1;
2635 tANI_U8 tid: 4;
2636#endif
2637
2638} __ani_attr_packed tSirMacQoSDelBARsp, *tpSirMacQoSDelBARsp;
2639
2640
2641
2642// 11b rate encoding in MAC format
2643
2644#define SIR_MAC_RATE_1 0x02
2645#define SIR_MAC_RATE_2 0x04
2646#define SIR_MAC_RATE_5_5 0x0B
2647#define SIR_MAC_RATE_11 0x16
2648
2649// 11a/g rate encoding in MAC format
2650
2651#define SIR_MAC_RATE_6 0x0C
2652#define SIR_MAC_RATE_9 0x12
2653#define SIR_MAC_RATE_12 0x18
2654#define SIR_MAC_RATE_18 0x24
2655#define SIR_MAC_RATE_24 0x30
2656#define SIR_MAC_RATE_36 0x48
2657#define SIR_MAC_RATE_48 0x60
2658#define SIR_MAC_RATE_54 0x6C
2659
2660// ANI legacy supported rates
2661#define SIR_MAC_RATE_72 0x01
2662#define SIR_MAC_RATE_96 0x03
2663#define SIR_MAC_RATE_108 0x05
2664
2665// ANI enhanced rates
2666#define SIR_MAC_RATE_42 1000
2667#define SIR_MAC_RATE_84 1001
2668#define SIR_MAC_RATE_126 1002
2669#define SIR_MAC_RATE_144 1003
2670#define SIR_MAC_RATE_168 1004
2671#define SIR_MAC_RATE_192 1005
2672#define SIR_MAC_RATE_216 1006
2673#define SIR_MAC_RATE_240 1007
2674
2675
2676#define sirIsArate(x) ((((tANI_U8)x)==SIR_MAC_RATE_6) || \
2677 (((tANI_U8)x)==SIR_MAC_RATE_9) || \
2678 (((tANI_U8)x)==SIR_MAC_RATE_12)|| \
2679 (((tANI_U8)x)==SIR_MAC_RATE_18)|| \
2680 (((tANI_U8)x)==SIR_MAC_RATE_24)|| \
2681 (((tANI_U8)x)==SIR_MAC_RATE_36)|| \
2682 (((tANI_U8)x)==SIR_MAC_RATE_48)|| \
2683 (((tANI_U8)x)==SIR_MAC_RATE_54))
2684
2685#define sirIsBrate(x) ((((tANI_U8)x)==SIR_MAC_RATE_1) || \
2686 (((tANI_U8)x)==SIR_MAC_RATE_2) || \
2687 (((tANI_U8)x)==SIR_MAC_RATE_5_5)|| \
2688 (((tANI_U8)x)==SIR_MAC_RATE_11))
2689
2690#define sirIsGrate(x) ((((tANI_U8)x)==SIR_MAC_RATE_1) || \
2691 (((tANI_U8)x)==SIR_MAC_RATE_2) || \
2692 (((tANI_U8)x)==SIR_MAC_RATE_5_5)|| \
2693 (((tANI_U8)x)==SIR_MAC_RATE_11) || \
2694 (((tANI_U8)x)==SIR_MAC_RATE_6) || \
2695 (((tANI_U8)x)==SIR_MAC_RATE_9) || \
2696 (((tANI_U8)x)==SIR_MAC_RATE_12) || \
2697 (((tANI_U8)x)==SIR_MAC_RATE_18) || \
2698 (((tANI_U8)x)==SIR_MAC_RATE_24) || \
2699 (((tANI_U8)x)==SIR_MAC_RATE_36) || \
2700 (((tANI_U8)x)==SIR_MAC_RATE_48) || \
2701 (((tANI_U8)x)==SIR_MAC_RATE_54))
2702
2703#define sirIsProprate(x) ((((tANI_U8)x)==SIR_MAC_RATE_72) || \
2704 (((tANI_U8)x)==SIR_MAC_RATE_96) || \
2705 (((tANI_U8)x)==SIR_MAC_RATE_108))
2706
2707#define sirIsEnhancedRate(x) \
2708 (((x)==SIR_MAC_RATE_42) || \
2709 ((x)==SIR_MAC_RATE_84) || \
2710 ((x)==SIR_MAC_RATE_126) || \
2711 ((x)==SIR_MAC_RATE_144) || \
2712 ((x)==SIR_MAC_RATE_168) || \
2713 ((x)==SIR_MAC_RATE_192) || \
2714 ((x)==SIR_MAC_RATE_216) || \
2715 ((x)==SIR_MAC_RATE_240))
2716
2717/// Table that has MAC<-->PHY rate encodings
2718typedef __ani_attr_pre_packed struct sSirMacPhyRates
2719{
2720 tANI_U8 rateId;
2721 tANI_U8 phyRate; // Rate in PHY encoding format
2722 tANI_U16 macRate; // Rate in MAC encoding format
2723} __ani_attr_packed tSirMacPhyRates, *tpSirMacPhyRates;
2724
2725
2726typedef __ani_attr_pre_packed struct sSirPhy11aHdr
2727{
2728
2729#ifndef ANI_LITTLE_BIT_ENDIAN
2730
2731 tANI_U8 lengthLo : 3;
2732 tANI_U8 reserved : 1;
2733 tANI_U8 rate : 4;
2734
2735 tANI_U8 lengthMid : 8;
2736
2737 tANI_U8 tail: 6;
2738 tANI_U8 parity : 1;
2739 tANI_U8 lengthHi : 1;
2740
2741 tANI_U8 serviceLo;
2742 tANI_U8 serviceHi;
2743#else
2744 tANI_U8 rate : 4;
2745 tANI_U8 reserved : 1;
2746 tANI_U8 lengthLo : 3;
2747
2748 tANI_U8 lengthMid : 8;
2749
2750 tANI_U8 lengthHi : 1;
2751 tANI_U8 parity : 1;
2752 tANI_U8 tail: 6;
2753
2754 tANI_U8 serviceLo;
2755 tANI_U8 serviceHi;
2756#endif
2757} __ani_attr_packed tSirPhy11aHdr, *tpSirPhy11aHdr;
2758
Leela V Kiran Kumar Reddy Chirala6a458752013-02-16 15:41:27 -08002759#define SIR_MAC_MIN_IE_LEN 2 // Minimum IE length for IE validation
Jeff Johnson295189b2012-06-20 16:38:30 -07002760#endif /* __MAC_PROT_DEFS_H */