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