blob: 3e0f546f0bbe8554373f68b268944c3101d5b6a9 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22#if !defined( __LIM_SESSION_H )
23#define __LIM_SESSION_H
24
25
26/**=========================================================================
27
28 \file limSession.h
29
30 \brief prototype for lim Session related APIs
31
32 \author Sunit Bhatia
33
34 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
35 Qualcomm Confidential and Proprietary.
36
37 ========================================================================*/
38
39
40/*--------------------------------------------------------------------------
41 Include Files
42 ------------------------------------------------------------------------*/
43
44
45
46/*--------------------------------------------------------------------------
47 Preprocessor definitions and constants
48 ------------------------------------------------------------------------*/
49#ifdef WLAN_SOFTAP_FEATURE
50#define NUM_WEP_KEYS 4
51#endif
52
53/*--------------------------------------------------------------------------
54 Type declarations
55 ------------------------------------------------------------------------*/
56typedef struct
57{
58 tSirMacBeaconInterval beaconInterval;
59 tANI_U8 fShortPreamble;
60 tANI_U8 llaCoexist;
61 tANI_U8 llbCoexist;
62 tANI_U8 llgCoexist;
63 tANI_U8 ht20Coexist;
64 tANI_U8 llnNonGFCoexist;
65 tANI_U8 fRIFSMode;
66 tANI_U8 fLsigTXOPProtectionFullSupport;
67 tANI_U8 gHTObssMode;
68}tBeaconParams, *tpBeaconParams;
69
70typedef struct sPESession // Added to Support BT-AMP
71{
72 /* To check session table is in use or free*/
73 tANI_U8 available;
74 tANI_U8 peSessionId;
75 tANI_U8 smeSessionId;
76 tANI_U16 transactionId;
77
78 //In AP role: BSSID and selfMacAddr will be the same.
79 //In STA role: they will be different
80 tSirMacAddr bssId;
81 tSirMacAddr selfMacAddr;
82 tSirMacSSid ssId;
83 tANI_U8 bssIdx;
84 tANI_U8 valid;
85 tLimMlmStates limMlmState; //MLM State
86 tLimMlmStates limPrevMlmState; //Previous MLM State
87 tLimSmeStates limSmeState; //SME State
88 tLimSmeStates limPrevSmeState; //Previous SME State
89 tLimSystemRole limSystemRole;
90 tSirBssType bssType;
91 tANI_U8 operMode; // AP - 0; STA - 1 ;
92 tSirNwType nwType;
93 tpSirSmeStartBssReq pLimStartBssReq; //handle to smestart bss req
94 tpSirSmeJoinReq pLimJoinReq; // handle to sme join req
95 tpSirSmeReassocReq pLimReAssocReq; //handle to sme reassoc req
96 tpLimMlmJoinReq pLimMlmJoinReq; //handle to MLM join Req
Madan Mohan Koyyalamudi61bc5662012-11-02 14:33:10 -070097#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
98 void *pLimMlmReassocRetryReq; //keep reasoc req for retry
99#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700100 void *pLimMlmReassocReq; //handle to MLM reassoc Req
101 tANI_U16 channelChangeReasonCode;
102 tANI_U8 dot11mode;
Jeff Johnsone7245742012-09-05 17:12:55 -0700103 tANI_U8 htCapability;
104 /* Supported Channel Width Set: 0-20MHz 1 - 40MHz */
105 tANI_U8 htSupportedChannelWidthSet;
106 /* Recommended Tx Width Set
107 * 0 - use 20 MHz channel (control channel)
108 * 1 - use channel width enabled under Supported Channel Width Set
109 */
110 tANI_U8 htRecommendedTxWidthSet;
111 /* Identifies the 40 MHz extension channel */
112 ePhyChanBondState htSecondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700113 tSirRFBand limRFBand;
114 tANI_U8 limIbssActive; //TO SUPPORT CONCURRENCY
115
116 /* These global varibales moved to session Table to support BT-AMP : Oct 9th review */
117 tAniAuthType limCurrentAuthType;
118 tANI_U16 limCurrentBssCaps;
119 tANI_U8 limCurrentBssQosCaps;
120 tANI_U16 limCurrentBssPropCap;
121 tANI_U8 limSentCapsChangeNtf;
Jeff Johnson295189b2012-06-20 16:38:30 -0700122 tANI_U16 limAID;
123
124 /* Parameters For Reassociation */
125 tSirMacAddr limReAssocbssId;
126 tSirMacChanNum limReassocChannelId;
Jeff Johnsone7245742012-09-05 17:12:55 -0700127 /* CB paramaters required/duplicated for Reassoc since re-assoc mantains its own params in lim */
128 tANI_U8 reAssocHtSupportedChannelWidthSet;
129 tANI_U8 reAssocHtRecommendedTxWidthSet;
130 ePhyChanBondState reAssocHtSecondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700131 tSirMacSSid limReassocSSID;
132 tANI_U16 limReassocBssCaps;
133 tANI_U8 limReassocBssQosCaps;
134 tANI_U16 limReassocBssPropCap;
Jeff Johnson295189b2012-06-20 16:38:30 -0700135
136 // Assoc or ReAssoc Response Data/Frame
137 void *limAssocResponseData;
138
139
140
141 /** BSS Table parameters **/
142
143
144 /*
145 * staId: Start BSS: this is the Sta Id for the BSS.
146 Join: this is the selfStaId
147 In both cases above, the peer STA ID wll be stored in dph hash table.
148 */
149 tANI_U16 staId;
150 tANI_U16 statypeForBss; //to know session is for PEER or SELF
151 tANI_U8 shortSlotTimeSupported;
152 tANI_U8 dtimPeriod;
153 tSirMacRateSet rateSet;
154 tSirMacRateSet extRateSet;
155 tSirMacHTOperatingMode htOperMode;
156 tANI_U8 currentOperChannel;
157 tANI_U8 currentReqChannel;
158 tANI_U8 LimRxedBeaconCntDuringHB;
159
160 //Time stamp of the last beacon received from the BSS to which STA is connected.
161 tANI_U64 lastBeaconTimeStamp;
162 //RX Beacon count for the current BSS to which STA is connected.
163 tANI_U32 currentBssBeaconCnt;
164 tANI_U8 lastBeaconDtimCount;
165 tANI_U8 lastBeaconDtimPeriod;
166
167 tANI_U32 bcnLen;
168 tANI_U8 *beacon; //Used to store last beacon / probe response before assoc.
169
170 tANI_U32 assocReqLen;
171 tANI_U8 *assocReq; //Used to store association request frame sent out while associating.
172
173 tANI_U32 assocRspLen;
174 tANI_U8 *assocRsp; //Used to store association response received while associating
175 tAniSirDph dph;
176 void * *parsedAssocReq; //Used to store parsed assoc req from various requesting station
177#ifdef WLAN_FEATURE_VOWIFI_11R
178 tANI_U32 RICDataLen; //Used to store the Ric data received in the assoc response
179 tANI_U8 *ricData;
180#endif
181#ifdef FEATURE_WLAN_CCX
182 tANI_U32 tspecLen; //Used to store the TSPEC IEs received in the assoc response
183 tANI_U8 *tspecIes;
184#endif
185 tANI_U32 encryptType;
186
187#ifdef WLAN_SOFTAP_FEATURE
188 tANI_BOOLEAN bTkipCntrMeasActive; // Used to keep record of TKIP counter measures start/stop
189
190 tANI_U8 gLimProtectionControl; //used for 11n protection
191
192 tANI_U8 gHTNonGFDevicesPresent;
193
194 //protection related config cache
195 tCfgProtection cfgProtection;
196
197 // Number of legacy STAs associated
198 tLimProtStaParams gLim11bParams;
199
200 // Number of 11A STAs associated
201 tLimProtStaParams gLim11aParams;
202
203 // Number of non-ht non-legacy STAs associated
204 tLimProtStaParams gLim11gParams;
205
206 //Number of nonGf STA associated
207 tLimProtStaParams gLimNonGfParams;
208
209 //Number of HT 20 STAs associated
210 tLimProtStaParams gLimHt20Params;
211
212 //Number of Lsig Txop not supported STAs associated
213 tLimProtStaParams gLimLsigTxopParams;
214
215 // Number of STAs that do not support short preamble
216 tLimNoShortParams gLimNoShortParams;
217
218 // Number of STAs that do not support short slot time
219 tLimNoShortSlotParams gLimNoShortSlotParams;
220
221
222 // OLBC parameters
223 tLimProtStaParams gLimOlbcParams;
224
225 // OLBC parameters
226 tLimProtStaParams gLimOverlap11gParams;
227
228 tLimProtStaParams gLimOverlap11aParams;
229 tLimProtStaParams gLimOverlapHt20Params;
230 tLimProtStaParams gLimOverlapNonGfParams;
231
232 //cache for each overlap
233 tCacheParams protStaCache[LIM_PROT_STA_CACHE_SIZE];
234
235 tANI_U8 privacy;
236 tAniAuthType authType;
237 tSirKeyMaterial WEPKeyMaterial[NUM_WEP_KEYS];
238
239 tDot11fIERSN gStartBssRSNIe;
240 tDot11fIEWPA gStartBssWPAIe;
241 tSirAPWPSIEs APWPSIEs;
242 tANI_U8 apUapsdEnable;
243 tSirWPSPBCSession *pAPWPSPBCSession;
244 tANI_U32 DefProbeRspIeBitmap[8];
245 tANI_U32 proxyProbeRspEn;
246 tDot11fProbeResponse probeRespFrame;
247 tANI_U8 ssidHidden;
248 tANI_BOOLEAN fwdWPSPBCProbeReq;
249 tANI_U8 wps_state;
250#endif
251
252 tANI_U8 limQosEnabled:1; //11E
253 tANI_U8 limWmeEnabled:1; //WME
254 tANI_U8 limWsmEnabled:1; //WSM
255 tANI_U8 limHcfEnabled:1;
256 tANI_U8 lim11dEnabled:1;
257
258 tANI_U32 lim11hEnable;
259
260 tPowerdBm maxTxPower; //MIN (Regulatory and local power constraint)
261 tVOS_CON_MODE pePersona;
262#if defined WLAN_FEATURE_VOWIFI
263 tPowerdBm txMgmtPower;
264#endif
265
266#ifdef WLAN_FEATURE_VOWIFI_11R
267 tAniBool is11Rconnection;
268#endif
269
270#ifdef FEATURE_WLAN_CCX
271 tAniBool isCCXconnection;
272 tCcxPEContext ccxContext;
273#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700274#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700275 tAniBool isFastTransitionEnabled;
276#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700277#ifdef FEATURE_WLAN_LFR
278 tAniBool isFastRoamIniFeatureEnabled;
279#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700280#ifdef WLAN_FEATURE_P2P
281 tSirNoAParam p2pNoA;
282 tSirP2PNoaAttr p2pGoPsUpdate;
Madan Mohan Koyyalamudi666d33a2012-11-29 11:32:59 -0800283 tANI_U32 defaultAuthFailureTimeout;
Jeff Johnson295189b2012-06-20 16:38:30 -0700284#endif
285
286 /* EDCA QoS parameters
287 * gLimEdcaParams - These EDCA parameters are used locally on AP or STA.
288 * If STA, then these are values taken from the Assoc Rsp when associating,
289 * or Beacons/Probe Response after association. If AP, then these are
290 * values originally set locally on AP.
291 *
292 * gLimEdcaParamsBC - These EDCA parameters are use by AP to broadcast
293 * to other STATIONs in the BSS.
294 *
295 * gLimEdcaParamsActive: These EDCA parameters are what's actively being
296 * used on station. Specific AC values may be downgraded depending on
297 * admission control for that particular AC.
298 */
299 tSirMacEdcaParamRecord gLimEdcaParams[MAX_NUM_AC]; //used locally
300 tSirMacEdcaParamRecord gLimEdcaParamsBC[MAX_NUM_AC]; //used for broadcast
301 tSirMacEdcaParamRecord gLimEdcaParamsActive[MAX_NUM_AC];
302
303 tANI_U8 gLimEdcaParamSetCount;
304
305 tBeaconParams beaconParams;
Jeff Johnsone7245742012-09-05 17:12:55 -0700306#ifdef WLAN_FEATURE_11AC
307 tANI_U8 vhtCapability;
308 tANI_U8 vhtTxChannelWidthSet;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700309 tLimOperatingModeInfo gLimOperatingMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700310 tLimWiderBWChannelSwitchInfo gLimWiderBWChannelSwitch;
311 tANI_U8 vhtCapabilityPresentInBeacon;
312 tANI_U8 apCenterChan;
313 tANI_U8 apChanWidth;
Jeff Johnsone7245742012-09-05 17:12:55 -0700314#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700315 tANI_U8 spectrumMgtEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -0700316 /* *********************11H related*****************************/
317 //tANI_U32 gLim11hEnable;
318 tLimSpecMgmtInfo gLimSpecMgmt;
319 // CB Primary/Secondary Channel Switch Info
320 tLimChannelSwitchInfo gLimChannelSwitch;
321 /* *********************End 11H related*****************************/
Jeff Johnson295189b2012-06-20 16:38:30 -0700322
323 /*Flag to Track Status/Indicate HBFailure on this session */
324 tANI_BOOLEAN LimHBFailureStatus;
325 tANI_U32 gLimPhyMode;
Jeff Johnsone7245742012-09-05 17:12:55 -0700326
Jeff Johnson295189b2012-06-20 16:38:30 -0700327}tPESession, *tpPESession;
328
329#define LIM_MAX_ACTIVE_SESSIONS 4
330
331
332/*-------------------------------------------------------------------------
333 Function declarations and documenation
334 ------------------------------------------------------------------------*/
335
336
337/*--------------------------------------------------------------------------
338
339 \brief peCreateSession() - creates a new PE session given the BSSID
340
341 This function returns the session context and the session ID if the session
342 corresponding to the passed BSSID is found in the PE session table.
343
344 \param pMac - pointer to global adapter context
345 \param bssid - BSSID of the new session
346 \param sessionId -session ID is returned here, if session is created.
347
348 \return tpPESession - pointer to the session context or NULL if session can not be created.
349
350 \sa
351
352 --------------------------------------------------------------------------*/
353tpPESession peCreateSession(tpAniSirGlobal pMac, tANI_U8 *bssid , tANI_U8* sessionId, tANI_U16 numSta);
354
355
356/*--------------------------------------------------------------------------
357 \brief peFindSessionByBssid() - looks up the PE session given the BSSID.
358
359 This function returns the session context and the session ID if the session
360 corresponding to the given BSSID is found in the PE session table.
361
362 \param pMac - pointer to global adapter context
363 \param bssid - BSSID of the session
364 \param sessionId -session ID is returned here, if session is found.
365
366 \return tpPESession - pointer to the session context or NULL if session is not found.
367
368 \sa
369 --------------------------------------------------------------------------*/
370tpPESession peFindSessionByBssid(tpAniSirGlobal pMac, tANI_U8* bssid, tANI_U8* sessionId);
371
372
373
374/*--------------------------------------------------------------------------
375 \brief peFindSessionByPeerSta() - looks up the PE session given the Peer Station Address.
376
377 This function returns the session context and the session ID if the session
378 corresponding to the given destination address is found in the PE session table.
379
380 \param pMac - pointer to global adapter context
381 \param sa - Peer STA Address of the session
382 \param sessionId -session ID is returned here, if session is found.
383
384 \return tpPESession - pointer to the session context or NULL if session is not found.
385
386 \sa
387 --------------------------------------------------------------------------*/
388tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U8* sessionId);
389
390/*--------------------------------------------------------------------------
391 \brief peFindSessionBySessionId() - looks up the PE session given the session ID.
392
393 This function returns the session context if the session
394 corresponding to the given session ID is found in the PE session table.
395
396 \param pMac - pointer to global adapter context
397 \param sessionId -session ID for which session context needs to be looked up.
398
399 \return tpPESession - pointer to the session context or NULL if session is not found.
400
401 \sa
402 --------------------------------------------------------------------------*/
403 tpPESession peFindSessionBySessionId(tpAniSirGlobal pMac , tANI_U8 sessionId);
404
405/*--------------------------------------------------------------------------
406 \brief peFindSessionByBssid() - looks up the PE session given staid.
407
408 This function returns the session context and the session ID if the session
409 corresponding to the given StaId is found in the PE session table.
410
411 \param pMac - pointer to global adapter context
412 \param staid - StaId 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--------------------------------------------------------------------------*/
418 tpPESession peFindSessionByStaId(tpAniSirGlobal pMac, tANI_U8 staid, tANI_U8* sessionId);
419
420
421
422
423
424/*--------------------------------------------------------------------------
425 \brief peDeleteSession() - deletes the PE session given the session ID.
426
427
428 \param pMac - pointer to global adapter context
429 \param sessionId -session ID of the session which needs to be deleted.
430
431 \sa
432 --------------------------------------------------------------------------*/
433void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry);
434
435
436/*--------------------------------------------------------------------------
437 \brief peDeleteSession() - Returns the SME session ID and Transaction ID .
438
439
440 \param pMac - pointer to global adapter context
441 \param sessionId -session ID of the session which needs to be deleted.
442
443 \sa
444 --------------------------------------------------------------------------*/
445
446
447#endif //#if !defined( __LIM_SESSION_H )
448
449
450
451
452