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