blob: caf444a58c7cd5f8b3ff6e3b544f268c351a8c49 [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
Jeff Johnson295189b2012-06-20 16:38:30 -070042/**=========================================================================
43
44 \file limSession.c
45
46 \brief implementation for lim Session related APIs
47
48 \author Sunit Bhatia
49
50 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
51
52 Qualcomm Confidential and Proprietary.
53
54 ========================================================================*/
55
56
57/*--------------------------------------------------------------------------
58 Include Files
59 ------------------------------------------------------------------------*/
60#include "aniGlobal.h"
61#include "limDebug.h"
62#include "limSession.h"
63#include "limUtils.h"
Srinivas Girigowda5cecb202013-10-08 09:13:25 -070064#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -070065#include "ccxApi.h"
66#endif
67
68/*--------------------------------------------------------------------------
69
70 \brief peInitBeaconParams() - Initialize the beaconParams structure
71
72
73 \param tpPESession - pointer to the session context or NULL if session can not be created.
74 \return void
75 \sa
76
77 --------------------------------------------------------------------------*/
78
79void peInitBeaconParams(tpAniSirGlobal pMac, tpPESession psessionEntry)
80{
81 psessionEntry->beaconParams.beaconInterval = 0;
82 psessionEntry->beaconParams.fShortPreamble = 0;
83 psessionEntry->beaconParams.llaCoexist = 0;
84 psessionEntry->beaconParams.llbCoexist = 0;
85 psessionEntry->beaconParams.llgCoexist = 0;
86 psessionEntry->beaconParams.ht20Coexist = 0;
87 psessionEntry->beaconParams.llnNonGFCoexist = 0;
88 psessionEntry->beaconParams.fRIFSMode = 0;
89 psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = 0;
90 psessionEntry->beaconParams.gHTObssMode = 0;
91
92 // Number of legacy STAs associated
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +053093 vos_mem_set((void*)&psessionEntry->gLim11bParams, sizeof(tLimProtStaParams), 0);
94 vos_mem_set((void*)&psessionEntry->gLim11aParams, sizeof(tLimProtStaParams), 0);
95 vos_mem_set((void*)&psessionEntry->gLim11gParams, sizeof(tLimProtStaParams), 0);
96 vos_mem_set((void*)&psessionEntry->gLimNonGfParams, sizeof(tLimProtStaParams), 0);
97 vos_mem_set((void*)&psessionEntry->gLimHt20Params, sizeof(tLimProtStaParams), 0);
98 vos_mem_set((void*)&psessionEntry->gLimLsigTxopParams, sizeof(tLimProtStaParams), 0);
99 vos_mem_set((void*)&psessionEntry->gLimOlbcParams, sizeof(tLimProtStaParams), 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700100}
101
102/*--------------------------------------------------------------------------
103
104 \brief peCreateSession() - creates a new PE session given the BSSID
105
106 This function returns the session context and the session ID if the session
107 corresponding to the passed BSSID is found in the PE session table.
108
109 \param pMac - pointer to global adapter context
110 \param bssid - BSSID of the new session
111 \param sessionId -session ID is returned here, if session is created.
112
113 \return tpPESession - pointer to the session context or NULL if session can not be created.
114
115 \sa
116
117 --------------------------------------------------------------------------*/
118tpPESession peCreateSession(tpAniSirGlobal pMac, tANI_U8 *bssid , tANI_U8* sessionId, tANI_U16 numSta)
119{
120 tANI_U8 i;
121 for(i =0; i < pMac->lim.maxBssId; i++)
122 {
123 /* Find first free room in session table */
124 if(pMac->lim.gpSession[i].valid == FALSE)
125 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530126 vos_mem_set((void*)&pMac->lim.gpSession[i], sizeof(tPESession), 0);
Jeff Johnson295189b2012-06-20 16:38:30 -0700127
128 //Allocate space for Station Table for this session.
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530129 pMac->lim.gpSession[i].dph.dphHashTable.pHashTable = vos_mem_malloc(
130 sizeof(tpDphHashNode)*numSta);
131 if ( NULL == pMac->lim.gpSession[i].dph.dphHashTable.pHashTable )
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700133 limLog(pMac, LOGE, FL("memory allocate failed!"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700134 return NULL;
135 }
136
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530137 pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray = vos_mem_malloc(
138 sizeof(tDphHashNode)*numSta);
139 if ( NULL == pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray )
Jeff Johnson295189b2012-06-20 16:38:30 -0700140 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700141 limLog(pMac, LOGE, FL("memory allocate failed!"));
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530142 vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pHashTable);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800143 pMac->lim.gpSession[i].dph.dphHashTable.pHashTable = NULL;
Jeff Johnson295189b2012-06-20 16:38:30 -0700144 return NULL;
145 }
146 pMac->lim.gpSession[i].dph.dphHashTable.size = numSta;
147
148 dphHashTableClassInit(pMac,
149 &pMac->lim.gpSession[i].dph.dphHashTable);
150
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530151 pMac->lim.gpSession[i].gpLimPeerIdxpool = vos_mem_malloc(sizeof(
152 *pMac->lim.gpSession[i].gpLimPeerIdxpool) * (numSta+1));
153 if ( NULL == pMac->lim.gpSession[i].gpLimPeerIdxpool )
Gopichand Nakkala777e6032012-12-31 16:39:21 -0800154 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700155 PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!"));)
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530156 vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pHashTable);
157 vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray);
Leela Venkata Kiran Kumar Reddy Chiralad6c0fe22013-12-11 19:10:50 -0800158 pMac->lim.gpSession[i].dph.dphHashTable.pHashTable = NULL;
159 pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray = NULL;
Gopichand Nakkala777e6032012-12-31 16:39:21 -0800160 return NULL;
161 }
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530162 vos_mem_set(pMac->lim.gpSession[i].gpLimPeerIdxpool,
163 sizeof(*pMac->lim.gpSession[i].gpLimPeerIdxpool) * (numSta+1), 0);
Gopichand Nakkala777e6032012-12-31 16:39:21 -0800164 pMac->lim.gpSession[i].freePeerIdxHead = 0;
165 pMac->lim.gpSession[i].freePeerIdxTail = 0;
166 pMac->lim.gpSession[i].gLimNumOfCurrentSTAs = 0;
167
Jeff Johnson295189b2012-06-20 16:38:30 -0700168 /* Copy the BSSID to the session table */
169 sirCopyMacAddr(pMac->lim.gpSession[i].bssId, bssid);
170 pMac->lim.gpSession[i].valid = TRUE;
171
172 /* Intialize the SME and MLM states to IDLE */
173 pMac->lim.gpSession[i].limMlmState = eLIM_MLM_IDLE_STATE;
174 pMac->lim.gpSession[i].limSmeState = eLIM_SME_IDLE_STATE;
175 pMac->lim.gpSession[i].limCurrentAuthType = eSIR_OPEN_SYSTEM;
176 peInitBeaconParams(pMac, &pMac->lim.gpSession[i]);
177#ifdef WLAN_FEATURE_VOWIFI_11R
178 pMac->lim.gpSession[i].is11Rconnection = FALSE;
179#endif
180
181#ifdef FEATURE_WLAN_CCX
182 pMac->lim.gpSession[i].isCCXconnection = FALSE;
183#endif
184
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700185#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700186 pMac->lim.gpSession[i].isFastTransitionEnabled = FALSE;
187#endif
Jeff Johnson43971f52012-07-17 12:26:56 -0700188#ifdef FEATURE_WLAN_LFR
189 pMac->lim.gpSession[i].isFastRoamIniFeatureEnabled = FALSE;
190#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700191 *sessionId = i;
192
Jeff Johnsone7245742012-09-05 17:12:55 -0700193 pMac->lim.gpSession[i].gLimPhyMode = WNI_CFG_PHY_MODE_11G; //TODO :Check with the team what should be default mode
194 /* Initialize CB mode variables when session is created */
195 pMac->lim.gpSession[i].htSupportedChannelWidthSet = 0;
196 pMac->lim.gpSession[i].htRecommendedTxWidthSet = 0;
197 pMac->lim.gpSession[i].htSecondaryChannelOffset = 0;
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -0800198#ifdef FEATURE_WLAN_TDLS
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530199 vos_mem_set(pMac->lim.gpSession[i].peerAIDBitmap,
200 sizeof(pMac->lim.gpSession[i].peerAIDBitmap), 0);
Gopichand Nakkala2a0a1572013-02-10 21:39:16 -0800201#endif
Gopichand Nakkalabe8653b2013-04-10 08:16:05 +0530202 pMac->lim.gpSession[i].fWaitForProbeRsp = 0;
203 pMac->lim.gpSession[i].fIgnoreCapsChange = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700204 return(&pMac->lim.gpSession[i]);
205 }
206 }
207 limLog(pMac, LOGE, FL("Session can not be created.. Reached Max permitted sessions \n "));
208 return NULL;
209}
210
211
212/*--------------------------------------------------------------------------
213 \brief peFindSessionByBssid() - looks up the PE session given the BSSID.
214
215 This function returns the session context and the session ID if the session
216 corresponding to the given BSSID is found in the PE session table.
217
218 \param pMac - pointer to global adapter context
219 \param bssid - BSSID of the session
220 \param sessionId -session ID is returned here, if session is found.
221
222 \return tpPESession - pointer to the session context or NULL if session is not found.
223
224 \sa
225 --------------------------------------------------------------------------*/
226tpPESession peFindSessionByBssid(tpAniSirGlobal pMac, tANI_U8* bssid, tANI_U8* sessionId)
227{
228 tANI_U8 i;
229
230 for(i =0; i < pMac->lim.maxBssId; i++)
231 {
232 /* If BSSID matches return corresponding tables address*/
233 if( (pMac->lim.gpSession[i].valid) && (sirCompareMacAddr(pMac->lim.gpSession[i].bssId, bssid)))
234 {
235 *sessionId = i;
236 return(&pMac->lim.gpSession[i]);
237 }
238 }
239
240 limLog(pMac, LOG4, FL("Session lookup fails for BSSID: \n "));
241 limPrintMacAddr(pMac, bssid, LOG4);
242 return(NULL);
243
244}
245
246
Leela Venkata Kiran Kumar Reddy Chirala3ca17902013-02-27 19:50:05 -0800247/*--------------------------------------------------------------------------
248 \brief peFindSessionByBssIdx() - looks up the PE session given the bssIdx.
249
250 This function returns the session context if the session
251 corresponding to the given bssIdx is found in the PE session table.
252 \param pMac - pointer to global adapter context
253 \param bssIdx - bss index of the session
254 \return tpPESession - pointer to the session context or NULL if session is not found.
255 \sa
256 --------------------------------------------------------------------------*/
257tpPESession peFindSessionByBssIdx(tpAniSirGlobal pMac, tANI_U8 bssIdx)
258{
259 tANI_U8 i;
260 for (i = 0; i < pMac->lim.maxBssId; i++)
261 {
262 /* If BSSID matches return corresponding tables address*/
263 if ( (pMac->lim.gpSession[i].valid) && (pMac->lim.gpSession[i].bssIdx == bssIdx))
264 {
265 return &pMac->lim.gpSession[i];
266 }
267 }
268 limLog(pMac, LOG4, FL("Session lookup fails for bssIdx: %d"), bssIdx);
269 return NULL;
270}
Jeff Johnson295189b2012-06-20 16:38:30 -0700271
272/*--------------------------------------------------------------------------
273 \brief peFindSessionBySessionId() - looks up the PE session given the session ID.
274
275 This function returns the session context if the session
276 corresponding to the given session ID is found in the PE session table.
277
278 \param pMac - pointer to global adapter context
279 \param sessionId -session ID for which session context needs to be looked up.
280
281 \return tpPESession - pointer to the session context or NULL if session is not found.
282
283 \sa
284 --------------------------------------------------------------------------*/
285 tpPESession peFindSessionBySessionId(tpAniSirGlobal pMac , tANI_U8 sessionId)
286{
287 if(sessionId >= pMac->lim.maxBssId)
288 {
289 limLog(pMac, LOGE, FL("Invalid sessionId: %d \n "), sessionId);
290 return(NULL);
291 }
292 if((pMac->lim.gpSession[sessionId].valid == TRUE))
293 {
294 return(&pMac->lim.gpSession[sessionId]);
295 }
296 limLog(pMac, LOG1, FL("Session %d not active\n "), sessionId);
297 return(NULL);
298
299}
300
301
302/*--------------------------------------------------------------------------
303 \brief peFindSessionByStaId() - looks up the PE session given staid.
304
305 This function returns the session context and the session ID if the session
306 corresponding to the given StaId is found in the PE session table.
307
308 \param pMac - pointer to global adapter context
309 \param staid - StaId of the session
310 \param sessionId -session ID is returned here, if session is found.
311
312 \return tpPESession - pointer to the session context or NULL if session is not found.
313
314 \sa
315 --------------------------------------------------------------------------*/
316tpPESession peFindSessionByStaId(tpAniSirGlobal pMac, tANI_U8 staid, tANI_U8* sessionId)
317{
318 tANI_U8 i, j;
319
320 for(i =0; i < pMac->lim.maxBssId; i++)
321 {
322 if(pMac->lim.gpSession[i].valid)
323 {
324 for(j = 0; j < pMac->lim.gpSession[i].dph.dphHashTable.size; j++)
325 {
326 if((pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray[j].valid) &&
327 (pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray[j].added) &&
328 (staid == pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray[j].staIndex))
329 {
330 *sessionId = i;
331 return(&pMac->lim.gpSession[i]);
332 }
333 }
334 }
335 }
336
Jeff Johnsone7245742012-09-05 17:12:55 -0700337 limLog(pMac, LOG4, FL("Session lookup fails for StaId: %d\n "), staid);
Jeff Johnson295189b2012-06-20 16:38:30 -0700338 return(NULL);
339}
340
341
342
343/*--------------------------------------------------------------------------
344 \brief peDeleteSession() - deletes the PE session given the session ID.
345
346
347 \param pMac - pointer to global adapter context
348 \param sessionId -session ID of the session which needs to be deleted.
349
350 \sa
351 --------------------------------------------------------------------------*/
352void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry)
353{
354 tANI_U16 i = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700355 tANI_U16 n;
356 TX_TIMER *timer_ptr;
Jeff Johnson295189b2012-06-20 16:38:30 -0700357
358 limLog(pMac, LOGW, FL("Trying to delete a session %d.\n "), psessionEntry->peSessionId);
359
Jeff Johnsone7245742012-09-05 17:12:55 -0700360 for (n = 0; n < pMac->lim.maxStation; n++)
361 {
362 timer_ptr = &pMac->lim.limTimers.gpLimCnfWaitTimer[n];
363
364 if(psessionEntry->peSessionId == timer_ptr->sessionId)
365 {
366 if(VOS_TRUE == tx_timer_running(timer_ptr))
367 {
368 tx_timer_deactivate(timer_ptr);
369 }
370 }
371 }
372
Jeff Johnson295189b2012-06-20 16:38:30 -0700373 if(psessionEntry->pLimStartBssReq != NULL)
374 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530375 vos_mem_free( psessionEntry->pLimStartBssReq );
Jeff Johnson295189b2012-06-20 16:38:30 -0700376 psessionEntry->pLimStartBssReq = NULL;
377 }
378
379 if(psessionEntry->pLimJoinReq != NULL)
380 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530381 vos_mem_free( psessionEntry->pLimJoinReq );
Jeff Johnson295189b2012-06-20 16:38:30 -0700382 psessionEntry->pLimJoinReq = NULL;
383 }
384
385 if(psessionEntry->pLimReAssocReq != NULL)
386 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530387 vos_mem_free( psessionEntry->pLimReAssocReq );
Jeff Johnson295189b2012-06-20 16:38:30 -0700388 psessionEntry->pLimReAssocReq = NULL;
389 }
390
391 if(psessionEntry->pLimMlmJoinReq != NULL)
392 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530393 vos_mem_free( psessionEntry->pLimMlmJoinReq );
Jeff Johnson295189b2012-06-20 16:38:30 -0700394 psessionEntry->pLimMlmJoinReq = NULL;
395 }
396
397 if(psessionEntry->dph.dphHashTable.pHashTable != NULL)
398 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530399 vos_mem_free(psessionEntry->dph.dphHashTable.pHashTable);
Jeff Johnson295189b2012-06-20 16:38:30 -0700400 psessionEntry->dph.dphHashTable.pHashTable = NULL;
401 }
402
403 if(psessionEntry->dph.dphHashTable.pDphNodeArray != NULL)
404 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530405 vos_mem_free(psessionEntry->dph.dphHashTable.pDphNodeArray);
Jeff Johnson295189b2012-06-20 16:38:30 -0700406 psessionEntry->dph.dphHashTable.pDphNodeArray = NULL;
407 }
408
Gopichand Nakkala777e6032012-12-31 16:39:21 -0800409 if(psessionEntry->gpLimPeerIdxpool != NULL)
410 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530411 vos_mem_free(psessionEntry->gpLimPeerIdxpool);
Gopichand Nakkala777e6032012-12-31 16:39:21 -0800412 psessionEntry->gpLimPeerIdxpool = NULL;
413 }
414
Jeff Johnson295189b2012-06-20 16:38:30 -0700415 if(psessionEntry->beacon != NULL)
416 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530417 vos_mem_free( psessionEntry->beacon);
Jeff Johnson295189b2012-06-20 16:38:30 -0700418 psessionEntry->beacon = NULL;
419 }
420
421 if(psessionEntry->assocReq != NULL)
422 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530423 vos_mem_free( psessionEntry->assocReq);
Jeff Johnson295189b2012-06-20 16:38:30 -0700424 psessionEntry->assocReq = NULL;
425 }
426
427 if(psessionEntry->assocRsp != NULL)
428 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530429 vos_mem_free( psessionEntry->assocRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700430 psessionEntry->assocRsp = NULL;
431 }
432
433
434 if(psessionEntry->parsedAssocReq != NULL)
435 {
436 // Cleanup the individual allocation first
437 for (i=0; i < psessionEntry->dph.dphHashTable.size; i++)
438 {
439 if ( psessionEntry->parsedAssocReq[i] != NULL )
440 {
441 if( ((tpSirAssocReq)(psessionEntry->parsedAssocReq[i]))->assocReqFrame )
442 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530443 vos_mem_free(((tpSirAssocReq)
444 (psessionEntry->parsedAssocReq[i]))->assocReqFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700445 ((tpSirAssocReq)(psessionEntry->parsedAssocReq[i]))->assocReqFrame = NULL;
446 ((tpSirAssocReq)(psessionEntry->parsedAssocReq[i]))->assocReqFrameLength = 0;
447 }
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530448 vos_mem_free(psessionEntry->parsedAssocReq[i]);
Jeff Johnson295189b2012-06-20 16:38:30 -0700449 psessionEntry->parsedAssocReq[i] = NULL;
450 }
451 }
452 // Cleanup the whole block
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530453 vos_mem_free(psessionEntry->parsedAssocReq);
Jeff Johnson295189b2012-06-20 16:38:30 -0700454 psessionEntry->parsedAssocReq = NULL;
455 }
Dhanashri Atree3a2a592013-03-08 13:18:42 -0800456 if (NULL != psessionEntry->limAssocResponseData)
457 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530458 vos_mem_free( psessionEntry->limAssocResponseData);
Dhanashri Atree3a2a592013-03-08 13:18:42 -0800459 psessionEntry->limAssocResponseData = NULL;
460 }
461
462#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
463 if (NULL != psessionEntry->pLimMlmReassocRetryReq)
464 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530465 vos_mem_free( psessionEntry->pLimMlmReassocRetryReq);
Dhanashri Atree3a2a592013-03-08 13:18:42 -0800466 psessionEntry->pLimMlmReassocRetryReq = NULL;
467 }
468#endif
469
470 if (NULL != psessionEntry->pLimMlmReassocReq)
471 {
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530472 vos_mem_free( psessionEntry->pLimMlmReassocReq);
Dhanashri Atree3a2a592013-03-08 13:18:42 -0800473 psessionEntry->pLimMlmReassocReq = NULL;
474 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700475
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700476#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -0700477 limCleanupCcxCtxt(pMac, psessionEntry);
478#endif
479
480 psessionEntry->valid = FALSE;
481 return;
482}
483
484
485/*--------------------------------------------------------------------------
486 \brief peFindSessionByPeerSta() - looks up the PE session given the Station Address.
487
488 This function returns the session context and the session ID if the session
489 corresponding to the given station address is found in the PE session table.
490
491 \param pMac - pointer to global adapter context
492 \param sa - Peer STA Address of the session
493 \param sessionId -session ID is returned here, if session is found.
494
495 \return tpPESession - pointer to the session context or NULL if session is not found.
496
497 \sa
498 --------------------------------------------------------------------------*/
499
500
501tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U8* sessionId)
502{
503 tANI_U8 i;
504 tpDphHashNode pSta;
505 tANI_U16 aid;
506
507 for(i =0; i < pMac->lim.maxBssId; i++)
508 {
509 if( (pMac->lim.gpSession[i].valid))
510 {
511 pSta = dphLookupHashEntry(pMac, sa, &aid, &pMac->lim.gpSession[i].dph.dphHashTable);
512 if (pSta != NULL)
513 {
514 *sessionId = i;
515 return &pMac->lim.gpSession[i];
516 }
517 }
518 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700519
520 limLog(pMac, LOG1, FL("Session lookup fails for Peer StaId: \n "));
521 limPrintMacAddr(pMac, sa, LOG1);
Jeff Johnson295189b2012-06-20 16:38:30 -0700522 return NULL;
523}
524
525
526
527
528
529
530
531
532