blob: f36257566e6016804ec153234b63608e111f528c [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kanchanapally, Vidyullatha3f3b6542015-08-21 14:38:49 +05302 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
AnjaneeDevi Kapparapu24b52ff2014-02-18 18:44:02 -08003 *
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.
Gopichand Nakkala9c070ad2013-01-08 21:16:34 -080020 */
AnjaneeDevi Kapparapu24b52ff2014-02-18 18:44:02 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Gopichand Nakkala9c070ad2013-01-08 21:16:34 -080028/*
Jeff Johnson295189b2012-06-20 16:38:30 -070029 *
Jeff Johnson295189b2012-06-20 16:38:30 -070030 * This file sirMacPropExts.h contains the MAC protocol
31 * extensions to support ANI feature set.
32 * Author: Chandra Modumudi
33 * Date: 11/27/02
34 * History:-
35 * Date Modified by Modification Information
36 * --------------------------------------------------------------------
Jeff Johnsonda6d7492013-02-27 10:48:42 -080037 *
Jeff Johnson295189b2012-06-20 16:38:30 -070038 */
39#ifndef __MAC_PROP_EXTS_H
40#define __MAC_PROP_EXTS_H
41
42#include "sirTypes.h"
43#include "sirApi.h"
44#include "aniSystemDefs.h"
45
46/// EID (Element ID) definitions
47
48// Proprietary IEs
49
50// Types definitions used within proprietary IE
51#define SIR_MAC_PROP_EXT_RATES_TYPE 0
52#define SIR_MAC_PROP_AP_NAME_TYPE 1
Jeff Johnson295189b2012-06-20 16:38:30 -070053#define SIR_MAC_PROP_LOAD_INFO_TYPE 6
54#define SIR_MAC_PROP_ASSOC_TYPE 7
55#define SIR_MAC_PROP_LOAD_BALANCE_TYPE 8
56#define SIR_MAC_PROP_LL_ATTR_TYPE 9
57#define SIR_MAC_PROP_CAPABILITY 10 // proprietary capabilities
58#define SIR_MAC_PROP_VERSION 11 // version info
59#define SIR_MAC_PROP_EDCAPARAMS 12 // edca params for 11e and wme
60#define SIR_MAC_PROP_SRCMAC 13 // sender's mac address
61#define SIR_MAC_PROP_TITAN 14 // Advertises a TITAN device
62#define SIR_MAC_PROP_CHANNEL_SWITCH 15 // proprietary channel switch info
63#define SIR_MAC_PROP_QUIET_BSS 16 // Broadcast's REQ for Quiet BSS
64#define SIR_MAC_PROP_TRIG_STA_BK_SCAN 17 // trigger station bk scan during quiet bss duration
65#define SIR_MAC_PROP_TAURUS 18 // Advertises a TAURUS device
66
67// capability ie info
68#define SIR_MAC_PROP_CAPABILITY_MIN sizeof(tANI_U16)
69
70// trigger sta scan ie length defines
71#define SIR_MAC_PROP_TRIG_STA_BK_SCAN_EID_MIN 0
72#define SIR_MAC_PROP_TRIG_STA_BK_SCAN_EID_MAX 1
73
74// the bit map is also used as a config enable, setting a bit in the
75// propIE config variable, enables the corresponding capability in the propIE
76// the enables simply result in including the corresponding element in the
77// propIE
78// Ex: setting the capability bit HCF would result in using the capability bit map for
79// hcf instead of including the full HCF element in the IE
80// capabilities bit map - bit offsets
81// setting 11eQos has effect only if QoS is also enabled. then it overrides
82// 11e support and implements it silently (as part of the prop ie)
83#define SIR_MAC_PROP_CAPABILITY_HCF WNI_CFG_PROP_CAPABILITY_HCF
84#define SIR_MAC_PROP_CAPABILITY_11EQOS WNI_CFG_PROP_CAPABILITY_11EQOS
85#define SIR_MAC_PROP_CAPABILITY_WME WNI_CFG_PROP_CAPABILITY_WME
86#define SIR_MAC_PROP_CAPABILITY_WSM WNI_CFG_PROP_CAPABILITY_WSM
87#define SIR_MAC_PROP_CAPABILITY_EXTRATES WNI_CFG_PROP_CAPABILITY_EXTRATES
88// ap->sta only, request STA to stop using prop rates for some time
89#define SIR_MAC_PROP_CAPABILITY_EXTRATE_STOP WNI_CFG_PROP_CAPABILITY_EXTRATE_STOP
90#define SIR_MAC_PROP_CAPABILITY_TITAN WNI_CFG_PROP_CAPABILITY_TITAN
91#define SIR_MAC_PROP_CAPABILITY_TAURUS WNI_CFG_PROP_CAPABILITY_TAURUS
92#define SIR_MAC_PROP_CAPABILITY_ESCORT_PKT WNI_CFG_PROP_CAPABILITY_ESCORT_PKT
93// unused 9-12
94#define SIR_MAC_PROP_CAPABILITY_EDCAPARAMS WNI_CFG_PROP_CAPABILITY_EDCAPARAMS
95#define SIR_MAC_PROP_CAPABILITY_LOADINFO WNI_CFG_PROP_CAPABILITY_LOADINFO
96#define SIR_MAC_PROP_CAPABILITY_VERSION WNI_CFG_PROP_CAPABILITY_VERSION
97#define SIR_MAC_PROP_CAPABILITY_MAXBITOFFSET WNI_CFG_PROP_CAPABILITY_MAXBITOFFSET
98
99// macro to set/get a capability bit, bitname is one of HCF/11EQOS/etc...
100#define PROP_CAPABILITY_SET(bitname, value) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800101 ((value) = (value) | ((tANI_U16)(1 << SIR_MAC_PROP_CAPABILITY_ ## bitname)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700102
103#define PROP_CAPABILITY_RESET(bitname, value) \
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800104 ((value) = (value) & ~((tANI_U16)(1 << SIR_MAC_PROP_CAPABILITY_ ## bitname)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700105
106#define PROP_CAPABILITY_GET(bitname, value) \
107 (((value) >> SIR_MAC_PROP_CAPABILITY_ ## bitname) & 1)
108
109
110#define IS_DOT11_MODE_PROPRIETARY(dot11Mode) \
111 (((dot11Mode == WNI_CFG_DOT11_MODE_POLARIS) || \
112 (dot11Mode == WNI_CFG_DOT11_MODE_TITAN) || \
113 (dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \
114 (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE)
115
Jeff Johnson295189b2012-06-20 16:38:30 -0700116#define IS_DOT11_MODE_HT(dot11Mode) \
117 (((dot11Mode == WNI_CFG_DOT11_MODE_11N) || \
118 (dot11Mode == WNI_CFG_DOT11_MODE_11N_ONLY) || \
Jeff Johnsone7245742012-09-05 17:12:55 -0700119 (dot11Mode == WNI_CFG_DOT11_MODE_11AC) || \
120 (dot11Mode == WNI_CFG_DOT11_MODE_11AC_ONLY) || \
Jeff Johnson295189b2012-06-20 16:38:30 -0700121 (dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \
122 (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE)
Jeff Johnsone7245742012-09-05 17:12:55 -0700123
124#ifdef WLAN_FEATURE_11AC
125#define IS_DOT11_MODE_VHT(dot11Mode) \
126 (((dot11Mode == WNI_CFG_DOT11_MODE_11AC) || \
127 (dot11Mode == WNI_CFG_DOT11_MODE_11AC_ONLY) || \
128 (dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \
Jeff Johnson295189b2012-06-20 16:38:30 -0700129 (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE)
130#endif
131 /*
132 * When Titan capabilities can be turned on based on the
133 * Proprietary Extensions CFG, then this macro can be used.
134 * Here Titan capabilities can be turned on for 11G/Gonly/N/NOnly mode also.
135 */
136#define IS_DOT11_MODE_TITAN_ALLOWED(dot11Mode) \
137 (((dot11Mode == WNI_CFG_DOT11_MODE_TITAN) || \
138 (dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \
139 (dot11Mode == WNI_CFG_DOT11_MODE_11G) || \
140 (dot11Mode == WNI_CFG_DOT11_MODE_11N) || \
141 (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE)
142
143
144 /*
145 * When Taurus capabilities can be turned on based on the
146 * Proprietary Extensions CFG, then this macro can be used.
147 * Here Taurus capabilities can be turned on for 11N/Nonly mode also.
148 */
149#define IS_DOT11_MODE_TAURUS_ALLOWED(dot11Mode) \
150 (((dot11Mode == WNI_CFG_DOT11_MODE_TAURUS) || \
151 (dot11Mode == WNI_CFG_DOT11_MODE_11N) || \
152 (dot11Mode == WNI_CFG_DOT11_MODE_ALL)) ? TRUE: FALSE)
153
154
155
156#define IS_DOT11_MODE_POLARIS(dot11Mode) IS_DOT11_MODE_PROPRIETARY(dot11Mode)
157
158#define IS_DOT11_MODE_11B(dot11Mode) \
159 ((dot11Mode == WNI_CFG_DOT11_MODE_11B) ? TRUE : FALSE)
160
Kanchanapally, Vidyullatha3f3b6542015-08-21 14:38:49 +0530161#define IS_BSS_VHT_CAPABLE(vhtCaps) \
162 ((vhtCaps).present && \
163 ((vhtCaps).rxMCSMap != 0xFFFF) && \
164 ((vhtCaps).txMCSMap != 0xFFFF))
165
Jeff Johnson295189b2012-06-20 16:38:30 -0700166/// ANI proprietary Status Codes enum
167/// (present in Management response frames)
168typedef enum eSirMacPropStatusCodes
169{
170 dummy
171} tSirMacPropStatusCodes;
172
173/**
174 * ANI proprietary Reason Codes enum
175 * (present in Deauthentication/Disassociation Management frames)
176 */
177typedef enum eSirMacPropReasonCodes
178{
179 eSIR_MAC_ULA_TIMEOUT_REASON=0xFF00
180} tSirMacPropReasonCodes;
181
182
183/// Proprietary IE definition
184typedef struct sSirMacPropIE
185{
186 tANI_U8 elementID; // SIR_MAC_ANI_PROP_IE_EID
187 tANI_U8 length;
188 tANI_U8 oui[3]; // ANI_OUI for Airgo products
189 tANI_U8 info[1];
190} tSirMacPropIE, *tpSirMacPropIE;
191
192
193typedef struct sSirMacPropRateSet
194{
195 tANI_U8 numPropRates;
196 tANI_U8 propRate[8];
197} tSirMacPropRateSet, *tpSirMacPropRateSet;
198
199
200typedef struct sSirMacPropLLSet
201{
202 tANI_U32 deferThreshold;
203} tSirMacPropLLSet, *tpSirMacPropLLSet;
204
205#define SIR_PROP_VERSION_STR_MAX 20
206typedef struct sSirMacPropVersion
207{
208 tANI_U32 chip_rev; // board, chipset info
209 tANI_U8 card_type; // Type of Card
210 tANI_U8 build_version[SIR_PROP_VERSION_STR_MAX]; //build version string
211} tSirMacPropVersion, *tpSirMacPropVersion;
212#define SIR_MAC_PROP_VERSION_MIN (SIR_PROP_VERSION_STR_MAX + sizeof(tANI_U32))
213
214
215// TCID MACRO's
216#define TCID_0 0x01
217#define TCID_1 0x02
218#define TCID_2 0x04
219#define TCID_3 0x08
220#define TCID_4 0x10
221#define TCID_5 0x20
222#define TCID_6 0x40
223#define TCID_7 0x80
224#define TCID_ALL 0xFF
225
226// Get state of Concatenation
227#define GET_CONCAT_STATE(ccBitmap,tcid) \
228 ((ccBitmap) & (tcid))
229
230// Get state of Compression
231#define GET_COMPRESSION_STATE(cpBitmap,tcid) \
232 ((cpBitmap) & (tcid))
233
Jeff Johnson295189b2012-06-20 16:38:30 -0700234// Get/Set the state of Reverse FCS
235#define GET_RFCS_OPER_STATE(revFcsState) (revFcsState & 0x01)
236#define GET_RFCS_PATTERN_ID(revFcsState) ((revFcsState & 0x0E) >> 1)
237
238/* STA CB Legacy Bss detect states */
239#define LIM_CB_LEGACY_BSS_DETECT_IDLE 0
240#define LIM_CB_LEGACY_BSS_DETECT_RUNNING 1
241
242/* Default value for gLimRestoreCBNumScanInterval */
243#define LIM_RESTORE_CB_NUM_SCAN_INTERVAL_DEFAULT 2
244
245//
246// Proprietary Quite BSS IE structure
247//
248// Based on the setting of the "Titan" proprietary bit
249// in the tSirPropIEStruct.capability field (bit #6),
250// this IE will be sent appropriately to all the ANI
251// peers in the following management frames -
252// 1) Beacons
253// 2) Probe Rsp
254//
255typedef struct sQuietBssIEStruct
256{
257
258 // Indicates the number of TBTT's until the next beacon
259 // interval during which the next quiet interval will
260 // start
261 // 1 - Quiet Interval will start during the beacon
262 // interval starting at the next TBTT
263 // 0 - Reserved
264 tANI_U8 quietCount;
265
266 // Shall be set to the number of beacon intervals between
267 // the start of regularly scheduled quiet intervals
268 // defined by this Quiet Element
269 // 0 - No periodic quiet interval is defined
270 tANI_U8 quietPeriod;
271
272 // Duration of the quiet interval, expressed in TUs
273 // 1 TU = 1024 microseconds??
274 tANI_U16 quietDuration;
275
276 // Set to the offset of the start of the quiet interval
277 // from the TBTT specified by the quietCount field,
278 // expressed in TUs. The value of this offset field will
279 // be less than one beacon interval
280 // 1 TU = 1024 microseconds??
281 tANI_U16 quietOffset;
282
283} tQuietBssIEStruct, *tpQuietBssIEStruct;
284
285typedef struct sChannelSwitchPropIEStruct
286{
287 tANI_U8 mode;
288 tANI_U8 primaryChannel;
289 tANI_U8 subBand;
290 tANI_U8 channelSwitchCount;
291
292} tChannelSwitchPropIEStruct, *tpChannelSwitchPropIEStruct;
293
294// generic proprietary IE structure definition
295typedef struct sSirPropIEStruct
296{
297 tANI_U8 aniIndicator;
298
299 tANI_U8 propRatesPresent:1;
300 tANI_U8 apNamePresent:1;
301 tANI_U8 loadBalanceInfoPresent:1;
302 tANI_U8 versionPresent:1;
303 tANI_U8 edcaParamPresent:1;
304 tANI_U8 capabilityPresent:1;
305 tANI_U8 titanPresent:1;
306 tANI_U8 taurusPresent:1;
307 tANI_U8 propChannelSwitchPresent:1;
308 tANI_U8 quietBssPresent:1;
309 tANI_U8 triggerStaScanPresent:1;
310 tANI_U8 rsvd:5;
311
Jeff Johnson295189b2012-06-20 16:38:30 -0700312
313 tSirMacPropRateSet propRates;
314 tAniApName apName; // used in beacon/probe only
315 tSirAlternateRadioInfo alternateRadio; // used in assoc response only
316 tANI_U16 capability; // capability bit map
317 tSirMacPropVersion version;
318 tSirMacEdcaParamSetIE edca;
319 tChannelSwitchPropIEStruct channelSwitch;
320 tQuietBssIEStruct quietBss;
321 tANI_U8 triggerStaScanEnable;
322
Jeff Johnson295189b2012-06-20 16:38:30 -0700323
324} tSirPropIEStruct, *tpSirPropIEStruct;
325
326
327
328#endif /* __MAC_PROP_EXTS_H */