blob: 78f27eb7e28d06fe695ac45f61e5a9c17d049c38 [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/**=========================================================================
47
48 \file limSession.h
49
50 \brief prototype for lim Session related APIs
51
52 \author Sunit Bhatia
53
54 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
55 Qualcomm Confidential and Proprietary.
56
57 ========================================================================*/
58
59
60/*--------------------------------------------------------------------------
61 Include Files
62 ------------------------------------------------------------------------*/
63
64
65
66/*--------------------------------------------------------------------------
67 Preprocessor definitions and constants
68 ------------------------------------------------------------------------*/
69#ifdef WLAN_SOFTAP_FEATURE
70#define NUM_WEP_KEYS 4
71#endif
72
73/*--------------------------------------------------------------------------
74 Type declarations
75 ------------------------------------------------------------------------*/
76typedef struct
77{
78 tSirMacBeaconInterval beaconInterval;
79 tANI_U8 fShortPreamble;
80 tANI_U8 llaCoexist;
81 tANI_U8 llbCoexist;
82 tANI_U8 llgCoexist;
83 tANI_U8 ht20Coexist;
84 tANI_U8 llnNonGFCoexist;
85 tANI_U8 fRIFSMode;
86 tANI_U8 fLsigTXOPProtectionFullSupport;
87 tANI_U8 gHTObssMode;
88}tBeaconParams, *tpBeaconParams;
89
90typedef struct sPESession // Added to Support BT-AMP
91{
92 /* To check session table is in use or free*/
93 tANI_U8 available;
94 tANI_U8 peSessionId;
95 tANI_U8 smeSessionId;
96 tANI_U16 transactionId;
97
98 //In AP role: BSSID and selfMacAddr will be the same.
99 //In STA role: they will be different
100 tSirMacAddr bssId;
101 tSirMacAddr selfMacAddr;
102 tSirMacSSid ssId;
103 tANI_U8 bssIdx;
104 tANI_U8 valid;
105 tLimMlmStates limMlmState; //MLM State
106 tLimMlmStates limPrevMlmState; //Previous MLM State
107 tLimSmeStates limSmeState; //SME State
108 tLimSmeStates limPrevSmeState; //Previous SME State
109 tLimSystemRole limSystemRole;
110 tSirBssType bssType;
111 tANI_U8 operMode; // AP - 0; STA - 1 ;
112 tSirNwType nwType;
113 tpSirSmeStartBssReq pLimStartBssReq; //handle to smestart bss req
114 tpSirSmeJoinReq pLimJoinReq; // handle to sme join req
115 tpSirSmeReassocReq pLimReAssocReq; //handle to sme reassoc req
116 tpLimMlmJoinReq pLimMlmJoinReq; //handle to MLM join Req
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -0700117#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
118 void *pLimMlmReassocRetryReq; //keep reasoc req for retry
119#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700120 void *pLimMlmReassocReq; //handle to MLM reassoc Req
121 tANI_U16 channelChangeReasonCode;
122 tANI_U8 dot11mode;
Jeff Johnsone7245742012-09-05 17:12:55 -0700123 tANI_U8 htCapability;
124 /* Supported Channel Width Set: 0-20MHz 1 - 40MHz */
125 tANI_U8 htSupportedChannelWidthSet;
126 /* Recommended Tx Width Set
127 * 0 - use 20 MHz channel (control channel)
128 * 1 - use channel width enabled under Supported Channel Width Set
129 */
130 tANI_U8 htRecommendedTxWidthSet;
131 /* Identifies the 40 MHz extension channel */
132 ePhyChanBondState htSecondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700133 tSirRFBand limRFBand;
134 tANI_U8 limIbssActive; //TO SUPPORT CONCURRENCY
135
136 /* These global varibales moved to session Table to support BT-AMP : Oct 9th review */
137 tAniAuthType limCurrentAuthType;
138 tANI_U16 limCurrentBssCaps;
139 tANI_U8 limCurrentBssQosCaps;
140 tANI_U16 limCurrentBssPropCap;
141 tANI_U8 limSentCapsChangeNtf;
Jeff Johnson295189b2012-06-20 16:38:30 -0700142 tANI_U16 limAID;
143
144 /* Parameters For Reassociation */
145 tSirMacAddr limReAssocbssId;
146 tSirMacChanNum limReassocChannelId;
Jeff Johnsone7245742012-09-05 17:12:55 -0700147 /* CB paramaters required/duplicated for Reassoc since re-assoc mantains its own params in lim */
148 tANI_U8 reAssocHtSupportedChannelWidthSet;
149 tANI_U8 reAssocHtRecommendedTxWidthSet;
150 ePhyChanBondState reAssocHtSecondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700151 tSirMacSSid limReassocSSID;
152 tANI_U16 limReassocBssCaps;
153 tANI_U8 limReassocBssQosCaps;
154 tANI_U16 limReassocBssPropCap;
Jeff Johnson295189b2012-06-20 16:38:30 -0700155
156 // Assoc or ReAssoc Response Data/Frame
157 void *limAssocResponseData;
158
159
160
161 /** BSS Table parameters **/
162
163
164 /*
165 * staId: Start BSS: this is the Sta Id for the BSS.
166 Join: this is the selfStaId
167 In both cases above, the peer STA ID wll be stored in dph hash table.
168 */
169 tANI_U16 staId;
170 tANI_U16 statypeForBss; //to know session is for PEER or SELF
171 tANI_U8 shortSlotTimeSupported;
172 tANI_U8 dtimPeriod;
173 tSirMacRateSet rateSet;
174 tSirMacRateSet extRateSet;
175 tSirMacHTOperatingMode htOperMode;
176 tANI_U8 currentOperChannel;
177 tANI_U8 currentReqChannel;
178 tANI_U8 LimRxedBeaconCntDuringHB;
179
180 //Time stamp of the last beacon received from the BSS to which STA is connected.
181 tANI_U64 lastBeaconTimeStamp;
182 //RX Beacon count for the current BSS to which STA is connected.
183 tANI_U32 currentBssBeaconCnt;
184 tANI_U8 lastBeaconDtimCount;
185 tANI_U8 lastBeaconDtimPeriod;
186
187 tANI_U32 bcnLen;
188 tANI_U8 *beacon; //Used to store last beacon / probe response before assoc.
189
190 tANI_U32 assocReqLen;
191 tANI_U8 *assocReq; //Used to store association request frame sent out while associating.
192
193 tANI_U32 assocRspLen;
194 tANI_U8 *assocRsp; //Used to store association response received while associating
195 tAniSirDph dph;
196 void * *parsedAssocReq; //Used to store parsed assoc req from various requesting station
197#ifdef WLAN_FEATURE_VOWIFI_11R
198 tANI_U32 RICDataLen; //Used to store the Ric data received in the assoc response
199 tANI_U8 *ricData;
200#endif
201#ifdef FEATURE_WLAN_CCX
202 tANI_U32 tspecLen; //Used to store the TSPEC IEs received in the assoc response
203 tANI_U8 *tspecIes;
204#endif
205 tANI_U32 encryptType;
206
207#ifdef WLAN_SOFTAP_FEATURE
208 tANI_BOOLEAN bTkipCntrMeasActive; // Used to keep record of TKIP counter measures start/stop
209
210 tANI_U8 gLimProtectionControl; //used for 11n protection
211
212 tANI_U8 gHTNonGFDevicesPresent;
213
214 //protection related config cache
215 tCfgProtection cfgProtection;
216
217 // Number of legacy STAs associated
218 tLimProtStaParams gLim11bParams;
219
220 // Number of 11A STAs associated
221 tLimProtStaParams gLim11aParams;
222
223 // Number of non-ht non-legacy STAs associated
224 tLimProtStaParams gLim11gParams;
225
226 //Number of nonGf STA associated
227 tLimProtStaParams gLimNonGfParams;
228
229 //Number of HT 20 STAs associated
230 tLimProtStaParams gLimHt20Params;
231
232 //Number of Lsig Txop not supported STAs associated
233 tLimProtStaParams gLimLsigTxopParams;
234
235 // Number of STAs that do not support short preamble
236 tLimNoShortParams gLimNoShortParams;
237
238 // Number of STAs that do not support short slot time
239 tLimNoShortSlotParams gLimNoShortSlotParams;
240
241
242 // OLBC parameters
243 tLimProtStaParams gLimOlbcParams;
244
245 // OLBC parameters
246 tLimProtStaParams gLimOverlap11gParams;
247
248 tLimProtStaParams gLimOverlap11aParams;
249 tLimProtStaParams gLimOverlapHt20Params;
250 tLimProtStaParams gLimOverlapNonGfParams;
251
252 //cache for each overlap
253 tCacheParams protStaCache[LIM_PROT_STA_CACHE_SIZE];
254
255 tANI_U8 privacy;
256 tAniAuthType authType;
257 tSirKeyMaterial WEPKeyMaterial[NUM_WEP_KEYS];
258
259 tDot11fIERSN gStartBssRSNIe;
260 tDot11fIEWPA gStartBssWPAIe;
261 tSirAPWPSIEs APWPSIEs;
262 tANI_U8 apUapsdEnable;
263 tSirWPSPBCSession *pAPWPSPBCSession;
264 tANI_U32 DefProbeRspIeBitmap[8];
265 tANI_U32 proxyProbeRspEn;
266 tDot11fProbeResponse probeRespFrame;
267 tANI_U8 ssidHidden;
268 tANI_BOOLEAN fwdWPSPBCProbeReq;
269 tANI_U8 wps_state;
270#endif
271
272 tANI_U8 limQosEnabled:1; //11E
273 tANI_U8 limWmeEnabled:1; //WME
274 tANI_U8 limWsmEnabled:1; //WSM
275 tANI_U8 limHcfEnabled:1;
276 tANI_U8 lim11dEnabled:1;
277
278 tANI_U32 lim11hEnable;
279
280 tPowerdBm maxTxPower; //MIN (Regulatory and local power constraint)
281 tVOS_CON_MODE pePersona;
282#if defined WLAN_FEATURE_VOWIFI
283 tPowerdBm txMgmtPower;
284#endif
285
286#ifdef WLAN_FEATURE_VOWIFI_11R
287 tAniBool is11Rconnection;
288#endif
289
290#ifdef FEATURE_WLAN_CCX
291 tAniBool isCCXconnection;
292 tCcxPEContext ccxContext;
293#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700294#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700295 tAniBool isFastTransitionEnabled;
296#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700297#ifdef FEATURE_WLAN_LFR
298 tAniBool isFastRoamIniFeatureEnabled;
299#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700300#ifdef WLAN_FEATURE_P2P
301 tSirNoAParam p2pNoA;
302 tSirP2PNoaAttr p2pGoPsUpdate;
Madan Mohan Koyyalamudi666d33a2012-11-29 11:32:59 -0800303 tANI_U32 defaultAuthFailureTimeout;
Viral Modid86bde22012-12-10 13:09:21 -0800304 tSirP2PNoaStart p2pGoPsNoaStartInd;
Jeff Johnson295189b2012-06-20 16:38:30 -0700305#endif
306
307 /* EDCA QoS parameters
308 * gLimEdcaParams - These EDCA parameters are used locally on AP or STA.
309 * If STA, then these are values taken from the Assoc Rsp when associating,
310 * or Beacons/Probe Response after association. If AP, then these are
311 * values originally set locally on AP.
312 *
313 * gLimEdcaParamsBC - These EDCA parameters are use by AP to broadcast
314 * to other STATIONs in the BSS.
315 *
316 * gLimEdcaParamsActive: These EDCA parameters are what's actively being
317 * used on station. Specific AC values may be downgraded depending on
318 * admission control for that particular AC.
319 */
320 tSirMacEdcaParamRecord gLimEdcaParams[MAX_NUM_AC]; //used locally
321 tSirMacEdcaParamRecord gLimEdcaParamsBC[MAX_NUM_AC]; //used for broadcast
322 tSirMacEdcaParamRecord gLimEdcaParamsActive[MAX_NUM_AC];
323
324 tANI_U8 gLimEdcaParamSetCount;
325
326 tBeaconParams beaconParams;
Jeff Johnsone7245742012-09-05 17:12:55 -0700327#ifdef WLAN_FEATURE_11AC
328 tANI_U8 vhtCapability;
329 tANI_U8 vhtTxChannelWidthSet;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700330 tLimOperatingModeInfo gLimOperatingMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700331 tLimWiderBWChannelSwitchInfo gLimWiderBWChannelSwitch;
332 tANI_U8 vhtCapabilityPresentInBeacon;
333 tANI_U8 apCenterChan;
334 tANI_U8 apChanWidth;
Jeff Johnsone7245742012-09-05 17:12:55 -0700335#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700336 tANI_U8 spectrumMgtEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -0700337 /* *********************11H related*****************************/
338 //tANI_U32 gLim11hEnable;
339 tLimSpecMgmtInfo gLimSpecMgmt;
340 // CB Primary/Secondary Channel Switch Info
341 tLimChannelSwitchInfo gLimChannelSwitch;
342 /* *********************End 11H related*****************************/
Jeff Johnson295189b2012-06-20 16:38:30 -0700343
344 /*Flag to Track Status/Indicate HBFailure on this session */
345 tANI_BOOLEAN LimHBFailureStatus;
346 tANI_U32 gLimPhyMode;
Jeff Johnsone7245742012-09-05 17:12:55 -0700347
Gopichand Nakkala777e6032012-12-31 16:39:21 -0800348 /**
349 * Following is the place holder for free peer index pool.
350 * A non-zero value indicates that peer index is available
351 * for assignment.
352 */
353 tANI_U8 *gpLimPeerIdxpool;
354 tANI_U8 freePeerIdxHead;
355 tANI_U8 freePeerIdxTail;
356 tANI_U16 gLimNumOfCurrentSTAs;
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/*--------------------------------------------------------------------------
406 \brief peFindSessionByPeerSta() - looks up the PE session given the Peer Station Address.
407
408 This function returns the session context and the session ID if the session
409 corresponding to the given destination address is found in the PE session table.
410
411 \param pMac - pointer to global adapter context
412 \param sa - Peer STA Address of the session
413 \param sessionId -session ID is returned here, if session is found.
414
415 \return tpPESession - pointer to the session context or NULL if session is not found.
416
417 \sa
418 --------------------------------------------------------------------------*/
419tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U8* sessionId);
420
421/*--------------------------------------------------------------------------
422 \brief peFindSessionBySessionId() - looks up the PE session given the session ID.
423
424 This function returns the session context if the session
425 corresponding to the given session ID is found in the PE session table.
426
427 \param pMac - pointer to global adapter context
428 \param sessionId -session ID for which session context needs to be looked up.
429
430 \return tpPESession - pointer to the session context or NULL if session is not found.
431
432 \sa
433 --------------------------------------------------------------------------*/
434 tpPESession peFindSessionBySessionId(tpAniSirGlobal pMac , tANI_U8 sessionId);
435
436/*--------------------------------------------------------------------------
437 \brief peFindSessionByBssid() - looks up the PE session given staid.
438
439 This function returns the session context and the session ID if the session
440 corresponding to the given StaId is found in the PE session table.
441
442 \param pMac - pointer to global adapter context
443 \param staid - StaId of the session
444 \param sessionId - session ID is returned here, if session is found.
445
446 \return tpPESession - pointer to the session context or NULL if session is not found.
447
448--------------------------------------------------------------------------*/
449 tpPESession peFindSessionByStaId(tpAniSirGlobal pMac, tANI_U8 staid, tANI_U8* sessionId);
450
451
452
453
454
455/*--------------------------------------------------------------------------
456 \brief peDeleteSession() - deletes the PE session given the session ID.
457
458
459 \param pMac - pointer to global adapter context
460 \param sessionId -session ID of the session which needs to be deleted.
461
462 \sa
463 --------------------------------------------------------------------------*/
464void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry);
465
466
467/*--------------------------------------------------------------------------
468 \brief peDeleteSession() - Returns the SME session ID and Transaction ID .
469
470
471 \param pMac - pointer to global adapter context
472 \param sessionId -session ID of the session which needs to be deleted.
473
474 \sa
475 --------------------------------------------------------------------------*/
476
477
478#endif //#if !defined( __LIM_SESSION_H )
479
480
481
482
483