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