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