blob: 214e8167262218996a66a9b3583ae5c076654b0e [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 */
41
42#if !defined( __LIM_SESSION_H )
43#define __LIM_SESSION_H
44
45
46/**=========================================================================
Jeff Johnson3c3e1782013-02-27 10:48:42 -080047
Jeff Johnson295189b2012-06-20 16:38:30 -070048 \file limSession.h
Jeff Johnson3c3e1782013-02-27 10:48:42 -080049
Jeff Johnson295189b2012-06-20 16:38:30 -070050 \brief prototype for lim Session related APIs
51
52 \author Sunit Bhatia
Jeff Johnson295189b2012-06-20 16:38:30 -070053 ========================================================================*/
54
55
56/*--------------------------------------------------------------------------
57 Include Files
58 ------------------------------------------------------------------------*/
59
60
61
62/*--------------------------------------------------------------------------
63 Preprocessor definitions and constants
64 ------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -070065#define NUM_WEP_KEYS 4
Jeff Johnson295189b2012-06-20 16:38:30 -070066
67/*--------------------------------------------------------------------------
68 Type declarations
69 ------------------------------------------------------------------------*/
70typedef struct
71{
72 tSirMacBeaconInterval beaconInterval;
73 tANI_U8 fShortPreamble;
74 tANI_U8 llaCoexist;
75 tANI_U8 llbCoexist;
76 tANI_U8 llgCoexist;
77 tANI_U8 ht20Coexist;
78 tANI_U8 llnNonGFCoexist;
79 tANI_U8 fRIFSMode;
80 tANI_U8 fLsigTXOPProtectionFullSupport;
81 tANI_U8 gHTObssMode;
82}tBeaconParams, *tpBeaconParams;
83
84typedef struct sPESession // Added to Support BT-AMP
85{
86 /* To check session table is in use or free*/
87 tANI_U8 available;
88 tANI_U8 peSessionId;
89 tANI_U8 smeSessionId;
90 tANI_U16 transactionId;
91
92 //In AP role: BSSID and selfMacAddr will be the same.
93 //In STA role: they will be different
94 tSirMacAddr bssId;
95 tSirMacAddr selfMacAddr;
96 tSirMacSSid ssId;
97 tANI_U8 bssIdx;
98 tANI_U8 valid;
99 tLimMlmStates limMlmState; //MLM State
100 tLimMlmStates limPrevMlmState; //Previous MLM State
101 tLimSmeStates limSmeState; //SME State
102 tLimSmeStates limPrevSmeState; //Previous SME State
103 tLimSystemRole limSystemRole;
104 tSirBssType bssType;
105 tANI_U8 operMode; // AP - 0; STA - 1 ;
106 tSirNwType nwType;
107 tpSirSmeStartBssReq pLimStartBssReq; //handle to smestart bss req
108 tpSirSmeJoinReq pLimJoinReq; // handle to sme join req
Srinivas Girigowdac16730e2013-01-16 13:39:39 -0800109 tpSirSmeJoinReq pLimReAssocReq; //handle to sme reassoc req
Jeff Johnson295189b2012-06-20 16:38:30 -0700110 tpLimMlmJoinReq pLimMlmJoinReq; //handle to MLM join Req
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700111#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
112 void *pLimMlmReassocRetryReq; //keep reasoc req for retry
113#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700114 void *pLimMlmReassocReq; //handle to MLM reassoc Req
115 tANI_U16 channelChangeReasonCode;
116 tANI_U8 dot11mode;
Jeff Johnsone7245742012-09-05 17:12:55 -0700117 tANI_U8 htCapability;
118 /* Supported Channel Width Set: 0-20MHz 1 - 40MHz */
119 tANI_U8 htSupportedChannelWidthSet;
120 /* Recommended Tx Width Set
121 * 0 - use 20 MHz channel (control channel)
122 * 1 - use channel width enabled under Supported Channel Width Set
123 */
124 tANI_U8 htRecommendedTxWidthSet;
125 /* Identifies the 40 MHz extension channel */
126 ePhyChanBondState htSecondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700127 tSirRFBand limRFBand;
128 tANI_U8 limIbssActive; //TO SUPPORT CONCURRENCY
129
130 /* These global varibales moved to session Table to support BT-AMP : Oct 9th review */
131 tAniAuthType limCurrentAuthType;
132 tANI_U16 limCurrentBssCaps;
133 tANI_U8 limCurrentBssQosCaps;
134 tANI_U16 limCurrentBssPropCap;
135 tANI_U8 limSentCapsChangeNtf;
Jeff Johnson295189b2012-06-20 16:38:30 -0700136 tANI_U16 limAID;
137
138 /* Parameters For Reassociation */
139 tSirMacAddr limReAssocbssId;
140 tSirMacChanNum limReassocChannelId;
Jeff Johnsone7245742012-09-05 17:12:55 -0700141 /* CB paramaters required/duplicated for Reassoc since re-assoc mantains its own params in lim */
142 tANI_U8 reAssocHtSupportedChannelWidthSet;
143 tANI_U8 reAssocHtRecommendedTxWidthSet;
144 ePhyChanBondState reAssocHtSecondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700145 tSirMacSSid limReassocSSID;
146 tANI_U16 limReassocBssCaps;
147 tANI_U8 limReassocBssQosCaps;
148 tANI_U16 limReassocBssPropCap;
Jeff Johnson295189b2012-06-20 16:38:30 -0700149
150 // Assoc or ReAssoc Response Data/Frame
151 void *limAssocResponseData;
152
153
154
155 /** BSS Table parameters **/
156
157
158 /*
159 * staId: Start BSS: this is the Sta Id for the BSS.
160 Join: this is the selfStaId
161 In both cases above, the peer STA ID wll be stored in dph hash table.
162 */
163 tANI_U16 staId;
164 tANI_U16 statypeForBss; //to know session is for PEER or SELF
165 tANI_U8 shortSlotTimeSupported;
166 tANI_U8 dtimPeriod;
167 tSirMacRateSet rateSet;
168 tSirMacRateSet extRateSet;
169 tSirMacHTOperatingMode htOperMode;
170 tANI_U8 currentOperChannel;
171 tANI_U8 currentReqChannel;
172 tANI_U8 LimRxedBeaconCntDuringHB;
173
174 //Time stamp of the last beacon received from the BSS to which STA is connected.
175 tANI_U64 lastBeaconTimeStamp;
176 //RX Beacon count for the current BSS to which STA is connected.
177 tANI_U32 currentBssBeaconCnt;
178 tANI_U8 lastBeaconDtimCount;
179 tANI_U8 lastBeaconDtimPeriod;
180
181 tANI_U32 bcnLen;
182 tANI_U8 *beacon; //Used to store last beacon / probe response before assoc.
183
184 tANI_U32 assocReqLen;
185 tANI_U8 *assocReq; //Used to store association request frame sent out while associating.
186
187 tANI_U32 assocRspLen;
188 tANI_U8 *assocRsp; //Used to store association response received while associating
189 tAniSirDph dph;
190 void * *parsedAssocReq; //Used to store parsed assoc req from various requesting station
191#ifdef WLAN_FEATURE_VOWIFI_11R
192 tANI_U32 RICDataLen; //Used to store the Ric data received in the assoc response
193 tANI_U8 *ricData;
194#endif
195#ifdef FEATURE_WLAN_CCX
196 tANI_U32 tspecLen; //Used to store the TSPEC IEs received in the assoc response
197 tANI_U8 *tspecIes;
198#endif
199 tANI_U32 encryptType;
200
Jeff Johnson295189b2012-06-20 16:38:30 -0700201 tANI_BOOLEAN bTkipCntrMeasActive; // Used to keep record of TKIP counter measures start/stop
202
203 tANI_U8 gLimProtectionControl; //used for 11n protection
204
205 tANI_U8 gHTNonGFDevicesPresent;
206
207 //protection related config cache
208 tCfgProtection cfgProtection;
209
210 // Number of legacy STAs associated
211 tLimProtStaParams gLim11bParams;
212
213 // Number of 11A STAs associated
214 tLimProtStaParams gLim11aParams;
215
216 // Number of non-ht non-legacy STAs associated
217 tLimProtStaParams gLim11gParams;
218
219 //Number of nonGf STA associated
220 tLimProtStaParams gLimNonGfParams;
221
222 //Number of HT 20 STAs associated
223 tLimProtStaParams gLimHt20Params;
224
225 //Number of Lsig Txop not supported STAs associated
226 tLimProtStaParams gLimLsigTxopParams;
227
228 // Number of STAs that do not support short preamble
229 tLimNoShortParams gLimNoShortParams;
230
231 // Number of STAs that do not support short slot time
232 tLimNoShortSlotParams gLimNoShortSlotParams;
233
234
235 // OLBC parameters
236 tLimProtStaParams gLimOlbcParams;
237
238 // OLBC parameters
239 tLimProtStaParams gLimOverlap11gParams;
240
241 tLimProtStaParams gLimOverlap11aParams;
242 tLimProtStaParams gLimOverlapHt20Params;
243 tLimProtStaParams gLimOverlapNonGfParams;
244
245 //cache for each overlap
246 tCacheParams protStaCache[LIM_PROT_STA_CACHE_SIZE];
247
248 tANI_U8 privacy;
249 tAniAuthType authType;
250 tSirKeyMaterial WEPKeyMaterial[NUM_WEP_KEYS];
251
252 tDot11fIERSN gStartBssRSNIe;
253 tDot11fIEWPA gStartBssWPAIe;
254 tSirAPWPSIEs APWPSIEs;
255 tANI_U8 apUapsdEnable;
256 tSirWPSPBCSession *pAPWPSPBCSession;
257 tANI_U32 DefProbeRspIeBitmap[8];
258 tANI_U32 proxyProbeRspEn;
259 tDot11fProbeResponse probeRespFrame;
260 tANI_U8 ssidHidden;
261 tANI_BOOLEAN fwdWPSPBCProbeReq;
262 tANI_U8 wps_state;
Jeff Johnson295189b2012-06-20 16:38:30 -0700263
264 tANI_U8 limQosEnabled:1; //11E
265 tANI_U8 limWmeEnabled:1; //WME
266 tANI_U8 limWsmEnabled:1; //WSM
267 tANI_U8 limHcfEnabled:1;
268 tANI_U8 lim11dEnabled:1;
Chet Lanctot186b5732013-03-18 10:26:30 -0700269#ifdef WLAN_FEATURE_11W
270 tANI_U8 limRmfEnabled:1; //11W
271#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700272 tANI_U32 lim11hEnable;
273
274 tPowerdBm maxTxPower; //MIN (Regulatory and local power constraint)
275 tVOS_CON_MODE pePersona;
276#if defined WLAN_FEATURE_VOWIFI
277 tPowerdBm txMgmtPower;
278#endif
279
280#ifdef WLAN_FEATURE_VOWIFI_11R
281 tAniBool is11Rconnection;
282#endif
283
284#ifdef FEATURE_WLAN_CCX
285 tAniBool isCCXconnection;
286 tCcxPEContext ccxContext;
287#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700288#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700289 tAniBool isFastTransitionEnabled;
290#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700291#ifdef FEATURE_WLAN_LFR
292 tAniBool isFastRoamIniFeatureEnabled;
293#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700294 tSirNoAParam p2pNoA;
295 tSirP2PNoaAttr p2pGoPsUpdate;
Madan Mohan Koyyalamudi666d33a2012-11-29 11:32:59 -0800296 tANI_U32 defaultAuthFailureTimeout;
Viral Modid86bde22012-12-10 13:09:21 -0800297 tSirP2PNoaStart p2pGoPsNoaStartInd;
Jeff Johnson295189b2012-06-20 16:38:30 -0700298
299 /* EDCA QoS parameters
300 * gLimEdcaParams - These EDCA parameters are used locally on AP or STA.
301 * If STA, then these are values taken from the Assoc Rsp when associating,
302 * or Beacons/Probe Response after association. If AP, then these are
303 * values originally set locally on AP.
304 *
305 * gLimEdcaParamsBC - These EDCA parameters are use by AP to broadcast
306 * to other STATIONs in the BSS.
307 *
308 * gLimEdcaParamsActive: These EDCA parameters are what's actively being
309 * used on station. Specific AC values may be downgraded depending on
310 * admission control for that particular AC.
311 */
312 tSirMacEdcaParamRecord gLimEdcaParams[MAX_NUM_AC]; //used locally
313 tSirMacEdcaParamRecord gLimEdcaParamsBC[MAX_NUM_AC]; //used for broadcast
314 tSirMacEdcaParamRecord gLimEdcaParamsActive[MAX_NUM_AC];
315
316 tANI_U8 gLimEdcaParamSetCount;
317
318 tBeaconParams beaconParams;
Jeff Johnsone7245742012-09-05 17:12:55 -0700319#ifdef WLAN_FEATURE_11AC
320 tANI_U8 vhtCapability;
321 tANI_U8 vhtTxChannelWidthSet;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700322 tLimOperatingModeInfo gLimOperatingMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700323 tLimWiderBWChannelSwitchInfo gLimWiderBWChannelSwitch;
324 tANI_U8 vhtCapabilityPresentInBeacon;
325 tANI_U8 apCenterChan;
326 tANI_U8 apChanWidth;
Shailender Karmuchi08f87c22013-01-17 12:51:24 -0800327 tANI_U8 txBFIniFeatureEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -0700328#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700329 tANI_U8 spectrumMgtEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -0700330 /* *********************11H related*****************************/
331 //tANI_U32 gLim11hEnable;
332 tLimSpecMgmtInfo gLimSpecMgmt;
333 // CB Primary/Secondary Channel Switch Info
334 tLimChannelSwitchInfo gLimChannelSwitch;
335 /* *********************End 11H related*****************************/
Jeff Johnson295189b2012-06-20 16:38:30 -0700336
337 /*Flag to Track Status/Indicate HBFailure on this session */
338 tANI_BOOLEAN LimHBFailureStatus;
339 tANI_U32 gLimPhyMode;
Kiran Kumar Lokere2ac471f2013-05-30 16:08:48 -0700340 tANI_U8 amsduSupportedInBA;
Gopichand Nakkalab2d2c312013-01-04 11:41:02 -0800341 tANI_U8 txLdpcIniFeatureEnabled;
Gopichand Nakkala777e6032012-12-31 16:39:21 -0800342 /**
343 * Following is the place holder for free peer index pool.
344 * A non-zero value indicates that peer index is available
345 * for assignment.
346 */
347 tANI_U8 *gpLimPeerIdxpool;
348 tANI_U8 freePeerIdxHead;
349 tANI_U8 freePeerIdxTail;
350 tANI_U16 gLimNumOfCurrentSTAs;
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -0800351#ifdef FEATURE_WLAN_TDLS
352 tANI_U32 peerAIDBitmap[2];
353#endif
Gopichand Nakkalabe8653b2013-04-10 08:16:05 +0530354 tANI_BOOLEAN fWaitForProbeRsp;
355 tANI_BOOLEAN fIgnoreCapsChange;
krunal soni4f087d22013-07-29 16:32:26 -0700356 tANI_U8 oxygenNwkIniFeatureEnabled;
357
Jeff Johnson295189b2012-06-20 16:38:30 -0700358}tPESession, *tpPESession;
359
360#define LIM_MAX_ACTIVE_SESSIONS 4
361
362
363/*-------------------------------------------------------------------------
364 Function declarations and documenation
365 ------------------------------------------------------------------------*/
366
367
368/*--------------------------------------------------------------------------
369
370 \brief peCreateSession() - creates a new PE session given the BSSID
371
372 This function returns the session context and the session ID if the session
373 corresponding to the passed BSSID is found in the PE session table.
374
375 \param pMac - pointer to global adapter context
376 \param bssid - BSSID of the new session
377 \param sessionId -session ID is returned here, if session is created.
378
379 \return tpPESession - pointer to the session context or NULL if session can not be created.
380
381 \sa
382
383 --------------------------------------------------------------------------*/
384tpPESession peCreateSession(tpAniSirGlobal pMac, tANI_U8 *bssid , tANI_U8* sessionId, tANI_U16 numSta);
385
386
387/*--------------------------------------------------------------------------
388 \brief peFindSessionByBssid() - looks up the PE session given the BSSID.
389
390 This function returns the session context and the session ID if the session
391 corresponding to the given BSSID is found in the PE session table.
392
393 \param pMac - pointer to global adapter context
394 \param bssid - BSSID of the session
395 \param sessionId -session ID is returned here, if session is found.
396
397 \return tpPESession - pointer to the session context or NULL if session is not found.
398
399 \sa
400 --------------------------------------------------------------------------*/
401tpPESession peFindSessionByBssid(tpAniSirGlobal pMac, tANI_U8* bssid, tANI_U8* sessionId);
402
403
404
405/*--------------------------------------------------------------------------
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -0800406 \brief peFindSessionByBssIdx() - looks up the PE session given the bssIdx.
407
408 This function returns the session context if the session
409 corresponding to the given bssIdx is found in the PE session table.
410 \param pMac - pointer to global adapter context
411 \param bssIdx - bss index of the session
412 \return tpPESession - pointer to the session context or NULL if session is not found.
413 \sa
414 --------------------------------------------------------------------------*/
415tpPESession peFindSessionByBssIdx(tpAniSirGlobal pMac, tANI_U8 bssIdx);
416
417
418
419
420/*--------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -0700421 \brief peFindSessionByPeerSta() - looks up the PE session given the Peer Station Address.
422
423 This function returns the session context and the session ID if the session
424 corresponding to the given destination address is found in the PE session table.
425
426 \param pMac - pointer to global adapter context
427 \param sa - Peer STA Address of the session
428 \param sessionId -session ID is returned here, if session is found.
429
430 \return tpPESession - pointer to the session context or NULL if session is not found.
431
432 \sa
433 --------------------------------------------------------------------------*/
434tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U8* sessionId);
435
436/*--------------------------------------------------------------------------
437 \brief peFindSessionBySessionId() - looks up the PE session given the session ID.
438
439 This function returns the session context if the session
440 corresponding to the given session ID is found in the PE session table.
441
442 \param pMac - pointer to global adapter context
443 \param sessionId -session ID for which session context needs to be looked up.
444
445 \return tpPESession - pointer to the session context or NULL if session is not found.
446
447 \sa
448 --------------------------------------------------------------------------*/
449 tpPESession peFindSessionBySessionId(tpAniSirGlobal pMac , tANI_U8 sessionId);
450
451/*--------------------------------------------------------------------------
452 \brief peFindSessionByBssid() - looks up the PE session given staid.
453
454 This function returns the session context and the session ID if the session
455 corresponding to the given StaId is found in the PE session table.
456
457 \param pMac - pointer to global adapter context
458 \param staid - StaId of the session
459 \param sessionId - session ID is returned here, if session is found.
460
461 \return tpPESession - pointer to the session context or NULL if session is not found.
462
463--------------------------------------------------------------------------*/
464 tpPESession peFindSessionByStaId(tpAniSirGlobal pMac, tANI_U8 staid, tANI_U8* sessionId);
465
466
467
468
469
470/*--------------------------------------------------------------------------
471 \brief peDeleteSession() - deletes the PE session given the session ID.
472
473
474 \param pMac - pointer to global adapter context
475 \param sessionId -session ID of the session which needs to be deleted.
476
477 \sa
478 --------------------------------------------------------------------------*/
479void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry);
480
481
482/*--------------------------------------------------------------------------
483 \brief peDeleteSession() - Returns the SME session ID and Transaction ID .
484
485
486 \param pMac - pointer to global adapter context
487 \param sessionId -session ID of the session which needs to be deleted.
488
489 \sa
490 --------------------------------------------------------------------------*/
491
492
493#endif //#if !defined( __LIM_SESSION_H )
494
495
496
497
498