blob: ca39bd87998724463a8699cafee5ca956b5b32ed [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
97 void *pLimMlmReassocReq; //handle to MLM reassoc Req
98 tANI_U16 channelChangeReasonCode;
99 tANI_U8 dot11mode;
Jeff Johnsone7245742012-09-05 17:12:55 -0700100 tANI_U8 htCapability;
101 /* Supported Channel Width Set: 0-20MHz 1 - 40MHz */
102 tANI_U8 htSupportedChannelWidthSet;
103 /* Recommended Tx Width Set
104 * 0 - use 20 MHz channel (control channel)
105 * 1 - use channel width enabled under Supported Channel Width Set
106 */
107 tANI_U8 htRecommendedTxWidthSet;
108 /* Identifies the 40 MHz extension channel */
109 ePhyChanBondState htSecondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700110 tSirRFBand limRFBand;
111 tANI_U8 limIbssActive; //TO SUPPORT CONCURRENCY
112
113 /* These global varibales moved to session Table to support BT-AMP : Oct 9th review */
114 tAniAuthType limCurrentAuthType;
115 tANI_U16 limCurrentBssCaps;
116 tANI_U8 limCurrentBssQosCaps;
117 tANI_U16 limCurrentBssPropCap;
118 tANI_U8 limSentCapsChangeNtf;
Jeff Johnson295189b2012-06-20 16:38:30 -0700119 tANI_U16 limAID;
120
121 /* Parameters For Reassociation */
122 tSirMacAddr limReAssocbssId;
123 tSirMacChanNum limReassocChannelId;
Jeff Johnsone7245742012-09-05 17:12:55 -0700124 /* CB paramaters required/duplicated for Reassoc since re-assoc mantains its own params in lim */
125 tANI_U8 reAssocHtSupportedChannelWidthSet;
126 tANI_U8 reAssocHtRecommendedTxWidthSet;
127 ePhyChanBondState reAssocHtSecondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 tSirMacSSid limReassocSSID;
129 tANI_U16 limReassocBssCaps;
130 tANI_U8 limReassocBssQosCaps;
131 tANI_U16 limReassocBssPropCap;
Jeff Johnson295189b2012-06-20 16:38:30 -0700132
133 // Assoc or ReAssoc Response Data/Frame
134 void *limAssocResponseData;
135
136
137
138 /** BSS Table parameters **/
139
140
141 /*
142 * staId: Start BSS: this is the Sta Id for the BSS.
143 Join: this is the selfStaId
144 In both cases above, the peer STA ID wll be stored in dph hash table.
145 */
146 tANI_U16 staId;
147 tANI_U16 statypeForBss; //to know session is for PEER or SELF
148 tANI_U8 shortSlotTimeSupported;
149 tANI_U8 dtimPeriod;
150 tSirMacRateSet rateSet;
151 tSirMacRateSet extRateSet;
152 tSirMacHTOperatingMode htOperMode;
153 tANI_U8 currentOperChannel;
154 tANI_U8 currentReqChannel;
155 tANI_U8 LimRxedBeaconCntDuringHB;
156
157 //Time stamp of the last beacon received from the BSS to which STA is connected.
158 tANI_U64 lastBeaconTimeStamp;
159 //RX Beacon count for the current BSS to which STA is connected.
160 tANI_U32 currentBssBeaconCnt;
161 tANI_U8 lastBeaconDtimCount;
162 tANI_U8 lastBeaconDtimPeriod;
163
164 tANI_U32 bcnLen;
165 tANI_U8 *beacon; //Used to store last beacon / probe response before assoc.
166
167 tANI_U32 assocReqLen;
168 tANI_U8 *assocReq; //Used to store association request frame sent out while associating.
169
170 tANI_U32 assocRspLen;
171 tANI_U8 *assocRsp; //Used to store association response received while associating
172 tAniSirDph dph;
173 void * *parsedAssocReq; //Used to store parsed assoc req from various requesting station
174#ifdef WLAN_FEATURE_VOWIFI_11R
175 tANI_U32 RICDataLen; //Used to store the Ric data received in the assoc response
176 tANI_U8 *ricData;
177#endif
178#ifdef FEATURE_WLAN_CCX
179 tANI_U32 tspecLen; //Used to store the TSPEC IEs received in the assoc response
180 tANI_U8 *tspecIes;
181#endif
182 tANI_U32 encryptType;
183
184#ifdef WLAN_SOFTAP_FEATURE
185 tANI_BOOLEAN bTkipCntrMeasActive; // Used to keep record of TKIP counter measures start/stop
186
187 tANI_U8 gLimProtectionControl; //used for 11n protection
188
189 tANI_U8 gHTNonGFDevicesPresent;
190
191 //protection related config cache
192 tCfgProtection cfgProtection;
193
194 // Number of legacy STAs associated
195 tLimProtStaParams gLim11bParams;
196
197 // Number of 11A STAs associated
198 tLimProtStaParams gLim11aParams;
199
200 // Number of non-ht non-legacy STAs associated
201 tLimProtStaParams gLim11gParams;
202
203 //Number of nonGf STA associated
204 tLimProtStaParams gLimNonGfParams;
205
206 //Number of HT 20 STAs associated
207 tLimProtStaParams gLimHt20Params;
208
209 //Number of Lsig Txop not supported STAs associated
210 tLimProtStaParams gLimLsigTxopParams;
211
212 // Number of STAs that do not support short preamble
213 tLimNoShortParams gLimNoShortParams;
214
215 // Number of STAs that do not support short slot time
216 tLimNoShortSlotParams gLimNoShortSlotParams;
217
218
219 // OLBC parameters
220 tLimProtStaParams gLimOlbcParams;
221
222 // OLBC parameters
223 tLimProtStaParams gLimOverlap11gParams;
224
225 tLimProtStaParams gLimOverlap11aParams;
226 tLimProtStaParams gLimOverlapHt20Params;
227 tLimProtStaParams gLimOverlapNonGfParams;
228
229 //cache for each overlap
230 tCacheParams protStaCache[LIM_PROT_STA_CACHE_SIZE];
231
232 tANI_U8 privacy;
233 tAniAuthType authType;
234 tSirKeyMaterial WEPKeyMaterial[NUM_WEP_KEYS];
235
236 tDot11fIERSN gStartBssRSNIe;
237 tDot11fIEWPA gStartBssWPAIe;
238 tSirAPWPSIEs APWPSIEs;
239 tANI_U8 apUapsdEnable;
240 tSirWPSPBCSession *pAPWPSPBCSession;
241 tANI_U32 DefProbeRspIeBitmap[8];
242 tANI_U32 proxyProbeRspEn;
243 tDot11fProbeResponse probeRespFrame;
244 tANI_U8 ssidHidden;
245 tANI_BOOLEAN fwdWPSPBCProbeReq;
246 tANI_U8 wps_state;
247#endif
248
249 tANI_U8 limQosEnabled:1; //11E
250 tANI_U8 limWmeEnabled:1; //WME
251 tANI_U8 limWsmEnabled:1; //WSM
252 tANI_U8 limHcfEnabled:1;
253 tANI_U8 lim11dEnabled:1;
254
255 tANI_U32 lim11hEnable;
256
257 tPowerdBm maxTxPower; //MIN (Regulatory and local power constraint)
258 tVOS_CON_MODE pePersona;
259#if defined WLAN_FEATURE_VOWIFI
260 tPowerdBm txMgmtPower;
261#endif
262
263#ifdef WLAN_FEATURE_VOWIFI_11R
264 tAniBool is11Rconnection;
265#endif
266
267#ifdef FEATURE_WLAN_CCX
268 tAniBool isCCXconnection;
269 tCcxPEContext ccxContext;
270#endif
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700271#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700272 tAniBool isFastTransitionEnabled;
273#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700274#ifdef FEATURE_WLAN_LFR
275 tAniBool isFastRoamIniFeatureEnabled;
276#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700277#ifdef WLAN_FEATURE_P2P
278 tSirNoAParam p2pNoA;
279 tSirP2PNoaAttr p2pGoPsUpdate;
280#endif
281
282 /* EDCA QoS parameters
283 * gLimEdcaParams - These EDCA parameters are used locally on AP or STA.
284 * If STA, then these are values taken from the Assoc Rsp when associating,
285 * or Beacons/Probe Response after association. If AP, then these are
286 * values originally set locally on AP.
287 *
288 * gLimEdcaParamsBC - These EDCA parameters are use by AP to broadcast
289 * to other STATIONs in the BSS.
290 *
291 * gLimEdcaParamsActive: These EDCA parameters are what's actively being
292 * used on station. Specific AC values may be downgraded depending on
293 * admission control for that particular AC.
294 */
295 tSirMacEdcaParamRecord gLimEdcaParams[MAX_NUM_AC]; //used locally
296 tSirMacEdcaParamRecord gLimEdcaParamsBC[MAX_NUM_AC]; //used for broadcast
297 tSirMacEdcaParamRecord gLimEdcaParamsActive[MAX_NUM_AC];
298
299 tANI_U8 gLimEdcaParamSetCount;
300
301 tBeaconParams beaconParams;
Jeff Johnsone7245742012-09-05 17:12:55 -0700302#ifdef WLAN_FEATURE_11AC
303 tANI_U8 vhtCapability;
304 tANI_U8 vhtTxChannelWidthSet;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700305 tLimOperatingModeInfo gLimOperatingMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700306 tLimWiderBWChannelSwitchInfo gLimWiderBWChannelSwitch;
307 tANI_U8 vhtCapabilityPresentInBeacon;
308 tANI_U8 apCenterChan;
309 tANI_U8 apChanWidth;
Jeff Johnsone7245742012-09-05 17:12:55 -0700310#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700311 tANI_U8 spectrumMgtEnabled;
Jeff Johnsone7245742012-09-05 17:12:55 -0700312 /* *********************11H related*****************************/
313 //tANI_U32 gLim11hEnable;
314 tLimSpecMgmtInfo gLimSpecMgmt;
315 // CB Primary/Secondary Channel Switch Info
316 tLimChannelSwitchInfo gLimChannelSwitch;
317 /* *********************End 11H related*****************************/
Jeff Johnson295189b2012-06-20 16:38:30 -0700318
319 /*Flag to Track Status/Indicate HBFailure on this session */
320 tANI_BOOLEAN LimHBFailureStatus;
321 tANI_U32 gLimPhyMode;
Jeff Johnsone7245742012-09-05 17:12:55 -0700322
Jeff Johnson295189b2012-06-20 16:38:30 -0700323}tPESession, *tpPESession;
324
325#define LIM_MAX_ACTIVE_SESSIONS 4
326
327
328/*-------------------------------------------------------------------------
329 Function declarations and documenation
330 ------------------------------------------------------------------------*/
331
332
333/*--------------------------------------------------------------------------
334
335 \brief peCreateSession() - creates a new PE session given the BSSID
336
337 This function returns the session context and the session ID if the session
338 corresponding to the passed BSSID is found in the PE session table.
339
340 \param pMac - pointer to global adapter context
341 \param bssid - BSSID of the new session
342 \param sessionId -session ID is returned here, if session is created.
343
344 \return tpPESession - pointer to the session context or NULL if session can not be created.
345
346 \sa
347
348 --------------------------------------------------------------------------*/
349tpPESession peCreateSession(tpAniSirGlobal pMac, tANI_U8 *bssid , tANI_U8* sessionId, tANI_U16 numSta);
350
351
352/*--------------------------------------------------------------------------
353 \brief peFindSessionByBssid() - looks up the PE session given the BSSID.
354
355 This function returns the session context and the session ID if the session
356 corresponding to the given BSSID is found in the PE session table.
357
358 \param pMac - pointer to global adapter context
359 \param bssid - BSSID of the session
360 \param sessionId -session ID is returned here, if session is found.
361
362 \return tpPESession - pointer to the session context or NULL if session is not found.
363
364 \sa
365 --------------------------------------------------------------------------*/
366tpPESession peFindSessionByBssid(tpAniSirGlobal pMac, tANI_U8* bssid, tANI_U8* sessionId);
367
368
369
370/*--------------------------------------------------------------------------
371 \brief peFindSessionByPeerSta() - looks up the PE session given the Peer Station Address.
372
373 This function returns the session context and the session ID if the session
374 corresponding to the given destination address is found in the PE session table.
375
376 \param pMac - pointer to global adapter context
377 \param sa - Peer STA Address of the session
378 \param sessionId -session ID is returned here, if session is found.
379
380 \return tpPESession - pointer to the session context or NULL if session is not found.
381
382 \sa
383 --------------------------------------------------------------------------*/
384tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U8* sessionId);
385
386/*--------------------------------------------------------------------------
387 \brief peFindSessionBySessionId() - looks up the PE session given the session ID.
388
389 This function returns the session context if the session
390 corresponding to the given session ID is found in the PE session table.
391
392 \param pMac - pointer to global adapter context
393 \param sessionId -session ID for which session context needs to be looked up.
394
395 \return tpPESession - pointer to the session context or NULL if session is not found.
396
397 \sa
398 --------------------------------------------------------------------------*/
399 tpPESession peFindSessionBySessionId(tpAniSirGlobal pMac , tANI_U8 sessionId);
400
401/*--------------------------------------------------------------------------
402 \brief peFindSessionByBssid() - looks up the PE session given staid.
403
404 This function returns the session context and the session ID if the session
405 corresponding to the given StaId is found in the PE session table.
406
407 \param pMac - pointer to global adapter context
408 \param staid - StaId of the session
409 \param sessionId - session ID is returned here, if session is found.
410
411 \return tpPESession - pointer to the session context or NULL if session is not found.
412
413--------------------------------------------------------------------------*/
414 tpPESession peFindSessionByStaId(tpAniSirGlobal pMac, tANI_U8 staid, tANI_U8* sessionId);
415
416
417
418
419
420/*--------------------------------------------------------------------------
421 \brief peDeleteSession() - deletes the PE session given the session ID.
422
423
424 \param pMac - pointer to global adapter context
425 \param sessionId -session ID of the session which needs to be deleted.
426
427 \sa
428 --------------------------------------------------------------------------*/
429void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry);
430
431
432/*--------------------------------------------------------------------------
433 \brief peDeleteSession() - Returns the SME session ID and Transaction ID .
434
435
436 \param pMac - pointer to global adapter context
437 \param sessionId -session ID of the session which needs to be deleted.
438
439 \sa
440 --------------------------------------------------------------------------*/
441
442
443#endif //#if !defined( __LIM_SESSION_H )
444
445
446
447
448