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