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