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