Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Sushant Kaushik | 02c866d | 2015-01-16 15:24:25 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 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. |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 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 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file schBeaconProcess.cc contains beacon processing related |
| 30 | * functions |
| 31 | * |
| 32 | * Author: Sandesh Goel |
| 33 | * Date: 02/25/02 |
| 34 | * History:- |
| 35 | * Date Modified by Modification Information |
| 36 | * -------------------------------------------------------------------- |
| 37 | * |
| 38 | */ |
| 39 | |
| 40 | #include "palTypes.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 | |
| 43 | #include "cfgApi.h" |
| 44 | #include "pmmApi.h" |
| 45 | #include "limApi.h" |
| 46 | #include "utilsApi.h" |
| 47 | #include "schDebug.h" |
| 48 | #include "schApi.h" |
| 49 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 50 | |
| 51 | #include "limUtils.h" |
| 52 | #include "limSendMessages.h" |
| 53 | #include "limStaHashApi.h" |
| 54 | |
| 55 | #if defined WLAN_FEATURE_VOWIFI |
| 56 | #include "rrmApi.h" |
| 57 | #endif |
| 58 | |
| 59 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 60 | #include "vos_diag_core_log.h" |
| 61 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 62 | |
| 63 | /** |
| 64 | * Number of bytes of variation in beacon length from the last beacon |
| 65 | * to trigger reprogramming of rx delay register |
| 66 | */ |
| 67 | #define SCH_BEACON_LEN_DELTA 3 |
| 68 | |
| 69 | // calculate 2^cw - 1 |
| 70 | #define CW_GET(cw) (((cw) == 0) ? 1 : ((1 << (cw)) - 1)) |
| 71 | |
| 72 | static void |
| 73 | ap_beacon_process( |
| 74 | tpAniSirGlobal pMac, |
| 75 | tANI_U8* pRxPacketInfo, |
| 76 | tpSchBeaconStruct pBcnStruct, |
| 77 | tpUpdateBeaconParams pBeaconParams, |
| 78 | tpPESession psessionEntry) |
| 79 | { |
| 80 | tpSirMacMgmtHdr pMh = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 81 | tANI_U32 phyMode; |
| 82 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 83 | //Get RF band from psessionEntry |
| 84 | rfBand = psessionEntry->limRFBand; |
| 85 | |
| 86 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 87 | |
| 88 | if(SIR_BAND_5_GHZ == rfBand) |
| 89 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 90 | if (psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 91 | { |
| 92 | if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) |
| 93 | { |
| 94 | //11a (non HT) AP overlaps or |
| 95 | //HT AP with HT op mode as mixed overlaps. |
| 96 | //HT AP with HT op mode as overlap legacy overlaps. |
| 97 | if ((!pBcnStruct->HTInfo.present) || |
| 98 | (eSIR_HT_OP_MODE_MIXED == pBcnStruct->HTInfo.opMode) || |
| 99 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBcnStruct->HTInfo.opMode)) |
| 100 | { |
| 101 | limUpdateOverlapStaParam(pMac, pMh->bssId, &(pMac->lim.gLimOverlap11aParams)); |
| 102 | |
| 103 | if (pMac->lim.gLimOverlap11aParams.numSta && |
| 104 | !pMac->lim.gLimOverlap11aParams.protectionEnabled) |
| 105 | { |
| 106 | limEnable11aProtection(pMac, true, true, pBeaconParams,psessionEntry); |
| 107 | } |
| 108 | } |
| 109 | //HT AP with HT20 op mode overlaps. |
| 110 | else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pBcnStruct->HTInfo.opMode) |
| 111 | { |
| 112 | limUpdateOverlapStaParam(pMac, pMh->bssId, &(pMac->lim.gLimOverlapHt20Params)); |
| 113 | |
| 114 | if (pMac->lim.gLimOverlapHt20Params.numSta && |
| 115 | !pMac->lim.gLimOverlapHt20Params.protectionEnabled) |
| 116 | { |
| 117 | limEnableHT20Protection(pMac, true, true, pBeaconParams,psessionEntry); |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | else if(SIR_BAND_2_4_GHZ == rfBand) |
| 124 | { |
| 125 | //We are 11G AP. |
| 126 | if ((phyMode == WNI_CFG_PHY_MODE_11G) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 127 | (false == psessionEntry->htCapability)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 128 | { |
| 129 | if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) |
| 130 | { |
| 131 | if (((!(pBcnStruct->erpPresent)) && |
| 132 | !(pBcnStruct->HTInfo.present))|| |
| 133 | //if erp not present then 11B AP overlapping |
Abhishek Singh | c98534e | 2015-06-12 10:44:34 +0530 | [diff] [blame] | 134 | (!pMac->roam.configParam.ignorePeerErpInfo && |
| 135 | pBcnStruct->erpPresent && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 136 | (pBcnStruct->erpIEInfo.useProtection || |
| 137 | pBcnStruct->erpIEInfo.nonErpPresent))) |
| 138 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 139 | #ifdef FEATURE_WLAN_ESE |
| 140 | if( psessionEntry->isESEconnection ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 141 | { |
| 142 | VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 143 | "%s: [INFOLOG]ESE 11g erpPresent=%d useProtection=%d nonErpPresent=%d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 144 | pBcnStruct->erpPresent, |
| 145 | pBcnStruct->erpIEInfo.useProtection, |
| 146 | pBcnStruct->erpIEInfo.nonErpPresent); |
| 147 | } |
| 148 | #endif |
| 149 | limEnableOverlap11gProtection(pMac, pBeaconParams, pMh,psessionEntry); |
| 150 | } |
| 151 | |
| 152 | } |
| 153 | } |
| 154 | // handling the case when HT AP has overlapping legacy BSS. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 155 | else if(psessionEntry->htCapability) |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 156 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 157 | if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) |
| 158 | { |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 159 | if (((!(pBcnStruct->erpPresent)) && |
| 160 | !(pBcnStruct->HTInfo.present))|| |
| 161 | //if erp not present then 11B AP overlapping |
Abhishek Singh | c98534e | 2015-06-12 10:44:34 +0530 | [diff] [blame] | 162 | (!pMac->roam.configParam.ignorePeerErpInfo && |
| 163 | pBcnStruct->erpPresent && |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 164 | (pBcnStruct->erpIEInfo.useProtection || |
| 165 | pBcnStruct->erpIEInfo.nonErpPresent))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 166 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 167 | #ifdef FEATURE_WLAN_ESE |
| 168 | if( psessionEntry->isESEconnection ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 169 | { |
| 170 | VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 171 | "%s: [INFOLOG]ESE 11g erpPresent=%d useProtection=%d nonErpPresent=%d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 172 | pBcnStruct->erpPresent, |
| 173 | pBcnStruct->erpIEInfo.useProtection, |
| 174 | pBcnStruct->erpIEInfo.nonErpPresent); |
| 175 | } |
| 176 | #endif |
| 177 | limEnableOverlap11gProtection(pMac, pBeaconParams, pMh,psessionEntry); |
| 178 | } |
| 179 | |
| 180 | //11g device overlaps |
| 181 | if (pBcnStruct->erpPresent && |
| 182 | !(pBcnStruct->erpIEInfo.useProtection || |
| 183 | pBcnStruct->erpIEInfo.nonErpPresent) && !(pBcnStruct->HTInfo.present)) |
| 184 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 185 | limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlap11gParams)); |
| 186 | |
| 187 | if (psessionEntry->gLimOverlap11gParams.numSta && |
| 188 | !psessionEntry->gLimOverlap11gParams.protectionEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 189 | { |
| 190 | limEnableHtProtectionFrom11g(pMac, true, true, pBeaconParams,psessionEntry); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | //ht device overlaps. |
| 195 | //here we will check for HT related devices only which might need protection. |
| 196 | //check for 11b and 11g is already done in the previous blocks. |
| 197 | //so we will not check for HT operating mode as MIXED. |
| 198 | if (pBcnStruct->HTInfo.present) |
| 199 | { |
| 200 | //if we are not already in mixed mode or legacy mode as HT operating mode |
| 201 | //and received beacon has HT operating mode as legacy |
| 202 | //then we need to enable protection from 11g station. |
| 203 | //we don't need protection from 11b because if that's needed then our operating |
| 204 | //mode would have already been set to legacy in the previous blocks. |
Sushant Kaushik | ae17dd6 | 2015-08-27 17:07:04 +0530 | [diff] [blame] | 205 | if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBcnStruct->HTInfo.opMode |
| 206 | && !pMac->roam.configParam.ignorePeerHTopMode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 207 | { |
| 208 | if((eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) && |
| 209 | (eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode)) |
| 210 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 211 | limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlap11gParams)); |
| 212 | if (psessionEntry->gLimOverlap11gParams.numSta && |
| 213 | !psessionEntry->gLimOverlap11gParams.protectionEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 214 | { |
| 215 | limEnableHtProtectionFrom11g(pMac, true, true, pBeaconParams,psessionEntry); |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pBcnStruct->HTInfo.opMode) |
| 220 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 221 | limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlapHt20Params)); |
| 222 | if (psessionEntry->gLimOverlapHt20Params.numSta && |
| 223 | !psessionEntry->gLimOverlapHt20Params.protectionEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 224 | { |
| 225 | limEnableHT20Protection(pMac, true, true, pBeaconParams,psessionEntry); |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | } |
| 231 | } |
| 232 | } |
| 233 | pMac->sch.gSchBcnIgnored++; |
| 234 | } |
| 235 | // -------------------------------------------------------------------- |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | /** |
| 241 | * __schBeaconProcessNoSession |
| 242 | * |
| 243 | * FUNCTION: |
| 244 | * Process the received beacon frame when |
| 245 | * -- Station is not scanning |
| 246 | * -- No corresponding session is found |
| 247 | * |
| 248 | * LOGIC: |
| 249 | * Following scenarios exist when Session Does not exist: |
| 250 | * * IBSS Beacons, when IBSS session already exists with same SSID, |
| 251 | * but from STA which has not yet joined and has a different BSSID. |
| 252 | * - invoke limHandleIBSScoalescing with the session context of existing IBSS session. |
| 253 | * |
| 254 | * * IBSS Beacons when IBSS session does not exist, only Infra or BT-AMP session exists, |
| 255 | * then save the beacon in the scan results and throw it away. |
| 256 | * |
| 257 | * * Infra Beacons |
| 258 | * - beacons received when no session active |
| 259 | * should not come here, it should be handled as part of scanning, |
| 260 | * else they should not be getting received, should update scan results and drop it if that happens. |
| 261 | * - beacons received when IBSS session active: |
| 262 | * update scan results and drop it. |
| 263 | * - beacons received when Infra session(STA) is active: |
| 264 | * update scan results and drop it |
| 265 | * - beacons received when BT-STA session is active: |
| 266 | * update scan results and drop it. |
| 267 | * - beacons received when Infra/BT-STA or Infra/IBSS is active. |
| 268 | * update scan results and drop it. |
| 269 | * |
| 270 | |
| 271 | */ |
| 272 | static void __schBeaconProcessNoSession(tpAniSirGlobal pMac, tpSchBeaconStruct pBeacon,tANI_U8* pRxPacketInfo) |
| 273 | { |
| 274 | tpPESession psessionEntry = NULL; |
| 275 | |
| 276 | if( (psessionEntry = limIsIBSSSessionActive(pMac)) != NULL) |
| 277 | { |
| 278 | limHandleIBSScoalescing(pMac, pBeacon, pRxPacketInfo, psessionEntry); |
| 279 | } |
| 280 | |
| 281 | //If station(STA/BT-STA/BT-AP/IBSS) mode, Always save the beacon in the scan results, if atleast one session is active |
| 282 | //schBeaconProcessNoSession will be called only when there is atleast one session active, so not checking |
| 283 | //it again here. |
| 284 | limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE); |
| 285 | return; |
| 286 | } |
| 287 | |
| 288 | |
| 289 | |
| 290 | /* |
| 291 | * __schBeaconProcessForSession |
| 292 | * |
| 293 | * FUNCTION: |
| 294 | * Process the received beacon frame when |
| 295 | * -- Station is not scanning |
| 296 | * -- Corresponding session is found |
| 297 | * |
| 298 | * LOGIC: |
| 299 | * Following scenarios exist when Session exists |
| 300 | * * IBSS STA receving beacons from IBSS Peers, who are part of IBSS. |
| 301 | * - call limHandleIBSScoalescing with that session context. |
| 302 | * * Infra STA receving beacons from AP to which it is connected |
| 303 | * - call schBeaconProcessFromAP with that session's context. |
| 304 | * * BTAMP STA receving beacons from BTAMP AP |
| 305 | * - call schBeaconProcessFromAP with that session's context. |
| 306 | * * BTAMP AP receiving beacons from BTAMP STA |
| 307 | * (here need to make sure BTAP creates session entry for BT STA) |
| 308 | * - just update the beacon count for heart beat purposes for now, |
| 309 | * for now, don't process the beacon. |
| 310 | * * Infra/IBSS both active and receives IBSS beacon: |
| 311 | * - call limHandleIBSScoalescing with that session context. |
| 312 | * * Infra/IBSS both active and receives Infra beacon: |
| 313 | * - call schBeaconProcessFromAP with that session's context. |
| 314 | * any updates to EDCA parameters will be effective for IBSS as well, |
| 315 | * even though no WMM for IBSS ?? Need to figure out how to handle this scenario. |
| 316 | * * Infra/BTSTA both active and receive Infra beacon. |
| 317 | * - change in EDCA parameters on Infra affect the BTSTA link. |
| 318 | * Update the same parameters on BT link |
| 319 | * * Infra/BTSTA both active and receive BT-AP beacon. |
| 320 | * -update beacon cnt for heartbeat |
| 321 | * * Infra/BTAP both active and receive Infra beacon. |
| 322 | * - BT-AP starts advertising BE parameters from Infra AP, if they get changed. |
| 323 | * |
| 324 | * * Infra/BTAP both active and receive BTSTA beacon. |
| 325 | * - update beacon cnt for heartbeat |
| 326 | */ |
| 327 | |
| 328 | static void __schBeaconProcessForSession( tpAniSirGlobal pMac, |
| 329 | tpSchBeaconStruct pBeacon, |
| 330 | tANI_U8* pRxPacketInfo, |
| 331 | tpPESession psessionEntry) |
| 332 | { |
| 333 | tANI_U32 bi; |
| 334 | tANI_U8 bssIdx = 0; |
| 335 | //tpSirMacMgmtHdr pMh = SIR_MAC_BD_TO_MPDUHEADER(pRxPacketInfo); |
| 336 | //tANI_U8 bssid[sizeof(tSirMacAddr)]; |
| 337 | tUpdateBeaconParams beaconParams; |
| 338 | tANI_U8 sendProbeReq = FALSE; |
| 339 | tpDphHashNode pStaDs = NULL; |
Hanumantha Reddy Pothula | 0de1080 | 2016-02-11 17:29:27 +0530 | [diff] [blame^] | 340 | tANI_U32 channelBondingMode = 0; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 341 | #ifdef WLAN_FEATURE_11AC |
| 342 | tpSirMacMgmtHdr pMh = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 343 | tANI_U16 aid; |
| 344 | tANI_U8 operMode; |
Kiran Kumar Lokere | 6e45533 | 2013-06-21 19:31:12 -0700 | [diff] [blame] | 345 | tANI_U8 chWidth = 0; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 346 | #endif |
Girish Gowli | 7f984bf | 2014-10-20 21:04:55 +0530 | [diff] [blame] | 347 | #if defined FEATURE_WLAN_ESE || defined WLAN_FEATURE_VOWIFI |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 348 | tPowerdBm regMax = 0,maxTxPower = 0; |
| 349 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 350 | |
Kaushik, Sushant | fb15673 | 2014-01-07 15:36:03 +0530 | [diff] [blame] | 351 | vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 352 | beaconParams.paramChangeBitmap = 0; |
| 353 | |
| 354 | if(eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) |
| 355 | { |
Abhishek Singh | d5c3127 | 2014-03-07 14:46:50 +0530 | [diff] [blame] | 356 | if( limHandleIBSScoalescing(pMac, pBeacon, pRxPacketInfo, psessionEntry) |
| 357 | != eSIR_SUCCESS ) |
| 358 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 359 | } |
| 360 | else if( (eLIM_STA_ROLE == psessionEntry->limSystemRole) || |
| 361 | (eLIM_BT_AMP_STA_ROLE == psessionEntry->limSystemRole)) |
| 362 | { |
| 363 | /* |
| 364 | * This handles two cases: |
| 365 | * -- Infra STA receving beacons from AP |
| 366 | * -- BTAMP_STA receving beacons from BTAMP_AP |
| 367 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 368 | //Always save the beacon into LIM's cached scan results |
| 369 | limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE); |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 370 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 371 | /** |
| 372 | * This is the Beacon received from the AP we're currently associated with. Check |
| 373 | * if there are any changes in AP's capabilities |
| 374 | */ |
| 375 | if((tANI_U8) pBeacon->channelNumber != psessionEntry->currentOperChannel) |
| 376 | { |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 377 | PELOGE(schLog(pMac, LOGE, FL("Channel Change from %d --> %d - " |
Kiran Kumar Lokere | af882c8 | 2013-03-18 16:07:05 -0700 | [diff] [blame] | 378 | "Ignoring beacon!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | psessionEntry->currentOperChannel, pBeacon->channelNumber);) |
| 380 | goto fail; |
| 381 | } |
Abhishek Singh | df8eb31 | 2014-11-15 00:49:28 +0530 | [diff] [blame] | 382 | |
| 383 | if( RF_CHAN_14 >= psessionEntry->currentOperChannel ) |
| 384 | { |
| 385 | channelBondingMode = pMac->roam.configParam.channelBondingMode24GHz; |
| 386 | } |
| 387 | else |
| 388 | { |
| 389 | channelBondingMode = pMac->roam.configParam.channelBondingMode5GHz; |
| 390 | } |
| 391 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 392 | limDetectChangeInApCapabilities(pMac, pBeacon, psessionEntry); |
| 393 | if(limGetStaHashBssidx(pMac, DPH_STA_HASH_INDEX_PEER, &bssIdx, psessionEntry) != eSIR_SUCCESS) |
| 394 | goto fail; |
| 395 | beaconParams.bssIdx = bssIdx; |
Madan Mohan Koyyalamudi | fff03f2 | 2013-07-11 11:32:07 +0530 | [diff] [blame] | 396 | vos_mem_copy(( tANI_U8* )&psessionEntry->lastBeaconTimeStamp, |
| 397 | ( tANI_U8* )pBeacon->timeStamp, sizeof(tANI_U64)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 398 | psessionEntry->lastBeaconDtimCount = pBeacon->tim.dtimCount; |
| 399 | psessionEntry->lastBeaconDtimPeriod= pBeacon->tim.dtimPeriod; |
| 400 | psessionEntry->currentBssBeaconCnt++; |
| 401 | |
| 402 | |
| 403 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 404 | MTRACE(macTrace(pMac, TRACE_CODE_RX_MGMT_TSF, psessionEntry->peSessionId, pBeacon->timeStamp[0]);) |
| 405 | MTRACE(macTrace(pMac, TRACE_CODE_RX_MGMT_TSF, psessionEntry->peSessionId, pBeacon->timeStamp[1]);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 406 | |
| 407 | /* Read beacon interval session Entry */ |
| 408 | bi = psessionEntry->beaconParams.beaconInterval; |
| 409 | if (bi != pBeacon->beaconInterval) |
| 410 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 411 | schLog(pMac, LOG1, FL("Beacon interval changed from %d to %d"), |
| 412 | pBeacon->beaconInterval, bi); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 413 | |
| 414 | bi = pBeacon->beaconInterval; |
| 415 | psessionEntry->beaconParams.beaconInterval = (tANI_U16) bi; |
| 416 | beaconParams.paramChangeBitmap |= PARAM_BCN_INTERVAL_CHANGED; |
| 417 | beaconParams.beaconInterval = (tANI_U16)bi; |
| 418 | } |
| 419 | |
| 420 | if (pBeacon->cfPresent) |
| 421 | { |
| 422 | cfgSetInt(pMac, WNI_CFG_CFP_PERIOD, pBeacon->cfParamSet.cfpPeriod); |
| 423 | limSendCFParams(pMac, bssIdx, pBeacon->cfParamSet.cfpCount, pBeacon->cfParamSet.cfpPeriod); |
| 424 | } |
| 425 | |
| 426 | if (pBeacon->timPresent) |
| 427 | { |
| 428 | cfgSetInt(pMac, WNI_CFG_DTIM_PERIOD, pBeacon->tim.dtimPeriod); |
| 429 | //No need to send DTIM Period and Count to HAL/SMAC |
| 430 | //SMAC already parses TIM bit. |
| 431 | } |
| 432 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 433 | if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
| 434 | |
| 435 | limDecideStaProtection(pMac, pBeacon, &beaconParams, psessionEntry); |
| 436 | if (pBeacon->erpPresent) |
| 437 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 438 | if (pBeacon->erpIEInfo.barkerPreambleMode) |
| 439 | limEnableShortPreamble(pMac, false, &beaconParams, psessionEntry); |
| 440 | else |
| 441 | limEnableShortPreamble(pMac, true, &beaconParams, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 442 | } |
| 443 | limUpdateShortSlot(pMac, pBeacon, &beaconParams,psessionEntry); |
| 444 | |
| 445 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 446 | if ((pBeacon->wmeEdcaPresent && (psessionEntry->limWmeEnabled)) || |
| 447 | (pBeacon->edcaPresent && (psessionEntry->limQosEnabled))) |
| 448 | { |
| 449 | if(pBeacon->edcaParams.qosInfo.count != psessionEntry->gLimEdcaParamSetCount) |
| 450 | { |
| 451 | if (schBeaconEdcaProcess(pMac, &pBeacon->edcaParams, psessionEntry) != eSIR_SUCCESS) |
Kiran Kumar Lokere | af882c8 | 2013-03-18 16:07:05 -0700 | [diff] [blame] | 452 | PELOGE(schLog(pMac, LOGE, FL("EDCA parameter processing error"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 453 | else if(pStaDs != NULL) |
| 454 | { |
| 455 | // If needed, downgrade the EDCA parameters |
| 456 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 457 | |
| 458 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 459 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 460 | else |
| 461 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 462 | } |
| 463 | else |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 464 | PELOGE(schLog(pMac, LOGE, FL("Self Entry missing in Hash Table"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 465 | } |
| 466 | } |
| 467 | else if( (pBeacon->qosCapabilityPresent && psessionEntry->limQosEnabled) && |
| 468 | (pBeacon->qosCapability.qosInfo.count != psessionEntry->gLimEdcaParamSetCount)) |
| 469 | sendProbeReq = TRUE; |
| 470 | } |
| 471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 472 | if ( psessionEntry->htCapability && pBeacon->HTInfo.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | { |
| 474 | limUpdateStaRunTimeHTSwitchChnlParams( pMac, &pBeacon->HTInfo, bssIdx,psessionEntry); |
| 475 | } |
| 476 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 477 | if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE) ||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) || |
| 478 | (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) ) |
| 479 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 480 | /* Channel Switch information element updated */ |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 481 | if(pBeacon->channelSwitchPresent || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | pBeacon->propIEinfo.propChannelSwitchPresent) |
| 483 | { |
| 484 | limUpdateChannelSwitch(pMac, pBeacon, psessionEntry); |
| 485 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 486 | else if (psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 487 | { |
| 488 | limCancelDot11hChannelSwitch(pMac, psessionEntry); |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 489 | } |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 490 | // check for HT capability |
| 491 | pStaDs = dphLookupHashEntry(pMac, pMh->sa, &aid, |
| 492 | &psessionEntry->dph.dphHashTable); |
Abhishek Singh | df8eb31 | 2014-11-15 00:49:28 +0530 | [diff] [blame] | 493 | /* Update the channel bonding mode only if channel bonding |
| 494 | * mode is enabled in INI. |
| 495 | */ |
Abhishek Singh | e1f1f0b | 2015-08-06 14:07:59 +0530 | [diff] [blame] | 496 | if ( (pStaDs != NULL) && (HAL_STA_INVALID_IDX != pStaDs->staIndex ) && |
Abhishek Singh | df8eb31 | 2014-11-15 00:49:28 +0530 | [diff] [blame] | 497 | (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != channelBondingMode) ) |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 498 | { |
| 499 | /* Following check is related to HT40 on 2.4GHz mode*/ |
| 500 | if ((pStaDs->htSecondaryChannelOffset != |
| 501 | pBeacon->HTInfo.secondaryChannelOffset) && |
| 502 | (IS_HT40_OBSS_SCAN_FEATURE_ENABLE) && |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 503 | (psessionEntry->currentOperChannel <= RF_CHAN_14)) |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 504 | { |
| 505 | VOS_TRACE( VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 506 | FL(" Current Secondarychanoffset %d received " |
| 507 | " secondaryChannelOffset %d, staIdx = %d"), |
| 508 | pStaDs->htSecondaryChannelOffset, |
| 509 | pBeacon->HTInfo.secondaryChannelOffset, |
| 510 | pStaDs->staIndex); |
| 511 | if (eANI_BOOLEAN_TRUE ==(limCheckHTChanBondModeChange(pMac, |
| 512 | psessionEntry, |
| 513 | pBeacon->HTInfo.secondaryChannelOffset, |
| 514 | pStaDs->htSecondaryChannelOffset, |
| 515 | pStaDs->staIndex))) |
| 516 | { |
| 517 | pStaDs->htSupportedChannelWidthSet = |
| 518 | pBeacon->HTInfo.recommendedTxWidthSet; |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 519 | pStaDs->htSecondaryChannelOffset = |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 520 | pBeacon->HTInfo.secondaryChannelOffset; |
Girish Gowli | a95daca | 2015-02-04 20:31:31 +0530 | [diff] [blame] | 521 | limUpdateMaxRateFlag(pMac, psessionEntry->smeSessionId, |
| 522 | limGetMaxRateFlags(pStaDs, psessionEntry)); |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 523 | } |
| 524 | } |
| 525 | } |
| 526 | else |
Abhishek Singh | df8eb31 | 2014-11-15 00:49:28 +0530 | [diff] [blame] | 527 | schLog(pMac, LOG1, |
| 528 | FL("Self Entry missing in Hash Table or channel bonding mode is disabled")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 529 | } |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 530 | /* TODO : Below condition checks can be merged with the if */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 531 | #ifdef WLAN_FEATURE_11AC |
Kiran Kumar Lokere | 6e45533 | 2013-06-21 19:31:12 -0700 | [diff] [blame] | 532 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || |
| 533 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) || |
| 534 | (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE)) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 535 | { |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 536 | // check for VHT capability |
| 537 | pStaDs = dphLookupHashEntry(pMac, pMh->sa, &aid, |
| 538 | &psessionEntry->dph.dphHashTable); |
Abhishek Singh | df8eb31 | 2014-11-15 00:49:28 +0530 | [diff] [blame] | 539 | |
| 540 | /* Update the channel bonding mode only if channel bonding |
| 541 | * mode is enabled in INI. |
| 542 | */ |
Abhishek Singh | e1f1f0b | 2015-08-06 14:07:59 +0530 | [diff] [blame] | 543 | if ( (NULL != pStaDs) && (HAL_STA_INVALID_IDX != pStaDs->staIndex ) && |
Abhishek Singh | df8eb31 | 2014-11-15 00:49:28 +0530 | [diff] [blame] | 544 | (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != channelBondingMode) ) |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 545 | { |
| 546 | if (psessionEntry->vhtCapability && pBeacon->OperatingMode.present ) |
| 547 | { |
| 548 | operMode = pStaDs->vhtSupportedChannelWidthSet ? |
| 549 | eHT_CHANNEL_WIDTH_80MHZ : |
| 550 | pStaDs->htSupportedChannelWidthSet ? |
| 551 | eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ; |
| 552 | if (operMode != pBeacon->OperatingMode.chanWidth) |
| 553 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 554 | schLog(pMac, LOG1, |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 555 | FL(" received OpMode Chanwidth %d, staIdx = %d"), |
| 556 | pBeacon->OperatingMode.chanWidth, |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 557 | pStaDs->staIndex); |
| 558 | schLog(pMac, LOG1, FL(" MAC -" MAC_ADDRESS_STR), |
| 559 | MAC_ADDR_ARRAY(pMh->sa)); |
Kiran Kumar Lokere | 6e45533 | 2013-06-21 19:31:12 -0700 | [diff] [blame] | 560 | |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 561 | if (pBeacon->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ) |
| 562 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 563 | schLog(pMac, LOG1, |
| 564 | FL("Updating the CH Width to 80MHz")); |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 565 | pStaDs->vhtSupportedChannelWidthSet = |
| 566 | WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; |
| 567 | pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; |
| 568 | } |
| 569 | else if (pBeacon->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ) |
| 570 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 571 | schLog(pMac, LOG1, |
| 572 | FL("Updating the CH Width to 40MHz")); |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 573 | pStaDs->vhtSupportedChannelWidthSet = |
| 574 | WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; |
| 575 | pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; |
| 576 | } |
| 577 | else if (pBeacon->OperatingMode.chanWidth == |
| 578 | eHT_CHANNEL_WIDTH_20MHZ) |
| 579 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 580 | schLog(pMac, LOG1, |
| 581 | FL("Updating the CH Width to 20MHz")); |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 582 | pStaDs->vhtSupportedChannelWidthSet = |
| 583 | WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; |
| 584 | pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; |
| 585 | } |
| 586 | limCheckVHTOpModeChange(pMac, psessionEntry, |
| 587 | pBeacon->OperatingMode.chanWidth, |
| 588 | pStaDs->staIndex); |
| 589 | } |
| 590 | } |
| 591 | else if (psessionEntry->vhtCapability && pBeacon->VHTOperation.present) |
| 592 | { |
| 593 | operMode = pStaDs->vhtSupportedChannelWidthSet; |
| 594 | if (operMode != pBeacon->VHTOperation.chanWidth) |
| 595 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 596 | schLog(pMac, LOG1, |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 597 | FL(" received VHTOP CHWidth %d staIdx = %d"), |
| 598 | pBeacon->VHTOperation.chanWidth, |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 599 | pStaDs->staIndex); |
| 600 | schLog(pMac, LOG1, FL(" MAC -" MAC_ADDRESS_STR), |
| 601 | MAC_ADDR_ARRAY(pMh->sa)); |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 602 | |
| 603 | if (pBeacon->VHTOperation.chanWidth == |
| 604 | WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) |
| 605 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 606 | schLog(pMac, LOG1, |
| 607 | FL("Updating the CH Width to 80MHz")); |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 608 | pStaDs->vhtSupportedChannelWidthSet = |
| 609 | WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; |
| 610 | pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; |
| 611 | chWidth = eHT_CHANNEL_WIDTH_80MHZ; |
| 612 | } |
| 613 | else if (pBeacon->VHTOperation.chanWidth == |
| 614 | WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ) |
| 615 | { |
| 616 | pStaDs->vhtSupportedChannelWidthSet = |
| 617 | WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; |
| 618 | if (pBeacon->HTCaps.supportedChannelWidthSet) |
| 619 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 620 | schLog(pMac, LOG1, |
| 621 | FL("Updating the CH Width to 40MHz")); |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 622 | pStaDs->htSupportedChannelWidthSet = |
| 623 | eHT_CHANNEL_WIDTH_40MHZ; |
| 624 | chWidth = eHT_CHANNEL_WIDTH_40MHZ; |
| 625 | } |
| 626 | else |
| 627 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 628 | schLog(pMac, LOG1, |
| 629 | FL("Updating the CH Width to 20MHz")); |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 630 | pStaDs->htSupportedChannelWidthSet = |
| 631 | eHT_CHANNEL_WIDTH_20MHZ; |
| 632 | chWidth = eHT_CHANNEL_WIDTH_20MHZ; |
| 633 | } |
| 634 | } |
Kiran Kumar Lokere | 6e45533 | 2013-06-21 19:31:12 -0700 | [diff] [blame] | 635 | limCheckVHTOpModeChange(pMac, psessionEntry, |
Ravi Joshi | 0fc681b | 2013-09-11 16:46:07 -0700 | [diff] [blame] | 636 | chWidth, pStaDs->staIndex); |
| 637 | } |
| 638 | } |
| 639 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 640 | } |
| 641 | #endif |
| 642 | |
Girish Gowli | 7f984bf | 2014-10-20 21:04:55 +0530 | [diff] [blame] | 643 | #if defined (FEATURE_WLAN_ESE) || defined (WLAN_FEATURE_VOWIFI) |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 644 | /* Obtain the Max Tx power for the current regulatory */ |
| 645 | regMax = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); |
| 646 | #endif |
Girish Gowli | 7f984bf | 2014-10-20 21:04:55 +0530 | [diff] [blame] | 647 | #if defined WLAN_FEATURE_VOWIFI |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 648 | { |
| 649 | tPowerdBm localRRMConstraint = 0; |
| 650 | if ( pMac->rrm.rrmPEContext.rrmEnable && pBeacon->powerConstraintPresent ) |
| 651 | { |
| 652 | localRRMConstraint = pBeacon->localPowerConstraint.localPowerConstraints; |
| 653 | } |
| 654 | else |
| 655 | { |
| 656 | localRRMConstraint = 0; |
| 657 | } |
| 658 | maxTxPower = VOS_MIN(regMax,(regMax - localRRMConstraint)); |
| 659 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 660 | #elif defined FEATURE_WLAN_ESE |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 661 | maxTxPower = regMax; |
| 662 | #endif |
| 663 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 664 | #if defined FEATURE_WLAN_ESE |
| 665 | if( psessionEntry->isESEconnection ) |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 666 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 667 | tPowerdBm localESEConstraint = 0; |
| 668 | if (pBeacon->eseTxPwr.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 669 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 670 | localESEConstraint = pBeacon->eseTxPwr.power_limit; |
| 671 | maxTxPower = limGetMaxTxPower(maxTxPower, localESEConstraint, pMac->roam.configParam.nTxPowerCap); |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 672 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 673 | schLog( pMac, LOG1, "RegMax = %d, localESECons = %d, MaxTx = %d", regMax, localESEConstraint, maxTxPower ); |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 674 | } |
| 675 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 676 | |
Girish Gowli | 7f984bf | 2014-10-20 21:04:55 +0530 | [diff] [blame] | 677 | #if defined (FEATURE_WLAN_ESE) || defined (WLAN_FEATURE_VOWIFI) |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 678 | { |
| 679 | //If maxTxPower is increased or decreased |
| 680 | if( maxTxPower != psessionEntry->maxTxPower ) |
| 681 | { |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 682 | schLog( pMac, LOG1, "Local power constraint change..updating new maxTx power %d to HAL",maxTxPower); |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 683 | if( limSendSetMaxTxPowerReq ( pMac, maxTxPower, psessionEntry ) == eSIR_SUCCESS ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 684 | psessionEntry->maxTxPower = maxTxPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 685 | } |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 686 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 687 | #endif |
| 688 | |
| 689 | // Indicate to LIM that Beacon is received |
| 690 | |
| 691 | if (pBeacon->HTInfo.present) |
| 692 | limReceivedHBHandler(pMac, (tANI_U8)pBeacon->HTInfo.primaryChannel, psessionEntry); |
| 693 | else |
| 694 | limReceivedHBHandler(pMac, (tANI_U8)pBeacon->channelNumber, psessionEntry); |
| 695 | |
| 696 | // I don't know if any additional IE is required here. Currently, not include addIE. |
| 697 | if(sendProbeReq) |
| 698 | limSendProbeReqMgmtFrame(pMac, &psessionEntry->ssId, |
| 699 | psessionEntry->bssId, psessionEntry->currentOperChannel,psessionEntry->selfMacAddr, |
| 700 | psessionEntry->dot11mode, 0, NULL); |
| 701 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 702 | if(beaconParams.paramChangeBitmap) |
| 703 | { |
Abhishek Singh | c75726d | 2015-04-13 14:44:14 +0530 | [diff] [blame] | 704 | schLog(pMac, LOGW, FL("Beacon for session[%d] got changed. "), psessionEntry->peSessionId); |
| 705 | schLog(pMac, LOGW, FL("sending beacon param change bitmap: 0x%x "), beaconParams.paramChangeBitmap); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 706 | limSendBeaconParams(pMac, &beaconParams, psessionEntry); |
| 707 | } |
| 708 | |
| 709 | fail: |
| 710 | return; |
| 711 | |
| 712 | } |
| 713 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 714 | /** |
| 715 | * schBeaconProcess |
| 716 | * |
| 717 | * FUNCTION: |
| 718 | * Process the received beacon frame |
| 719 | * |
| 720 | * LOGIC: |
| 721 | * |
| 722 | * ASSUMPTIONS: |
| 723 | * |
| 724 | * NOTE: |
| 725 | * |
| 726 | * @param pRxPacketInfo pointer to buffer descriptor |
| 727 | * @return None |
| 728 | */ |
| 729 | |
| 730 | void schBeaconProcess(tpAniSirGlobal pMac, tANI_U8* pRxPacketInfo, tpPESession psessionEntry) |
| 731 | { |
| 732 | static tSchBeaconStruct beaconStruct; |
| 733 | tUpdateBeaconParams beaconParams; |
| 734 | tpPESession pAPSession = NULL; |
Kaushik, Sushant | fb15673 | 2014-01-07 15:36:03 +0530 | [diff] [blame] | 735 | vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 736 | beaconParams.paramChangeBitmap = 0; |
| 737 | |
| 738 | pMac->sch.gSchBcnRcvCnt++; |
| 739 | |
| 740 | // Convert the beacon frame into a structure |
| 741 | if (sirConvertBeaconFrame2Struct(pMac, (tANI_U8 *) pRxPacketInfo, &beaconStruct)!= eSIR_SUCCESS) |
| 742 | { |
Sushant Kaushik | 02c866d | 2015-01-16 15:24:25 +0530 | [diff] [blame] | 743 | schLog(pMac, LOGE, FL("beacon parsing failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 744 | pMac->sch.gSchBcnParseErrorCnt++; |
Sushant Kaushik | 02c866d | 2015-01-16 15:24:25 +0530 | [diff] [blame] | 745 | |
| 746 | if ((NULL != psessionEntry) && (!psessionEntry->currentBssBeaconCnt)) |
| 747 | limParseBeaconForTim(pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry); |
| 748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 749 | return; |
| 750 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 751 | if (beaconStruct.ssidPresent) |
| 752 | { |
| 753 | beaconStruct.ssId.ssId[beaconStruct.ssId.length] = 0; |
| 754 | } |
| 755 | |
| 756 | /* |
| 757 | * First process the beacon in the context of any existing AP or BTAP session. |
| 758 | * This takes cares of following two scenarios: |
| 759 | * - psessionEntry = NULL: |
| 760 | * e.g. beacon received from a neighboring BSS, you want to apply the protection settings to BTAP/InfraAP beacons |
| 761 | * - psessionEntry is non NULL: |
| 762 | * e.g. beacon received is from the INFRA AP to which you are connected on another concurrent link. |
| 763 | * In this case also, we want to apply the protection settings(as advertised by Infra AP) to BTAP beacons |
| 764 | * |
| 765 | * |
| 766 | */ |
| 767 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 768 | if (((pAPSession = limIsApSessionActive(pMac)) != NULL) |
| 769 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 770 | && (!(WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo))) |
| 771 | #endif |
| 772 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 773 | { |
| 774 | beaconParams.bssIdx = pAPSession->bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 775 | if (pAPSession->gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 776 | ap_beacon_process(pMac, pRxPacketInfo, &beaconStruct, &beaconParams, pAPSession); |
| 777 | |
| 778 | if (beaconParams.paramChangeBitmap) |
| 779 | { |
| 780 | //Update the beacons and apply the new settings to HAL |
| 781 | schSetFixedBeaconFields(pMac, pAPSession); |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 782 | schLog(pMac, LOG1, FL("Beacon for PE session[%d] got changed."), |
| 783 | pAPSession->peSessionId); |
| 784 | schLog(pMac, LOG1, FL("sending beacon param change bitmap: 0x%x "), |
| 785 | beaconParams.paramChangeBitmap); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 786 | limSendBeaconParams(pMac, &beaconParams, pAPSession); |
| 787 | } |
| 788 | } |
| 789 | |
| 790 | /* |
| 791 | * Now process the beacon in the context of the BSS which is transmitting the beacons, if one is found |
| 792 | */ |
| 793 | if(psessionEntry == NULL) |
| 794 | { |
| 795 | __schBeaconProcessNoSession(pMac, &beaconStruct, pRxPacketInfo ); |
| 796 | } |
| 797 | else |
| 798 | { |
| 799 | __schBeaconProcessForSession(pMac, &beaconStruct, pRxPacketInfo, psessionEntry ); |
| 800 | } |
| 801 | |
| 802 | } |
| 803 | |
| 804 | |
| 805 | |
| 806 | |
| 807 | |
| 808 | // -------------------------------------------------------------------- |
| 809 | /** |
| 810 | * schBeaconEdcaProcess |
| 811 | * |
| 812 | * FUNCTION: |
| 813 | * Process the EDCA parameter set in the received beacon frame |
| 814 | * |
| 815 | * LOGIC: |
| 816 | * |
| 817 | * ASSUMPTIONS: |
| 818 | * |
| 819 | * NOTE: |
| 820 | * |
| 821 | * @param edca reference to edca parameters in beacon struct |
| 822 | * @return success |
| 823 | */ |
| 824 | |
| 825 | tSirRetStatus schBeaconEdcaProcess(tpAniSirGlobal pMac, tSirMacEdcaParamSetIE *edca, tpPESession psessionEntry) |
| 826 | { |
| 827 | tANI_U8 i; |
| 828 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 829 | vos_log_qos_edca_pkt_type *log_ptr = NULL; |
| 830 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 831 | |
Kiran Kumar Lokere | af882c8 | 2013-03-18 16:07:05 -0700 | [diff] [blame] | 832 | PELOG1(schLog(pMac, LOG1, FL("Updating parameter set count: Old %d ---> new %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 833 | psessionEntry->gLimEdcaParamSetCount, edca->qosInfo.count);) |
| 834 | |
| 835 | psessionEntry->gLimEdcaParamSetCount = edca->qosInfo.count; |
| 836 | psessionEntry->gLimEdcaParams[EDCA_AC_BE] = edca->acbe; |
| 837 | psessionEntry->gLimEdcaParams[EDCA_AC_BK] = edca->acbk; |
| 838 | psessionEntry->gLimEdcaParams[EDCA_AC_VI] = edca->acvi; |
| 839 | psessionEntry->gLimEdcaParams[EDCA_AC_VO] = edca->acvo; |
| 840 | //log: LOG_WLAN_QOS_EDCA_C |
| 841 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 842 | WLAN_VOS_DIAG_LOG_ALLOC(log_ptr, vos_log_qos_edca_pkt_type, LOG_WLAN_QOS_EDCA_C); |
| 843 | if(log_ptr) |
| 844 | { |
| 845 | log_ptr->aci_be = psessionEntry->gLimEdcaParams[EDCA_AC_BE].aci.aci; |
| 846 | log_ptr->cw_be = psessionEntry->gLimEdcaParams[EDCA_AC_BE].cw.max << 4 | |
| 847 | psessionEntry->gLimEdcaParams[EDCA_AC_BE].cw.min; |
| 848 | log_ptr->txoplimit_be = psessionEntry->gLimEdcaParams[EDCA_AC_BE].txoplimit; |
| 849 | log_ptr->aci_bk = psessionEntry->gLimEdcaParams[EDCA_AC_BK].aci.aci; |
| 850 | log_ptr->cw_bk = psessionEntry->gLimEdcaParams[EDCA_AC_BK].cw.max << 4 | |
| 851 | psessionEntry->gLimEdcaParams[EDCA_AC_BK].cw.min; |
| 852 | log_ptr->txoplimit_bk = psessionEntry->gLimEdcaParams[EDCA_AC_BK].txoplimit; |
| 853 | log_ptr->aci_vi = psessionEntry->gLimEdcaParams[EDCA_AC_VI].aci.aci; |
| 854 | log_ptr->cw_vi = psessionEntry->gLimEdcaParams[EDCA_AC_VI].cw.max << 4 | |
| 855 | psessionEntry->gLimEdcaParams[EDCA_AC_VI].cw.min; |
| 856 | log_ptr->txoplimit_vi = psessionEntry->gLimEdcaParams[EDCA_AC_VI].txoplimit; |
| 857 | log_ptr->aci_vo = psessionEntry->gLimEdcaParams[EDCA_AC_VO].aci.aci; |
| 858 | log_ptr->cw_vo = psessionEntry->gLimEdcaParams[EDCA_AC_VO].cw.max << 4 | |
| 859 | psessionEntry->gLimEdcaParams[EDCA_AC_VO].cw.min; |
| 860 | log_ptr->txoplimit_vo = psessionEntry->gLimEdcaParams[EDCA_AC_VO].txoplimit; |
| 861 | } |
| 862 | WLAN_VOS_DIAG_LOG_REPORT(log_ptr); |
| 863 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 864 | PELOG1(schLog(pMac, LOGE, FL("Updating Local EDCA Params(gLimEdcaParams) to: "));) |
| 865 | for(i=0; i<MAX_NUM_AC; i++) |
| 866 | { |
Kiran Kumar Lokere | af882c8 | 2013-03-18 16:07:05 -0700 | [diff] [blame] | 867 | PELOG1(schLog(pMac, LOG1, FL("AC[%d]: AIFSN: %d, ACM %d, CWmin %d, CWmax %d, TxOp %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 868 | i, |
| 869 | psessionEntry->gLimEdcaParams[i].aci.aifsn, |
| 870 | psessionEntry->gLimEdcaParams[i].aci.acm, |
| 871 | psessionEntry->gLimEdcaParams[i].cw.min, |
| 872 | psessionEntry->gLimEdcaParams[i].cw.max, |
| 873 | psessionEntry->gLimEdcaParams[i].txoplimit);) |
| 874 | } |
| 875 | |
| 876 | return eSIR_SUCCESS; |
| 877 | } |