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