Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * 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 Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 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 Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 42 | /**========================================================================= |
| 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" |
| 64 | #ifdef FEATURE_WLAN_CCX |
| 65 | #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 | |
| 79 | void 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 Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 93 | 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 Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 100 | } |
| 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 | --------------------------------------------------------------------------*/ |
| 118 | tpPESession 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 Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 126 | vos_mem_set((void*)&pMac->lim.gpSession[i], sizeof(tPESession), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 127 | |
| 128 | //Allocate space for Station Table for this session. |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 129 | 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 Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 132 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 133 | limLog(pMac, LOGE, FL("memory allocate failed!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 134 | return NULL; |
| 135 | } |
| 136 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 137 | 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 Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 140 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 141 | limLog(pMac, LOGE, FL("memory allocate failed!")); |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 142 | vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pHashTable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 143 | return NULL; |
| 144 | } |
| 145 | pMac->lim.gpSession[i].dph.dphHashTable.size = numSta; |
| 146 | |
| 147 | dphHashTableClassInit(pMac, |
| 148 | &pMac->lim.gpSession[i].dph.dphHashTable); |
| 149 | |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 150 | pMac->lim.gpSession[i].gpLimPeerIdxpool = vos_mem_malloc(sizeof( |
| 151 | *pMac->lim.gpSession[i].gpLimPeerIdxpool) * (numSta+1)); |
| 152 | if ( NULL == pMac->lim.gpSession[i].gpLimPeerIdxpool ) |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 153 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 154 | PELOGE(limLog(pMac, LOGE, FL("memory allocate failed!"));) |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 155 | vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pHashTable); |
| 156 | vos_mem_free(pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 157 | return NULL; |
| 158 | } |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 159 | vos_mem_set(pMac->lim.gpSession[i].gpLimPeerIdxpool, |
| 160 | sizeof(*pMac->lim.gpSession[i].gpLimPeerIdxpool) * (numSta+1), 0); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 161 | pMac->lim.gpSession[i].freePeerIdxHead = 0; |
| 162 | pMac->lim.gpSession[i].freePeerIdxTail = 0; |
| 163 | pMac->lim.gpSession[i].gLimNumOfCurrentSTAs = 0; |
| 164 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 165 | /* Copy the BSSID to the session table */ |
| 166 | sirCopyMacAddr(pMac->lim.gpSession[i].bssId, bssid); |
| 167 | pMac->lim.gpSession[i].valid = TRUE; |
| 168 | |
| 169 | /* Intialize the SME and MLM states to IDLE */ |
| 170 | pMac->lim.gpSession[i].limMlmState = eLIM_MLM_IDLE_STATE; |
| 171 | pMac->lim.gpSession[i].limSmeState = eLIM_SME_IDLE_STATE; |
| 172 | pMac->lim.gpSession[i].limCurrentAuthType = eSIR_OPEN_SYSTEM; |
| 173 | peInitBeaconParams(pMac, &pMac->lim.gpSession[i]); |
| 174 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 175 | pMac->lim.gpSession[i].is11Rconnection = FALSE; |
| 176 | #endif |
| 177 | |
| 178 | #ifdef FEATURE_WLAN_CCX |
| 179 | pMac->lim.gpSession[i].isCCXconnection = FALSE; |
| 180 | #endif |
| 181 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 182 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 183 | pMac->lim.gpSession[i].isFastTransitionEnabled = FALSE; |
| 184 | #endif |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 185 | #ifdef FEATURE_WLAN_LFR |
| 186 | pMac->lim.gpSession[i].isFastRoamIniFeatureEnabled = FALSE; |
| 187 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 188 | *sessionId = i; |
| 189 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 190 | pMac->lim.gpSession[i].gLimPhyMode = WNI_CFG_PHY_MODE_11G; //TODO :Check with the team what should be default mode |
| 191 | /* Initialize CB mode variables when session is created */ |
| 192 | pMac->lim.gpSession[i].htSupportedChannelWidthSet = 0; |
| 193 | pMac->lim.gpSession[i].htRecommendedTxWidthSet = 0; |
| 194 | pMac->lim.gpSession[i].htSecondaryChannelOffset = 0; |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 195 | #ifdef FEATURE_WLAN_TDLS |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 196 | vos_mem_set(pMac->lim.gpSession[i].peerAIDBitmap, |
| 197 | sizeof(pMac->lim.gpSession[i].peerAIDBitmap), 0); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 198 | #endif |
Gopichand Nakkala | be8653b | 2013-04-10 08:16:05 +0530 | [diff] [blame] | 199 | pMac->lim.gpSession[i].fWaitForProbeRsp = 0; |
| 200 | pMac->lim.gpSession[i].fIgnoreCapsChange = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 201 | return(&pMac->lim.gpSession[i]); |
| 202 | } |
| 203 | } |
| 204 | limLog(pMac, LOGE, FL("Session can not be created.. Reached Max permitted sessions \n ")); |
| 205 | return NULL; |
| 206 | } |
| 207 | |
| 208 | |
| 209 | /*-------------------------------------------------------------------------- |
| 210 | \brief peFindSessionByBssid() - looks up the PE session given the BSSID. |
| 211 | |
| 212 | This function returns the session context and the session ID if the session |
| 213 | corresponding to the given BSSID is found in the PE session table. |
| 214 | |
| 215 | \param pMac - pointer to global adapter context |
| 216 | \param bssid - BSSID of the session |
| 217 | \param sessionId -session ID is returned here, if session is found. |
| 218 | |
| 219 | \return tpPESession - pointer to the session context or NULL if session is not found. |
| 220 | |
| 221 | \sa |
| 222 | --------------------------------------------------------------------------*/ |
| 223 | tpPESession peFindSessionByBssid(tpAniSirGlobal pMac, tANI_U8* bssid, tANI_U8* sessionId) |
| 224 | { |
| 225 | tANI_U8 i; |
| 226 | |
| 227 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 228 | { |
| 229 | /* If BSSID matches return corresponding tables address*/ |
| 230 | if( (pMac->lim.gpSession[i].valid) && (sirCompareMacAddr(pMac->lim.gpSession[i].bssId, bssid))) |
| 231 | { |
| 232 | *sessionId = i; |
| 233 | return(&pMac->lim.gpSession[i]); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | limLog(pMac, LOG4, FL("Session lookup fails for BSSID: \n ")); |
| 238 | limPrintMacAddr(pMac, bssid, LOG4); |
| 239 | return(NULL); |
| 240 | |
| 241 | } |
| 242 | |
| 243 | |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 244 | /*-------------------------------------------------------------------------- |
| 245 | \brief peFindSessionByBssIdx() - looks up the PE session given the bssIdx. |
| 246 | |
| 247 | This function returns the session context if the session |
| 248 | corresponding to the given bssIdx is found in the PE session table. |
| 249 | \param pMac - pointer to global adapter context |
| 250 | \param bssIdx - bss index of the session |
| 251 | \return tpPESession - pointer to the session context or NULL if session is not found. |
| 252 | \sa |
| 253 | --------------------------------------------------------------------------*/ |
| 254 | tpPESession peFindSessionByBssIdx(tpAniSirGlobal pMac, tANI_U8 bssIdx) |
| 255 | { |
| 256 | tANI_U8 i; |
| 257 | for (i = 0; i < pMac->lim.maxBssId; i++) |
| 258 | { |
| 259 | /* If BSSID matches return corresponding tables address*/ |
| 260 | if ( (pMac->lim.gpSession[i].valid) && (pMac->lim.gpSession[i].bssIdx == bssIdx)) |
| 261 | { |
| 262 | return &pMac->lim.gpSession[i]; |
| 263 | } |
| 264 | } |
| 265 | limLog(pMac, LOG4, FL("Session lookup fails for bssIdx: %d"), bssIdx); |
| 266 | return NULL; |
| 267 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 268 | |
| 269 | /*-------------------------------------------------------------------------- |
| 270 | \brief peFindSessionBySessionId() - looks up the PE session given the session ID. |
| 271 | |
| 272 | This function returns the session context if the session |
| 273 | corresponding to the given session ID is found in the PE session table. |
| 274 | |
| 275 | \param pMac - pointer to global adapter context |
| 276 | \param sessionId -session ID for which session context needs to be looked up. |
| 277 | |
| 278 | \return tpPESession - pointer to the session context or NULL if session is not found. |
| 279 | |
| 280 | \sa |
| 281 | --------------------------------------------------------------------------*/ |
| 282 | tpPESession peFindSessionBySessionId(tpAniSirGlobal pMac , tANI_U8 sessionId) |
| 283 | { |
| 284 | if(sessionId >= pMac->lim.maxBssId) |
| 285 | { |
| 286 | limLog(pMac, LOGE, FL("Invalid sessionId: %d \n "), sessionId); |
| 287 | return(NULL); |
| 288 | } |
| 289 | if((pMac->lim.gpSession[sessionId].valid == TRUE)) |
| 290 | { |
| 291 | return(&pMac->lim.gpSession[sessionId]); |
| 292 | } |
| 293 | limLog(pMac, LOG1, FL("Session %d not active\n "), sessionId); |
| 294 | return(NULL); |
| 295 | |
| 296 | } |
| 297 | |
| 298 | |
| 299 | /*-------------------------------------------------------------------------- |
| 300 | \brief peFindSessionByStaId() - looks up the PE session given staid. |
| 301 | |
| 302 | This function returns the session context and the session ID if the session |
| 303 | corresponding to the given StaId is found in the PE session table. |
| 304 | |
| 305 | \param pMac - pointer to global adapter context |
| 306 | \param staid - StaId of the session |
| 307 | \param sessionId -session ID is returned here, if session is found. |
| 308 | |
| 309 | \return tpPESession - pointer to the session context or NULL if session is not found. |
| 310 | |
| 311 | \sa |
| 312 | --------------------------------------------------------------------------*/ |
| 313 | tpPESession peFindSessionByStaId(tpAniSirGlobal pMac, tANI_U8 staid, tANI_U8* sessionId) |
| 314 | { |
| 315 | tANI_U8 i, j; |
| 316 | |
| 317 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 318 | { |
| 319 | if(pMac->lim.gpSession[i].valid) |
| 320 | { |
| 321 | for(j = 0; j < pMac->lim.gpSession[i].dph.dphHashTable.size; j++) |
| 322 | { |
| 323 | if((pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray[j].valid) && |
| 324 | (pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray[j].added) && |
| 325 | (staid == pMac->lim.gpSession[i].dph.dphHashTable.pDphNodeArray[j].staIndex)) |
| 326 | { |
| 327 | *sessionId = i; |
| 328 | return(&pMac->lim.gpSession[i]); |
| 329 | } |
| 330 | } |
| 331 | } |
| 332 | } |
| 333 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 334 | limLog(pMac, LOG4, FL("Session lookup fails for StaId: %d\n "), staid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 335 | return(NULL); |
| 336 | } |
| 337 | |
| 338 | |
| 339 | |
| 340 | /*-------------------------------------------------------------------------- |
| 341 | \brief peDeleteSession() - deletes the PE session given the session ID. |
| 342 | |
| 343 | |
| 344 | \param pMac - pointer to global adapter context |
| 345 | \param sessionId -session ID of the session which needs to be deleted. |
| 346 | |
| 347 | \sa |
| 348 | --------------------------------------------------------------------------*/ |
| 349 | void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 350 | { |
| 351 | tANI_U16 i = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 352 | tANI_U16 n; |
| 353 | TX_TIMER *timer_ptr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 354 | |
| 355 | limLog(pMac, LOGW, FL("Trying to delete a session %d.\n "), psessionEntry->peSessionId); |
| 356 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 357 | for (n = 0; n < pMac->lim.maxStation; n++) |
| 358 | { |
| 359 | timer_ptr = &pMac->lim.limTimers.gpLimCnfWaitTimer[n]; |
| 360 | |
| 361 | if(psessionEntry->peSessionId == timer_ptr->sessionId) |
| 362 | { |
| 363 | if(VOS_TRUE == tx_timer_running(timer_ptr)) |
| 364 | { |
| 365 | tx_timer_deactivate(timer_ptr); |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 370 | if(psessionEntry->pLimStartBssReq != NULL) |
| 371 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 372 | vos_mem_free( psessionEntry->pLimStartBssReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 373 | psessionEntry->pLimStartBssReq = NULL; |
| 374 | } |
| 375 | |
| 376 | if(psessionEntry->pLimJoinReq != NULL) |
| 377 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 378 | vos_mem_free( psessionEntry->pLimJoinReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | psessionEntry->pLimJoinReq = NULL; |
| 380 | } |
| 381 | |
| 382 | if(psessionEntry->pLimReAssocReq != NULL) |
| 383 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 384 | vos_mem_free( psessionEntry->pLimReAssocReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 385 | psessionEntry->pLimReAssocReq = NULL; |
| 386 | } |
| 387 | |
| 388 | if(psessionEntry->pLimMlmJoinReq != NULL) |
| 389 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 390 | vos_mem_free( psessionEntry->pLimMlmJoinReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 391 | psessionEntry->pLimMlmJoinReq = NULL; |
| 392 | } |
| 393 | |
| 394 | if(psessionEntry->dph.dphHashTable.pHashTable != NULL) |
| 395 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 396 | vos_mem_free(psessionEntry->dph.dphHashTable.pHashTable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 397 | psessionEntry->dph.dphHashTable.pHashTable = NULL; |
| 398 | } |
| 399 | |
| 400 | if(psessionEntry->dph.dphHashTable.pDphNodeArray != NULL) |
| 401 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 402 | vos_mem_free(psessionEntry->dph.dphHashTable.pDphNodeArray); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 403 | psessionEntry->dph.dphHashTable.pDphNodeArray = NULL; |
| 404 | } |
| 405 | |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 406 | if(psessionEntry->gpLimPeerIdxpool != NULL) |
| 407 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 408 | vos_mem_free(psessionEntry->gpLimPeerIdxpool); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 409 | psessionEntry->gpLimPeerIdxpool = NULL; |
| 410 | } |
| 411 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 412 | if(psessionEntry->beacon != NULL) |
| 413 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 414 | vos_mem_free( psessionEntry->beacon); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 415 | psessionEntry->beacon = NULL; |
| 416 | } |
| 417 | |
| 418 | if(psessionEntry->assocReq != NULL) |
| 419 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 420 | vos_mem_free( psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 421 | psessionEntry->assocReq = NULL; |
| 422 | } |
| 423 | |
| 424 | if(psessionEntry->assocRsp != NULL) |
| 425 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 426 | vos_mem_free( psessionEntry->assocRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 427 | psessionEntry->assocRsp = NULL; |
| 428 | } |
| 429 | |
| 430 | |
| 431 | if(psessionEntry->parsedAssocReq != NULL) |
| 432 | { |
| 433 | // Cleanup the individual allocation first |
| 434 | for (i=0; i < psessionEntry->dph.dphHashTable.size; i++) |
| 435 | { |
| 436 | if ( psessionEntry->parsedAssocReq[i] != NULL ) |
| 437 | { |
| 438 | if( ((tpSirAssocReq)(psessionEntry->parsedAssocReq[i]))->assocReqFrame ) |
| 439 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 440 | vos_mem_free(((tpSirAssocReq) |
| 441 | (psessionEntry->parsedAssocReq[i]))->assocReqFrame); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 442 | ((tpSirAssocReq)(psessionEntry->parsedAssocReq[i]))->assocReqFrame = NULL; |
| 443 | ((tpSirAssocReq)(psessionEntry->parsedAssocReq[i]))->assocReqFrameLength = 0; |
| 444 | } |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 445 | vos_mem_free(psessionEntry->parsedAssocReq[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 446 | psessionEntry->parsedAssocReq[i] = NULL; |
| 447 | } |
| 448 | } |
| 449 | // Cleanup the whole block |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 450 | vos_mem_free(psessionEntry->parsedAssocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 451 | psessionEntry->parsedAssocReq = NULL; |
| 452 | } |
Dhanashri Atre | e3a2a59 | 2013-03-08 13:18:42 -0800 | [diff] [blame] | 453 | if (NULL != psessionEntry->limAssocResponseData) |
| 454 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 455 | vos_mem_free( psessionEntry->limAssocResponseData); |
Dhanashri Atre | e3a2a59 | 2013-03-08 13:18:42 -0800 | [diff] [blame] | 456 | psessionEntry->limAssocResponseData = NULL; |
| 457 | } |
| 458 | |
| 459 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 460 | if (NULL != psessionEntry->pLimMlmReassocRetryReq) |
| 461 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 462 | vos_mem_free( psessionEntry->pLimMlmReassocRetryReq); |
Dhanashri Atre | e3a2a59 | 2013-03-08 13:18:42 -0800 | [diff] [blame] | 463 | psessionEntry->pLimMlmReassocRetryReq = NULL; |
| 464 | } |
| 465 | #endif |
| 466 | |
| 467 | if (NULL != psessionEntry->pLimMlmReassocReq) |
| 468 | { |
Bansidhar Gopalachari | 72515da | 2013-07-11 11:14:27 +0530 | [diff] [blame^] | 469 | vos_mem_free( psessionEntry->pLimMlmReassocReq); |
Dhanashri Atre | e3a2a59 | 2013-03-08 13:18:42 -0800 | [diff] [blame] | 470 | psessionEntry->pLimMlmReassocReq = NULL; |
| 471 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 472 | |
| 473 | #ifdef FEATURE_WLAN_CCX |
| 474 | limCleanupCcxCtxt(pMac, psessionEntry); |
| 475 | #endif |
| 476 | |
| 477 | psessionEntry->valid = FALSE; |
| 478 | return; |
| 479 | } |
| 480 | |
| 481 | |
| 482 | /*-------------------------------------------------------------------------- |
| 483 | \brief peFindSessionByPeerSta() - looks up the PE session given the Station Address. |
| 484 | |
| 485 | This function returns the session context and the session ID if the session |
| 486 | corresponding to the given station address is found in the PE session table. |
| 487 | |
| 488 | \param pMac - pointer to global adapter context |
| 489 | \param sa - Peer STA Address of the session |
| 490 | \param sessionId -session ID is returned here, if session is found. |
| 491 | |
| 492 | \return tpPESession - pointer to the session context or NULL if session is not found. |
| 493 | |
| 494 | \sa |
| 495 | --------------------------------------------------------------------------*/ |
| 496 | |
| 497 | |
| 498 | tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U8* sessionId) |
| 499 | { |
| 500 | tANI_U8 i; |
| 501 | tpDphHashNode pSta; |
| 502 | tANI_U16 aid; |
| 503 | |
| 504 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 505 | { |
| 506 | if( (pMac->lim.gpSession[i].valid)) |
| 507 | { |
| 508 | pSta = dphLookupHashEntry(pMac, sa, &aid, &pMac->lim.gpSession[i].dph.dphHashTable); |
| 509 | if (pSta != NULL) |
| 510 | { |
| 511 | *sessionId = i; |
| 512 | return &pMac->lim.gpSession[i]; |
| 513 | } |
| 514 | } |
| 515 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 516 | |
| 517 | limLog(pMac, LOG1, FL("Session lookup fails for Peer StaId: \n ")); |
| 518 | limPrintMacAddr(pMac, sa, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 519 | return NULL; |
| 520 | } |
| 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |