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