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