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 | |
| 42 | /* |
| 43 | * |
| 44 | * Airgo Networks, Inc proprietary. All rights reserved. |
| 45 | * This file limProcessAssocRspFrame.cc contains the code |
| 46 | * for processing Re/Association Response Frame. |
| 47 | * Author: Chandra Modumudi |
| 48 | * Date: 03/18/02 |
| 49 | * History:- |
| 50 | * Date Modified by Modification Information |
| 51 | * -------------------------------------------------------------------- |
| 52 | * |
| 53 | */ |
| 54 | |
| 55 | #include "wniApi.h" |
| 56 | #if (WNI_POLARIS_FW_PRODUCT == AP) |
| 57 | #include "wniCfgAp.h" |
| 58 | #else |
| 59 | #include "wniCfgSta.h" |
| 60 | #endif |
| 61 | #include "aniGlobal.h" |
| 62 | #include "cfgApi.h" |
| 63 | |
| 64 | #include "utilsApi.h" |
| 65 | #include "pmmApi.h" |
| 66 | #include "limTypes.h" |
| 67 | #include "limUtils.h" |
| 68 | #include "limAssocUtils.h" |
| 69 | #include "limSecurityUtils.h" |
| 70 | #include "limSerDesUtils.h" |
| 71 | #include "limStaHashApi.h" |
| 72 | #include "limSendMessages.h" |
| 73 | |
| 74 | #ifdef FEATURE_WLAN_CCX |
| 75 | #include "ccxApi.h" |
| 76 | #endif |
| 77 | |
| 78 | extern tSirRetStatus schBeaconEdcaProcess(tpAniSirGlobal pMac, tSirMacEdcaParamSetIE *edca, tpPESession psessionEntry); |
| 79 | |
| 80 | |
| 81 | /** |
| 82 | * @function : limUpdateAssocStaDatas |
| 83 | * |
| 84 | * @brief : This function is called to Update the Station Descriptor (dph) Details from |
| 85 | * Association / ReAssociation Response Frame |
| 86 | * |
| 87 | *LOGIC: |
| 88 | * |
| 89 | *ASSUMPTIONS: |
| 90 | * |
| 91 | *NOTE: |
| 92 | * |
| 93 | * @param pMac - Pointer to Global MAC structure |
| 94 | * @param pStaDs - Station Descriptor in DPH |
| 95 | * @param pAssocRsp - Pointer to Association Response Structure |
| 96 | * |
| 97 | * @return None |
| 98 | */ |
| 99 | void limUpdateAssocStaDatas(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpSirAssocRsp pAssocRsp,tpPESession psessionEntry) |
| 100 | { |
| 101 | tANI_U32 prop; |
| 102 | tANI_U32 phyMode; |
| 103 | tANI_U32 val; |
| 104 | //tpSirBoardCapabilities pBoardCaps; |
| 105 | tANI_BOOLEAN qosMode; |
| 106 | tANI_U16 rxHighestRate = 0; |
| 107 | |
| 108 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 109 | |
| 110 | pStaDs->staType= STA_ENTRY_SELF; |
| 111 | |
| 112 | limGetQosMode(psessionEntry, &qosMode); |
| 113 | // set the ani peer bit, if self mode is one of the proprietary modes |
| 114 | if(IS_DOT11_MODE_PROPRIETARY(psessionEntry->dot11mode)) |
| 115 | { |
| 116 | wlan_cfgGetInt(pMac, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED, &prop); |
| 117 | |
| 118 | if (prop) |
| 119 | { |
| 120 | pStaDs->aniPeer = eHAL_SET; |
| 121 | pStaDs->propCapability = pAssocRsp->propIEinfo.capability; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | //pMac->lim.gLimMlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
| 126 | pStaDs->mlmStaContext.authType = psessionEntry->limCurrentAuthType; |
| 127 | |
| 128 | // Add capabilities information, rates and AID |
| 129 | pStaDs->mlmStaContext.capabilityInfo = pAssocRsp->capabilityInfo; |
| 130 | pStaDs->shortPreambleEnabled= (tANI_U8)pAssocRsp->capabilityInfo.shortPreamble; |
| 131 | |
| 132 | //Update HT Capabilites only when the self mode supports HT |
| 133 | if(IS_DOT11_MODE_HT(psessionEntry->dot11mode)) { |
| 134 | pStaDs->mlmStaContext.htCapability = pAssocRsp->HTCaps.present; |
| 135 | |
| 136 | if ( pAssocRsp->HTCaps.present ) { |
| 137 | pStaDs->htGreenfield = ( tANI_U8 ) pAssocRsp->HTCaps.greenField; |
| 138 | pStaDs->htSupportedChannelWidthSet = ( tANI_U8 ) (pAssocRsp->HTCaps.supportedChannelWidthSet ? |
| 139 | pAssocRsp->HTInfo.recommendedTxWidthSet : |
| 140 | pAssocRsp->HTCaps.supportedChannelWidthSet ); |
| 141 | pStaDs->htLsigTXOPProtection = ( tANI_U8 ) pAssocRsp->HTCaps.lsigTXOPProtection; |
| 142 | pStaDs->htMIMOPSState = (tSirMacHTMIMOPowerSaveState)pAssocRsp->HTCaps.mimoPowerSave; |
| 143 | pStaDs->htMaxAmsduLength = ( tANI_U8 ) pAssocRsp->HTCaps.maximalAMSDUsize; |
| 144 | pStaDs->htAMpduDensity = pAssocRsp->HTCaps.mpduDensity; |
| 145 | pStaDs->htDsssCckRate40MHzSupport = (tANI_U8)pAssocRsp->HTCaps.dsssCckMode40MHz; |
| 146 | pStaDs->htShortGI20Mhz = (tANI_U8)pAssocRsp->HTCaps.shortGI20MHz; |
| 147 | pStaDs->htShortGI40Mhz = (tANI_U8)pAssocRsp->HTCaps.shortGI40MHz; |
| 148 | pStaDs->htMaxRxAMpduFactor = pAssocRsp->HTCaps.maxRxAMPDUFactor; |
| 149 | limFillRxHighestSupportedRate(pMac, &rxHighestRate, pAssocRsp->HTCaps.supportedMCSSet); |
| 150 | pStaDs->supportedRates.rxHighestDataRate = rxHighestRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 151 | /* This is for AP as peer STA and we are INFRA STA. We will put APs offset in dph node which is peer STA */ |
| 152 | pStaDs->htSecondaryChannelOffset = (tANI_U8)pAssocRsp->HTInfo.secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 153 | |
| 154 | //FIXME_AMPDU |
| 155 | // In the future, may need to check for "assoc.HTCaps.delayedBA" |
| 156 | // For now, it is IMMEDIATE BA only on ALL TID's |
| 157 | pStaDs->baPolicyFlag = 0xFF; |
| 158 | } |
| 159 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 160 | |
| 161 | #ifdef WLAN_FEATURE_11AC |
| 162 | if(IS_DOT11_MODE_VHT(psessionEntry->dot11mode)) |
| 163 | { |
| 164 | pStaDs->mlmStaContext.vhtCapability = pAssocRsp->VHTCaps.present; |
| 165 | } |
| 166 | if (limPopulateOwnRateSet(pMac, &pStaDs->supportedRates, |
| 167 | pAssocRsp->HTCaps.supportedMCSSet, |
| 168 | false,psessionEntry , &pAssocRsp->VHTCaps) != eSIR_SUCCESS) |
| 169 | #else |
| 170 | if (limPopulateOwnRateSet(pMac, &pStaDs->supportedRates, pAssocRsp->HTCaps.supportedMCSSet, false,psessionEntry) != eSIR_SUCCESS) |
| 171 | #endif |
| 172 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 173 | limLog(pMac, LOGP, FL("could not get rateset and extended rate set\n")); |
| 174 | return; |
| 175 | } |
| 176 | |
| 177 | //If one of the rates is 11g rates, set the ERP mode. |
| 178 | if ((phyMode == WNI_CFG_PHY_MODE_11G) && sirIsArate(pStaDs->supportedRates.llaRates[0] & 0x7f)) |
| 179 | pStaDs->erpEnabled = eHAL_SET; |
| 180 | |
| 181 | |
| 182 | val = WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET_LEN; |
| 183 | if (wlan_cfgGetStr(pMac, WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET, |
| 184 | (tANI_U8 *) &pStaDs->mlmStaContext.propRateSet.propRate, |
| 185 | &val) != eSIR_SUCCESS) { |
| 186 | /// Could not get prop rateset from CFG. Log error. |
| 187 | limLog(pMac, LOGP, FL("could not retrieve prop rateset\n")); |
| 188 | return; |
| 189 | } |
| 190 | pStaDs->mlmStaContext.propRateSet.numPropRates = (tANI_U8) val; |
| 191 | |
| 192 | pStaDs->qosMode = 0; |
| 193 | pStaDs->lleEnabled = 0; |
| 194 | |
| 195 | // update TSID to UP mapping |
| 196 | //if (pMac->lim.gLimQosEnabled) |
| 197 | if (qosMode) { |
| 198 | if (pAssocRsp->edcaPresent) { |
| 199 | tSirRetStatus status; |
| 200 | status = schBeaconEdcaProcess(pMac,&pAssocRsp->edca, psessionEntry); |
| 201 | PELOG2(limLog(pMac, LOG2, "Edca set update based on AssocRsp: status %d\n", |
| 202 | status);) |
| 203 | if (status != eSIR_SUCCESS) { |
| 204 | PELOGE(limLog(pMac, LOGE, FL("Edca error in AssocResp \n"));) |
| 205 | } else { // update default tidmap based on ACM |
| 206 | pStaDs->qosMode = 1; |
| 207 | pStaDs->lleEnabled = 1; |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | pStaDs->wmeEnabled = 0; |
| 213 | pStaDs->wsmEnabled = 0; |
| 214 | if (psessionEntry->limWmeEnabled && pAssocRsp->wmeEdcaPresent) |
| 215 | { |
| 216 | tSirRetStatus status; |
| 217 | status = schBeaconEdcaProcess(pMac,&pAssocRsp->edca, psessionEntry); |
| 218 | PELOGW(limLog(pMac, LOGW, "WME Edca set update based on AssocRsp: status %d\n", status);) |
| 219 | |
| 220 | if (status != eSIR_SUCCESS) |
| 221 | PELOGE(limLog(pMac, LOGE, FL("WME Edca error in AssocResp - ignoring\n"));) |
| 222 | else { // update default tidmap based on HashACM |
| 223 | pStaDs->qosMode = 1; |
| 224 | pStaDs->wmeEnabled = 1; |
| 225 | } |
| 226 | } |
| 227 | else { |
| 228 | /* We received assoc rsp from a legacy AP. So fill in the default |
| 229 | * local EDCA params. This is needed (refer to bug #14989) as we'll |
| 230 | * be passing the gLimEdcaParams to HAL in limProcessStaMlmAddBssRsp(). |
| 231 | */ |
| 232 | schSetDefaultEdcaParams(pMac, psessionEntry); |
| 233 | } |
| 234 | |
Pratik Bhalgat | b5b19b0 | 2012-11-22 16:28:19 +0530 | [diff] [blame] | 235 | if(qosMode && (!pStaDs->qosMode) && pStaDs->mlmStaContext.htCapability) |
| 236 | { |
| 237 | // Enable QOS for all HT AP's even though WMM or 802.11E IE is not present |
| 238 | pStaDs->qosMode = 1; |
| 239 | pStaDs->wmeEnabled = 1; |
| 240 | } |
| 241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | |
| 243 | } |
| 244 | |
| 245 | #if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK) |
| 246 | /** |
| 247 | * @function : limUpdateReAssocGlobals |
| 248 | * |
| 249 | * @brief : This function is called to Update the Globals (LIM) during ReAssoc. |
| 250 | * |
| 251 | *LOGIC: |
| 252 | * |
| 253 | *ASSUMPTIONS: |
| 254 | * |
| 255 | *NOTE: |
| 256 | * |
| 257 | * @param pMac - Pointer to Global MAC structure |
| 258 | * @param pAssocRsp - Pointer to Association Response Structure |
| 259 | * |
| 260 | * @return None |
| 261 | */ |
| 262 | |
| 263 | void limUpdateReAssocGlobals(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,tpPESession psessionEntry) |
| 264 | { |
| 265 | /** |
| 266 | * Update the status for PMM module |
| 267 | */ |
| 268 | pmmResetPmmState(pMac); |
| 269 | |
| 270 | // Update the current Bss Information |
| 271 | palCopyMemory( pMac->hHdd, psessionEntry->bssId, |
| 272 | psessionEntry->limReAssocbssId, sizeof(tSirMacAddr)); |
| 273 | psessionEntry->currentOperChannel = psessionEntry->limReassocChannelId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 274 | psessionEntry->htSecondaryChannelOffset = psessionEntry->reAssocHtSupportedChannelWidthSet; |
| 275 | psessionEntry->htRecommendedTxWidthSet = psessionEntry->reAssocHtRecommendedTxWidthSet; |
| 276 | psessionEntry->htSecondaryChannelOffset = psessionEntry->reAssocHtSecondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | psessionEntry->limCurrentBssCaps = psessionEntry->limReassocBssCaps; |
| 278 | psessionEntry->limCurrentBssQosCaps = psessionEntry->limReassocBssQosCaps; |
| 279 | psessionEntry->limCurrentBssPropCap = psessionEntry->limReassocBssPropCap; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 280 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 281 | palCopyMemory( pMac->hHdd, (tANI_U8 *) &psessionEntry->ssId, |
| 282 | (tANI_U8 *) &psessionEntry->limReassocSSID, |
| 283 | psessionEntry->limReassocSSID.length+1); |
| 284 | |
| 285 | // Store assigned AID for TIM processing |
| 286 | psessionEntry->limAID = pAssocRsp->aid & 0x3FFF; |
| 287 | /** Set the State Back to ReAssoc Rsp*/ |
| 288 | psessionEntry->limMlmState = eLIM_MLM_WT_REASSOC_RSP_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 289 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 290 | |
| 291 | |
| 292 | } |
| 293 | #endif |
| 294 | |
| 295 | /** |
| 296 | * @function : limProcessAssocRspFrame |
| 297 | * |
| 298 | * @brief : This function is called by limProcessMessageQueue() upon |
| 299 | * Re/Association Response frame reception. |
| 300 | * |
| 301 | *LOGIC: |
| 302 | * |
| 303 | *ASSUMPTIONS: |
| 304 | * |
| 305 | *NOTE: |
| 306 | * |
| 307 | * @param pMac - Pointer to Global MAC structure |
| 308 | * @param *pRxPacketInfo - A pointer to Rx packet info structure |
| 309 | * @param subType - Indicates whether it is Association Response (=0) or |
| 310 | * Reassociation Response (=1) frame |
| 311 | * |
| 312 | * @return None |
| 313 | */ |
| 314 | |
| 315 | void |
| 316 | limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 subType,tpPESession psessionEntry) |
| 317 | { |
| 318 | tANI_U8 *pBody; |
| 319 | tANI_U16 caps; |
| 320 | tANI_U32 frameLen; |
| 321 | tSirMacAddr currentBssId; |
| 322 | tpSirMacMgmtHdr pHdr; |
| 323 | tSirMacCapabilityInfo localCapabilities; |
| 324 | tpDphHashNode pStaDs; |
| 325 | tpSirAssocRsp pAssocRsp; |
| 326 | tLimMlmAssocCnf mlmAssocCnf; |
| 327 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 328 | #ifdef ANI_PRODUCT_TYPE_CLIENT |
| 329 | tSchBeaconStruct *pBeaconStruct; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 330 | #endif |
| 331 | |
| 332 | //Initialize status code to success. |
| 333 | |
| 334 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 335 | |
| 336 | mlmAssocCnf.resultCode = eSIR_SME_SUCCESS; |
| 337 | /* Update PE session Id*/ |
| 338 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 339 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 340 | if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd, |
| 341 | (void **)&pBeaconStruct, sizeof(tSchBeaconStruct))) |
| 342 | { |
| 343 | limLog(pMac, LOGE, FL("Unable to PAL allocate memory in limProcessAssocRspFrame\n") ); |
| 344 | return; |
| 345 | } |
| 346 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 347 | |
| 348 | if (psessionEntry->limSystemRole == eLIM_AP_ROLE || psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE ) |
| 349 | { |
| 350 | // Should not have received Re/Association Response |
| 351 | // frame on AP. Log error |
| 352 | limLog(pMac, LOGE, |
| 353 | FL("received Re/Assoc response frame on role %d \n"), |
| 354 | psessionEntry->limSystemRole); |
| 355 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 356 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | return; |
| 358 | } |
| 359 | |
| 360 | |
| 361 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 362 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 363 | |
| 364 | if (((subType == LIM_ASSOC) && |
| 365 | (psessionEntry->limMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE)) || |
| 366 | ((subType == LIM_REASSOC) && |
| 367 | ((psessionEntry->limMlmState != eLIM_MLM_WT_REASSOC_RSP_STATE) |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 368 | #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] | 369 | && (psessionEntry->limMlmState != eLIM_MLM_WT_FT_REASSOC_RSP_STATE) |
| 370 | #endif |
| 371 | ))) |
| 372 | { |
| 373 | /// Received unexpected Re/Association Response frame |
| 374 | |
| 375 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
| 376 | PELOG1(limLog(pMac, LOG1, FL("mlm state is set to %d session=%d\n"), |
| 377 | psessionEntry->limMlmState, psessionEntry->peSessionId);) |
| 378 | #endif |
| 379 | // Log error |
| 380 | if (!pHdr->fc.retry) |
| 381 | { |
| 382 | limLog(pMac, LOGE, |
| 383 | FL("received Re/Assoc rsp frame in unexpected state\n")); |
| 384 | limPrintMlmState(pMac, LOGE, psessionEntry->limMlmState); |
| 385 | } |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 386 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 387 | return; |
| 388 | } |
| 389 | #if 0 |
| 390 | if (wlan_cfgGetStr(pMac, WNI_CFG_BSSID, currentBssId, &cfg) != |
| 391 | eSIR_SUCCESS) |
| 392 | { |
| 393 | /// Could not get BSSID from CFG. Log error. |
| 394 | limLog(pMac, LOGP, FL("could not retrieve BSSID\n")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 395 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 396 | return; |
| 397 | } |
| 398 | #endif //TO SUPPORT BT-AMP |
| 399 | sirCopyMacAddr(currentBssId,psessionEntry->bssId); |
| 400 | |
| 401 | if (subType == LIM_ASSOC) |
| 402 | { |
| 403 | if (!palEqualMemory( pMac->hHdd,pHdr->sa, currentBssId, sizeof(tSirMacAddr)) ) |
| 404 | { |
| 405 | /** |
| 406 | * Received Association Response frame from an entity |
| 407 | * other than one to which request was initiated. |
| 408 | * Ignore this and wait until Association Failure Timeout. |
| 409 | */ |
| 410 | |
| 411 | // Log error |
Mohit Khanna | 2386376 | 2012-09-11 17:40:09 -0700 | [diff] [blame] | 412 | PELOGW(limLog(pMac, LOGW, |
| 413 | FL("received AssocRsp frame from unexpected peer "MAC_ADDRESS_STR), |
| 414 | MAC_ADDR_ARRAY(pHdr->sa));) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 415 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 416 | return; |
| 417 | } |
| 418 | } |
| 419 | else |
| 420 | { |
| 421 | if ( !palEqualMemory( pMac->hHdd,pHdr->sa, psessionEntry->limReAssocbssId, sizeof(tSirMacAddr)) ) |
| 422 | { |
| 423 | /** |
| 424 | * Received Reassociation Response frame from an entity |
| 425 | * other than one to which request was initiated. |
| 426 | * Ignore this and wait until Reassociation Failure Timeout. |
| 427 | */ |
| 428 | |
| 429 | // Log error |
Mohit Khanna | 2386376 | 2012-09-11 17:40:09 -0700 | [diff] [blame] | 430 | PELOGW(limLog(pMac, LOGW, |
| 431 | FL("received ReassocRsp frame from unexpected peer "MAC_ADDRESS_STR), |
| 432 | MAC_ADDR_ARRAY(pHdr->sa));) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 433 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 434 | |
| 435 | return; |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | if ( palAllocateMemory(pMac->hHdd, (void **)&pAssocRsp, sizeof(*pAssocRsp)) != eHAL_STATUS_SUCCESS) { |
| 440 | limLog(pMac, LOGP, FL("Pal Allocate Memory failed in AssocRsp\n")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 441 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
| 442 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 443 | return; |
| 444 | } |
| 445 | |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame^] | 446 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 447 | FL("Assoc Resp Frame Received: BSSID %02x:%02x:%02x:%02x:%02x:%02x (Rssi %d)"), |
| 448 | pHdr->bssId[0], pHdr->bssId[1], pHdr->bssId[2], |
| 449 | pHdr->bssId[3], pHdr->bssId[4], pHdr->bssId[5], |
| 450 | (uint)abs((tANI_S8)WDA_GET_RX_RSSI_DB(pRxPacketInfo))); |
| 451 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 452 | // Get pointer to Re/Association Response frame body |
| 453 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 454 | |
| 455 | // parse Re/Association Response frame. |
| 456 | if (sirConvertAssocRespFrame2Struct( |
| 457 | pMac, pBody, frameLen, pAssocRsp) == eSIR_FAILURE) |
| 458 | { |
| 459 | if (palFreeMemory(pMac->hHdd, pAssocRsp) != eHAL_STATUS_SUCCESS) |
| 460 | { |
| 461 | limLog(pMac, LOGP, FL("PalFree Memory failed \n")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 462 | } |
| 463 | PELOGE(limLog(pMac, LOGE, FL("Parse error Assoc resp subtype %d, length=%d\n"), frameLen,subType);) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 464 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
| 465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 466 | return; |
| 467 | } |
| 468 | |
| 469 | if(!pAssocRsp->suppRatesPresent) |
| 470 | { |
| 471 | PELOGE(limLog(pMac, LOGW, FL("assoc response does not have supported rate set"));) |
| 472 | palCopyMemory(pMac->hHdd, &pAssocRsp->supportedRates, |
| 473 | &psessionEntry->rateSet, sizeof(tSirMacRateSet)); |
| 474 | } |
| 475 | |
| 476 | mlmAssocCnf.protStatusCode = pAssocRsp->statusCode; |
| 477 | |
| 478 | if( psessionEntry->assocRsp != NULL ) |
| 479 | { |
| 480 | palFreeMemory(pMac->hHdd, psessionEntry->assocRsp); |
| 481 | psessionEntry->assocRsp = NULL; |
| 482 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 483 | if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocRsp, frameLen)) != eHAL_STATUS_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 484 | { |
| 485 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc response, len = %d"), frameLen);) |
| 486 | } |
| 487 | else |
| 488 | { |
| 489 | //Store the Assoc response. This is sent to csr/hdd in join cnf response. |
| 490 | palCopyMemory(pMac->hHdd, psessionEntry->assocRsp, pBody, frameLen); |
| 491 | psessionEntry->assocRspLen = frameLen; |
| 492 | } |
| 493 | |
| 494 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 495 | if (psessionEntry->ricData != NULL) |
| 496 | { |
| 497 | palFreeMemory(pMac->hHdd, psessionEntry->ricData); |
| 498 | psessionEntry->ricData = NULL; |
| 499 | } |
| 500 | if(pAssocRsp->ricPresent) |
| 501 | { |
| 502 | psessionEntry->RICDataLen = pAssocRsp->num_RICData * sizeof(tDot11fIERICDataDesc); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 503 | if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->ricData, psessionEntry->RICDataLen)) != eHAL_STATUS_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 504 | { |
| 505 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc response"));) |
| 506 | psessionEntry->RICDataLen = 0; |
| 507 | } |
| 508 | else |
| 509 | { |
| 510 | palCopyMemory(pMac->hHdd, psessionEntry->ricData, &pAssocRsp->RICData[0], psessionEntry->RICDataLen); |
| 511 | } |
| 512 | } |
| 513 | else |
| 514 | { |
| 515 | psessionEntry->RICDataLen = 0; |
| 516 | psessionEntry->ricData = NULL; |
| 517 | } |
| 518 | #endif |
| 519 | |
| 520 | #ifdef FEATURE_WLAN_CCX |
| 521 | if (psessionEntry->tspecIes != NULL) |
| 522 | { |
| 523 | palFreeMemory(pMac->hHdd, psessionEntry->tspecIes); |
| 524 | psessionEntry->tspecIes = NULL; |
| 525 | } |
| 526 | if(pAssocRsp->tspecPresent) |
| 527 | { |
| 528 | psessionEntry->tspecLen = pAssocRsp->num_tspecs * sizeof(tDot11fIEWMMTSPEC); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 529 | if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->tspecIes, psessionEntry->tspecLen)) != eHAL_STATUS_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 530 | { |
| 531 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc response"));) |
| 532 | psessionEntry->tspecLen = 0; |
| 533 | } |
| 534 | else |
| 535 | { |
| 536 | palCopyMemory(pMac->hHdd, psessionEntry->tspecIes, &pAssocRsp->TSPECInfo[0], psessionEntry->tspecLen); |
| 537 | } |
| 538 | PELOG1(limLog(pMac, LOG1, FL(" Tspec EID present in assoc rsp "));) |
| 539 | } |
| 540 | else |
| 541 | { |
| 542 | psessionEntry->tspecLen = 0; |
| 543 | psessionEntry->tspecIes = NULL; |
| 544 | PELOG1(limLog(pMac, LOG1, FL(" Tspec EID *NOT* present in assoc rsp "));) |
| 545 | } |
| 546 | #endif |
| 547 | |
| 548 | if (pAssocRsp->capabilityInfo.ibss) |
| 549 | { |
| 550 | /** |
| 551 | * Received Re/Association Response from peer |
| 552 | * with IBSS capability set. |
| 553 | * Ignore the frame and wait until Re/assoc |
| 554 | * failure timeout. |
| 555 | */ |
| 556 | |
| 557 | // Log error |
| 558 | limLog(pMac, LOGE, |
| 559 | FL("received Re/AssocRsp frame with IBSS capability\n")); |
| 560 | palFreeMemory(pMac->hHdd, pAssocRsp); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 561 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
| 562 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 563 | return; |
| 564 | } |
| 565 | |
| 566 | if (cfgGetCapabilityInfo(pMac, &caps,psessionEntry) != eSIR_SUCCESS) |
| 567 | { |
| 568 | /** |
| 569 | * Could not get Capabilities value |
| 570 | * from CFG. Log error. |
| 571 | */ |
| 572 | palFreeMemory(pMac->hHdd, pAssocRsp); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 573 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
| 574 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 575 | limLog(pMac, LOGP, FL("could not retrieve Capabilities value\n")); |
| 576 | return; |
| 577 | } |
| 578 | limCopyU16((tANI_U8 *) &localCapabilities, caps); |
| 579 | |
| 580 | if (subType == LIM_ASSOC) // Stop Association failure timer |
| 581 | limDeactivateAndChangeTimer(pMac, eLIM_ASSOC_FAIL_TIMER); |
| 582 | else // Stop Reassociation failure timer |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 583 | { |
| 584 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 585 | pMac->lim.reAssocRetryAttempt = 0; |
Madan Mohan Koyyalamudi | a9ebd5e | 2012-11-15 16:00:56 -0800 | [diff] [blame] | 586 | if ((NULL != pMac->lim.pSessionEntry) && (NULL != pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)) |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 587 | { |
| 588 | palFreeMemory( pMac->hHdd, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq); |
| 589 | pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = NULL; |
| 590 | } |
| 591 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 592 | limDeactivateAndChangeTimer(pMac, eLIM_REASSOC_FAIL_TIMER); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 593 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 594 | |
| 595 | if (pAssocRsp->statusCode != eSIR_MAC_SUCCESS_STATUS) |
| 596 | { |
| 597 | // Re/Association response was received |
| 598 | // either with failure code. |
| 599 | // Log error. |
| 600 | PELOGE(limLog(pMac, LOGE, FL("received Re/AssocRsp frame failure code %d\n"), pAssocRsp->statusCode);) |
| 601 | // Need to update 'association failure' error counter |
| 602 | // along with STATUS CODE |
| 603 | |
| 604 | // Return Assoc confirm to SME with received failure code |
| 605 | |
| 606 | if (pAssocRsp->propIEinfo.loadBalanceInfoPresent) |
| 607 | { |
| 608 | mlmAssocCnf.resultCode = eSIR_SME_TRANSFER_STA; |
| 609 | palCopyMemory( pMac->hHdd, pMac->lim.gLimAlternateRadio.bssId, |
| 610 | pAssocRsp->propIEinfo.alternateRadio.bssId, sizeof(tSirMacAddr)); |
| 611 | pMac->lim.gLimAlternateRadio.channelId = |
| 612 | pAssocRsp->propIEinfo.alternateRadio.channelId; |
| 613 | }else |
| 614 | mlmAssocCnf.resultCode = eSIR_SME_ASSOC_REFUSED; |
| 615 | |
| 616 | // Delete Pre-auth context for the associated BSS |
| 617 | if (limSearchPreAuthList(pMac, pHdr->sa)) |
| 618 | limDeletePreAuthNode(pMac, pHdr->sa); |
| 619 | |
| 620 | goto assocReject; |
| 621 | } |
| 622 | else if ((pAssocRsp->aid & 0x3FFF) > 2007) |
| 623 | { |
| 624 | // Re/Association response was received |
| 625 | // with invalid AID value |
| 626 | // Log error |
| 627 | PELOGW(limLog(pMac, LOGW, FL("received Re/AssocRsp frame with invalid aid %X \n"), pAssocRsp->aid);) |
| 628 | mlmAssocCnf.resultCode = eSIR_SME_INVALID_ASSOC_RSP_RXED; |
| 629 | mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 630 | |
| 631 | // Send advisory Disassociation frame to AP |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 632 | limSendDisassocMgmtFrame(pMac, eSIR_MAC_UNSPEC_FAILURE_REASON, |
| 633 | pHdr->sa, psessionEntry, FALSE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 634 | |
| 635 | goto assocReject; |
| 636 | } |
| 637 | // Association Response received with success code |
Varun Reddy Yeturu | a39b990 | 2013-01-18 15:48:32 -0800 | [diff] [blame] | 638 | /* |
| 639 | * Set the link state to POSTASSOC now that we have received |
| 640 | * assoc/reassoc response |
| 641 | * NOTE: for BTAMP case, it is being handled in limProcessMlmAssocReq |
| 642 | */ |
| 643 | if (!((psessionEntry->bssType == eSIR_BTAMP_STA_MODE) || |
| 644 | ((psessionEntry->bssType == eSIR_BTAMP_AP_MODE) && |
| 645 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)))) |
| 646 | { |
| 647 | if (limSetLinkState(pMac, eSIR_LINK_POSTASSOC_STATE, psessionEntry->bssId, |
| 648 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) |
| 649 | { |
| 650 | PELOGE(limLog(pMac, LOGE, FL("Set link state to POSTASSOC failed\n"));) |
| 651 | return; |
| 652 | } |
| 653 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 654 | if (subType == LIM_REASSOC) |
| 655 | { |
| 656 | // Log success |
| 657 | PELOG1(limLog(pMac, LOG1, FL("Successfully Reassociated with BSS\n"));) |
| 658 | #ifdef FEATURE_WLAN_CCX |
| 659 | { |
| 660 | tANI_U8 cnt = 0; |
| 661 | if (pAssocRsp->tsmPresent) |
| 662 | { |
| 663 | limLog(pMac, LOGW, "TSM IE Present in Reassoc Rsp\n"); |
| 664 | // Start the TSM timer only if the TSPEC Ie is present in the reassoc rsp |
| 665 | if (pAssocRsp->tspecPresent) { |
| 666 | // Find the TSPEC IE with VO user priority |
| 667 | for (cnt=0; cnt<pAssocRsp->num_tspecs; cnt++) { |
| 668 | if ( upToAc(pAssocRsp->TSPECInfo[cnt].user_priority) == EDCA_AC_VO) { |
| 669 | psessionEntry->ccxContext.tsm.tid = pAssocRsp->TSPECInfo[cnt].user_priority; |
| 670 | vos_mem_copy(&psessionEntry->ccxContext.tsm.tsmInfo, |
| 671 | &pAssocRsp->tsmIE, sizeof(tSirMacCCXTSMIE)); |
| 672 | limActivateTSMStatsTimer(pMac, psessionEntry); |
| 673 | if(psessionEntry->ccxContext.tsm.tsmInfo.state) { |
| 674 | psessionEntry->ccxContext.tsm.tsmMetrics.RoamingCount++; |
| 675 | } |
| 676 | break; |
| 677 | } |
| 678 | } |
| 679 | } else { |
| 680 | limLog(pMac, LOGE, "TSM present but TSPEC IE not present in Reassoc Rsp\n"); |
| 681 | } |
| 682 | } |
| 683 | } |
| 684 | #endif |
| 685 | if (psessionEntry->pLimMlmJoinReq) |
| 686 | { |
| 687 | palFreeMemory( pMac->hHdd, psessionEntry->pLimMlmJoinReq); |
| 688 | psessionEntry->pLimMlmJoinReq = NULL; |
| 689 | } |
| 690 | |
| 691 | psessionEntry->limAssocResponseData = (void *) pAssocRsp; /** Store the ReAssocRsp Frame in DphTable to be used |
| 692 | during processing DelSta nd DelBss to send AddBss again*/ |
| 693 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 694 | |
| 695 | if(!pStaDs) |
| 696 | { |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame^] | 697 | PELOGE(limLog(pMac, LOGE, FL("could not get hash entry at DPH for"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 698 | limPrintMacAddr(pMac, pHdr->sa, LOGE); |
| 699 | mlmAssocCnf.resultCode = eSIR_SME_INVALID_ASSOC_RSP_RXED; |
| 700 | mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 701 | |
| 702 | // Send advisory Disassociation frame to AP |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 703 | limSendDisassocMgmtFrame(pMac, eSIR_MAC_UNSPEC_FAILURE_REASON, |
| 704 | pHdr->sa, psessionEntry, FALSE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 705 | |
| 706 | goto assocReject; |
| 707 | } |
| 708 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 709 | #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] | 710 | if (psessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE) |
| 711 | { |
| 712 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame^] | 713 | PELOGE(limLog(pMac, LOG1, FL("Sending self sta"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 714 | #endif |
| 715 | pmmResetPmmState(pMac); |
| 716 | |
| 717 | limUpdateAssocStaDatas(pMac, pStaDs, pAssocRsp,psessionEntry); |
| 718 | |
| 719 | // Store assigned AID for TIM processing |
| 720 | psessionEntry->limAID = pAssocRsp->aid & 0x3FFF; |
| 721 | |
Madan Mohan Koyyalamudi | 5e001fd | 2012-11-27 19:16:34 +0530 | [diff] [blame] | 722 | // Downgrade the EDCA parameters if needed |
| 723 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 724 | |
| 725 | // Send the active EDCA parameters to HAL |
| 726 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 727 | { |
| 728 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 729 | } |
| 730 | else |
| 731 | { |
| 732 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 733 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 734 | limAddFTStaSelf(pMac, (pAssocRsp->aid & 0x3FFF), psessionEntry); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 735 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 736 | |
| 737 | return; |
| 738 | } |
| 739 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 740 | |
| 741 | /* If we're re-associating to the same BSS, we don't want to invoke delete |
| 742 | * STA, delete BSS, as that would remove the already established TSPEC. |
| 743 | * Just go ahead and re-add the BSS, STA with new capability information. |
| 744 | * However, if we're re-associating to a different BSS, then follow thru |
| 745 | * with del STA, del BSS, add BSS, add STA. |
| 746 | */ |
| 747 | if (sirCompareMacAddr( psessionEntry->bssId, psessionEntry->limReAssocbssId)) |
| 748 | limHandleAddBssInReAssocContext(pMac, pStaDs, psessionEntry); |
| 749 | else |
| 750 | { |
| 751 | // reset the uapsd mask settings since we're re-associating to new AP |
| 752 | pMac->lim.gUapsdPerAcDeliveryEnableMask = 0; |
| 753 | pMac->lim.gUapsdPerAcTriggerEnableMask = 0; |
| 754 | |
| 755 | if (limCleanupRxPath(pMac, pStaDs,psessionEntry) != eSIR_SUCCESS) |
| 756 | goto assocReject; |
| 757 | } |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 758 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
| 759 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 760 | return; |
| 761 | } |
| 762 | |
| 763 | // Log success |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 764 | PELOG1(limLog(pMac, LOG1, FL("Successfully Associated with BSS "MAC_ADDRESS_STR), |
Mohit Khanna | 2386376 | 2012-09-11 17:40:09 -0700 | [diff] [blame] | 765 | MAC_ADDR_ARRAY(pHdr->sa));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 766 | #ifdef FEATURE_WLAN_CCX |
| 767 | if(psessionEntry->ccxContext.tsm.tsmInfo.state) |
| 768 | { |
| 769 | psessionEntry->ccxContext.tsm.tsmMetrics.RoamingCount = 0; |
| 770 | } |
| 771 | #endif |
| 772 | /** |
| 773 | * Update the status for PMM module |
| 774 | */ |
| 775 | pmmResetPmmState(pMac); |
| 776 | |
| 777 | // Store assigned AID for TIM processing |
| 778 | psessionEntry->limAID = pAssocRsp->aid & 0x3FFF; |
| 779 | |
| 780 | |
| 781 | //STA entry was created during pre-assoc state. |
| 782 | if ((pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable)) == NULL) |
| 783 | { |
| 784 | // Could not add hash table entry |
| 785 | PELOGE(limLog(pMac, LOGE, FL("could not get hash entry at DPH for \n"));) |
| 786 | limPrintMacAddr(pMac, pHdr->sa, LOGE); |
| 787 | |
| 788 | mlmAssocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 789 | mlmAssocCnf.protStatusCode = eSIR_SME_SUCCESS; |
| 790 | |
| 791 | |
| 792 | limPostSmeMessage(pMac, LIM_MLM_ASSOC_CNF, |
| 793 | (tANI_U32 *) &mlmAssocCnf); |
| 794 | palFreeMemory(pMac->hHdd, pAssocRsp); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 795 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
| 796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 797 | return; |
| 798 | } |
| 799 | |
| 800 | // Delete Pre-auth context for the associated BSS |
| 801 | if (limSearchPreAuthList(pMac, pHdr->sa)) |
| 802 | limDeletePreAuthNode(pMac, pHdr->sa); |
| 803 | |
| 804 | limUpdateAssocStaDatas(pMac, pStaDs, pAssocRsp,psessionEntry); |
| 805 | #ifdef ANI_PRODUCT_TYPE_CLIENT |
| 806 | // Extract the AP capabilities from the beacon that was received earlier |
| 807 | // TODO - Watch out for an error response! |
| 808 | limExtractApCapabilities( pMac, |
| 809 | (tANI_U8 *) psessionEntry->pLimJoinReq->bssDescription.ieFields, |
| 810 | limGetIElenFromBssDescription( &psessionEntry->pLimJoinReq->bssDescription ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 811 | pBeaconStruct ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 812 | |
| 813 | if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 814 | limDecideStaProtectionOnAssoc(pMac, pBeaconStruct, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 815 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 816 | if(pBeaconStruct->erpPresent) { |
| 817 | if (pBeaconStruct->erpIEInfo.barkerPreambleMode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 818 | psessionEntry->beaconParams.fShortPreamble = false; |
| 819 | else |
| 820 | psessionEntry->beaconParams.fShortPreamble = true; |
| 821 | } |
| 822 | |
| 823 | |
| 824 | //Update the BSS Entry, this entry was added during preassoc. |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 825 | if( eSIR_SUCCESS == limStaSendAddBss( pMac, pAssocRsp, pBeaconStruct, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 826 | &psessionEntry->pLimJoinReq->bssDescription, true, psessionEntry)) |
| 827 | { |
| 828 | palFreeMemory(pMac->hHdd, pAssocRsp); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 829 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 830 | return; |
| 831 | } |
| 832 | else |
| 833 | { |
| 834 | mlmAssocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 835 | mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 836 | } |
| 837 | |
| 838 | #elif defined(ANI_AP_CLIENT_SDK) |
| 839 | if( eSIR_SUCCESS == limStaSendAddBss( pMac, *pAssocRsp, |
| 840 | &psessionEntry->pLimJoinReq->neighborBssList.bssList[0], true)) |
| 841 | { |
| 842 | palFreeMemory(pMac->hHdd, pAssocRsp); |
| 843 | return; |
| 844 | } |
| 845 | else |
| 846 | { |
| 847 | mlmAssocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 848 | mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 849 | } |
| 850 | #else |
| 851 | palFreeMemory(pMac->hHdd, pAssocRsp); |
| 852 | return; |
| 853 | #endif |
| 854 | |
| 855 | |
| 856 | assocReject: |
| 857 | if ((subType == LIM_ASSOC) |
| 858 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 859 | || ((subType == LIM_REASSOC) && (psessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE)) |
| 860 | #endif |
| 861 | ) { |
| 862 | PELOGE(limLog(pMac, LOGE, FL("Assoc Rejected by the peer. Reason: %d\n"), mlmAssocCnf.resultCode);) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 863 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
| 864 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 865 | |
| 866 | if (psessionEntry->pLimMlmJoinReq) |
| 867 | { |
| 868 | palFreeMemory( pMac->hHdd, psessionEntry->pLimMlmJoinReq); |
| 869 | psessionEntry->pLimMlmJoinReq = NULL; |
| 870 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 871 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 872 | if (subType == LIM_ASSOC) |
| 873 | { |
| 874 | limPostSmeMessage(pMac, LIM_MLM_ASSOC_CNF, (tANI_U32 *) &mlmAssocCnf); |
| 875 | } |
| 876 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 877 | else |
| 878 | { |
| 879 | mlmAssocCnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; |
| 880 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmAssocCnf); |
| 881 | } |
| 882 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 883 | } else { |
| 884 | limRestorePreReassocState( pMac, |
| 885 | eSIR_SME_REASSOC_REFUSED, mlmAssocCnf.protStatusCode,psessionEntry); |
| 886 | } |
| 887 | |
| 888 | /* CR: vos packet memory is leaked when assoc rsp timeouted/failed. */ |
| 889 | /* notify TL that association is failed so that TL can flush the cached frame */ |
| 890 | WLANTL_AssocFailed (psessionEntry->staId); |
| 891 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 892 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 893 | palFreeMemory(pMac->hHdd, pAssocRsp); |
| 894 | return; |
| 895 | } /*** end limProcessAssocRspFrame() ***/ |
| 896 | |