Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file limAssocUtils.cc contains the utility functions |
| 30 | * LIM uses while processing (Re) Association messages. |
| 31 | * Author: Chandra Modumudi |
| 32 | * Date: 02/13/02 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | * 05/26/10 js WPA handling in (Re)Assoc frames |
| 37 | * |
| 38 | */ |
| 39 | |
| 40 | #include "palTypes.h" |
| 41 | #include "aniGlobal.h" |
| 42 | #include "wniApi.h" |
| 43 | #include "sirCommon.h" |
| 44 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 45 | #include "wniCfgSta.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 46 | #include "pmmApi.h" |
| 47 | #include "cfgApi.h" |
| 48 | |
| 49 | #include "schApi.h" |
| 50 | #include "utilsApi.h" |
| 51 | #include "limUtils.h" |
| 52 | #include "limAssocUtils.h" |
| 53 | #include "limSecurityUtils.h" |
| 54 | #include "limSerDesUtils.h" |
| 55 | #include "limStaHashApi.h" |
| 56 | #include "limAdmitControl.h" |
| 57 | #include "limSendMessages.h" |
| 58 | #include "limIbssPeerMgmt.h" |
| 59 | #include "limSession.h" |
| 60 | |
| 61 | #include "vos_types.h" |
| 62 | #include "wlan_qct_wda.h" |
| 63 | |
| 64 | /* |
| 65 | * fill up the rate info properly based on what is actually supported by the peer |
| 66 | * TBD TBD TBD |
| 67 | */ |
| 68 | void |
| 69 | limFillSupportedRatesInfo( |
| 70 | tpAniSirGlobal pMac, |
| 71 | tpDphHashNode pSta, |
| 72 | tpSirSupportedRates pRates, |
| 73 | tpPESession psessionEntry) |
| 74 | { |
| 75 | //pSta will be NULL for self entry, so get the opRateMode based on the self mode. |
| 76 | //For the peer entry get it from the peer Capabilities present in hash table |
| 77 | if(pSta == NULL) |
| 78 | pRates->opRateMode = limGetStaRateMode((tANI_U8)psessionEntry->dot11mode); |
| 79 | else |
| 80 | pRates->opRateMode = limGetStaPeerType(pMac, pSta, psessionEntry); |
| 81 | |
| 82 | } |
| 83 | |
| 84 | |
| 85 | /** |
| 86 | * limCmpSSid() |
| 87 | * |
| 88 | *FUNCTION: |
| 89 | * This function is called in various places within LIM code |
| 90 | * to determine whether received SSid is same as SSID in use. |
| 91 | * |
| 92 | *LOGIC: |
| 93 | * |
| 94 | *ASSUMPTIONS: |
| 95 | * NA |
| 96 | * |
| 97 | *NOTE: |
| 98 | * NA |
| 99 | * |
| 100 | * @param *prxSSid - pointer to SSID structure |
| 101 | * |
| 102 | * @return status - true for SSID match else false. |
| 103 | */ |
| 104 | |
| 105 | tANI_U8 |
| 106 | limCmpSSid(tpAniSirGlobal pMac, tSirMacSSid *prxSSid,tpPESession psessionEntry) |
| 107 | { |
| 108 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 109 | if (vos_mem_compare((tANI_U8* ) prxSSid, (tANI_U8 *) &psessionEntry->ssId, |
| 110 | (tANI_U8) (psessionEntry->ssId.length + 1))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 111 | return true; |
| 112 | else |
| 113 | return false; |
| 114 | |
| 115 | } /****** end limCmpSSid() ******/ |
| 116 | |
| 117 | |
| 118 | |
| 119 | /** |
| 120 | * limCompareCapabilities() |
| 121 | * |
| 122 | *FUNCTION: |
| 123 | * This function is called during Association/Reassociation |
| 124 | * frame handling to determine whether received capabilities |
| 125 | * match with local capabilities or not. |
| 126 | * |
| 127 | *LOGIC: |
| 128 | * |
| 129 | *ASSUMPTIONS: |
| 130 | * NA |
| 131 | * |
| 132 | *NOTE: |
| 133 | * NA |
| 134 | * |
| 135 | * @param pMac - Pointer to Global MAC structure |
| 136 | * @param pAssocReq - Pointer to received Assoc Req frame |
| 137 | * @param pLocalCapabs - Pointer to local capabilities |
| 138 | * |
| 139 | * @return status - true for Capabilitity match else false. |
| 140 | */ |
| 141 | |
| 142 | tANI_U8 |
| 143 | limCompareCapabilities(tpAniSirGlobal pMac, |
| 144 | tSirAssocReq *pAssocReq, |
| 145 | tSirMacCapabilityInfo *pLocalCapabs,tpPESession psessionEntry) |
| 146 | { |
| 147 | tANI_U32 val; |
| 148 | |
| 149 | |
| 150 | if ( ((psessionEntry->limSystemRole == eLIM_AP_ROLE)|| |
| 151 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && |
| 152 | (pAssocReq->capabilityInfo.ibss) ) |
| 153 | { |
| 154 | // Requesting STA asserting IBSS capability. |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 155 | limLog(pMac, LOG1,FL("Requesting STA asserting IBSS capability")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 156 | return false; |
| 157 | } |
| 158 | |
| 159 | // Compare CF capabilities |
| 160 | if (pAssocReq->capabilityInfo.cfPollable || |
| 161 | pAssocReq->capabilityInfo.cfPollReq) |
| 162 | { |
| 163 | // AP does not support PCF functionality |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 164 | limLog(pMac, LOG1,FL(" AP does not support PCF functionality")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 165 | return false; |
| 166 | } |
| 167 | |
| 168 | #if 0 //See CR24696 for analysis |
| 169 | // Compare privacy capability |
| 170 | if (pAssocReq->capabilityInfo.privacy != pLocalCapabs->privacy) |
| 171 | { |
| 172 | // AP does not support privacy |
| 173 | return false; |
| 174 | } |
| 175 | #endif |
| 176 | |
| 177 | // Compare short preamble capability |
| 178 | if (pAssocReq->capabilityInfo.shortPreamble && |
| 179 | (pAssocReq->capabilityInfo.shortPreamble != |
| 180 | pLocalCapabs->shortPreamble)) |
| 181 | { |
Nirav Shah | bc35fb7 | 2013-12-12 18:14:06 +0530 | [diff] [blame] | 182 | |
| 183 | // Allowing a STA requesting short preamble while |
| 184 | // AP does not support it |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 185 | #if 0 |
| 186 | // AP does not support short preamable |
| 187 | return false; |
| 188 | #endif |
| 189 | } |
| 190 | |
| 191 | |
Nirav Shah | bc35fb7 | 2013-12-12 18:14:06 +0530 | [diff] [blame] | 192 | limLog(pMac, LOG1, "QoS in AssocReq: %d, local capabs qos: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 193 | pAssocReq->capabilityInfo.qos, |
| 194 | pLocalCapabs->qos); |
| 195 | |
| 196 | // Compare QoS capability |
| 197 | if (pAssocReq->capabilityInfo.qos && |
| 198 | (pAssocReq->capabilityInfo.qos != pLocalCapabs->qos)) |
| 199 | { |
| 200 | /*Temporary hack for UPF to skip 11e capability check in order to interop with |
| 201 | CSR - proper fix needs to be put in place*/ |
| 202 | if ( 0 != vos_get_skip_11e_check()) |
| 203 | { |
Nirav Shah | bc35fb7 | 2013-12-12 18:14:06 +0530 | [diff] [blame] | 204 | limLog(pMac, LOG1, FL("Received unmatched QOS but cfg to suppress" |
| 205 | " - continuing")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 206 | } |
| 207 | else |
| 208 | { |
| 209 | // AP does not support QoS capability |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 210 | limLog(pMac, LOG1,FL("AP does not support QoS capability")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 211 | return false; |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | |
| 216 | /* |
| 217 | * If AP supports shortSlot and if apple user has |
| 218 | * enforced association only from shortSlot station, |
| 219 | * then AP must reject any station that does not support |
| 220 | * shortSlot |
| 221 | */ |
| 222 | if ( ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && (pLocalCapabs->shortSlotTime == 1) ) |
| 223 | |
| 224 | { |
| 225 | if (wlan_cfgGetInt(pMac, WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY, &val) != eSIR_SUCCESS) |
| 226 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 227 | limLog(pMac, LOGP, FL("error getting WNI_CFG_FORCE_SHORT_SLOT_ASSOC_ONLY ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 228 | return false; |
| 229 | } |
| 230 | if(val) |
| 231 | { |
| 232 | if (pAssocReq->capabilityInfo.shortSlotTime != pLocalCapabs->shortSlotTime) |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 233 | { |
| 234 | limLog(pMac, LOG1,FL("Received shortSlotTime %d does not " |
| 235 | "match with local %d"),pAssocReq->capabilityInfo.shortSlotTime, |
| 236 | pLocalCapabs->shortSlotTime); |
| 237 | return false; |
| 238 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 239 | } |
| 240 | } |
| 241 | |
| 242 | return true; |
| 243 | } /****** end limCompareCapabilities() ******/ |
| 244 | |
| 245 | |
| 246 | /** |
| 247 | * limCheckRxBasicRates() |
| 248 | * |
| 249 | *FUNCTION: |
| 250 | * This function is called during Association/Reassociation |
| 251 | * frame handling to determine whether received rates in |
| 252 | * Assoc/Reassoc request frames include all BSS basic rates |
| 253 | * or not. |
| 254 | * |
| 255 | *LOGIC: |
| 256 | * |
| 257 | *ASSUMPTIONS: |
| 258 | * NA |
| 259 | * |
| 260 | *NOTE: |
| 261 | * NA |
| 262 | * |
| 263 | * @param rxRateSet - pointer to SSID structure |
| 264 | * |
| 265 | * @return status - true if ALL BSS basic rates are present in the |
| 266 | * received rateset else false. |
| 267 | */ |
| 268 | |
| 269 | tANI_U8 |
| 270 | limCheckRxBasicRates(tpAniSirGlobal pMac, tSirMacRateSet rxRateSet,tpPESession psessionEntry) |
| 271 | { |
| 272 | tSirMacRateSet *pRateSet, basicRate; |
| 273 | tANI_U8 i, j, k, match; |
| 274 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 275 | pRateSet = vos_mem_malloc(sizeof(tSirMacRateSet)); |
| 276 | if (NULL == pRateSet) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 278 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for RATESET")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 279 | |
| 280 | return false; |
| 281 | } |
| 282 | |
| 283 | |
| 284 | #if 0 |
| 285 | if (wlan_cfgGetStr(pMac, WNI_CFG_OPERATIONAL_RATE_SET, |
| 286 | (tANI_U8 *) &pRateSet->rate, |
| 287 | (tANI_U32 *) &cfgLen) != eSIR_SUCCESS) |
| 288 | { |
| 289 | /// Could not get Operational rateset from CFG. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 290 | limLog(pMac, LOGP, FL("could not retrieve Operational rateset")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 291 | |
| 292 | // Free up memory allocated for rateset |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 293 | vos_mem_free((tANI_U8 *) pRateSet); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 294 | |
| 295 | return false; |
| 296 | } |
| 297 | #endif //TO SUPPORT BT-AMP |
| 298 | |
| 299 | /* Copy operational rate set from session Entry */ |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 300 | vos_mem_copy(pRateSet->rate, (psessionEntry->rateSet.rate), |
| 301 | psessionEntry->rateSet.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 302 | |
| 303 | pRateSet->numRates = psessionEntry->rateSet.numRates; |
| 304 | |
| 305 | // Extract BSS basic rateset from operational rateset |
Kiran Kumar Lokere | a328bcd | 2013-04-22 22:02:05 -0700 | [diff] [blame] | 306 | for (i = 0, j = 0; ((i < pRateSet->numRates) && (i < SIR_MAC_RATESET_EID_MAX)) ; i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 307 | { |
| 308 | if ((pRateSet->rate[i] & 0x80) == 0x80) |
| 309 | { |
| 310 | // msb is set, so this is a basic rate |
| 311 | basicRate.rate[j++] = pRateSet->rate[i]; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | /* |
| 316 | * For each BSS basic rate, find if it is present in the |
| 317 | * received rateset. |
| 318 | */ |
| 319 | for (k = 0; k < j; k++) |
| 320 | { |
| 321 | match = 0; |
Krunal Soni | a75019a | 2013-05-01 01:08:22 -0700 | [diff] [blame] | 322 | for (i = 0; ((i < rxRateSet.numRates) && (i < SIR_MAC_RATESET_EID_MAX)); i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 323 | { |
| 324 | if ((rxRateSet.rate[i] | 0x80) == basicRate.rate[k]) |
| 325 | match = 1; |
| 326 | } |
| 327 | |
| 328 | if (!match) |
| 329 | { |
| 330 | // Free up memory allocated for rateset |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 331 | vos_mem_free((tANI_U8 *)pRateSet); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 332 | |
| 333 | return false; |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | // Free up memory allocated for rateset |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 338 | vos_mem_free((tANI_U8 *)pRateSet); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 339 | |
| 340 | return true; |
| 341 | } /****** end limCheckRxBasicRates() ******/ |
| 342 | |
| 343 | |
| 344 | |
| 345 | /** |
| 346 | * limCheckMCSSet() |
| 347 | * |
| 348 | *FUNCTION: |
| 349 | * This function is called during Association/Reassociation |
| 350 | * frame handling to determine whether received MCS rates in |
| 351 | * Assoc/Reassoc request frames includes all Basic MCS Rate Set or not. |
| 352 | * |
| 353 | *LOGIC: |
| 354 | * |
| 355 | *ASSUMPTIONS: |
| 356 | * NA |
| 357 | * |
| 358 | *NOTE: |
| 359 | * NA |
| 360 | * |
| 361 | * @param supportedMCSSet - pointer to Supported MCS Rate Set |
| 362 | * |
| 363 | * @return status - true if ALL MCS Basic Rate Set rates are present in the |
| 364 | * received rateset else false. |
| 365 | */ |
| 366 | |
| 367 | tANI_U8 |
| 368 | limCheckMCSSet(tpAniSirGlobal pMac, tANI_U8* supportedMCSSet) |
| 369 | { |
| 370 | tANI_U8 basicMCSSet[SIZE_OF_BASIC_MCS_SET] = {0}; |
| 371 | tANI_U32 cfgLen = 0; |
| 372 | tANI_U8 i; |
| 373 | tANI_U8 validBytes; |
| 374 | tANI_U8 lastByteMCSMask = 0x1f; |
| 375 | |
| 376 | |
| 377 | cfgLen = WNI_CFG_BASIC_MCS_SET_LEN; |
| 378 | if (wlan_cfgGetStr(pMac, WNI_CFG_BASIC_MCS_SET, |
| 379 | (tANI_U8 *) basicMCSSet, |
| 380 | (tANI_U32 *) &cfgLen) != eSIR_SUCCESS) |
| 381 | { |
| 382 | /// Could not get Basic MCS rateset from CFG. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 383 | limLog(pMac, LOGP, FL("could not retrieve Basic MCS rateset")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 384 | return false; |
| 385 | } |
| 386 | |
| 387 | validBytes = VALID_MCS_SIZE/8; |
| 388 | |
| 389 | //check if all the Basic MCS Bits are set in supported MCS bitmap |
| 390 | for(i=0; i<validBytes; i++) |
| 391 | { |
| 392 | if( (basicMCSSet[i] & supportedMCSSet[i]) != basicMCSSet[i]) |
| 393 | { |
Nirav Shah | bc35fb7 | 2013-12-12 18:14:06 +0530 | [diff] [blame] | 394 | //Log is avaiable in calling function in file limProcessAssocReqFrame.c |
| 395 | limLog(pMac, LOGW, FL("One of Basic MCS Set Rates is" |
| 396 | "not supported by the Station.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 397 | return false; |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | //check the last 5 bits of the valid MCS bitmap |
| 402 | if( ((basicMCSSet[i] & lastByteMCSMask) & (supportedMCSSet[i] & lastByteMCSMask)) != |
| 403 | (basicMCSSet[i] & lastByteMCSMask)) |
| 404 | { |
Nirav Shah | bc35fb7 | 2013-12-12 18:14:06 +0530 | [diff] [blame] | 405 | //Log is avaiable in calling function in file limProcessAssocReqFrame.c |
| 406 | limLog(pMac, LOGW, FL("One of Basic MCS Set Rates is not" |
| 407 | "supported by the Station.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 408 | return false; |
| 409 | } |
| 410 | |
| 411 | return true; |
| 412 | } |
| 413 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 414 | |
| 415 | #define SECURITY_SUITE_TYPE_MASK 0xFF |
| 416 | #define SECURITY_SUITE_TYPE_WEP40 0x1 |
| 417 | #define SECURITY_SUITE_TYPE_TKIP 0x2 |
| 418 | #define SECURITY_SUITE_TYPE_CCMP 0x4 |
| 419 | #define SECURITY_SUITE_TYPE_WEP104 0x4 |
| 420 | |
| 421 | /** |
| 422 | * limCheckRxRSNIeMatch() |
| 423 | * |
| 424 | *FUNCTION: |
| 425 | * This function is called during Association/Reassociation |
| 426 | * frame handling to determine whether received RSN in |
| 427 | * Assoc/Reassoc request frames include supported cipher suites or not. |
| 428 | * |
| 429 | *LOGIC: |
| 430 | * |
| 431 | *ASSUMPTIONS: |
| 432 | * NA |
| 433 | * |
| 434 | *NOTE: |
| 435 | * NA |
| 436 | * |
| 437 | * @param rxRSNIe - received RSN IE in (Re)Assco req |
| 438 | * |
| 439 | * @return status - true if ALL BSS basic rates are present in the |
| 440 | * received rateset else false. |
| 441 | */ |
| 442 | |
| 443 | tANI_U8 |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 444 | limCheckRxRSNIeMatch(tpAniSirGlobal pMac, tDot11fIERSN rxRSNIe,tpPESession pSessionEntry, |
| 445 | tANI_U8 staIsHT, tANI_BOOLEAN *pmfConnection) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 446 | { |
| 447 | tDot11fIERSN *pRSNIe; |
| 448 | tANI_U8 i, j, match, onlyNonHtCipher = 1; |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 449 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 450 | tANI_BOOLEAN weArePMFCapable; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame^] | 451 | tANI_BOOLEAN weRequirePMF; |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 452 | tANI_BOOLEAN theyArePMFCapable; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame^] | 453 | tANI_BOOLEAN theyRequirePMF; |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 454 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 455 | |
| 456 | |
| 457 | //RSN IE should be received from PE |
| 458 | pRSNIe = &pSessionEntry->gStartBssRSNIe; |
| 459 | |
| 460 | // Check groupwise cipher suite |
| 461 | for (i = 0; i < sizeof(rxRSNIe.gp_cipher_suite); i++) |
| 462 | { |
| 463 | if (pRSNIe->gp_cipher_suite[i] != rxRSNIe.gp_cipher_suite[i]) |
| 464 | { |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 465 | limLog(pMac, LOG1, FL("RSN group cipher suite does not match local" |
| 466 | " %d recieved %d"),pRSNIe->gp_cipher_suite[i], |
| 467 | rxRSNIe.gp_cipher_suite[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 468 | return eSIR_MAC_INVALID_GROUP_CIPHER_STATUS; |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | /* |
| 473 | * For each Pairwise cipher suite check whether we support |
| 474 | * received pairwise |
| 475 | */ |
| 476 | match = 0; |
| 477 | for (i = 0; i < rxRSNIe.pwise_cipher_suite_count; i++) |
| 478 | { |
| 479 | for(j = 0; j < pRSNIe->pwise_cipher_suite_count; j++) |
| 480 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 481 | if (vos_mem_compare(&rxRSNIe.pwise_cipher_suites[i], |
| 482 | &pRSNIe->pwise_cipher_suites[j], |
| 483 | sizeof(pRSNIe->pwise_cipher_suites[j]))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 484 | { |
| 485 | match = 1; |
| 486 | break; |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | if ((staIsHT) |
| 491 | #ifdef ANI_LITTLE_BYTE_ENDIAN |
| 492 | &&( (rxRSNIe.pwise_cipher_suites[i][3] & SECURITY_SUITE_TYPE_MASK) == SECURITY_SUITE_TYPE_CCMP)) |
| 493 | #else |
| 494 | &&( (rxRSNIe.pwise_cipher_suites[i][0] & SECURITY_SUITE_TYPE_MASK) == SECURITY_SUITE_TYPE_CCMP)) |
| 495 | #endif |
| 496 | { |
| 497 | onlyNonHtCipher=0; |
| 498 | } |
| 499 | |
| 500 | } |
| 501 | |
| 502 | if ((!match) || ((staIsHT) && onlyNonHtCipher)) |
| 503 | { |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 504 | limLog(pMac, LOG1, FL("pairwise cipher suite does not match(%d)" |
| 505 | "staIsHT %d onlyNonHtCipher %d"),match,staIsHT, |
| 506 | onlyNonHtCipher); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 507 | return eSIR_MAC_INVALID_PAIRWISE_CIPHER_STATUS; |
| 508 | } |
Venkata Prathyusha Kuntupalli | ea7098e | 2013-01-31 16:08:13 -0800 | [diff] [blame] | 509 | /* Check RSN capabilities |
| 510 | * Bit 0 of First Byte - PreAuthentication Capability |
| 511 | */ |
| 512 | if(((rxRSNIe.RSN_Cap[0] >> 0) & 0x1) == true) //this is supported by AP only |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 513 | { |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 514 | limLog(pMac, LOG1, FL("Preuthentication Capability is set")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 515 | return eSIR_MAC_INVALID_RSN_IE_CAPABILITIES_STATUS; |
| 516 | } |
| 517 | |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 518 | *pmfConnection = eANI_BOOLEAN_FALSE; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame^] | 519 | |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 520 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame^] | 521 | weArePMFCapable = pSessionEntry->pLimStartBssReq->pmfCapable; |
| 522 | weRequirePMF = pSessionEntry->pLimStartBssReq->pmfRequired; |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 523 | theyArePMFCapable = (rxRSNIe.RSN_Cap[0] >> 7) & 0x1; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame^] | 524 | theyRequirePMF = (rxRSNIe.RSN_Cap[0] >> 6) & 0x1; |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 525 | |
Chet Lanctot | ec4de33 | 2013-10-11 15:42:22 -0700 | [diff] [blame] | 526 | if ((theyRequirePMF && theyArePMFCapable && !weArePMFCapable) || |
| 527 | (weRequirePMF && !theyArePMFCapable)) |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 528 | { |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 529 | limLog(pMac, LOG1, FL("Association fail, robust management frames " |
| 530 | "policy violation theyRequirePMF =%d theyArePMFCapable %d " |
| 531 | "weArePMFCapable %d weRequirePMF %d theyArePMFCapable %d"), |
| 532 | theyRequirePMF,theyArePMFCapable,weArePMFCapable,weRequirePMF, |
| 533 | theyArePMFCapable); |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 534 | return eSIR_MAC_ROBUST_MGMT_FRAMES_POLICY_VIOLATION; |
| 535 | } |
| 536 | |
| 537 | if(theyArePMFCapable && weArePMFCapable) |
| 538 | *pmfConnection = eANI_BOOLEAN_TRUE; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame^] | 539 | |
| 540 | limLog(pMac, LOG1, FL("weAreCapable %d, weRequire %d, theyAreCapable %d, " |
| 541 | "theyRequire %d, PMFconnection %d"), |
| 542 | weArePMFCapable, weRequirePMF, theyArePMFCapable, theyRequirePMF, *pmfConnection); |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 543 | #endif |
| 544 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 545 | return eSIR_SUCCESS; |
| 546 | } /****** end limCheckRxRSNIeMatch() ******/ |
| 547 | |
| 548 | /** |
| 549 | * limCheckRxWPAIeMatch() |
| 550 | * |
| 551 | *FUNCTION: |
| 552 | * This function is called during Association/Reassociation |
| 553 | * frame handling to determine whether received RSN in |
| 554 | * Assoc/Reassoc request frames include supported cipher suites or not. |
| 555 | * |
| 556 | *LOGIC: |
| 557 | * |
| 558 | *ASSUMPTIONS: |
| 559 | * NA |
| 560 | * |
| 561 | *NOTE: |
| 562 | * NA |
| 563 | * |
| 564 | * @param rxWPAIe - Received WPA IE in (Re)Assco req |
| 565 | * |
| 566 | * @return status - true if ALL BSS basic rates are present in the |
| 567 | * received rateset else false. |
| 568 | */ |
| 569 | |
| 570 | tANI_U8 |
| 571 | limCheckRxWPAIeMatch(tpAniSirGlobal pMac, tDot11fIEWPA rxWPAIe,tpPESession pSessionEntry, tANI_U8 staIsHT) |
| 572 | { |
| 573 | tDot11fIEWPA *pWPAIe; |
| 574 | tANI_U8 i, j, match, onlyNonHtCipher = 1; |
| 575 | |
| 576 | // WPA IE should be received from PE |
| 577 | pWPAIe = &pSessionEntry->gStartBssWPAIe; |
| 578 | |
| 579 | // Check groupwise cipher suite |
| 580 | for (i = 0; i < 4; i++) |
| 581 | { |
| 582 | if (pWPAIe->multicast_cipher[i] != rxWPAIe.multicast_cipher[i]) |
| 583 | { |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 584 | limLog(pMac, LOG1, FL("WPA group cipher suite does not match local" |
| 585 | " %d recieved %d"),pWPAIe->multicast_cipher[i], |
| 586 | rxWPAIe.multicast_cipher[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 587 | return eSIR_MAC_INVALID_GROUP_CIPHER_STATUS; |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | /* |
| 592 | * For each Pairwise cipher suite check whether we support |
| 593 | * received pairwise |
| 594 | */ |
| 595 | match = 0; |
| 596 | for (i = 0; i < rxWPAIe.unicast_cipher_count; i++) |
| 597 | { |
| 598 | for(j = 0; j < pWPAIe->unicast_cipher_count; j++) |
| 599 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 600 | if (vos_mem_compare(rxWPAIe.unicast_ciphers[i], |
| 601 | pWPAIe->unicast_ciphers[j], |
| 602 | 4)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 603 | { |
| 604 | match = 1; |
| 605 | break; |
| 606 | } |
| 607 | } |
| 608 | |
| 609 | if ((staIsHT) |
| 610 | #ifdef ANI_LITTLE_BYTE_ENDIAN |
| 611 | &&( (rxWPAIe.unicast_ciphers[i][3] & SECURITY_SUITE_TYPE_MASK) == SECURITY_SUITE_TYPE_CCMP)) |
| 612 | #else |
| 613 | &&( (rxWPAIe.unicast_ciphers[i][0] & SECURITY_SUITE_TYPE_MASK) == SECURITY_SUITE_TYPE_CCMP)) |
| 614 | #endif |
| 615 | { |
| 616 | onlyNonHtCipher=0; |
| 617 | } |
| 618 | |
| 619 | } |
| 620 | |
| 621 | if ((!match) || ((staIsHT) && onlyNonHtCipher)) |
| 622 | { |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 623 | limLog(pMac, LOG1, FL("pairwise cipher suite does not match(%d)" |
| 624 | "staIsHT %d onlyNonHtCipher %d"),match,staIsHT, |
| 625 | onlyNonHtCipher); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 626 | return eSIR_MAC_CIPHER_SUITE_REJECTED_STATUS; |
| 627 | } |
| 628 | |
| 629 | return eSIR_SUCCESS; |
| 630 | } /****** end limCheckRxWPAIeMatch() ******/ |
| 631 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 632 | |
| 633 | /** |
| 634 | * limCleanupRxPath() |
| 635 | * |
| 636 | *FUNCTION: |
| 637 | * This function is called to cleanup STA state at SP & RFP. |
| 638 | * |
| 639 | *LOGIC: |
| 640 | * To circumvent RFP's handling of dummy packet when it does not |
| 641 | * have an incomplete packet for the STA to be deleted, a packet |
| 642 | * with 'more framgents' bit set will be queued to RFP's WQ before |
| 643 | * queuing 'dummy packet'. |
| 644 | * A 'dummy' BD is pushed into RFP's WQ with type=00, subtype=1010 |
| 645 | * (Disassociation frame) and routing flags in BD set to eCPU's |
| 646 | * Low Priority WQ. |
| 647 | * RFP cleans up its local context for the STA id mentioned in the |
| 648 | * BD and then pushes BD to eCPU's low priority WQ. |
| 649 | * |
| 650 | *ASSUMPTIONS: |
| 651 | * NA |
| 652 | * |
| 653 | *NOTE: |
| 654 | * NA |
| 655 | * |
| 656 | * @param pMac Pointer to Global MAC structure |
| 657 | * @param pStaDs Pointer to the per STA data structure |
| 658 | * initialized by LIM and maintained at DPH |
| 659 | * |
| 660 | * @return None |
| 661 | */ |
| 662 | |
| 663 | tSirRetStatus |
| 664 | limCleanupRxPath(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionEntry) |
| 665 | { |
| 666 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 667 | |
| 668 | |
Nirav Shah | bc35fb7 | 2013-12-12 18:14:06 +0530 | [diff] [blame] | 669 | limLog( pMac, LOG1, FL("**Initiate cleanup")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 670 | |
| 671 | limAbortBackgroundScan( pMac ); |
Agarwal Ashish | 87039eb | 2014-01-15 14:13:15 +0530 | [diff] [blame] | 672 | psessionEntry->isCiscoVendorAP = FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 673 | if (pMac->lim.gLimAddtsSent) |
| 674 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 675 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_ADDTS_RSP_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 676 | tx_timer_deactivate(&pMac->lim.limTimers.gLimAddtsRspTimer); |
| 677 | } |
| 678 | |
| 679 | if (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_ASSOC_CNF_STATE) |
| 680 | { |
| 681 | limDeactivateAndChangePerStaIdTimer(pMac, eLIM_CNF_WAIT_TIMER, |
| 682 | pStaDs->assocId); |
| 683 | |
| 684 | if (!pStaDs->mlmStaContext.updateContext) |
| 685 | { |
| 686 | /** |
| 687 | * There is no context at Polaris to delete. |
| 688 | * Release our assigned AID back to the free pool |
| 689 | */ |
| 690 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 691 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) |
| 692 | { |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 693 | limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 694 | } |
| 695 | limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId,psessionEntry); |
| 696 | |
| 697 | return retCode; |
| 698 | } |
| 699 | } |
| 700 | |
| 701 | //delete all tspecs associated with this sta. |
| 702 | limAdmitControlDeleteSta(pMac, pStaDs->assocId); |
| 703 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 704 | |
| 705 | /** |
| 706 | * Make STA hash entry invalid at eCPU so that DPH |
| 707 | * does not process any more data packets and |
| 708 | * releases those BDs |
| 709 | */ |
| 710 | pStaDs->valid = 0; |
| 711 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE; |
| 712 | |
| 713 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 714 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 715 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_DEL_STA_RSP_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 716 | psessionEntry->limMlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 717 | /* Deactivating probe after heart beat timer */ |
| 718 | limDeactivateAndChangeTimer(pMac, eLIM_PROBE_AFTER_HB_TIMER); |
Leela Venkata Kiran Kumar Reddy Chirala | de5d059 | 2013-09-20 17:09:35 -0700 | [diff] [blame] | 719 | limDeactivateAndChangeTimer(pMac, eLIM_JOIN_FAIL_TIMER); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 720 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
| 721 | limDeactivateAndChangeTimer(pMac, eLIM_KEEPALIVE_TIMER); |
| 722 | pMac->lim.gLastBeaconDtimCount = 0; |
| 723 | pMac->lim.gLastBeaconDtimPeriod = 0; |
| 724 | |
| 725 | #ifdef FEATURE_WLAN_CCX |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 726 | #ifdef FEATURE_WLAN_CCX_UPLOAD |
| 727 | limSendSmeTsmIEInd(pMac, psessionEntry, 0, 0, 0); |
| 728 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 729 | limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 730 | #endif /* FEATURE_WLAN_CCX_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 731 | #endif |
| 732 | |
| 733 | /** |
| 734 | * Update the status for PMM module |
| 735 | */ |
| 736 | pmmResetPmmState(pMac); |
| 737 | } |
| 738 | #ifdef WLAN_DEBUG |
| 739 | // increment a debug count |
| 740 | pMac->lim.gLimNumRxCleanup++; |
| 741 | #endif |
| 742 | |
| 743 | if (psessionEntry->limSmeState == eLIM_SME_JOIN_FAILURE_STATE) { |
| 744 | retCode = limDelBss( pMac, pStaDs, psessionEntry->bssIdx, psessionEntry); |
| 745 | } |
| 746 | else |
| 747 | retCode = limDelSta( pMac, pStaDs, true, psessionEntry); |
| 748 | |
| 749 | return retCode; |
| 750 | |
| 751 | } /*** end limCleanupRxPath() ***/ |
| 752 | |
| 753 | |
| 754 | /** |
| 755 | * limSendDelStaCnf() |
| 756 | * |
| 757 | *FUNCTION: |
| 758 | * This function is called to send appropriate CNF message to SME |
| 759 | * |
| 760 | *LOGIC: |
| 761 | * |
| 762 | * |
| 763 | *ASSUMPTIONS: |
| 764 | * NA |
| 765 | * |
| 766 | *NOTE: |
| 767 | * NA |
| 768 | * |
| 769 | * @param pMac Pointer to Global MAC structure |
| 770 | * @param tpAniSirGlobal pMac, |
| 771 | * @param tSirMacAddr staDsAddr, |
| 772 | * @param tANI_U16 staDsAssocId, |
| 773 | * @param tLimMlmStaContext mlmStaContext, |
| 774 | * @param tSirResultCodes statusCode |
| 775 | * |
| 776 | * @return None |
| 777 | */ |
| 778 | |
| 779 | void |
| 780 | limSendDelStaCnf(tpAniSirGlobal pMac, tSirMacAddr staDsAddr, |
| 781 | tANI_U16 staDsAssocId, tLimMlmStaContext mlmStaContext, tSirResultCodes statusCode,tpPESession psessionEntry) |
| 782 | { |
| 783 | |
| 784 | tLimMlmDisassocCnf mlmDisassocCnf; |
| 785 | tLimMlmDeauthCnf mlmDeauthCnf; |
| 786 | tLimMlmPurgeStaInd mlmPurgeStaInd; |
| 787 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 788 | limLog(pMac, LOG1, FL("Sessionid: %d staDsAssocId: %d Trigger: %X " |
| 789 | "statusCode: %d staDsAddr: "MAC_ADDRESS_STR),psessionEntry->peSessionId, |
| 790 | staDsAssocId, mlmStaContext.cleanupTrigger, statusCode, |
| 791 | MAC_ADDR_ARRAY(staDsAddr)); |
| 792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 793 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 794 | { |
| 795 | // Set BSSID at CFG to null |
| 796 | tSirMacAddr nullAddr = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; |
| 797 | #if 0 |
| 798 | if (cfgSetStr(pMac, WNI_CFG_BSSID, (tANI_U8 *) &nullAddr, |
| 799 | sizeof(tSirMacAddr)) != eSIR_SUCCESS) |
| 800 | { |
| 801 | /// Could not update BSSID at CFG. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 802 | limLog(pMac, LOGP, FL("could not update BSSID at CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 803 | |
| 804 | return; |
| 805 | } |
| 806 | #endif//TO SUPPORT BT-AMP |
| 807 | |
| 808 | sirCopyMacAddr(nullAddr,psessionEntry->bssId); |
| 809 | |
| 810 | // Free up buffer allocated for JoinReq held by |
| 811 | // MLM state machine |
| 812 | if (psessionEntry->pLimMlmJoinReq) |
| 813 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 814 | vos_mem_free(psessionEntry->pLimMlmJoinReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 815 | psessionEntry->pLimMlmJoinReq = NULL; |
| 816 | } |
| 817 | |
| 818 | psessionEntry->limAID = 0; |
| 819 | |
| 820 | |
| 821 | } |
| 822 | |
| 823 | if ((mlmStaContext.cleanupTrigger == |
| 824 | eLIM_HOST_DISASSOC) || |
| 825 | (mlmStaContext.cleanupTrigger == |
| 826 | eLIM_LINK_MONITORING_DISASSOC) || |
| 827 | (mlmStaContext.cleanupTrigger == |
| 828 | eLIM_PROMISCUOUS_MODE_DISASSOC)) |
| 829 | { |
| 830 | /** |
| 831 | * Host or LMM driven Disassociation. |
| 832 | * Issue Disassoc Confirm to SME. |
| 833 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 834 | limLog( pMac, LOGW, FL("Lim Posting DISASSOC_CNF to Sme. Trigger: %X"), mlmStaContext.cleanupTrigger); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 835 | |
| 836 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 837 | vos_mem_copy((tANI_U8 *) &mlmDisassocCnf.peerMacAddr, |
| 838 | (tANI_U8 *) staDsAddr, |
| 839 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 840 | mlmDisassocCnf.resultCode = statusCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 841 | mlmDisassocCnf.disassocTrigger = |
| 842 | mlmStaContext.cleanupTrigger; |
| 843 | /* Update PE session Id*/ |
| 844 | mlmDisassocCnf.sessionId = psessionEntry->peSessionId; |
| 845 | |
| 846 | limPostSmeMessage(pMac, |
| 847 | LIM_MLM_DISASSOC_CNF, |
| 848 | (tANI_U32 *) &mlmDisassocCnf); |
| 849 | } |
| 850 | else if ((mlmStaContext.cleanupTrigger == |
| 851 | eLIM_HOST_DEAUTH) || |
| 852 | (mlmStaContext.cleanupTrigger == |
| 853 | eLIM_LINK_MONITORING_DEAUTH)) |
| 854 | { |
| 855 | /** |
| 856 | * Host or LMM driven Deauthentication. |
| 857 | * Issue Deauth Confirm to SME. |
| 858 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 859 | limLog( pMac, LOGW, FL("Lim Posting DEAUTH_CNF to Sme. Trigger: %X"), mlmStaContext.cleanupTrigger); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 860 | vos_mem_copy((tANI_U8 *) &mlmDeauthCnf.peerMacAddr, |
| 861 | (tANI_U8 *) staDsAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 862 | sizeof(tSirMacAddr)); |
| 863 | mlmDeauthCnf.resultCode = statusCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 864 | mlmDeauthCnf.deauthTrigger = |
| 865 | mlmStaContext.cleanupTrigger; |
| 866 | /* PE session Id */ |
| 867 | mlmDeauthCnf.sessionId = psessionEntry->peSessionId; |
| 868 | |
| 869 | limPostSmeMessage(pMac, |
| 870 | LIM_MLM_DEAUTH_CNF, |
| 871 | (tANI_U32 *) &mlmDeauthCnf); |
| 872 | } |
| 873 | else if ((mlmStaContext.cleanupTrigger == |
| 874 | eLIM_PEER_ENTITY_DISASSOC) || |
| 875 | (mlmStaContext.cleanupTrigger == |
| 876 | eLIM_PEER_ENTITY_DEAUTH)) |
| 877 | { |
| 878 | /** |
| 879 | * Received Disassociation/Deauthentication from peer. |
| 880 | * Issue Purge Ind to SME. |
| 881 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 882 | limLog( pMac, LOGW, FL("Lim Posting PURGE_STA_IND to Sme. Trigger: %X"), mlmStaContext.cleanupTrigger) ; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 883 | vos_mem_copy((tANI_U8 *) &mlmPurgeStaInd.peerMacAddr, |
| 884 | (tANI_U8 *) staDsAddr, |
| 885 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 886 | mlmPurgeStaInd.reasonCode = (tANI_U8) mlmStaContext.disassocReason; |
| 887 | mlmPurgeStaInd.aid = staDsAssocId; |
| 888 | mlmPurgeStaInd.purgeTrigger = mlmStaContext.cleanupTrigger; |
| 889 | mlmPurgeStaInd.sessionId = psessionEntry->peSessionId; |
| 890 | |
| 891 | limPostSmeMessage(pMac, |
| 892 | LIM_MLM_PURGE_STA_IND, |
| 893 | (tANI_U32 *) &mlmPurgeStaInd); |
| 894 | } |
| 895 | else if(mlmStaContext.cleanupTrigger == eLIM_JOIN_FAILURE) |
| 896 | { |
| 897 | //PE setup the peer entry in HW upfront, right after join is completed. |
| 898 | //If there is a failure during rest of the assoc sequence, this context needs to be cleaned up. |
| 899 | tANI_U8 smesessionId; |
| 900 | tANI_U16 smetransactionId; |
| 901 | |
| 902 | smesessionId = psessionEntry->smeSessionId; |
| 903 | smetransactionId = psessionEntry->transactionId; |
| 904 | |
| 905 | psessionEntry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 906 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 907 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 908 | //if it is a reassoc failure to join new AP |
Madan Mohan Koyyalamudi | f33324b | 2012-11-06 19:16:17 -0800 | [diff] [blame] | 909 | if((mlmStaContext.resultCode == eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE) || |
| 910 | (mlmStaContext.resultCode == eSIR_SME_FT_REASSOC_FAILURE)) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 911 | { |
| 912 | if(mlmStaContext.resultCode != eSIR_SME_SUCCESS ) |
| 913 | { |
| 914 | peDeleteSession(pMac, psessionEntry); |
| 915 | psessionEntry = NULL; |
| 916 | } |
| 917 | |
| 918 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_REASSOC_RSP, |
| 919 | mlmStaContext.resultCode, mlmStaContext.protStatusCode, psessionEntry, |
| 920 | smesessionId, smetransactionId); |
| 921 | } |
| 922 | else |
| 923 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 924 | vos_mem_free(psessionEntry->pLimJoinReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 925 | psessionEntry->pLimJoinReq = NULL; |
| 926 | |
| 927 | if(mlmStaContext.resultCode != eSIR_SME_SUCCESS) |
| 928 | { |
| 929 | peDeleteSession(pMac,psessionEntry); |
| 930 | psessionEntry = NULL; |
| 931 | } |
| 932 | |
| 933 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_JOIN_RSP, mlmStaContext.resultCode, mlmStaContext.protStatusCode, |
| 934 | psessionEntry, smesessionId, smetransactionId); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 935 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 936 | |
| 937 | } |
| 938 | |
| 939 | if((NULL != psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 940 | && (eLIM_AP_ROLE != psessionEntry->limSystemRole ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 941 | ) |
| 942 | { |
| 943 | peDeleteSession(pMac,psessionEntry); |
| 944 | psessionEntry = NULL; |
| 945 | } |
| 946 | } |
| 947 | |
| 948 | /** |
| 949 | * limRejectAssociation() |
| 950 | * |
| 951 | *FUNCTION: |
| 952 | * This function is called whenever Re/Association Request need |
| 953 | * to be rejected due to failure in assigning an AID or failure |
| 954 | * in adding STA context at Polaris or reject by applications. |
| 955 | * |
| 956 | *LOGIC: |
| 957 | * Resources allocated if any are freedup and (Re) Association |
| 958 | * Response frame is sent to requesting STA. Pre-Auth context |
| 959 | * will be added for this STA if it does not exist already |
| 960 | * |
| 961 | *ASSUMPTIONS: |
| 962 | * |
| 963 | *NOTE: |
| 964 | * |
| 965 | * @param *pBd - A pointer to Buffer descriptor + associated PDUs |
| 966 | * @param subType - Indicates whether it is Association Request (=0) or |
| 967 | * Reassociation Request (=1) frame |
| 968 | * @param addPreAuthContext - Indicates whether pre-auth context |
| 969 | * to be added for this STA |
| 970 | * @param authType - Indicates auth type to be added |
| 971 | * @param staId - Indicates staId of the STA being rejected |
| 972 | * association |
| 973 | * @param deleteSta - Indicates whether to delete STA context |
| 974 | * at Polaris |
| 975 | * @param rCode - Indicates what reasonCode to be sent in |
| 976 | * Re/Assoc response to STA |
| 977 | * |
| 978 | * @return None |
| 979 | */ |
| 980 | |
| 981 | void |
| 982 | limRejectAssociation(tpAniSirGlobal pMac, tSirMacAddr peerAddr, tANI_U8 subType, |
| 983 | tANI_U8 addPreAuthContext, tAniAuthType authType, |
| 984 | tANI_U16 staId, tANI_U8 deleteSta, tSirResultCodes rCode, tpPESession psessionEntry ) |
| 985 | { |
| 986 | tpDphHashNode pStaDs; |
| 987 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 988 | limLog(pMac, LOG1, FL("Sessionid: %d authType: %d subType: %d " |
| 989 | "addPreAuthContext: %d staId: %d deleteSta: %d rCode : %d " |
| 990 | "peerAddr: "MAC_ADDRESS_STR),psessionEntry->peSessionId, |
| 991 | authType, subType, addPreAuthContext, staId, deleteSta, rCode, |
| 992 | MAC_ADDR_ARRAY(peerAddr)); |
| 993 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 994 | if (addPreAuthContext) |
| 995 | { |
| 996 | // Create entry for this STA in pre-auth list |
| 997 | struct tLimPreAuthNode *pAuthNode; |
| 998 | |
| 999 | pAuthNode = limAcquireFreePreAuthNode(pMac, &pMac->lim.gLimPreAuthTimerTable); |
| 1000 | |
| 1001 | if (pAuthNode) |
| 1002 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1003 | vos_mem_copy((tANI_U8 *) pAuthNode->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1004 | peerAddr, |
| 1005 | sizeof(tSirMacAddr)); |
| 1006 | pAuthNode->fTimerStarted = 0; |
| 1007 | pAuthNode->mlmState = eLIM_MLM_AUTHENTICATED_STATE; |
| 1008 | pAuthNode->authType = (tAniAuthType) authType; |
| 1009 | limAddPreAuthNode(pMac, pAuthNode); |
| 1010 | } |
| 1011 | } |
| 1012 | |
| 1013 | if (deleteSta == true) |
| 1014 | { |
| 1015 | pStaDs = dphGetHashEntry(pMac, staId, &psessionEntry->dph.dphHashTable); |
| 1016 | |
| 1017 | if (pStaDs == NULL) |
| 1018 | { |
| 1019 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1020 | FL("No STA context, yet rejecting Association")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1021 | |
| 1022 | return; |
| 1023 | } |
| 1024 | |
| 1025 | /** |
| 1026 | * Polaris has state for this STA. |
| 1027 | * Trigger cleanup. |
| 1028 | */ |
| 1029 | pStaDs->mlmStaContext.cleanupTrigger = eLIM_REASSOC_REJECT; |
| 1030 | |
| 1031 | // Receive path cleanup |
| 1032 | limCleanupRxPath(pMac, pStaDs, psessionEntry); |
| 1033 | |
| 1034 | // Send Re/Association Response with |
| 1035 | // status code to requesting STA. |
| 1036 | limSendAssocRspMgmtFrame(pMac, |
| 1037 | rCode, |
| 1038 | 0, |
| 1039 | peerAddr, |
| 1040 | subType, 0,psessionEntry); |
| 1041 | |
| 1042 | if ( psessionEntry->parsedAssocReq[pStaDs->assocId] != NULL) |
| 1043 | { |
| 1044 | // Assoction confirmation is complete, free the copy of association request frame |
| 1045 | if ( ((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame) |
| 1046 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1047 | vos_mem_free(((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1048 | ((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame = NULL; |
| 1049 | } |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1050 | vos_mem_free(psessionEntry->parsedAssocReq[pStaDs->assocId]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1051 | psessionEntry->parsedAssocReq[pStaDs->assocId] = NULL; |
| 1052 | } |
| 1053 | } |
| 1054 | else |
| 1055 | { |
| 1056 | limSendAssocRspMgmtFrame(pMac, |
| 1057 | eSIR_MAC_MAX_ASSOC_STA_REACHED_STATUS, |
| 1058 | 1, |
| 1059 | peerAddr, |
| 1060 | subType, 0,psessionEntry); |
| 1061 | // Log error |
| 1062 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1063 | FL("received Re/Assoc req when max associated STAs reached from ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1064 | limPrintMacAddr(pMac, peerAddr, LOGW); |
| 1065 | limSendSmeMaxAssocExceededNtf(pMac, peerAddr, psessionEntry->smeSessionId); |
| 1066 | } |
| 1067 | } /*** end limRejectAssociation() ***/ |
| 1068 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1069 | |
| 1070 | /** ------------------------------------------------------------- |
| 1071 | \fn limDecideApProtectionOnHt20Delete |
| 1072 | \brief protection related function while HT20 station is getting deleted. |
| 1073 | \param tpAniSirGlobal pMac |
| 1074 | \param tpDphHashNode pStaDs |
| 1075 | \param tpUpdateBeaconParams pBeaconParams |
| 1076 | \return None |
| 1077 | -------------------------------------------------------------*/ |
| 1078 | static void |
| 1079 | limDecideApProtectionOnHt20Delete(tpAniSirGlobal pMac, |
| 1080 | tpDphHashNode pStaDs, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 1081 | { |
| 1082 | tANI_U32 i = 0; |
| 1083 | PELOG1( limLog(pMac, LOG1, FL("(%d) A HT 20 STA is disassociated. Addr is "), |
| 1084 | psessionEntry->gLimHt20Params.numSta); |
| 1085 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 1086 | if (psessionEntry->gLimHt20Params.numSta > 0) |
| 1087 | { |
| 1088 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1089 | { |
| 1090 | if (psessionEntry->protStaCache[i].active) |
| 1091 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1092 | if (vos_mem_compare(psessionEntry->protStaCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1093 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1094 | { |
| 1095 | psessionEntry->gLimHt20Params.numSta--; |
| 1096 | psessionEntry->protStaCache[i].active = false; |
| 1097 | break; |
| 1098 | } |
| 1099 | } |
| 1100 | } |
| 1101 | } |
| 1102 | |
| 1103 | if (psessionEntry->gLimHt20Params.numSta == 0) |
| 1104 | { |
| 1105 | // disable protection |
Nirav Shah | bc35fb7 | 2013-12-12 18:14:06 +0530 | [diff] [blame] | 1106 | limLog(pMac, LOG1, FL("No 11B STA exists, PESessionID %d"), |
| 1107 | psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1108 | limEnableHT20Protection(pMac, false, false, pBeaconParams,psessionEntry); |
| 1109 | } |
| 1110 | } |
| 1111 | /** ------------------------------------------------------------- |
| 1112 | \fn limDecideApProtectionOnDelete |
| 1113 | \brief Decides about protection related settings when a station is getting deleted. |
| 1114 | \param tpAniSirGlobal pMac |
| 1115 | \param tpDphHashNode pStaDs |
| 1116 | \param tpUpdateBeaconParams pBeaconParams |
| 1117 | \return None |
| 1118 | -------------------------------------------------------------*/ |
| 1119 | void |
| 1120 | limDecideApProtectionOnDelete(tpAniSirGlobal pMac, |
| 1121 | tpDphHashNode pStaDs, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) |
| 1122 | { |
| 1123 | tANI_U32 phyMode; |
| 1124 | tHalBitVal erpEnabled = eHAL_CLEAR; |
| 1125 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 1126 | tANI_U32 i; |
| 1127 | |
| 1128 | if(NULL == pStaDs) |
| 1129 | return; |
| 1130 | |
| 1131 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 1132 | if(SIR_BAND_5_GHZ == rfBand) |
| 1133 | { |
| 1134 | //we are HT. if we are 11A, then protection is not required. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1135 | if(true == psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1136 | { |
| 1137 | //we are HT and 11A station is leaving. |
| 1138 | //protection consideration required. |
| 1139 | //HT station leaving ==> this case is commonly handled between both the bands below. |
| 1140 | if((psessionEntry->beaconParams.llaCoexist) && |
| 1141 | (false == pStaDs->mlmStaContext.htCapability)) |
| 1142 | { |
| 1143 | PELOG1(limLog(pMac, LOG1, FL("(%d) A 11A STA is disassociated. Addr is "), |
| 1144 | psessionEntry->gLim11aParams.numSta); |
| 1145 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 1146 | if (psessionEntry->gLim11aParams.numSta > 0) |
| 1147 | { |
| 1148 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1149 | { |
| 1150 | if (psessionEntry->protStaCache[i].active) |
| 1151 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1152 | if (vos_mem_compare( psessionEntry->protStaCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1153 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1154 | { |
| 1155 | psessionEntry->gLim11aParams.numSta--; |
| 1156 | psessionEntry->protStaCache[i].active = false; |
| 1157 | break; |
| 1158 | } |
| 1159 | } |
| 1160 | } |
| 1161 | } |
| 1162 | |
| 1163 | if(psessionEntry->gLim11aParams.numSta == 0) |
| 1164 | { |
| 1165 | // disable protection |
| 1166 | limEnable11aProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 1167 | } |
| 1168 | } |
| 1169 | } |
| 1170 | } |
| 1171 | else if(SIR_BAND_2_4_GHZ == rfBand) |
| 1172 | { |
| 1173 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 1174 | |
| 1175 | erpEnabled = pStaDs->erpEnabled; |
| 1176 | //we are HT or 11G and 11B station is getting deleted. |
| 1177 | if (((phyMode == WNI_CFG_PHY_MODE_11G) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1178 | psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1179 | (erpEnabled == eHAL_CLEAR)) |
| 1180 | { |
| 1181 | PELOG1(limLog(pMac, LOG1, FL("(%d) A legacy STA is disassociated. Addr is "), |
| 1182 | psessionEntry->gLim11bParams.numSta); |
| 1183 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 1184 | if (psessionEntry->gLim11bParams.numSta > 0) |
| 1185 | { |
| 1186 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1187 | { |
| 1188 | if (psessionEntry->protStaCache[i].active) |
| 1189 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1190 | if (vos_mem_compare( psessionEntry->protStaCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1191 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1192 | { |
| 1193 | psessionEntry->gLim11bParams.numSta--; |
| 1194 | psessionEntry->protStaCache[i].active = false; |
| 1195 | break; |
| 1196 | } |
| 1197 | } |
| 1198 | } |
| 1199 | } |
| 1200 | |
| 1201 | if (psessionEntry->gLim11bParams.numSta == 0) |
| 1202 | { |
| 1203 | // disable protection |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1204 | limEnable11gProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 1205 | } |
| 1206 | } |
| 1207 | //(non-11B station is leaving) or (we are not 11G or HT AP) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1208 | else if(psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1209 | { //we are HT AP and non-11B station is leaving. |
| 1210 | |
| 1211 | //11g station is leaving |
| 1212 | if(!pStaDs->mlmStaContext.htCapability) |
| 1213 | { |
| 1214 | PELOG1(limLog(pMac, LOG1, FL("(%d) A 11g STA is disassociated. Addr is "), |
| 1215 | psessionEntry->gLim11bParams.numSta); |
| 1216 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 1217 | if (psessionEntry->gLim11gParams.numSta > 0) |
| 1218 | { |
| 1219 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1220 | { |
| 1221 | if (psessionEntry->protStaCache[i].active) |
| 1222 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1223 | if (vos_mem_compare( psessionEntry->protStaCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1224 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1225 | { |
| 1226 | psessionEntry->gLim11gParams.numSta--; |
| 1227 | psessionEntry->protStaCache[i].active = false; |
| 1228 | break; |
| 1229 | } |
| 1230 | } |
| 1231 | } |
| 1232 | } |
| 1233 | |
| 1234 | if (psessionEntry->gLim11gParams.numSta == 0) |
| 1235 | { |
| 1236 | // disable protection |
| 1237 | limEnableHtProtectionFrom11g(pMac, false, false, pBeaconParams,psessionEntry); |
| 1238 | } |
| 1239 | } |
| 1240 | } |
| 1241 | } |
| 1242 | |
| 1243 | //LSIG TXOP not supporting staiton leaving. applies to 2.4 as well as 5 GHZ. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1244 | if((true == psessionEntry->htCapability) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1245 | (true == pStaDs->mlmStaContext.htCapability)) |
| 1246 | { |
| 1247 | //HT non-GF leaving |
| 1248 | if(!pStaDs->htGreenfield) |
| 1249 | { |
| 1250 | PELOG1(limLog(pMac, LOG1, FL("(%d) A non-GF STA is disassociated. Addr is "), |
| 1251 | psessionEntry->gLimNonGfParams.numSta); |
| 1252 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 1253 | if (psessionEntry->gLimNonGfParams.numSta > 0) |
| 1254 | { |
| 1255 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1256 | { |
| 1257 | if (psessionEntry->protStaCache[i].active) |
| 1258 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1259 | if (vos_mem_compare( psessionEntry->protStaCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1260 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1261 | { |
| 1262 | psessionEntry->gLimNonGfParams.numSta--; |
| 1263 | psessionEntry->protStaCache[i].active = false; |
| 1264 | break; |
| 1265 | } |
| 1266 | } |
| 1267 | } |
| 1268 | } |
| 1269 | |
| 1270 | if (psessionEntry->gLimNonGfParams.numSta == 0) |
| 1271 | { |
| 1272 | // disable protection |
| 1273 | limEnableHTNonGfProtection(pMac, false, false, pBeaconParams,psessionEntry); |
| 1274 | } |
| 1275 | } |
| 1276 | //HT 20Mhz station leaving. |
| 1277 | if(psessionEntry->beaconParams.ht20Coexist && |
| 1278 | (eHT_CHANNEL_WIDTH_20MHZ == pStaDs->htSupportedChannelWidthSet)) |
| 1279 | { |
| 1280 | limDecideApProtectionOnHt20Delete(pMac, pStaDs, pBeaconParams,psessionEntry); |
| 1281 | } |
| 1282 | |
| 1283 | if(false == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport && |
| 1284 | (false == pStaDs->htLsigTXOPProtection)) |
| 1285 | { |
| 1286 | PELOG1( limLog(pMac, LOG1, FL("(%d) A HT LSIG not supporting STA is disassociated. Addr is "), |
| 1287 | psessionEntry->gLimLsigTxopParams.numSta); |
| 1288 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 1289 | if (psessionEntry->gLimLsigTxopParams.numSta > 0) |
| 1290 | { |
| 1291 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1292 | { |
| 1293 | if (psessionEntry->protStaCache[i].active) |
| 1294 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1295 | if (vos_mem_compare( psessionEntry->protStaCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1296 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1297 | { |
| 1298 | psessionEntry->gLimLsigTxopParams.numSta--; |
| 1299 | psessionEntry->protStaCache[i].active = false; |
| 1300 | break; |
| 1301 | } |
| 1302 | } |
| 1303 | } |
| 1304 | } |
| 1305 | |
| 1306 | if (psessionEntry->gLimLsigTxopParams.numSta == 0) |
| 1307 | { |
| 1308 | // disable protection |
| 1309 | limEnableHTLsigTxopProtection(pMac, true, false, pBeaconParams,psessionEntry); |
| 1310 | } |
| 1311 | } |
| 1312 | } |
| 1313 | } |
| 1314 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1315 | |
| 1316 | |
| 1317 | /** ------------------------------------------------------------- |
| 1318 | \fn limDecideShortPreamble |
| 1319 | \brief Decides about any short preamble reated change because of new station joining. |
| 1320 | \param tpAniSirGlobal pMac |
| 1321 | \param tpDphHashNode pStaDs |
| 1322 | \param tpUpdateBeaconParams pBeaconParams |
| 1323 | \return None |
| 1324 | -------------------------------------------------------------*/ |
| 1325 | void limDecideShortPreamble(tpAniSirGlobal pMac, |
| 1326 | tpDphHashNode pStaDs, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry ) |
| 1327 | { |
| 1328 | tANI_U32 i; |
| 1329 | |
| 1330 | if (pStaDs->shortPreambleEnabled == eHAL_CLEAR) |
| 1331 | { |
| 1332 | PELOG1(limLog(pMac, LOG1, FL("(%d) A non-short preamble STA is disassociated. Addr is "), |
| 1333 | psessionEntry->gLimNoShortParams.numNonShortPreambleSta); |
| 1334 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 1335 | if (psessionEntry->gLimNoShortParams.numNonShortPreambleSta > 0) |
| 1336 | { |
| 1337 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1338 | { |
| 1339 | if (psessionEntry->gLimNoShortParams.staNoShortCache[i].active) |
| 1340 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1341 | if (vos_mem_compare( psessionEntry->gLimNoShortParams.staNoShortCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1342 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1343 | { |
| 1344 | psessionEntry->gLimNoShortParams.numNonShortPreambleSta--; |
| 1345 | psessionEntry->gLimNoShortParams.staNoShortCache[i].active = false; |
| 1346 | break; |
| 1347 | } |
| 1348 | } |
| 1349 | } |
| 1350 | } |
| 1351 | |
| 1352 | if (psessionEntry->gLimNoShortParams.numNonShortPreambleSta == 0) |
| 1353 | { |
| 1354 | // enable short preamble |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1355 | //reset the cache |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1356 | vos_mem_set((tANI_U8 *)&psessionEntry->gLimNoShortParams, |
| 1357 | sizeof(tLimNoShortParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1358 | if (limEnableShortPreamble(pMac, true, pBeaconParams, psessionEntry) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1359 | PELOGE(limLog(pMac, LOGE, FL("Cannot enable short preamble"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1360 | } |
| 1361 | } |
| 1362 | } |
| 1363 | |
| 1364 | /** ------------------------------------------------------------- |
| 1365 | \fn limDecideShortSlot |
| 1366 | \brief Decides about any short slot time related change because of station leaving the BSS. |
| 1367 | \param tpAniSirGlobal pMac |
| 1368 | \param tpDphHashNode pStaDs |
| 1369 | \return None |
| 1370 | -------------------------------------------------------------*/ |
| 1371 | |
| 1372 | void |
| 1373 | limDecideShortSlot(tpAniSirGlobal pMac, tpDphHashNode pStaDs, |
| 1374 | tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) |
| 1375 | { |
| 1376 | tANI_U32 i, val; |
| 1377 | if (pStaDs->shortSlotTimeEnabled == eHAL_CLEAR) |
| 1378 | { |
| 1379 | PELOG1(limLog(pMac, LOG1, FL("(%d) A non-short slottime STA is disassociated. Addr is "), |
| 1380 | pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta); |
| 1381 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 1382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1383 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 1384 | psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta> 0) |
| 1385 | { |
| 1386 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1387 | { |
| 1388 | if (psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 1389 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1390 | if (vos_mem_compare(psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1391 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1392 | { |
| 1393 | psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta--; |
| 1394 | psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active = false; |
| 1395 | break; |
| 1396 | } |
| 1397 | } |
| 1398 | } |
| 1399 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1400 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1401 | { |
| 1402 | if (pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta> 0) |
| 1403 | { |
| 1404 | for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++) |
| 1405 | { |
| 1406 | if (pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active) |
| 1407 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1408 | if (vos_mem_compare(pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].addr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1409 | pStaDs->staAddr, sizeof(tSirMacAddr))) |
| 1410 | { |
| 1411 | pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta--; |
| 1412 | pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active = false; |
| 1413 | break; |
| 1414 | } |
| 1415 | } |
| 1416 | } |
| 1417 | } |
| 1418 | } |
| 1419 | |
| 1420 | wlan_cfgGetInt(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, &val); |
| 1421 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1422 | if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE ) && |
| 1423 | (val && psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta == 0)) |
| 1424 | { |
| 1425 | // enable short slot time |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1426 | //reset the cache |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1427 | vos_mem_set((tANI_U8 *)&psessionEntry->gLimNoShortSlotParams, |
| 1428 | sizeof(tLimNoShortSlotParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1429 | // in case of AP set SHORT_SLOT_TIME to enable |
| 1430 | if (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 1431 | { |
| 1432 | pBeaconParams->fShortSlotTime = true; |
| 1433 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1434 | psessionEntry->shortSlotTimeSupported = true; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1435 | } |
| 1436 | } |
| 1437 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1438 | { |
| 1439 | if (val && pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta == 0) |
| 1440 | { |
| 1441 | // enable short slot time |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1442 | //reset the cache |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1443 | vos_mem_set((tANI_U8 *)&pMac->lim.gLimNoShortSlotParams, |
| 1444 | sizeof(tLimNoShortSlotParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1445 | // in case of AP set SHORT_SLOT_TIME to enable |
| 1446 | if (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 1447 | { |
| 1448 | pBeaconParams->fShortSlotTime = true; |
| 1449 | pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1450 | psessionEntry->shortSlotTimeSupported = true; |
| 1451 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1452 | } |
| 1453 | } |
| 1454 | } |
| 1455 | } |
| 1456 | |
Madan Mohan Koyyalamudi | 85d140a | 2012-10-18 20:23:01 -0700 | [diff] [blame] | 1457 | void |
| 1458 | limPostReassocFailure(tpAniSirGlobal pMac, |
| 1459 | tSirResultCodes resultCode, |
| 1460 | tANI_U16 protStatusCode,tpPESession psessionEntry) |
| 1461 | { |
| 1462 | tLimMlmReassocCnf mlmReassocCnf; |
| 1463 | |
| 1464 | psessionEntry->limMlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
| 1465 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_LINK_ESTABLISHED_STATE)); |
| 1466 | |
| 1467 | // 'Change' timer for future activations |
| 1468 | limDeactivateAndChangeTimer(pMac, eLIM_REASSOC_FAIL_TIMER); |
| 1469 | |
| 1470 | mlmReassocCnf.resultCode = resultCode; |
| 1471 | mlmReassocCnf.protStatusCode = protStatusCode; |
| 1472 | /* Update PE session Id */ |
| 1473 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 1474 | limPostSmeMessage(pMac, |
| 1475 | LIM_MLM_REASSOC_CNF, |
| 1476 | (tANI_U32 *) &mlmReassocCnf); |
| 1477 | } /*** end limPostReassocFailure() ***/ |
| 1478 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1479 | /** |
| 1480 | * limRestorePreReassocState() |
| 1481 | * |
| 1482 | *FUNCTION: |
| 1483 | * This function is called on STA role whenever Reasociation |
| 1484 | * Response with a reject code is received from AP. |
| 1485 | * |
| 1486 | *LOGIC: |
| 1487 | * Reassociation failure timer is stopped, Old (or current) AP's |
| 1488 | * context is restored both at Polaris & software |
| 1489 | * |
| 1490 | *ASSUMPTIONS: |
| 1491 | * |
| 1492 | *NOTE: |
| 1493 | * |
| 1494 | * @param pMac - Pointer to Global MAC structure |
| 1495 | * @param resultCode - Result code that specifies why Reassociation |
| 1496 | * attemp failed |
| 1497 | * |
| 1498 | * @return None |
| 1499 | */ |
| 1500 | |
| 1501 | void |
| 1502 | limRestorePreReassocState(tpAniSirGlobal pMac, |
| 1503 | tSirResultCodes resultCode, |
| 1504 | tANI_U16 protStatusCode,tpPESession psessionEntry) |
| 1505 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1506 | tANI_U8 chanNum, secChanOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1507 | tLimMlmReassocCnf mlmReassocCnf; |
| 1508 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 1509 | limLog(pMac, LOG1, FL("sessionid: %d protStatusCode: %d resultCode: %d"), |
| 1510 | psessionEntry->smeSessionId, protStatusCode, resultCode); |
| 1511 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1512 | psessionEntry->limMlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1513 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_LINK_ESTABLISHED_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1514 | |
| 1515 | // 'Change' timer for future activations |
| 1516 | limDeactivateAndChangeTimer(pMac, eLIM_REASSOC_FAIL_TIMER); |
| 1517 | |
| 1518 | // Update BSSID at CFG database |
| 1519 | #if 0 |
| 1520 | if (cfgSetStr(pMac, WNI_CFG_BSSID, |
| 1521 | pMac->lim.gLimCurrentBssId, |
| 1522 | sizeof(tSirMacAddr)) != eSIR_SUCCESS) |
| 1523 | { |
| 1524 | /// Could not update BSSID at CFG. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1525 | limLog(pMac, LOGP, FL("could not update BSSID at CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1526 | return; |
| 1527 | } |
Madan Mohan Koyyalamudi | 70322d5 | 2012-10-18 20:07:33 -0700 | [diff] [blame] | 1528 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1529 | |
| 1530 | // chanNum = pMac->lim.gLimCurrentChannelId; |
| 1531 | |
| 1532 | /* To support BT-AMP */ |
| 1533 | chanNum = psessionEntry->currentOperChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1534 | secChanOffset = psessionEntry->htSecondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1535 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1536 | limSetChannel(pMac, chanNum, secChanOffset, psessionEntry->maxTxPower, psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1537 | |
| 1538 | /** @ToDo : Need to Integrate the STOP the DataTransfer to the AP from 11H code */ |
| 1539 | |
| 1540 | mlmReassocCnf.resultCode = resultCode; |
| 1541 | mlmReassocCnf.protStatusCode = protStatusCode; |
| 1542 | /* Update PE session Id */ |
| 1543 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 1544 | limPostSmeMessage(pMac, |
| 1545 | LIM_MLM_REASSOC_CNF, |
| 1546 | (tANI_U32 *) &mlmReassocCnf); |
| 1547 | } /*** end limRestorePreReassocState() ***/ |
| 1548 | |
| 1549 | |
| 1550 | |
| 1551 | /** |
| 1552 | * limIsReassocInProgress() |
| 1553 | * |
| 1554 | *FUNCTION: |
| 1555 | * This function is called to see if STA is in wt-reassoc-rsp state. |
| 1556 | * |
| 1557 | *LOGIC: |
| 1558 | * |
| 1559 | *ASSUMPTIONS: |
| 1560 | * |
| 1561 | *NOTE: |
| 1562 | * |
| 1563 | * @param pMac - Pointer to Global MAC structure |
| 1564 | * |
| 1565 | * @return eANI_BOOLEAN_TRUE When STA is waiting for Reassoc response from AP \n |
| 1566 | * else eANI_BOOLEAN_FALSE |
| 1567 | */ |
| 1568 | |
| 1569 | eAniBoolean |
| 1570 | limIsReassocInProgress(tpAniSirGlobal pMac,tpPESession psessionEntry) |
| 1571 | { |
Dhanashri Atre | af3e84d | 2013-01-18 18:03:06 -0800 | [diff] [blame] | 1572 | if (psessionEntry == NULL) |
| 1573 | { |
| 1574 | return eANI_BOOLEAN_FALSE; |
| 1575 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1576 | if(((psessionEntry->limSystemRole == eLIM_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))&& |
| 1577 | ((psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) || |
| 1578 | (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_LINK_FAIL_STATE))) |
| 1579 | return eANI_BOOLEAN_TRUE; |
| 1580 | |
| 1581 | return eANI_BOOLEAN_FALSE; |
| 1582 | } /*** end limIsReassocInProgress() ***/ |
| 1583 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1584 | #ifdef WLAN_FEATURE_11AC |
| 1585 | tSirRetStatus limPopulateVhtMcsSet(tpAniSirGlobal pMac, |
| 1586 | tpSirSupportedRates pRates, |
| 1587 | tDot11fIEVHTCaps *pPeerVHTCaps, |
| 1588 | tpPESession psessionEntry) |
| 1589 | { |
| 1590 | tANI_U32 val; |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 1591 | tANI_U32 selfStaDot11Mode=0; |
| 1592 | wlan_cfgGetInt(pMac,WNI_CFG_DOT11_MODE,&selfStaDot11Mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1593 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 1594 | // if(IS_DOT11_MODE_VHT(psessionEntry->dot11mode)) |
| 1595 | if (IS_DOT11_MODE_VHT(selfStaDot11Mode)) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1596 | { |
| 1597 | if ( wlan_cfgGetInt( pMac,WNI_CFG_VHT_RX_MCS_MAP,&val) != |
| 1598 | eSIR_SUCCESS ) |
| 1599 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1600 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve VHT RX MCS MAP"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1601 | goto error; |
| 1602 | } |
| 1603 | pRates->vhtRxMCSMap = (tANI_U16)val; |
| 1604 | |
| 1605 | if ( wlan_cfgGetInt( pMac,WNI_CFG_VHT_TX_MCS_MAP,&val ) != |
| 1606 | eSIR_SUCCESS ) |
| 1607 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1608 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve VHT TX MCS MAP"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1609 | goto error; |
| 1610 | } |
| 1611 | pRates->vhtTxMCSMap = (tANI_U16)val; |
| 1612 | |
| 1613 | if ( wlan_cfgGetInt( pMac,WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE,&val ) != |
| 1614 | eSIR_SUCCESS ) |
| 1615 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1616 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve VHT RX Supported data rate MAP"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1617 | goto error; |
| 1618 | } |
| 1619 | pRates->vhtRxHighestDataRate = (tANI_U16)val; |
| 1620 | |
| 1621 | if ( wlan_cfgGetInt( pMac,WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE,&val ) != |
| 1622 | eSIR_SUCCESS ) |
| 1623 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1624 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve VHT RX Supported data rate MAP"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1625 | goto error; |
| 1626 | } |
| 1627 | pRates->vhtTxHighestDataRate = (tANI_U16)val; |
| 1628 | |
| 1629 | if( pPeerVHTCaps != NULL) |
| 1630 | { |
| 1631 | pRates->vhtTxHighestDataRate = SIR_MIN(pRates->vhtTxHighestDataRate, pPeerVHTCaps->txSupDataRate); |
| 1632 | pRates->vhtRxHighestDataRate = SIR_MIN(pRates->vhtRxHighestDataRate, pPeerVHTCaps->rxHighSupDataRate); |
| 1633 | |
Jeff Johnson | 1250df4 | 2012-12-10 14:31:52 -0800 | [diff] [blame] | 1634 | // Acquire PEER MCS map if we exceed. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1635 | // We compare/update only the last 2 bits of the map as we support only single BSS. |
| 1636 | // Firmware takes care of this comparison |
| 1637 | pRates->vhtRxMCSMap &= ~(0x3); // Clearing the last 2 bits in the bitmap |
| 1638 | pRates->vhtRxMCSMap |= (pPeerVHTCaps->rxMCSMap & 0x3); // Updating the last 2 bits in the bitmap |
| 1639 | |
| 1640 | // Firmware takes care of this comparison |
| 1641 | pRates->vhtTxMCSMap &= ~(0x3); // Clearing the last 2 bits in the bitmap |
| 1642 | pRates->vhtTxMCSMap |= (pPeerVHTCaps->txMCSMap & 0x3); // Updating the last 2 bits in the bitmap |
| 1643 | } |
| 1644 | } |
| 1645 | return eSIR_SUCCESS; |
| 1646 | error: |
| 1647 | |
| 1648 | return eSIR_FAILURE; |
| 1649 | |
| 1650 | } |
| 1651 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1652 | |
| 1653 | /** |
| 1654 | * limPopulateOwnRateSet |
| 1655 | * |
| 1656 | * FUNCTION: |
| 1657 | * This function is called by limProcessAssocRsp() or |
| 1658 | * limAddStaInIBSS() |
| 1659 | * - It creates a combined rate set of 12 rates max which |
| 1660 | * comprises the basic and extended rates read from CFG |
| 1661 | * - It sorts the combined rate Set and copy it in the |
| 1662 | * rate array of the pSTA descriptor |
| 1663 | * - It sets the erpEnabled bit of the STA descriptor |
| 1664 | * |
| 1665 | * NOTE: |
| 1666 | * ERP bit is set iff the dph PHY mode is 11G and there is at least |
| 1667 | * an A rate in the supported or extended rate sets |
| 1668 | * |
| 1669 | * @param pMac - Pointer to Global MAC structure |
| 1670 | * @param basicOnly - When passed value is true, only basic |
| 1671 | * rates are copied to DPH node else |
| 1672 | * all supported rates are copied |
| 1673 | * @return eSIR_SUCCESS or eSIR_FAILURE |
| 1674 | * |
| 1675 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1676 | #ifdef WLAN_FEATURE_11AC |
| 1677 | tSirRetStatus |
| 1678 | limPopulateOwnRateSet(tpAniSirGlobal pMac, |
| 1679 | tpSirSupportedRates pRates, |
| 1680 | tANI_U8* pSupportedMCSSet, |
| 1681 | tANI_U8 basicOnly, |
| 1682 | tpPESession psessionEntry, |
| 1683 | tDot11fIEVHTCaps *pVHTCaps) |
| 1684 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1685 | tSirRetStatus |
| 1686 | limPopulateOwnRateSet(tpAniSirGlobal pMac, |
| 1687 | tpSirSupportedRates pRates, |
| 1688 | tANI_U8* pSupportedMCSSet, |
| 1689 | tANI_U8 basicOnly, |
| 1690 | tpPESession psessionEntry) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1691 | #endif |
| 1692 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1693 | { |
| 1694 | tSirMacRateSet tempRateSet; |
| 1695 | tSirMacRateSet tempRateSet2; |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1696 | tANI_U32 i,j,val,min,isArate; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1697 | tANI_U32 phyMode = 0; |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 1698 | tANI_U32 selfStaDot11Mode=0; |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1699 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1700 | isArate = 0; |
| 1701 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 1702 | wlan_cfgGetInt(pMac, WNI_CFG_DOT11_MODE, &selfStaDot11Mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1703 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 1704 | |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1705 | /* Include 11b rates only when the device configured in |
| 1706 | auto, 11a/b/g or 11b_only */ |
| 1707 | if ( (selfStaDot11Mode == WNI_CFG_DOT11_MODE_ALL) || |
| 1708 | (selfStaDot11Mode == WNI_CFG_DOT11_MODE_11A) || |
| 1709 | (selfStaDot11Mode == WNI_CFG_DOT11_MODE_11AC) || |
Leela Venkata Kiran Kumar Reddy Chirala | c9a10e5 | 2013-08-29 16:37:15 -0700 | [diff] [blame] | 1710 | (selfStaDot11Mode == WNI_CFG_DOT11_MODE_11N) || |
| 1711 | (selfStaDot11Mode == WNI_CFG_DOT11_MODE_11G) || |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1712 | (selfStaDot11Mode == WNI_CFG_DOT11_MODE_11B) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1713 | { |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1714 | val = WNI_CFG_SUPPORTED_RATES_11B_LEN; |
| 1715 | wlan_cfgGetStr( pMac, WNI_CFG_SUPPORTED_RATES_11B, |
| 1716 | (tANI_U8 *)&tempRateSet.rate, &val ); |
| 1717 | tempRateSet.numRates = (tANI_U8) val; |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 1718 | } |
| 1719 | else |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1720 | tempRateSet.numRates = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1721 | |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1722 | /* Include 11a rates when the device configured in non-11b mode */ |
| 1723 | if (!IS_DOT11_MODE_11B(selfStaDot11Mode)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1724 | { |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1725 | val = WNI_CFG_SUPPORTED_RATES_11A_LEN; |
| 1726 | wlan_cfgGetStr( pMac, WNI_CFG_SUPPORTED_RATES_11A, |
| 1727 | (tANI_U8 *)&tempRateSet2.rate, &val ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1728 | tempRateSet2.numRates = (tANI_U8) val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1729 | } |
| 1730 | else |
Madan Mohan Koyyalamudi | 626959e | 2013-07-15 20:50:43 +0530 | [diff] [blame] | 1731 | tempRateSet2.numRates = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1732 | |
| 1733 | if ((tempRateSet.numRates + tempRateSet2.numRates) > 12) |
| 1734 | { |
| 1735 | //we are in big trouble |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1736 | limLog(pMac, LOGP, FL("more than 12 rates in CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1737 | //panic |
| 1738 | goto error; |
| 1739 | } |
| 1740 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1741 | //copy all rates in tempRateSet, there are 12 rates max |
| 1742 | for (i = 0;i < tempRateSet2.numRates; i++) |
| 1743 | tempRateSet.rate[i + tempRateSet.numRates] = tempRateSet2.rate[i]; |
| 1744 | tempRateSet.numRates += tempRateSet2.numRates; |
| 1745 | |
| 1746 | /** |
| 1747 | * Sort rates in tempRateSet (they are likely to be already sorted) |
| 1748 | * put the result in pSupportedRates |
| 1749 | */ |
| 1750 | { |
| 1751 | tANI_U8 aRateIndex = 0; |
| 1752 | tANI_U8 bRateIndex = 0; |
| 1753 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 1754 | vos_mem_set((tANI_U8 *) pRates, sizeof(tSirSupportedRates), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1755 | for(i = 0;i < tempRateSet.numRates; i++) |
| 1756 | { |
| 1757 | min = 0; |
| 1758 | val = 0xff; |
| 1759 | isArate = 0; |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 1760 | for(j = 0; (j < tempRateSet.numRates) && (j < SIR_MAC_RATESET_EID_MAX); j++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1761 | { |
| 1762 | if ((tANI_U32) (tempRateSet.rate[j] & 0x7f) < val) |
| 1763 | { |
| 1764 | val = tempRateSet.rate[j] & 0x7f; |
| 1765 | min = j; |
| 1766 | } |
| 1767 | } |
| 1768 | |
| 1769 | if (sirIsArate(tempRateSet.rate[min] & 0x7f)) |
| 1770 | isArate = 1; |
| 1771 | |
| 1772 | /* |
| 1773 | * HAL needs to know whether the rate is basic rate or not, as it needs to |
| 1774 | * update the response rate table accordingly. e.g. if one of the 11a rates is |
| 1775 | * basic rate, then that rate can be used for sending control frames. |
| 1776 | * HAL updates the response rate table whenever basic rate set is changed. |
| 1777 | */ |
| 1778 | if (basicOnly) |
| 1779 | { |
| 1780 | if (tempRateSet.rate[min] & 0x80) |
| 1781 | { |
| 1782 | if (isArate) |
| 1783 | pRates->llaRates[aRateIndex++] = tempRateSet.rate[min]; |
| 1784 | else |
| 1785 | pRates->llbRates[bRateIndex++] = tempRateSet.rate[min]; |
| 1786 | } |
| 1787 | } |
| 1788 | else |
| 1789 | { |
| 1790 | if (isArate) |
| 1791 | pRates->llaRates[aRateIndex++] = tempRateSet.rate[min]; |
| 1792 | else |
| 1793 | pRates->llbRates[bRateIndex++] = tempRateSet.rate[min]; |
| 1794 | } |
| 1795 | tempRateSet.rate[min] = 0xff; |
| 1796 | } |
| 1797 | |
| 1798 | } |
| 1799 | |
| 1800 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 1801 | //if(IS_DOT11_MODE_HT(psessionEntry->dot11mode)) |
| 1802 | if (IS_DOT11_MODE_HT(selfStaDot11Mode)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1803 | { |
| 1804 | val = SIZE_OF_SUPPORTED_MCS_SET; |
| 1805 | if (wlan_cfgGetStr(pMac, WNI_CFG_SUPPORTED_MCS_SET, |
| 1806 | pRates->supportedMCSSet, |
| 1807 | &val) != eSIR_SUCCESS) |
| 1808 | { |
| 1809 | /// Could not get rateset from CFG. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1810 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve supportedMCSSet"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1811 | goto error; |
| 1812 | } |
| 1813 | |
| 1814 | |
| 1815 | //if supported MCS Set of the peer is passed in, then do the intersection |
| 1816 | //else use the MCS set from local CFG. |
| 1817 | |
| 1818 | if(pSupportedMCSSet != NULL) |
| 1819 | { |
| 1820 | for(i=0; i<SIR_MAC_MAX_SUPPORTED_MCS_SET; i++) |
| 1821 | pRates->supportedMCSSet[i] &= pSupportedMCSSet[i]; |
| 1822 | |
| 1823 | } |
| 1824 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1825 | PELOG2(limLog(pMac, LOG2, FL("MCS Rate Set Bitmap: "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1826 | for(i=0; i<SIR_MAC_MAX_SUPPORTED_MCS_SET; i++) |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 1827 | PELOG2(limLog(pMac, LOG2,FL("%x ") , pRates->supportedMCSSet[i]);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1828 | } |
| 1829 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1830 | #ifdef WLAN_FEATURE_11AC |
| 1831 | limPopulateVhtMcsSet(pMac, pRates , pVHTCaps,psessionEntry); |
| 1832 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1833 | |
| 1834 | return eSIR_SUCCESS; |
| 1835 | |
| 1836 | error: |
| 1837 | |
| 1838 | return eSIR_FAILURE; |
| 1839 | } /*** limPopulateOwnRateSet() ***/ |
| 1840 | |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1841 | #ifdef WLAN_FEATURE_11AC |
| 1842 | tSirRetStatus |
| 1843 | limPopulatePeerRateSet(tpAniSirGlobal pMac, |
| 1844 | |
| 1845 | tpSirSupportedRates pRates, |
| 1846 | tANI_U8* pSupportedMCSSet, |
| 1847 | tANI_U8 basicOnly, |
| 1848 | tpPESession psessionEntry, |
| 1849 | tDot11fIEVHTCaps *pVHTCaps) |
| 1850 | #else |
| 1851 | tSirRetStatus |
| 1852 | limPopulatePeerRateSet(tpAniSirGlobal pMac, |
| 1853 | tpSirSupportedRates pRates, |
| 1854 | tANI_U8* pSupportedMCSSet, |
| 1855 | tANI_U8 basicOnly, |
| 1856 | tpPESession psessionEntry) |
| 1857 | #endif |
| 1858 | { |
| 1859 | tSirMacRateSet tempRateSet; |
| 1860 | tSirMacRateSet tempRateSet2; |
| 1861 | tANI_U32 i,j,val,min,isArate; |
| 1862 | isArate = 0; |
| 1863 | |
| 1864 | /* copy operational rate set from psessionEntry */ |
Praveen Kumar Sirisilla | 8bdfac4 | 2013-10-10 17:20:48 -0700 | [diff] [blame] | 1865 | if ( psessionEntry->rateSet.numRates <= SIR_MAC_RATESET_EID_MAX ) |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1866 | { |
Kiet Lam | 842c3e1 | 2013-11-16 22:40:57 +0530 | [diff] [blame] | 1867 | vos_mem_copy((tANI_U8 *)tempRateSet.rate, |
| 1868 | (tANI_U8*)(psessionEntry->rateSet.rate), |
| 1869 | psessionEntry->rateSet.numRates); |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1870 | tempRateSet.numRates = psessionEntry->rateSet.numRates; |
| 1871 | } |
| 1872 | else |
| 1873 | { |
| 1874 | limLog(pMac, LOGE, FL("more than SIR_MAC_RATESET_EID_MAX rates\n")); |
| 1875 | goto error; |
| 1876 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 891bf06 | 2013-10-03 14:30:53 -0700 | [diff] [blame] | 1877 | if ((psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11G) || |
| 1878 | (psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11A) || |
| 1879 | (psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11N)) |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1880 | { |
| 1881 | |
Praveen Kumar Sirisilla | 8bdfac4 | 2013-10-10 17:20:48 -0700 | [diff] [blame] | 1882 | if (psessionEntry->extRateSet.numRates <= SIR_MAC_RATESET_EID_MAX) |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1883 | { |
Kiet Lam | 842c3e1 | 2013-11-16 22:40:57 +0530 | [diff] [blame] | 1884 | vos_mem_copy((tANI_U8 *)tempRateSet2.rate, |
| 1885 | (tANI_U8*)(psessionEntry->extRateSet.rate), |
| 1886 | psessionEntry->extRateSet.numRates); |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1887 | tempRateSet2.numRates = psessionEntry->extRateSet.numRates; |
| 1888 | } |
| 1889 | else { |
| 1890 | limLog(pMac, LOGE, FL("psessionEntry->extRateSet.numRates more than SIR_MAC_RATESET_EID_MAX rates\n")); |
| 1891 | goto error; |
| 1892 | } |
| 1893 | } |
| 1894 | else |
| 1895 | tempRateSet2.numRates = 0; |
Praveen Kumar Sirisilla | 8bdfac4 | 2013-10-10 17:20:48 -0700 | [diff] [blame] | 1896 | if ((tempRateSet.numRates + tempRateSet2.numRates) > SIR_MAC_RATESET_EID_MAX) |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1897 | { |
| 1898 | //we are in big trouble |
| 1899 | limLog(pMac, LOGP, FL("more than 12 rates in CFG")); |
| 1900 | goto error; |
| 1901 | } |
| 1902 | |
| 1903 | |
| 1904 | //copy all rates in tempRateSet, there are 12 rates max |
| 1905 | for (i = 0;i < tempRateSet2.numRates; i++) |
| 1906 | tempRateSet.rate[i + tempRateSet.numRates] = tempRateSet2.rate[i]; |
| 1907 | tempRateSet.numRates += tempRateSet2.numRates; |
| 1908 | /** |
| 1909 | * Sort rates in tempRateSet (they are likely to be already sorted) |
| 1910 | * put the result in pSupportedRates |
| 1911 | */ |
| 1912 | { |
| 1913 | tANI_U8 aRateIndex = 0; |
| 1914 | tANI_U8 bRateIndex = 0; |
Kiet Lam | 842c3e1 | 2013-11-16 22:40:57 +0530 | [diff] [blame] | 1915 | vos_mem_set((tANI_U8 *) pRates, sizeof(tSirSupportedRates), 0); |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1916 | for(i = 0;i < tempRateSet.numRates; i++) |
| 1917 | { |
| 1918 | min = 0; |
| 1919 | val = 0xff; |
| 1920 | isArate = 0; |
| 1921 | for(j = 0; (j < tempRateSet.numRates) && (j < SIR_MAC_RATESET_EID_MAX); j++) |
| 1922 | { |
| 1923 | if ((tANI_U32) (tempRateSet.rate[j] & 0x7f) < val) |
| 1924 | { |
| 1925 | val = tempRateSet.rate[j] & 0x7f; |
| 1926 | min = j; |
| 1927 | } |
| 1928 | } |
| 1929 | if (sirIsArate(tempRateSet.rate[min] & 0x7f)) |
| 1930 | isArate = 1; |
| 1931 | /* |
| 1932 | * HAL needs to know whether the rate is basic rate or not, as it needs to |
| 1933 | * update the response rate table accordingly. e.g. if one of the 11a rates is |
| 1934 | * basic rate, then that rate can be used for sending control frames. |
| 1935 | * HAL updates the response rate table whenever basic rate set is changed. |
| 1936 | */ |
| 1937 | if (basicOnly) |
| 1938 | { |
| 1939 | if (tempRateSet.rate[min] & 0x80) |
| 1940 | { |
| 1941 | if (isArate) |
| 1942 | pRates->llaRates[aRateIndex++] = tempRateSet.rate[min]; |
| 1943 | else |
| 1944 | pRates->llbRates[bRateIndex++] = tempRateSet.rate[min]; |
| 1945 | } |
| 1946 | } |
| 1947 | else |
| 1948 | { |
| 1949 | if (isArate) |
| 1950 | pRates->llaRates[aRateIndex++] = tempRateSet.rate[min]; |
| 1951 | else |
| 1952 | pRates->llbRates[bRateIndex++] = tempRateSet.rate[min]; |
| 1953 | } |
| 1954 | tempRateSet.rate[min] = 0xff; |
| 1955 | } |
| 1956 | } |
| 1957 | |
| 1958 | |
| 1959 | if (IS_DOT11_MODE_HT(psessionEntry->dot11mode)) |
| 1960 | { |
| 1961 | val = SIZE_OF_SUPPORTED_MCS_SET; |
| 1962 | if (wlan_cfgGetStr(pMac, WNI_CFG_SUPPORTED_MCS_SET, |
| 1963 | pRates->supportedMCSSet, |
| 1964 | &val) != eSIR_SUCCESS) |
| 1965 | { |
| 1966 | /// Could not get rateset from CFG. Log error. |
| 1967 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve supportedMCSSet"));) |
| 1968 | goto error; |
| 1969 | } |
| 1970 | //if supported MCS Set of the peer is passed in, then do the intersection |
| 1971 | //else use the MCS set from local CFG. |
| 1972 | if(pSupportedMCSSet != NULL) |
| 1973 | { |
| 1974 | for(i=0; i<SIR_MAC_MAX_SUPPORTED_MCS_SET; i++) |
| 1975 | pRates->supportedMCSSet[i] &= pSupportedMCSSet[i]; |
| 1976 | } |
| 1977 | PELOG2(limLog(pMac, LOG2, FL("MCS Rate Set Bitmap: "));) |
| 1978 | for(i=0; i<SIR_MAC_MAX_SUPPORTED_MCS_SET; i++) |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 1979 | PELOG2(limLog(pMac, LOG2,FL("%x ") , pRates->supportedMCSSet[i]);) |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 1980 | } |
| 1981 | #ifdef WLAN_FEATURE_11AC |
| 1982 | limPopulateVhtMcsSet(pMac, pRates , pVHTCaps,psessionEntry); |
| 1983 | #endif |
| 1984 | return eSIR_SUCCESS; |
| 1985 | error: |
| 1986 | return eSIR_FAILURE; |
| 1987 | } /*** limPopulatePeerRateSet() ***/ |
| 1988 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1989 | /** |
| 1990 | * limPopulateMatchingRateSet |
| 1991 | * FUNCTION: |
| 1992 | * This is called at the time of Association Request |
| 1993 | * processing on AP and while adding peer's context |
| 1994 | * in IBSS role to process the CFG rate sets and |
| 1995 | * the rate sets received in the Assoc request on AP |
| 1996 | * or Beacon/Probe Response from peer in IBSS. |
| 1997 | * |
| 1998 | * LOGIC: |
| 1999 | * 1. It makes the intersection between our own rate Sat |
| 2000 | * and extemcded rate set and the ones received in the |
| 2001 | * association request. |
| 2002 | * 2. It creates a combined rate set of 12 rates max which |
| 2003 | * comprised the basic and extended rates |
| 2004 | * 3. It sorts the combined rate Set and copy it in the |
| 2005 | * rate array of the pSTA descriptor |
| 2006 | * |
| 2007 | * ASSUMPTION: |
| 2008 | * The parser has already ensured unicity of the rates in the |
| 2009 | * association request structure |
| 2010 | * |
| 2011 | * @param: pMac - Pointer to Global MAC structure |
| 2012 | * pStaDs - Pointer to DPH node |
| 2013 | * pOperRateSet - Pointer to peer's supported rateset |
| 2014 | * pExtRateSet - Pointer to peer's extended rateset |
| 2015 | * |
| 2016 | * @return: eSIR_SUCCESS or eSIR_FAILURE |
| 2017 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2018 | #ifdef WLAN_FEATURE_11AC |
| 2019 | tSirRetStatus |
| 2020 | limPopulateMatchingRateSet(tpAniSirGlobal pMac, |
| 2021 | tpDphHashNode pStaDs, |
| 2022 | tSirMacRateSet *pOperRateSet, |
| 2023 | tSirMacRateSet *pExtRateSet, |
| 2024 | tANI_U8* pSupportedMCSSet, |
| 2025 | tSirMacPropRateSet *pAniLegRateSet, |
| 2026 | tpPESession psessionEntry, |
| 2027 | tDot11fIEVHTCaps *pVHTCaps) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2028 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2029 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2030 | tSirRetStatus |
| 2031 | limPopulateMatchingRateSet(tpAniSirGlobal pMac, |
| 2032 | tpDphHashNode pStaDs, |
| 2033 | tSirMacRateSet *pOperRateSet, |
| 2034 | tSirMacRateSet *pExtRateSet, |
| 2035 | tANI_U8* pSupportedMCSSet, |
| 2036 | tSirMacPropRateSet *pAniLegRateSet, |
| 2037 | tpPESession psessionEntry) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2038 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2039 | { |
| 2040 | tSirMacRateSet tempRateSet; |
| 2041 | tSirMacRateSet tempRateSet2; |
| 2042 | tANI_U32 i,j,val,min,isArate; |
| 2043 | tANI_U32 phyMode; |
| 2044 | tANI_U8 mcsSet[SIZE_OF_SUPPORTED_MCS_SET]; |
| 2045 | |
| 2046 | isArate=0; |
| 2047 | |
| 2048 | // limGetPhyMode(pMac, &phyMode); |
| 2049 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2050 | |
| 2051 | // get own rate set |
| 2052 | // val = WNI_CFG_OPERATIONAL_RATE_SET_LEN; |
| 2053 | #if 0 |
| 2054 | if (wlan_cfgGetStr(pMac, WNI_CFG_OPERATIONAL_RATE_SET, |
| 2055 | (tANI_U8 *) &tempRateSet.rate, |
| 2056 | &val) != eSIR_SUCCESS) |
| 2057 | { |
| 2058 | /// Could not get rateset from CFG. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2059 | limLog(pMac, LOGP, FL("could not retrieve rateset")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2060 | } |
| 2061 | |
| 2062 | #endif // TO SUPPORT BT-AMP |
| 2063 | |
| 2064 | /* copy operational rate set from psessionEntry */ |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2065 | vos_mem_copy((tempRateSet.rate), (psessionEntry->rateSet.rate), |
| 2066 | psessionEntry->rateSet.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2067 | tempRateSet.numRates = (tANI_U8) psessionEntry->rateSet.numRates; |
| 2068 | |
| 2069 | if (phyMode == WNI_CFG_PHY_MODE_11G) |
| 2070 | { |
| 2071 | |
| 2072 | #if 0 |
| 2073 | // get own extended rate set |
| 2074 | val = WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN; |
| 2075 | if (wlan_cfgGetStr(pMac, WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET, |
| 2076 | (tANI_U8 *) &tempRateSet2.rate, |
| 2077 | &val) != eSIR_SUCCESS) |
| 2078 | #endif |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2079 | vos_mem_copy((tempRateSet2.rate), (psessionEntry->extRateSet.rate), |
| 2080 | psessionEntry->extRateSet.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2081 | tempRateSet2.numRates = (tANI_U8) psessionEntry->extRateSet.numRates; |
| 2082 | } |
| 2083 | else |
| 2084 | tempRateSet2.numRates = 0; |
| 2085 | |
| 2086 | if ((tempRateSet.numRates + tempRateSet2.numRates) > 12) |
| 2087 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2088 | PELOGE(limLog(pMac, LOGE, FL("more than 12 rates in CFG"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2089 | goto error; |
| 2090 | } |
| 2091 | |
| 2092 | /** |
| 2093 | * Handling of the rate set IEs is the following: |
| 2094 | * - keep only rates that we support and that the station supports |
| 2095 | * - sort and the rates into the pSta->rate array |
| 2096 | */ |
| 2097 | |
| 2098 | // Copy all rates in tempRateSet, there are 12 rates max |
| 2099 | for(i = 0; i < tempRateSet2.numRates; i++) |
| 2100 | tempRateSet.rate[i + tempRateSet.numRates] = |
| 2101 | tempRateSet2.rate[i]; |
| 2102 | |
| 2103 | tempRateSet.numRates += tempRateSet2.numRates; |
| 2104 | |
| 2105 | /** |
| 2106 | * Sort rates in tempRateSet (they are likely to be already sorted) |
| 2107 | * put the result in tempRateSet2 |
| 2108 | */ |
| 2109 | tempRateSet2.numRates = 0; |
| 2110 | |
| 2111 | for(i = 0;i < tempRateSet.numRates; i++) |
| 2112 | { |
| 2113 | min = 0; |
| 2114 | val = 0xff; |
| 2115 | |
| 2116 | for(j = 0;j < tempRateSet.numRates; j++) |
| 2117 | if ((tANI_U32) (tempRateSet.rate[j] & 0x7f) < val) |
| 2118 | { |
| 2119 | val = tempRateSet.rate[j] & 0x7f; |
| 2120 | min = j; |
| 2121 | } |
| 2122 | |
| 2123 | tempRateSet2.rate[tempRateSet2.numRates++] = |
| 2124 | tempRateSet.rate[min]; |
| 2125 | tempRateSet.rate[min] = 0xff; |
| 2126 | } |
| 2127 | |
| 2128 | |
| 2129 | /** |
| 2130 | * Copy received rates in tempRateSet, the parser has ensured |
| 2131 | * unicity of the rates so there cannot be more than 12 |
| 2132 | */ |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 2133 | for(i = 0; (i < pOperRateSet->numRates && i < SIR_MAC_RATESET_EID_MAX) ; i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2134 | { |
| 2135 | tempRateSet.rate[i] = pOperRateSet->rate[i]; |
| 2136 | } |
| 2137 | |
| 2138 | tempRateSet.numRates = pOperRateSet->numRates; |
| 2139 | |
| 2140 | if (pExtRateSet->numRates) |
| 2141 | { |
| 2142 | if((tempRateSet.numRates + pExtRateSet->numRates) > 12 ) |
| 2143 | { |
| 2144 | limLog( pMac, LOG2, |
| 2145 | "Sum of SUPPORTED and EXTENDED Rate Set (%1d) exceeds 12!", |
| 2146 | tempRateSet.numRates + pExtRateSet->numRates ); |
| 2147 | |
| 2148 | if( tempRateSet.numRates < 12 ) |
| 2149 | { |
| 2150 | int found = 0; |
| 2151 | int tail = tempRateSet.numRates; |
| 2152 | |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 2153 | for( i = 0; (i < pExtRateSet->numRates && i < SIR_MAC_RATESET_EID_MAX); i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2154 | { |
| 2155 | found = 0; |
| 2156 | for( j = 0; j < (tANI_U32) tail; j++ ) |
| 2157 | { |
| 2158 | if((tempRateSet.rate[j] & 0x7F) == |
| 2159 | (pExtRateSet->rate[i] & 0x7F)) |
| 2160 | { |
| 2161 | found = 1; |
| 2162 | break; |
| 2163 | } |
| 2164 | } |
| 2165 | |
| 2166 | if( !found ) |
| 2167 | { |
| 2168 | tempRateSet.rate[tempRateSet.numRates++] = |
| 2169 | pExtRateSet->rate[i]; |
| 2170 | |
| 2171 | if( tempRateSet.numRates >= 12 ) |
| 2172 | break; |
| 2173 | } |
| 2174 | } |
| 2175 | } |
| 2176 | else |
| 2177 | limLog( pMac, LOG2, |
| 2178 | "Relying only on the SUPPORTED Rate Set IE..." ); |
| 2179 | } |
| 2180 | else |
| 2181 | { |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 2182 | for(j = 0; ((j < pExtRateSet->numRates) && (j < SIR_MAC_RATESET_EID_MAX) && ((i+j) < SIR_MAC_RATESET_EID_MAX)); j++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2183 | tempRateSet.rate[i+j] = pExtRateSet->rate[j]; |
| 2184 | |
| 2185 | tempRateSet.numRates += pExtRateSet->numRates; |
| 2186 | } |
| 2187 | } |
| 2188 | |
| 2189 | { |
| 2190 | tpSirSupportedRates rates = &pStaDs->supportedRates; |
| 2191 | tANI_U8 aRateIndex = 0; |
| 2192 | tANI_U8 bRateIndex = 0; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2193 | vos_mem_set((tANI_U8 *) rates, sizeof(tSirSupportedRates), 0); |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 2194 | for(i = 0;(i < tempRateSet2.numRates && i < SIR_MAC_RATESET_EID_MAX ); i++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2195 | { |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 2196 | for(j = 0;(j < tempRateSet.numRates && j < SIR_MAC_RATESET_EID_MAX); j++) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2197 | { |
| 2198 | if ((tempRateSet2.rate[i] & 0x7F) == |
| 2199 | (tempRateSet.rate[j] & 0x7F)) |
| 2200 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2201 | if (sirIsArate(tempRateSet2.rate[i] & 0x7f)) |
| 2202 | { |
| 2203 | isArate=1; |
Kiran Kumar Lokere | a328bcd | 2013-04-22 22:02:05 -0700 | [diff] [blame] | 2204 | if (aRateIndex < SIR_NUM_11A_RATES) |
| 2205 | rates->llaRates[aRateIndex++] = tempRateSet2.rate[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2206 | } |
| 2207 | else |
Kiran Kumar Lokere | a328bcd | 2013-04-22 22:02:05 -0700 | [diff] [blame] | 2208 | { |
| 2209 | if (bRateIndex < SIR_NUM_11B_RATES) |
| 2210 | rates->llbRates[bRateIndex++] = tempRateSet2.rate[i]; |
| 2211 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2212 | break; |
| 2213 | } |
| 2214 | } |
| 2215 | } |
| 2216 | |
| 2217 | |
| 2218 | //Now add the Polaris rates only when Proprietary rates are enabled. |
| 2219 | val = 0; |
| 2220 | if(wlan_cfgGetInt(pMac, WNI_CFG_PROPRIETARY_RATES_ENABLED, &val) != eSIR_SUCCESS) |
| 2221 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2222 | limLog(pMac, LOGP, FL("could not retrieve prop rate enabled flag from CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2223 | } |
| 2224 | else if(val) |
| 2225 | { |
| 2226 | for(i=0; i<pAniLegRateSet->numPropRates; i++) |
| 2227 | rates->aniLegacyRates[i] = pAniLegRateSet->propRate[i]; |
| 2228 | } |
| 2229 | |
| 2230 | } |
| 2231 | |
| 2232 | |
| 2233 | //compute the matching MCS rate set, if peer is 11n capable and self mode is 11n |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2234 | #ifdef FEATURE_WLAN_TDLS |
| 2235 | if(pStaDs->mlmStaContext.htCapability) |
| 2236 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2237 | if(IS_DOT11_MODE_HT(psessionEntry->dot11mode) && |
| 2238 | (pStaDs->mlmStaContext.htCapability)) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2239 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2240 | { |
| 2241 | val = SIZE_OF_SUPPORTED_MCS_SET; |
| 2242 | if (wlan_cfgGetStr(pMac, WNI_CFG_SUPPORTED_MCS_SET, |
| 2243 | mcsSet, |
| 2244 | &val) != eSIR_SUCCESS) |
| 2245 | { |
| 2246 | /// Could not get rateset from CFG. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2247 | limLog(pMac, LOGP, FL("could not retrieve supportedMCSSet")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2248 | goto error; |
| 2249 | } |
| 2250 | |
| 2251 | for(i=0; i<val; i++) |
| 2252 | pStaDs->supportedRates.supportedMCSSet[i] = mcsSet[i] & pSupportedMCSSet[i]; |
| 2253 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2254 | PELOG2(limLog(pMac, LOG2, FL("limPopulateMatchingRateSet: MCS Rate Set Bitmap from CFG and DPH : "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2255 | for(i=0; i<SIR_MAC_MAX_SUPPORTED_MCS_SET; i++) |
| 2256 | { |
| 2257 | PELOG2(limLog(pMac, LOG2,FL("%x %x "), mcsSet[i], pStaDs->supportedRates.supportedMCSSet[i]);) |
| 2258 | } |
| 2259 | } |
| 2260 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2261 | #ifdef WLAN_FEATURE_11AC |
| 2262 | limPopulateVhtMcsSet(pMac, &pStaDs->supportedRates, pVHTCaps, psessionEntry); |
| 2263 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2264 | /** |
| 2265 | * Set the erpEnabled bit iff the phy is in G mode and at least |
| 2266 | * one A rate is supported |
| 2267 | */ |
| 2268 | if ((phyMode == WNI_CFG_PHY_MODE_11G) && isArate) |
| 2269 | pStaDs->erpEnabled = eHAL_SET; |
| 2270 | |
| 2271 | |
| 2272 | |
| 2273 | return eSIR_SUCCESS; |
| 2274 | |
| 2275 | error: |
| 2276 | |
| 2277 | return eSIR_FAILURE; |
| 2278 | } /*** limPopulateMatchingRateSet() ***/ |
| 2279 | |
| 2280 | |
| 2281 | |
| 2282 | /** |
| 2283 | * limAddSta() |
| 2284 | * |
| 2285 | *FUNCTION: |
| 2286 | * This function is called to add an STA context at hardware |
| 2287 | * whenever a STA is (Re) Associated. |
| 2288 | * |
| 2289 | *LOGIC: |
| 2290 | * |
| 2291 | *ASSUMPTIONS: |
| 2292 | * NA |
| 2293 | * |
| 2294 | *NOTE: |
| 2295 | * NA |
| 2296 | * |
| 2297 | * @param pMac - Pointer to Global MAC structure |
| 2298 | * @param pStaDs - Pointer to the STA datastructure created by |
| 2299 | * LIM and maintained by DPH |
| 2300 | * @return retCode - Indicates success or failure return code |
| 2301 | */ |
| 2302 | |
| 2303 | tSirRetStatus |
| 2304 | limAddSta( |
| 2305 | tpAniSirGlobal pMac, |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2306 | tpDphHashNode pStaDs, tANI_U8 updateEntry, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2307 | { |
| 2308 | tpAddStaParams pAddStaParams = NULL; |
| 2309 | tSirMsgQ msgQ; |
| 2310 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 2311 | tSirMacAddr staMac, *pStaAddr; |
| 2312 | tANI_U8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2313 | tpSirAssocReq pAssocReq; |
| 2314 | tANI_U8 *p2pIe = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2315 | #if 0 |
| 2316 | retCode = wlan_cfgGetStr(pMac, WNI_CFG_STA_ID, staMac, &cfg); |
| 2317 | if (retCode != eSIR_SUCCESS) |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2318 | limLog(pMac, LOGP, FL("could not retrieve STA MAC")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2319 | #endif //To SUPPORT BT-AMP |
| 2320 | |
| 2321 | |
| 2322 | sirCopyMacAddr(staMac,psessionEntry->selfMacAddr); |
| 2323 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2324 | limLog(pMac, LOG1, FL("sessionid: %d updateEntry = %d limsystemrole = %d "), |
| 2325 | psessionEntry->smeSessionId, updateEntry, psessionEntry->limSystemRole); |
| 2326 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2327 | pAddStaParams = vos_mem_malloc(sizeof(tAddStaParams)); |
| 2328 | if (NULL == pAddStaParams) |
| 2329 | { |
| 2330 | limLog( pMac, LOGP, FL( "Unable to allocate memory during ADD_STA" )); |
| 2331 | return eSIR_MEM_ALLOC_FAILED; |
| 2332 | } |
| 2333 | vos_mem_set((tANI_U8 *) pAddStaParams, sizeof(tAddStaParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2334 | |
| 2335 | if ((limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) || |
| 2336 | (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) || |
| 2337 | (limGetSystemRole(psessionEntry) == eLIM_BT_AMP_AP_ROLE) ) |
| 2338 | pStaAddr = &pStaDs->staAddr; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2339 | #ifdef FEATURE_WLAN_TDLS |
| 2340 | /* SystemRole shouldn't be matter if staType is TDLS peer */ |
| 2341 | else if(STA_ENTRY_TDLS_PEER == pStaDs->staType) |
| 2342 | { |
| 2343 | pStaAddr = &pStaDs->staAddr ; |
| 2344 | } |
| 2345 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2346 | else |
| 2347 | pStaAddr = &staMac; |
| 2348 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2349 | limLog(pMac, LOG1, FL(MAC_ADDRESS_STR": Subtype(Assoc/Reassoc): %d "), |
| 2350 | MAC_ADDR_ARRAY(*pStaAddr), pStaDs->mlmStaContext.subType); |
| 2351 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2352 | vos_mem_copy((tANI_U8 *) pAddStaParams->staMac, |
| 2353 | (tANI_U8 *) *pStaAddr, sizeof(tSirMacAddr)); |
| 2354 | vos_mem_copy((tANI_U8 *) pAddStaParams->bssId, |
| 2355 | psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2356 | |
| 2357 | limFillSupportedRatesInfo(pMac, pStaDs, &pStaDs->supportedRates,psessionEntry); |
| 2358 | |
| 2359 | //Copy legacy rates |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2360 | vos_mem_copy ((tANI_U8*)&pAddStaParams->supportedRates, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2361 | (tANI_U8*)&pStaDs->supportedRates, sizeof(tSirSupportedRates)); |
| 2362 | |
| 2363 | pAddStaParams->assocId = pStaDs->assocId; |
| 2364 | |
| 2365 | pAddStaParams->wmmEnabled = pStaDs->qosMode; |
| 2366 | pAddStaParams->listenInterval = pStaDs->mlmStaContext.listenInterval; |
| 2367 | pAddStaParams->shortPreambleSupported = pStaDs->shortPreambleEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2368 | if((limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) && (pStaDs->mlmStaContext.subType == LIM_REASSOC)) |
| 2369 | { |
| 2370 | /* TBD - need to remove this REASSOC check after fixinf rmmod issue */ |
| 2371 | pAddStaParams->updateSta = pStaDs->mlmStaContext.updateContext; |
| 2372 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2373 | pStaDs->valid = 0; |
| 2374 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_ADD_STA_RSP_STATE; |
| 2375 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2376 | limLog(pMac, LOG2, FL(" Assoc ID: %d wmmEnabled = %d listenInterval = %d" |
| 2377 | " shortPreambleSupported: %d "), pAddStaParams->assocId, |
| 2378 | pAddStaParams->wmmEnabled, pAddStaParams->listenInterval, |
| 2379 | pAddStaParams->shortPreambleSupported); |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 2380 | // This will indicate HAL to "allocate" a new STA index |
| 2381 | #ifdef FEATURE_WLAN_TDLS |
| 2382 | /* As there is corner case in-between add_sta and change_sta,if del_sta for other staIdx happened, |
| 2383 | * firmware return wrong staIdx (recently removed staIdx). Until we get a confirmation from the |
| 2384 | * firmware team it is now return correct staIdx for same sta_mac_addr for update case, we want |
| 2385 | * to get around it by passing valid staIdx given by add_sta time. |
| 2386 | */ |
| 2387 | if((STA_ENTRY_TDLS_PEER == pStaDs->staType) && |
| 2388 | (true == updateEntry)) |
| 2389 | pAddStaParams->staIdx = pStaDs->staIndex; |
| 2390 | else |
| 2391 | #endif |
| 2392 | pAddStaParams->staIdx = HAL_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2393 | pAddStaParams->staType = pStaDs->staType; |
| 2394 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2395 | pAddStaParams->updateSta = updateEntry; |
| 2396 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2397 | pAddStaParams->status = eHAL_STATUS_SUCCESS; |
| 2398 | pAddStaParams->respReqd = 1; |
| 2399 | //Update HT Capability |
| 2400 | |
| 2401 | if ((limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) ||(limGetSystemRole(psessionEntry) == eLIM_BT_AMP_AP_ROLE) || (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE)) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2402 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2403 | pAddStaParams->htCapable = pStaDs->mlmStaContext.htCapability; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2404 | #ifdef WLAN_FEATURE_11AC |
| 2405 | pAddStaParams->vhtCapable = pStaDs->mlmStaContext.vhtCapability; |
| 2406 | #endif |
| 2407 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2408 | #ifdef FEATURE_WLAN_TDLS |
| 2409 | /* SystemRole shouldn't be matter if staType is TDLS peer */ |
| 2410 | else if(STA_ENTRY_TDLS_PEER == pStaDs->staType) |
Hoonki Lee | 99e5378 | 2013-02-12 18:07:03 -0800 | [diff] [blame] | 2411 | { |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2412 | pAddStaParams->htCapable = pStaDs->mlmStaContext.htCapability; |
Hoonki Lee | 99e5378 | 2013-02-12 18:07:03 -0800 | [diff] [blame] | 2413 | #ifdef WLAN_FEATURE_11AC |
| 2414 | pAddStaParams->vhtCapable = pStaDs->mlmStaContext.vhtCapability; |
| 2415 | #endif |
| 2416 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2417 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2418 | else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2419 | { |
| 2420 | pAddStaParams->htCapable = psessionEntry->htCapability; |
| 2421 | #ifdef WLAN_FEATURE_11AC |
| 2422 | pAddStaParams->vhtCapable = psessionEntry->vhtCapability; |
| 2423 | #endif |
| 2424 | |
| 2425 | } |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2426 | #ifdef WLAN_FEATURE_11AC |
| 2427 | limLog(pMac, LOG2, FL("vhtCapable: %d "),pAddStaParams->vhtCapable); |
| 2428 | #endif |
| 2429 | limLog(pMac, LOG2, FL(" StaIdx: %d updateSta = %d htcapable = %d "), |
| 2430 | pAddStaParams->staIdx,pAddStaParams->updateSta, |
| 2431 | pAddStaParams->htCapable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2432 | |
| 2433 | pAddStaParams->greenFieldCapable = pStaDs->htGreenfield; |
| 2434 | pAddStaParams->maxAmpduDensity= pStaDs->htAMpduDensity; |
| 2435 | pAddStaParams->maxAmpduSize = pStaDs->htMaxRxAMpduFactor; |
| 2436 | pAddStaParams->fDsssCckMode40Mhz = pStaDs->htDsssCckRate40MHzSupport; |
| 2437 | pAddStaParams->fShortGI20Mhz = pStaDs->htShortGI20Mhz; |
| 2438 | pAddStaParams->fShortGI40Mhz = pStaDs->htShortGI40Mhz; |
| 2439 | pAddStaParams->lsigTxopProtection = pStaDs->htLsigTXOPProtection; |
| 2440 | pAddStaParams->maxAmsduSize = pStaDs->htMaxAmsduLength; |
| 2441 | pAddStaParams->txChannelWidthSet = pStaDs->htSupportedChannelWidthSet; |
| 2442 | pAddStaParams->mimoPS = pStaDs->htMIMOPSState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2443 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2444 | limLog(pMac, LOG2, FL(" greenFieldCapable: %d maxAmpduDensity = %d " |
| 2445 | "maxAmpduDensity = %d"), pAddStaParams->greenFieldCapable, |
| 2446 | pAddStaParams->maxAmpduDensity, pAddStaParams->maxAmpduSize); |
| 2447 | |
| 2448 | limLog(pMac, LOG2, FL("fDsssCckMode40Mhz: %d fShortGI20Mhz: %d " |
| 2449 | "fShortGI40Mhz: %d"), pAddStaParams->fDsssCckMode40Mhz, |
| 2450 | pAddStaParams->fShortGI20Mhz, pAddStaParams->fShortGI40Mhz); |
| 2451 | |
| 2452 | limLog(pMac, LOG2, FL("lsigTxopProtection: %d maxAmsduSize: %d " |
| 2453 | "txChannelWidthSet: %d mimoPS: %d "), pAddStaParams->lsigTxopProtection, |
| 2454 | pAddStaParams->maxAmsduSize,pAddStaParams->txChannelWidthSet, |
| 2455 | pAddStaParams->mimoPS); |
| 2456 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2457 | #ifdef WLAN_FEATURE_11AC |
| 2458 | if(pAddStaParams->vhtCapable) |
| 2459 | { |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 2460 | pAddStaParams->vhtTxChannelWidthSet = pStaDs->vhtSupportedChannelWidthSet; |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 2461 | pAddStaParams->vhtTxBFCapable = |
Hoonki Lee | 99e5378 | 2013-02-12 18:07:03 -0800 | [diff] [blame] | 2462 | #ifdef FEATURE_WLAN_TDLS |
| 2463 | (( STA_ENTRY_PEER == pStaDs->staType ) || (STA_ENTRY_TDLS_PEER == pStaDs->staType)) ? |
| 2464 | pStaDs->vhtBeamFormerCapable : psessionEntry->txBFIniFeatureEnabled ; |
| 2465 | #else |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 2466 | ( STA_ENTRY_PEER == pStaDs->staType ) ? pStaDs->vhtBeamFormerCapable : |
| 2467 | psessionEntry->txBFIniFeatureEnabled ; |
Hoonki Lee | 99e5378 | 2013-02-12 18:07:03 -0800 | [diff] [blame] | 2468 | #endif |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2469 | limLog(pMac, LOG2, FL("vhtTxChannelWidthSet: %d vhtTxBFCapable: %d"), |
| 2470 | pAddStaParams->vhtTxChannelWidthSet,pAddStaParams->vhtTxBFCapable); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2471 | } |
| 2472 | #endif |
| 2473 | |
Gopichand Nakkala | b2d2c31 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 2474 | #ifdef FEATURE_WLAN_TDLS |
| 2475 | if((STA_ENTRY_PEER == pStaDs->staType) || |
| 2476 | (STA_ENTRY_TDLS_PEER == pStaDs->staType)) |
| 2477 | #else |
| 2478 | if (STA_ENTRY_PEER == pStaDs->staType) |
| 2479 | #endif |
| 2480 | { |
| 2481 | /* peer STA get the LDPC capability from pStaDs, which populated from |
| 2482 | * HT/VHT capability*/ |
Leela V Kiran Kumar Reddy Chirala | b1f7d34 | 2013-02-11 00:27:02 -0800 | [diff] [blame] | 2483 | if(pAddStaParams->vhtTxBFCapable && pMac->lim.disableLDPCWithTxbfAP) |
| 2484 | { |
| 2485 | pAddStaParams->htLdpcCapable = 0; |
| 2486 | pAddStaParams->vhtLdpcCapable = 0; |
| 2487 | } |
| 2488 | else |
| 2489 | { |
| 2490 | pAddStaParams->htLdpcCapable = pStaDs->htLdpcCapable; |
| 2491 | pAddStaParams->vhtLdpcCapable = pStaDs->vhtLdpcCapable; |
| 2492 | } |
Gopichand Nakkala | b2d2c31 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 2493 | } |
| 2494 | else if( STA_ENTRY_SELF == pStaDs->staType) |
| 2495 | { |
| 2496 | /* For Self STA get the LDPC capability from config.ini*/ |
| 2497 | pAddStaParams->htLdpcCapable = |
| 2498 | (psessionEntry->txLdpcIniFeatureEnabled & 0x01); |
| 2499 | pAddStaParams->vhtLdpcCapable = |
| 2500 | ((psessionEntry->txLdpcIniFeatureEnabled >> 1)& 0x01); |
| 2501 | } |
| 2502 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2503 | /* Update PE session ID*/ |
| 2504 | pAddStaParams->sessionId = psessionEntry->peSessionId; |
| 2505 | |
| 2506 | if (psessionEntry->parsedAssocReq != NULL) |
| 2507 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2508 | // Get a copy of the already parsed Assoc Request |
| 2509 | pAssocReq = (tpSirAssocReq) psessionEntry->parsedAssocReq[pStaDs->assocId]; |
| 2510 | if ( pAssocReq && pAssocReq->addIEPresent && pAssocReq->addIE.length ) { |
| 2511 | p2pIe = limGetP2pIEPtr(pMac, pAssocReq->addIE.addIEdata, pAssocReq->addIE.length); |
| 2512 | } |
| 2513 | pAddStaParams->p2pCapableSta = (p2pIe != NULL); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2514 | } |
| 2515 | |
| 2516 | //Disable BA. It will be set as part of ADDBA negotiation. |
| 2517 | for( i = 0; i < STACFG_MAX_TC; i++ ) |
| 2518 | { |
| 2519 | pAddStaParams->staTCParams[i].txUseBA = eBA_DISABLE; |
| 2520 | pAddStaParams->staTCParams[i].rxUseBA = eBA_DISABLE; |
| 2521 | } |
| 2522 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2523 | #ifdef FEATURE_WLAN_TDLS |
| 2524 | if(pStaDs->wmeEnabled && \ |
| 2525 | ((eLIM_AP_ROLE == psessionEntry->limSystemRole) || (STA_ENTRY_TDLS_PEER == pStaDs->staType)) ) |
| 2526 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2527 | if(pStaDs->wmeEnabled && (eLIM_AP_ROLE == psessionEntry->limSystemRole)) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2528 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2529 | { |
| 2530 | pAddStaParams->uAPSD = 0; |
| 2531 | /* update UAPSD and send it to LIM to add STA */ |
| 2532 | // bitmap MSB <- LSB MSB 4 bits are for |
| 2533 | // trigger enabled AC setting and LSB 4 bits |
| 2534 | // are for delivery enabled AC setting |
| 2535 | // 7 6 5 4 3 2 1 0 |
| 2536 | // BE BK VI VO BE BK VI VO |
| 2537 | pAddStaParams->uAPSD |= pStaDs->qos.capability.qosInfo.acvo_uapsd; |
| 2538 | pAddStaParams->uAPSD |= (pStaDs->qos.capability.qosInfo.acvi_uapsd << 1); |
| 2539 | pAddStaParams->uAPSD |= (pStaDs->qos.capability.qosInfo.acbk_uapsd << 2); |
| 2540 | pAddStaParams->uAPSD |= (pStaDs->qos.capability.qosInfo.acbe_uapsd << 3); |
| 2541 | //making delivery enabled and trigger enabled setting the same. |
| 2542 | pAddStaParams->uAPSD |= pAddStaParams->uAPSD << 4; |
| 2543 | |
| 2544 | pAddStaParams->maxSPLen = pStaDs->qos.capability.qosInfo.maxSpLen; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2545 | limLog( pMac, LOG1, FL("uAPSD = 0x%x, maxSpLen = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2546 | pAddStaParams->uAPSD, pAddStaParams->maxSPLen); |
| 2547 | } |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 2548 | |
| 2549 | #ifdef WLAN_FEATURE_11W |
| 2550 | pAddStaParams->rmfEnabled = pStaDs->rmfEnabled; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2551 | limLog( pMac, LOG1, FL( "PMF enabled %d"), pAddStaParams->rmfEnabled); |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 2552 | #endif |
| 2553 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2554 | limLog(pMac, LOG2, FL("htLdpcCapable: %d vhtLdpcCapable: %d " |
| 2555 | "p2pCapableSta: %d"), pAddStaParams->htLdpcCapable, |
| 2556 | pAddStaParams->vhtLdpcCapable, pAddStaParams->p2pCapableSta); |
| 2557 | |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 2558 | //we need to defer the message until we get the response back from HAL. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2559 | if (pAddStaParams->respReqd) |
| 2560 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2561 | |
| 2562 | msgQ.type = WDA_ADD_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2563 | |
| 2564 | msgQ.reserved = 0; |
| 2565 | msgQ.bodyptr = pAddStaParams; |
| 2566 | msgQ.bodyval = 0; |
| 2567 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2568 | limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_STA_REQ for assocId %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2569 | pStaDs->assocId); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2570 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2571 | |
| 2572 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
| 2573 | if( eSIR_SUCCESS != retCode) |
| 2574 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2575 | if (pAddStaParams->respReqd) |
| 2576 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2577 | limLog( pMac, LOGE, FL("ADD_STA_REQ for aId %d failed (reason %X)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2578 | pStaDs->assocId, retCode ); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2579 | vos_mem_free(pAddStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2580 | } |
| 2581 | |
| 2582 | return retCode; |
| 2583 | } |
| 2584 | |
| 2585 | |
| 2586 | /** |
| 2587 | * limDelSta() |
| 2588 | * |
| 2589 | *FUNCTION: |
| 2590 | * This function is called to delete an STA context at hardware |
| 2591 | * whenever a STA is disassociated |
| 2592 | * |
| 2593 | *LOGIC: |
| 2594 | * |
| 2595 | *ASSUMPTIONS: |
| 2596 | * NA |
| 2597 | * |
| 2598 | *NOTE: |
| 2599 | * NA |
| 2600 | * |
| 2601 | * @param pMac - Pointer to Global MAC structure |
| 2602 | * @param pStaDs - Pointer to the STA datastructure created by |
| 2603 | * LIM and maintained by DPH |
| 2604 | * @param fRespReqd - flag to indicate whether the delete is synchronous (true) |
| 2605 | * or not (false) |
| 2606 | * @return retCode - Indicates success or failure return code |
| 2607 | */ |
| 2608 | |
| 2609 | tSirRetStatus |
| 2610 | limDelSta( |
| 2611 | tpAniSirGlobal pMac, |
| 2612 | tpDphHashNode pStaDs, |
| 2613 | tANI_BOOLEAN fRespReqd, |
| 2614 | tpPESession psessionEntry) |
| 2615 | { |
| 2616 | tpDeleteStaParams pDelStaParams = NULL; |
| 2617 | tSirMsgQ msgQ; |
| 2618 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 2619 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2620 | pDelStaParams = vos_mem_malloc(sizeof( tDeleteStaParams )); |
| 2621 | if (NULL == pDelStaParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2622 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2623 | limLog( pMac, LOGP, FL( "Unable to allocate memory during ADD_STA" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2624 | return eSIR_MEM_ALLOC_FAILED; |
| 2625 | } |
| 2626 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2627 | vos_mem_set((tANI_U8 *) pDelStaParams, sizeof(tDeleteStaParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2628 | |
| 2629 | // |
| 2630 | // DPH contains the STA index only for "peer" STA entries. |
| 2631 | // LIM global contains "self" STA index |
| 2632 | // Thus, |
| 2633 | // if( STA role ) |
| 2634 | // get STA index from LIM global |
| 2635 | // else |
| 2636 | // get STA index from DPH |
| 2637 | // |
| 2638 | |
| 2639 | #if 0 |
| 2640 | /* Since we have not created any STA, no need to send msg to delete |
| 2641 | * STA to HAL */ |
| 2642 | if (psessionEntry->limSmeState == eLIM_SME_JOIN_FAILURE_STATE) { |
| 2643 | pDelStaParams->staIdx = 1; /* TODO : This is workaround. Need to find right STA Index before sending to HAL */ |
| 2644 | //return retCode; |
| 2645 | } |
| 2646 | #endif |
| 2647 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2648 | #ifdef FEATURE_WLAN_TDLS |
| 2649 | if( ((eLIM_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) && (pStaDs->staType != STA_ENTRY_TDLS_PEER)) ||(eLIM_BT_AMP_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) ) |
| 2650 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2651 | if( (eLIM_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) ||(eLIM_BT_AMP_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) ) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2652 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2653 | pDelStaParams->staIdx= psessionEntry->staId; |
| 2654 | |
| 2655 | else |
| 2656 | pDelStaParams->staIdx= pStaDs->staIndex; |
| 2657 | |
| 2658 | pDelStaParams->assocId = pStaDs->assocId; |
| 2659 | pStaDs->valid = 0; |
| 2660 | |
| 2661 | if (! fRespReqd) |
| 2662 | pDelStaParams->respReqd = 0; |
| 2663 | else |
| 2664 | { |
| 2665 | //when limDelSta is called from processSmeAssocCnf then mlmState is already set properly. |
| 2666 | if(eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE != GET_LIM_STA_CONTEXT_MLM_STATE(pStaDs)) |
| 2667 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2668 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_DEL_STA_RSP_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2669 | SET_LIM_STA_CONTEXT_MLM_STATE(pStaDs, eLIM_MLM_WT_DEL_STA_RSP_STATE); |
| 2670 | } |
| 2671 | if ( (eLIM_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) || |
| 2672 | (eLIM_BT_AMP_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) ) |
| 2673 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2674 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_DEL_STA_RSP_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2675 | |
| 2676 | psessionEntry->limMlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE; |
| 2677 | |
| 2678 | } |
| 2679 | pDelStaParams->respReqd = 1; |
| 2680 | //we need to defer the message until we get the response back from HAL. |
| 2681 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
| 2682 | } |
| 2683 | |
| 2684 | /* Update PE session ID*/ |
| 2685 | pDelStaParams->sessionId = psessionEntry->peSessionId; |
| 2686 | |
| 2687 | pDelStaParams->status = eHAL_STATUS_SUCCESS; |
| 2688 | msgQ.type = WDA_DELETE_STA_REQ; |
| 2689 | msgQ.reserved = 0; |
| 2690 | msgQ.bodyptr = pDelStaParams; |
| 2691 | msgQ.bodyval = 0; |
| 2692 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2693 | limLog( pMac, LOG1, FL( "Sessionid %d :Sending SIR_HAL_DELETE_STA_REQ " |
| 2694 | "for STAID: %X and AssocID: %d MAC : "MAC_ADDRESS_STR ), |
| 2695 | pDelStaParams->sessionId, |
| 2696 | pDelStaParams->staIdx, pDelStaParams->assocId, |
| 2697 | MAC_ADDR_ARRAY(pStaDs->staAddr)); |
| 2698 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2699 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2700 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
| 2701 | if( eSIR_SUCCESS != retCode) |
| 2702 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2703 | if(fRespReqd) |
| 2704 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2705 | limLog( pMac, LOGE, FL("Posting DELETE_STA_REQ to HAL failed, reason=%X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2706 | retCode ); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2707 | vos_mem_free(pDelStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2708 | } |
| 2709 | |
| 2710 | return retCode; |
| 2711 | } |
| 2712 | |
| 2713 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2714 | /*------------------------------------------------------------------------ |
| 2715 | * limAddFTStaSelf() |
| 2716 | * |
| 2717 | * FUNCTION: |
| 2718 | * |
| 2719 | * This function is called to add a STA once we have connected with a new |
| 2720 | * AP, that we have performed an FT to. |
| 2721 | * |
| 2722 | * The Add STA Response is created and now after the ADD Bss Is Successful |
| 2723 | * we add the self sta. We update with the association id from the reassoc |
| 2724 | * response from the AP. |
| 2725 | *------------------------------------------------------------------------ |
| 2726 | */ |
| 2727 | tSirRetStatus limAddFTStaSelf(tpAniSirGlobal pMac, tANI_U16 assocId, tpPESession psessionEntry) |
| 2728 | { |
| 2729 | tpAddStaParams pAddStaParams = NULL; |
| 2730 | tSirMsgQ msgQ; |
| 2731 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 2732 | |
| 2733 | pAddStaParams = pMac->ft.ftPEContext.pAddStaReq; |
| 2734 | pAddStaParams->assocId = assocId; |
| 2735 | |
| 2736 | msgQ.type = SIR_HAL_ADD_STA_REQ; |
| 2737 | msgQ.reserved = 0; |
| 2738 | msgQ.bodyptr = pAddStaParams; |
| 2739 | msgQ.bodyval = 0; |
| 2740 | |
| 2741 | |
| 2742 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2743 | limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_STA_REQ... (aid %d)" ), pAddStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2744 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2745 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2746 | |
| 2747 | psessionEntry->limPrevMlmState = psessionEntry->limMlmState; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 2748 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_ADD_STA_RSP_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2749 | psessionEntry->limMlmState = eLIM_MLM_WT_ADD_STA_RSP_STATE; |
| 2750 | if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) |
| 2751 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2752 | limLog( pMac, LOGE, FL("Posting ADD_STA_REQ to HAL failed, reason=%X"), retCode ); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2753 | vos_mem_free(pAddStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2754 | } |
| 2755 | // |
| 2756 | // Dont need it any more |
| 2757 | pMac->ft.ftPEContext.pAddStaReq = NULL; |
| 2758 | return retCode; |
| 2759 | } |
| 2760 | |
| 2761 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 2762 | |
| 2763 | /** |
| 2764 | * limAddStaSelf() |
| 2765 | * |
| 2766 | *FUNCTION: |
| 2767 | * This function is called to add an STA context at hardware |
| 2768 | * whenever a STA is (Re) Associated. |
| 2769 | * |
| 2770 | *LOGIC: |
| 2771 | * |
| 2772 | *ASSUMPTIONS: |
| 2773 | * NA |
| 2774 | * |
| 2775 | *NOTE: |
| 2776 | * NA |
| 2777 | * |
| 2778 | * @param pMac - Pointer to Global MAC structure |
| 2779 | * @param pStaDs - Pointer to the STA datastructure created by |
| 2780 | * LIM and maintained by DPH |
| 2781 | * @return retCode - Indicates success or failure return code |
| 2782 | */ |
| 2783 | |
| 2784 | tSirRetStatus |
| 2785 | limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESession psessionEntry) |
| 2786 | { |
| 2787 | tpAddStaParams pAddStaParams = NULL; |
| 2788 | tSirMsgQ msgQ; |
| 2789 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 2790 | tSirMacAddr staMac; |
| 2791 | tANI_U32 listenInterval = WNI_CFG_LISTEN_INTERVAL_STADEF; |
krunal soni | 71343fb | 2013-09-16 16:16:26 -0700 | [diff] [blame] | 2792 | tANI_U32 shortGi20MhzSupport; |
| 2793 | tANI_U32 shortGi40MhzSupport; |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2794 | /*This self Sta dot 11 mode comes from the cfg and the expectation here is |
| 2795 | * that cfg carries the systemwide capability that device under |
| 2796 | * consideration can support. This capability gets plumbed into the cfg |
| 2797 | * cache at system initialization time via the .dat and .ini file override |
| 2798 | * mechanisms and will not change. If it does change, it is the |
| 2799 | * responsibility of SME to evict the selfSta and reissue a new AddStaSelf |
| 2800 | * command.*/ |
| 2801 | tANI_U32 selfStaDot11Mode=0, selfTxWidth=0; |
| 2802 | wlan_cfgGetInt(pMac,WNI_CFG_DOT11_MODE,&selfStaDot11Mode); |
| 2803 | limLog( pMac, LOG1, FL("cfgDot11Mode %d"),(int)selfStaDot11Mode); |
| 2804 | wlan_cfgGetInt(pMac,WNI_CFG_HT_CAP_INFO_SUPPORTED_CHAN_WIDTH_SET,&selfTxWidth); |
| 2805 | limLog( pMac, LOG1, FL("SGI 20 %d"),(int)selfTxWidth); |
| 2806 | limLog( pMac, LOG1, FL("Roam Channel Bonding Mode %d"),(int)pMac->roam.configParam.uCfgDot11Mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2807 | |
| 2808 | #if 0 |
| 2809 | retCode =wlan_cfgGetStr(pMac, WNI_CFG_STA_ID, staMac, &cfg); |
| 2810 | if (retCode != eSIR_SUCCESS) |
| 2811 | { |
| 2812 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2813 | limLog(pMac, LOGP, FL("could not retrieve STA MAC")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2814 | return retCode; |
| 2815 | } |
| 2816 | #endif //TO SUPPORT BT-AMP |
| 2817 | sirCopyMacAddr(staMac,psessionEntry->selfMacAddr); |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2818 | limLog(pMac, LOG1, FL(MAC_ADDRESS_STR": "),MAC_ADDR_ARRAY(staMac)); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2819 | pAddStaParams = vos_mem_malloc(sizeof(tAddStaParams)); |
| 2820 | if (NULL == pAddStaParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2821 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2822 | limLog( pMac, LOGP, FL( "Unable to allocate memory during ADD_STA" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2823 | return eSIR_MEM_ALLOC_FAILED; |
| 2824 | } |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2825 | vos_mem_set((tANI_U8 *) pAddStaParams, sizeof(tAddStaParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2826 | |
| 2827 | /// Add STA context at MAC HW (BMU, RHP & TFP) |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2828 | vos_mem_copy((tANI_U8 *) pAddStaParams->staMac, |
| 2829 | (tANI_U8 *) staMac, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2830 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 2831 | vos_mem_copy((tANI_U8 *) pAddStaParams->bssId, |
| 2832 | psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2833 | |
| 2834 | pAddStaParams->assocId = psessionEntry->limAID; |
| 2835 | pAddStaParams->staType = STA_ENTRY_SELF; |
| 2836 | pAddStaParams->status = eHAL_STATUS_SUCCESS; |
| 2837 | pAddStaParams->respReqd = 1; |
| 2838 | |
| 2839 | /* Update PE session ID */ |
| 2840 | pAddStaParams->sessionId = psessionEntry->peSessionId; |
| 2841 | |
| 2842 | // This will indicate HAL to "allocate" a new STA index |
| 2843 | pAddStaParams->staIdx = staIdx; |
| 2844 | pAddStaParams->updateSta = updateSta; |
| 2845 | |
| 2846 | pAddStaParams->shortPreambleSupported = psessionEntry->beaconParams.fShortPreamble; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2847 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2848 | #ifdef WLAN_FEATURE_11AC |
| 2849 | limPopulateOwnRateSet(pMac, &pAddStaParams->supportedRates, NULL, false,psessionEntry,NULL); |
| 2850 | #else |
| 2851 | limPopulateOwnRateSet(pMac, &pAddStaParams->supportedRates, NULL, false,psessionEntry); |
| 2852 | #endif |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2853 | // if( psessionEntry->htCapability)---> old check |
| 2854 | /*We used to check if the session is htCapable before setting the htCapable |
| 2855 | * flag. The check limited us from operating */ |
| 2856 | if ( IS_DOT11_MODE_HT(selfStaDot11Mode) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2857 | { |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2858 | pAddStaParams->htCapable = TRUE ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2859 | #ifdef DISABLE_GF_FOR_INTEROP |
| 2860 | /* |
| 2861 | * To resolve the interop problem with Broadcom AP, |
| 2862 | * where TQ STA could not pass traffic with GF enabled, |
| 2863 | * TQ STA will do Greenfield only with TQ AP, for |
| 2864 | * everybody else it will be turned off. |
| 2865 | */ |
| 2866 | if( (psessionEntry->pLimJoinReq != NULL) && (!psessionEntry->pLimJoinReq->bssDescription.aniIndicator)) |
| 2867 | { |
| 2868 | limLog( pMac, LOGE, FL(" Turning off Greenfield, when adding self entry")); |
| 2869 | pAddStaParams->greenFieldCapable = WNI_CFG_GREENFIELD_CAPABILITY_DISABLE; |
| 2870 | } |
| 2871 | else |
| 2872 | #endif |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2873 | { |
| 2874 | pAddStaParams->greenFieldCapable = limGetHTCapability( pMac, eHT_GREENFIELD, psessionEntry); |
| 2875 | pAddStaParams->txChannelWidthSet = |
| 2876 | pMac->roam.configParam.channelBondingMode5GHz; |
| 2877 | // pAddStaParams->txChannelWidthSet = limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, psessionEntry); |
| 2878 | pAddStaParams->mimoPS = limGetHTCapability( pMac, eHT_MIMO_POWER_SAVE, psessionEntry ); |
| 2879 | pAddStaParams->rifsMode = limGetHTCapability( pMac, eHT_RIFS_MODE, psessionEntry ); |
| 2880 | pAddStaParams->lsigTxopProtection = limGetHTCapability( pMac, eHT_LSIG_TXOP_PROTECTION, psessionEntry ); |
| 2881 | pAddStaParams->delBASupport = limGetHTCapability( pMac, eHT_DELAYED_BA, psessionEntry ); |
| 2882 | pAddStaParams->maxAmpduDensity = limGetHTCapability( pMac, eHT_MPDU_DENSITY, psessionEntry ); |
| 2883 | pAddStaParams->maxAmpduSize = limGetHTCapability(pMac, eHT_MAX_RX_AMPDU_FACTOR, psessionEntry); |
| 2884 | pAddStaParams->maxAmsduSize = limGetHTCapability( pMac, eHT_MAX_AMSDU_LENGTH, psessionEntry ); |
| 2885 | pAddStaParams->fDsssCckMode40Mhz = limGetHTCapability( pMac, eHT_DSSS_CCK_MODE_40MHZ, psessionEntry); |
krunal soni | 71343fb | 2013-09-16 16:16:26 -0700 | [diff] [blame] | 2886 | /* |
| 2887 | * We will read the gShortGI20Mhz from ini file, and if it is set |
| 2888 | * to 1 then we will tell Peer that we support 40Mhz short GI |
| 2889 | */ |
| 2890 | if (HAL_STATUS_SUCCESS(ccmCfgGetInt |
| 2891 | (pMac, WNI_CFG_SHORT_GI_20MHZ, |
| 2892 | &shortGi20MhzSupport))) |
| 2893 | { |
| 2894 | if (VOS_TRUE == shortGi20MhzSupport) |
| 2895 | { |
| 2896 | pAddStaParams->fShortGI20Mhz = |
| 2897 | WNI_CFG_SHORT_GI_20MHZ_STAMAX; |
| 2898 | //pAddStaParams->fShortGI20Mhz = |
| 2899 | //limGetHTCapability(pMac, eHT_SHORT_GI_20MHZ, |
| 2900 | // psessionEntry); |
| 2901 | } |
| 2902 | else |
| 2903 | { |
| 2904 | pAddStaParams->fShortGI20Mhz = VOS_FALSE; |
| 2905 | } |
| 2906 | } |
| 2907 | else |
| 2908 | { |
| 2909 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 20Mhz" |
| 2910 | "CFG,setting value to default"));) |
| 2911 | pAddStaParams->fShortGI20Mhz = WNI_CFG_SHORT_GI_20MHZ_STADEF; |
| 2912 | } |
| 2913 | |
| 2914 | /* |
| 2915 | * We will read the gShortGI40Mhz from ini file, and if it is set |
| 2916 | * to 1 then we will tell Peer that we support 40Mhz short GI |
| 2917 | */ |
| 2918 | if (HAL_STATUS_SUCCESS(ccmCfgGetInt |
| 2919 | (pMac, WNI_CFG_SHORT_GI_40MHZ, |
| 2920 | &shortGi40MhzSupport))) |
| 2921 | { |
| 2922 | if (VOS_TRUE == shortGi40MhzSupport) |
| 2923 | { |
| 2924 | pAddStaParams->fShortGI40Mhz = |
| 2925 | WNI_CFG_SHORT_GI_40MHZ_STAMAX; |
| 2926 | //pAddStaParams->fShortGI40Mhz = |
| 2927 | //limGetHTCapability(pMac, eHT_SHORT_GI_40MHZ, |
| 2928 | // psessionEntry); |
| 2929 | } |
| 2930 | else |
| 2931 | { |
| 2932 | pAddStaParams->fShortGI40Mhz = VOS_FALSE; |
| 2933 | } |
| 2934 | } |
| 2935 | else |
| 2936 | { |
| 2937 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 40Mhz" |
| 2938 | "CFG,setting value to default"));) |
| 2939 | pAddStaParams->fShortGI40Mhz = WNI_CFG_SHORT_GI_40MHZ_STADEF; |
| 2940 | } |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2941 | limLog(pMac, LOG2, FL(" greenFieldCapable: %d maxAmpduDensity = %d " |
| 2942 | "maxAmpduSize = %d"), pAddStaParams->greenFieldCapable, |
| 2943 | pAddStaParams->maxAmpduDensity, pAddStaParams->maxAmpduSize); |
| 2944 | |
| 2945 | limLog(pMac, LOG2, FL("fDsssCckMode40Mhz: %d fShortGI20Mhz: %d " |
| 2946 | "fShortGI40Mhz: %d lsigTxopProtection: %d"), |
| 2947 | pAddStaParams->fDsssCckMode40Mhz, pAddStaParams->fShortGI20Mhz, |
| 2948 | pAddStaParams->fShortGI40Mhz, pAddStaParams->lsigTxopProtection); |
| 2949 | |
| 2950 | limLog(pMac, LOG2, FL(" maxAmsduSize: %d txChannelWidthSet: %d " |
| 2951 | "mimoPS: %d rifsMode %d delBASupport %d"), |
| 2952 | pAddStaParams->maxAmsduSize, |
| 2953 | pAddStaParams->txChannelWidthSet, pAddStaParams->mimoPS, |
| 2954 | pAddStaParams->rifsMode, pAddStaParams->delBASupport ); |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2955 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2956 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2957 | #ifdef WLAN_FEATURE_11AC |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2958 | pAddStaParams->vhtCapable = IS_DOT11_MODE_VHT(selfStaDot11Mode); |
| 2959 | if (pAddStaParams->vhtCapable){ |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 2960 | pAddStaParams->vhtTxChannelWidthSet = psessionEntry->vhtTxChannelWidthSet; |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2961 | limLog( pMac, LOG1, FL("VHT WIDTH SET %d"),pAddStaParams->vhtTxChannelWidthSet); |
| 2962 | } |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 2963 | pAddStaParams->vhtTxBFCapable = psessionEntry->txBFIniFeatureEnabled; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2964 | limLog(pMac, LOG2, FL("vhtCapable: %d vhtTxBFCapable %d "), |
| 2965 | pAddStaParams->vhtCapable, pAddStaParams->vhtTxBFCapable); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2966 | #endif |
Gopichand Nakkala | b2d2c31 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 2967 | |
| 2968 | /* For Self STA get the LDPC capability from session i.e config.ini*/ |
| 2969 | pAddStaParams->htLdpcCapable = |
| 2970 | (psessionEntry->txLdpcIniFeatureEnabled & 0x01); |
| 2971 | pAddStaParams->vhtLdpcCapable = |
| 2972 | ((psessionEntry->txLdpcIniFeatureEnabled >> 1)& 0x01); |
| 2973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2974 | if(wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &listenInterval) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2975 | limLog(pMac, LOGP, FL("Couldn't get LISTEN_INTERVAL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2976 | pAddStaParams->listenInterval = (tANI_U16)listenInterval; |
| 2977 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2978 | if (VOS_P2P_CLIENT_MODE == psessionEntry->pePersona) |
| 2979 | { |
| 2980 | pAddStaParams->p2pCapableSta = 1; |
| 2981 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2982 | |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2983 | //limFillSupportedRatesInfo(pMac, NULL, &pAddStaParams->supportedRates,psessionEntry); |
| 2984 | pAddStaParams->supportedRates.opRateMode = limGetStaRateMode((tANI_U8)selfStaDot11Mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2985 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 2986 | limLog(pMac, LOG2, FL(" StaIdx: %d updateSta = %d htcapable = %d "), |
| 2987 | pAddStaParams->staIdx,pAddStaParams->updateSta, |
| 2988 | pAddStaParams->htCapable); |
| 2989 | |
| 2990 | limLog(pMac, LOG2, FL("htLdpcCapable: %d vhtLdpcCapable: %d " |
| 2991 | "p2pCapableSta: %d"), |
| 2992 | pAddStaParams->htLdpcCapable,pAddStaParams->vhtLdpcCapable, |
| 2993 | pAddStaParams->p2pCapableSta); |
| 2994 | |
| 2995 | limLog(pMac, LOG2, FL(" sessionid: %d Assoc ID: %d listenInterval = %d" |
| 2996 | " shortPreambleSupported: %d "), psessionEntry->smeSessionId, |
| 2997 | pAddStaParams->assocId, pAddStaParams->listenInterval, |
| 2998 | pAddStaParams->shortPreambleSupported); |
| 2999 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3000 | msgQ.type = WDA_ADD_STA_REQ; |
| 3001 | // |
| 3002 | // FIXME_GEN4 |
| 3003 | // A global counter (dialog token) is required to keep track of |
| 3004 | // all PE <-> HAL communication(s) |
| 3005 | // |
| 3006 | msgQ.reserved = 0; |
| 3007 | msgQ.bodyptr = pAddStaParams; |
| 3008 | msgQ.bodyval = 0; |
| 3009 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3010 | limLog( pMac, LOGW, FL(MAC_ADDRESS_STR":Sessionid %d : " |
| 3011 | "Sending SIR_HAL_ADD_STA_REQ... (aid %d)" ), |
| 3012 | MAC_ADDR_ARRAY(pAddStaParams->staMac), |
| 3013 | pAddStaParams->sessionId, |
| 3014 | pAddStaParams->assocId); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3015 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3016 | |
| 3017 | if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) |
| 3018 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3019 | limLog( pMac, LOGE, FL("Posting ADD_STA_REQ to HAL failed, reason=%X"), retCode ); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3020 | vos_mem_free(pAddStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3021 | } |
| 3022 | return retCode; |
| 3023 | } |
| 3024 | |
| 3025 | |
| 3026 | /** |
| 3027 | * limTeardownInfraBSS() |
| 3028 | * |
| 3029 | *FUNCTION: |
| 3030 | * This function is called by various LIM functions to teardown |
| 3031 | * an established Infrastructure BSS |
| 3032 | * |
| 3033 | *LOGIC: |
| 3034 | * |
| 3035 | *ASSUMPTIONS: |
| 3036 | * |
| 3037 | *NOTE: |
| 3038 | * |
| 3039 | * @param pMac - Pointer to Global MAC structure |
| 3040 | * @return None |
| 3041 | */ |
| 3042 | |
| 3043 | void |
| 3044 | limTeardownInfraBss(tpAniSirGlobal pMac,tpPESession psessionEntry) |
| 3045 | { |
| 3046 | tSirMacAddr bcAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
| 3047 | |
| 3048 | /** |
| 3049 | * Send Broadcast Disassociate frame with |
| 3050 | * 'leaving BSS' reason. |
| 3051 | */ |
| 3052 | limSendDisassocMgmtFrame(pMac, |
| 3053 | eSIR_MAC_DISASSOC_LEAVING_BSS_REASON, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3054 | bcAddr,psessionEntry, FALSE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3055 | } /*** end limTeardownInfraBss() ***/ |
| 3056 | |
| 3057 | |
| 3058 | /** |
| 3059 | * limHandleCnfWaitTimeout() |
| 3060 | * |
| 3061 | *FUNCTION: |
| 3062 | * This function is called by limProcessMessageQueue to handle |
| 3063 | * various confirmation failure cases. |
| 3064 | * |
| 3065 | *LOGIC: |
| 3066 | * |
| 3067 | *ASSUMPTIONS: |
| 3068 | * |
| 3069 | *NOTE: |
| 3070 | * |
| 3071 | * @param pMac - Pointer to Global MAC structure |
| 3072 | * @param pStaDs - Pointer to a sta descriptor |
| 3073 | * @return None |
| 3074 | */ |
| 3075 | |
| 3076 | void limHandleCnfWaitTimeout(tpAniSirGlobal pMac, tANI_U16 staId) |
| 3077 | { |
| 3078 | tpDphHashNode pStaDs; |
| 3079 | tLimSystemRole systemRole; |
| 3080 | tpPESession psessionEntry = NULL; |
| 3081 | |
| 3082 | if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId))== NULL) |
| 3083 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3084 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3085 | return; |
| 3086 | } |
| 3087 | systemRole = limGetSystemRole(psessionEntry); |
| 3088 | pStaDs = dphGetHashEntry(pMac, staId, &psessionEntry->dph.dphHashTable); |
| 3089 | |
| 3090 | if (pStaDs == NULL) |
| 3091 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3092 | PELOGW(limLog(pMac, LOGW, FL("No STA context in SIR_LIM_CNF_WAIT_TIMEOUT."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3093 | return; |
| 3094 | } |
| 3095 | |
| 3096 | switch (pStaDs->mlmStaContext.mlmState) { |
| 3097 | case eLIM_MLM_WT_ASSOC_CNF_STATE: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3098 | PELOGW(limLog(pMac, LOGW, FL("Did not receive Assoc Cnf in eLIM_MLM_WT_ASSOC_CNF_STATE sta Assoc id %d"), pStaDs->assocId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3099 | limPrintMacAddr(pMac, pStaDs->staAddr, LOGW); |
| 3100 | |
| 3101 | if ( (systemRole == eLIM_AP_ROLE)|| (systemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 3102 | { |
| 3103 | limRejectAssociation( |
| 3104 | pMac, |
| 3105 | pStaDs->staAddr, |
| 3106 | pStaDs->mlmStaContext.subType, |
| 3107 | true, |
| 3108 | pStaDs->mlmStaContext.authType, |
| 3109 | pStaDs->assocId, |
| 3110 | true, |
| 3111 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 3112 | psessionEntry); |
| 3113 | } |
| 3114 | break; |
| 3115 | |
| 3116 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3117 | limLog(pMac, LOGW, FL("Received CNF_WAIT_TIMEOUT in state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3118 | pStaDs->mlmStaContext.mlmState); |
| 3119 | } |
| 3120 | } |
| 3121 | |
| 3122 | |
| 3123 | /** |
| 3124 | * limDeleteDphHashEntry() |
| 3125 | * |
| 3126 | *FUNCTION: |
| 3127 | * This function is called whenever we need to delete |
| 3128 | * the dph hash entry |
| 3129 | * |
| 3130 | *LOGIC: |
| 3131 | * |
| 3132 | *ASSUMPTIONS: |
| 3133 | * |
| 3134 | *NOTE: |
| 3135 | * |
| 3136 | * @param pMac Pointer to Global MAC structure |
| 3137 | * @param tANI_U16 staId |
| 3138 | * @return None |
| 3139 | */ |
| 3140 | |
| 3141 | void |
| 3142 | limDeleteDphHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_U16 staId,tpPESession psessionEntry) |
| 3143 | { |
| 3144 | tANI_U16 aid; |
| 3145 | tpDphHashNode pStaDs; |
| 3146 | tUpdateBeaconParams beaconParams; |
| 3147 | tLimSystemRole systemRole; |
| 3148 | |
Kaushik, Sushant | fb15673 | 2014-01-07 15:36:03 +0530 | [diff] [blame] | 3149 | vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3150 | beaconParams.paramChangeBitmap = 0; |
| 3151 | limDeactivateAndChangePerStaIdTimer(pMac, eLIM_CNF_WAIT_TIMER, staId); |
| 3152 | if (NULL == psessionEntry) |
| 3153 | { |
| 3154 | PELOGE(limLog(pMac, LOGE, FL("NULL psessionEntry"));) |
| 3155 | return; |
| 3156 | } |
| 3157 | systemRole = limGetSystemRole(psessionEntry); |
| 3158 | beaconParams.bssIdx = psessionEntry->bssIdx; |
| 3159 | pStaDs = dphLookupHashEntry(pMac, staAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 3160 | if (pStaDs != NULL) |
| 3161 | { |
| 3162 | PELOGW(limLog(pMac, LOGW, FL("Deleting DPH Hash entry for STAID: %X\n "), staId);) |
| 3163 | // update the station count and perform associated actions |
| 3164 | // do this before deleting the dph hash entry |
| 3165 | limUtilCountStaDel(pMac, pStaDs, psessionEntry); |
| 3166 | |
| 3167 | if((eLIM_AP_ROLE == psessionEntry->limSystemRole) || |
| 3168 | (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole)) |
| 3169 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3170 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE ){ |
| 3171 | if(psessionEntry->gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE){ |
| 3172 | limDecideApProtectionOnDelete(pMac, pStaDs, &beaconParams,psessionEntry); |
| 3173 | } |
| 3174 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3175 | |
| 3176 | if(eLIM_STA_IN_IBSS_ROLE == systemRole) |
| 3177 | limIbssDecideProtectionOnDelete(pMac, pStaDs, &beaconParams, psessionEntry); |
| 3178 | |
| 3179 | limDecideShortPreamble(pMac, pStaDs, &beaconParams, psessionEntry); |
| 3180 | limDecideShortSlot(pMac, pStaDs, &beaconParams, psessionEntry); |
| 3181 | |
| 3182 | //Send message to HAL about beacon parameter change. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3183 | PELOGW(limLog(pMac, LOGW, FL("param bitmap = %d "), beaconParams.paramChangeBitmap);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3184 | if(beaconParams.paramChangeBitmap) |
| 3185 | { |
| 3186 | schSetFixedBeaconFields(pMac,psessionEntry); |
| 3187 | limSendBeaconParams(pMac, &beaconParams, psessionEntry ); |
| 3188 | } |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame^] | 3189 | |
| 3190 | #ifdef WLAN_FEATURE_11W |
| 3191 | tx_timer_delete(&pStaDs->pmfSaQueryTimer); |
| 3192 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3193 | } |
| 3194 | if (dphDeleteHashEntry(pMac, staAddr, staId, &psessionEntry->dph.dphHashTable) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3195 | limLog(pMac, LOGP, FL("error deleting hash entry")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3196 | } |
| 3197 | } |
| 3198 | |
| 3199 | |
| 3200 | |
| 3201 | /** |
| 3202 | * limCheckAndAnnounceJoinSuccess() |
| 3203 | * |
| 3204 | *FUNCTION: |
| 3205 | * This function is called upon receiving Beacon/Probe Response |
| 3206 | * frame in WT_JOIN_BEACON_STATE to check if the received |
| 3207 | * Beacon/Probe Response is from the BSS that we're attempting |
| 3208 | * to join. |
| 3209 | * |
| 3210 | *LOGIC: |
| 3211 | * If the Beacon/Probe Response is indeed from the BSS we're |
| 3212 | * attempting to join, join success is sent to SME. |
| 3213 | * |
| 3214 | *ASSUMPTIONS: |
| 3215 | * |
| 3216 | *NOTE: |
| 3217 | * |
| 3218 | * @param pMac Pointer to Global MAC structure |
| 3219 | * @param pBPR Pointer to received Beacon/Probe Response |
| 3220 | * @param pHdr Pointer to received Beacon/Probe Response |
| 3221 | * MAC header |
| 3222 | * @return None |
| 3223 | */ |
| 3224 | |
| 3225 | void |
| 3226 | limCheckAndAnnounceJoinSuccess(tpAniSirGlobal pMac, |
| 3227 | tSirProbeRespBeacon *pBPR, |
| 3228 | tpSirMacMgmtHdr pHdr,tpPESession psessionEntry) |
| 3229 | { |
| 3230 | tSirMacSSid currentSSID; |
| 3231 | tLimMlmJoinCnf mlmJoinCnf; |
Madan Mohan Koyyalamudi | 666d33a | 2012-11-29 11:32:59 -0800 | [diff] [blame] | 3232 | tANI_U32 val = 0; |
| 3233 | tANI_U32 *noa1DurationFromBcn = NULL; |
| 3234 | tANI_U32 *noa2DurationFromBcn = NULL; |
| 3235 | tANI_U32 noa; |
| 3236 | tANI_U32 TotalNum_NoADesc = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3237 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3238 | vos_mem_copy(currentSSID.ssId, |
| 3239 | psessionEntry->ssId.ssId, |
| 3240 | psessionEntry->ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3241 | |
| 3242 | currentSSID.length = (tANI_U8)psessionEntry->ssId.length ; |
| 3243 | |
| 3244 | if ( |
| 3245 | /* Check for SSID only in probe response. Beacons may not carry |
| 3246 | SSID information in hidden SSID case */ |
| 3247 | ( (SIR_MAC_MGMT_FRAME == pHdr->fc.type) && |
| 3248 | (SIR_MAC_MGMT_PROBE_RSP == pHdr->fc.subType) ) && |
| 3249 | currentSSID.length && |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3250 | (!vos_mem_compare((tANI_U8 *) &pBPR->ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3251 | (tANI_U8 *) ¤tSSID, |
| 3252 | (tANI_U8) (1 + currentSSID.length)) )) |
| 3253 | { |
| 3254 | /** |
| 3255 | * Received SSID does not match with the one we've. |
| 3256 | * Ignore received Beacon frame |
| 3257 | */ |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3258 | PELOG1(limLog(pMac, LOG1, FL("SSID received in Beacon does not match"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3259 | #ifdef WLAN_DEBUG |
| 3260 | pMac->lim.gLimBcnSSIDMismatchCnt++; |
| 3261 | #endif |
| 3262 | return; |
| 3263 | } |
| 3264 | |
| 3265 | if( (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_STA_ROLE)) |
| 3266 | { |
Nirav Shah | bc35fb7 | 2013-12-12 18:14:06 +0530 | [diff] [blame] | 3267 | limLog(pMac, LOG1, FL("Received Beacon/PR with matching BSSID" |
| 3268 | MAC_ADDRESS_STR "PESessionID %d"), |
| 3269 | MAC_ADDR_ARRAY(psessionEntry->bssId), |
| 3270 | psessionEntry->peSessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3271 | // Deactivate Join Failure timer |
| 3272 | limDeactivateAndChangeTimer(pMac, eLIM_JOIN_FAIL_TIMER); |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 3273 | // Deactivate Periodic Join timer |
| 3274 | limDeactivateAndChangeTimer(pMac, eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3275 | |
Madan Mohan Koyyalamudi | 666d33a | 2012-11-29 11:32:59 -0800 | [diff] [blame] | 3276 | if (VOS_P2P_CLIENT_MODE == psessionEntry->pePersona && |
| 3277 | pBPR->P2PProbeRes.NoticeOfAbsence.present) |
| 3278 | { |
| 3279 | |
| 3280 | noa1DurationFromBcn = (tANI_U32*)(pBPR->P2PProbeRes.NoticeOfAbsence.NoADesc + 1); |
| 3281 | |
| 3282 | if(pBPR->P2PProbeRes.NoticeOfAbsence.num_NoADesc) |
| 3283 | TotalNum_NoADesc = pBPR->P2PProbeRes.NoticeOfAbsence.num_NoADesc/SIZE_OF_NOA_DESCRIPTOR; |
| 3284 | |
| 3285 | noa = *noa1DurationFromBcn; |
| 3286 | |
| 3287 | if(TotalNum_NoADesc > 1) |
| 3288 | { |
| 3289 | noa2DurationFromBcn = (tANI_U32*)(pBPR->P2PProbeRes.NoticeOfAbsence.NoADesc + SIZE_OF_NOA_DESCRIPTOR + 1); |
| 3290 | noa += *noa2DurationFromBcn; |
| 3291 | } |
| 3292 | |
| 3293 | /*If MAX Noa exceeds 3 secs we will consider only 3 secs to |
| 3294 | * avoid arbitary values in noa duration field |
| 3295 | */ |
| 3296 | noa = noa > MAX_NOA_PERIOD_IN_MICROSECS ? MAX_NOA_PERIOD_IN_MICROSECS : noa; |
| 3297 | noa = noa/1000; //Convert to ms |
| 3298 | |
| 3299 | if( wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,&val) == eSIR_SUCCESS ) |
| 3300 | { |
| 3301 | psessionEntry->defaultAuthFailureTimeout = val; |
| 3302 | ccmCfgSetInt(pMac,WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT ,val + noa, NULL, eANI_BOOLEAN_FALSE); |
| 3303 | } |
| 3304 | } |
| 3305 | else |
| 3306 | { |
| 3307 | psessionEntry->defaultAuthFailureTimeout = 0; |
| 3308 | } |
Madan Mohan Koyyalamudi | 666d33a | 2012-11-29 11:32:59 -0800 | [diff] [blame] | 3309 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3310 | // Update Beacon Interval at CFG database |
| 3311 | |
| 3312 | if ( pBPR->HTCaps.present ) |
| 3313 | limUpdateStaRunTimeHTCapability( pMac, &pBPR->HTCaps ); |
| 3314 | if ( pBPR->HTInfo.present ) |
| 3315 | limUpdateStaRunTimeHTInfo( pMac, &pBPR->HTInfo, psessionEntry); |
| 3316 | psessionEntry->limMlmState = eLIM_MLM_JOINED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3317 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_JOINED_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3318 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3319 | |
| 3320 | /** |
| 3321 | * Announce join success by sending |
| 3322 | * Join confirm to SME. |
| 3323 | */ |
| 3324 | mlmJoinCnf.resultCode = eSIR_SME_SUCCESS; |
| 3325 | mlmJoinCnf.protStatusCode = eSIR_MAC_SUCCESS_STATUS; |
| 3326 | /* Update PE sessionId*/ |
| 3327 | mlmJoinCnf.sessionId = psessionEntry->peSessionId; |
| 3328 | limPostSmeMessage(pMac, LIM_MLM_JOIN_CNF, (tANI_U32 *) &mlmJoinCnf); |
| 3329 | } // if ((pMac->lim.gLimSystemRole == IBSS.... |
| 3330 | } |
| 3331 | |
| 3332 | /** |
| 3333 | * limExtractApCapabilities() |
| 3334 | * |
| 3335 | *FUNCTION: |
| 3336 | * This function is called to extract all of the AP's capabilities |
| 3337 | * from the IEs received from it in Beacon/Probe Response frames |
| 3338 | * |
| 3339 | *LOGIC: |
| 3340 | * This routine mimics the limExtractApCapability() API. The difference here |
| 3341 | * is that this API returns the entire tSirProbeRespBeacon info as is. It is |
| 3342 | * left to the caller of this API to use this info as required |
| 3343 | * |
| 3344 | *ASSUMPTIONS: |
| 3345 | * NA |
| 3346 | * |
| 3347 | *NOTE: |
| 3348 | * |
| 3349 | * @param pMac Pointer to Global MAC structure |
| 3350 | * @param pIE Pointer to starting IE in Beacon/Probe Response |
| 3351 | * @param ieLen Length of all IEs combined |
| 3352 | * @param beaconStruct A pointer to tSirProbeRespBeacon that needs to be |
| 3353 | * populated |
| 3354 | * @return status A status reporting eSIR_SUCCESS or eSIR_FAILURE |
| 3355 | */ |
| 3356 | tSirRetStatus limExtractApCapabilities( tpAniSirGlobal pMac, |
| 3357 | tANI_U8 *pIE, |
| 3358 | tANI_U16 ieLen, |
| 3359 | tpSirProbeRespBeacon beaconStruct ) |
| 3360 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3361 | vos_mem_set((tANI_U8 *) beaconStruct, sizeof( tSirProbeRespBeacon ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3362 | |
| 3363 | PELOG3(limLog( pMac, LOG3, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3364 | FL( "In limExtractApCapabilities: The IE's being received are:" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3365 | sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG3, pIE, ieLen );) |
| 3366 | |
| 3367 | // Parse the Beacon IE's, Don't try to parse if we dont have anything in IE |
| 3368 | if (ieLen > 0) { |
| 3369 | if( eSIR_SUCCESS != sirParseBeaconIE( pMac, beaconStruct, pIE, (tANI_U32)ieLen )) |
| 3370 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3371 | limLog( pMac, LOGE, FL("APCapExtract: Beacon parsing error!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3372 | return eSIR_FAILURE; |
| 3373 | } |
| 3374 | } |
| 3375 | |
| 3376 | return eSIR_SUCCESS; |
| 3377 | } |
| 3378 | |
| 3379 | |
| 3380 | /** |
| 3381 | * limDelBss() |
| 3382 | * |
| 3383 | *FUNCTION: |
| 3384 | * This function is called to delete BSS context at hardware |
| 3385 | * whenever a STA is disassociated |
| 3386 | * |
| 3387 | *LOGIC: |
| 3388 | * |
| 3389 | *ASSUMPTIONS: |
| 3390 | * NA |
| 3391 | * |
| 3392 | *NOTE: |
| 3393 | * NA |
| 3394 | * |
| 3395 | * @param pMac - Pointer to Global MAC structure |
| 3396 | * @param pStaDs - Pointer to the STA datastructure created by |
| 3397 | * LIM and maintained by DPH |
| 3398 | * @return retCode - Indicates success or failure return code |
| 3399 | */ |
| 3400 | |
| 3401 | tSirRetStatus |
| 3402 | limDelBss(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tANI_U16 bssIdx,tpPESession psessionEntry) |
| 3403 | { |
| 3404 | tpDeleteBssParams pDelBssParams = NULL; |
| 3405 | tSirMsgQ msgQ; |
| 3406 | tSirRetStatus retCode = eSIR_SUCCESS; |
| 3407 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3408 | pDelBssParams = vos_mem_malloc(sizeof(tDeleteBssParams)); |
| 3409 | if (NULL == pDelBssParams) |
| 3410 | { |
| 3411 | limLog( pMac, LOGP, FL( "Unable to allocate memory during ADD_BSS" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3412 | return eSIR_MEM_ALLOC_FAILED; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3413 | } |
| 3414 | vos_mem_set((tANI_U8 *) pDelBssParams, sizeof(tDeleteBssParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3415 | |
| 3416 | |
| 3417 | pDelBssParams->sessionId = psessionEntry->peSessionId; //update PE session Id |
| 3418 | |
| 3419 | //DPH was storing the AssocID in staID field, |
| 3420 | //staID is actually assigned by HAL when AddSTA message is sent. |
| 3421 | if (pStaDs != NULL) |
| 3422 | { |
| 3423 | pDelBssParams->bssIdx= pStaDs->bssId; |
| 3424 | pStaDs->valid = 0; |
| 3425 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_DEL_BSS_RSP_STATE; |
| 3426 | } |
| 3427 | else |
| 3428 | pDelBssParams->bssIdx = bssIdx; |
| 3429 | psessionEntry->limMlmState = eLIM_MLM_WT_DEL_BSS_RSP_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3430 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_DEL_BSS_RSP_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3431 | |
Srinivas Girigowda | 2a69dcf | 2013-09-13 14:48:34 -0700 | [diff] [blame] | 3432 | if((psessionEntry->peSessionId == pMac->lim.limTimers.gLimJoinFailureTimer.sessionId) && |
| 3433 | (VOS_TRUE == tx_timer_running(&pMac->lim.limTimers.gLimJoinFailureTimer))) |
| 3434 | { |
| 3435 | limDeactivateAndChangeTimer(pMac, eLIM_JOIN_FAIL_TIMER); |
| 3436 | } |
| 3437 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3438 | pDelBssParams->status= eHAL_STATUS_SUCCESS; |
| 3439 | pDelBssParams->respReqd = 1; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3440 | |
| 3441 | PELOGW(limLog( pMac, LOGW, FL("Sessionid %d : Sending HAL_DELETE_BSS_REQ " |
| 3442 | "for bss idx: %X BSSID:"MAC_ADDRESS_STR), pDelBssParams->sessionId, |
| 3443 | pDelBssParams->bssIdx, |
| 3444 | MAC_ADDR_ARRAY(psessionEntry->bssId));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3445 | |
| 3446 | //we need to defer the message until we get the response back from HAL. |
| 3447 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
| 3448 | |
| 3449 | msgQ.type = WDA_DELETE_BSS_REQ; |
| 3450 | msgQ.reserved = 0; |
| 3451 | msgQ.bodyptr = pDelBssParams; |
| 3452 | msgQ.bodyval = 0; |
| 3453 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3454 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3455 | |
| 3456 | if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) |
| 3457 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3458 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3459 | limLog( pMac, LOGE, FL("Posting DELETE_BSS_REQ to HAL failed, reason=%X"), retCode ); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3460 | vos_mem_free(pDelBssParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3461 | } |
| 3462 | |
| 3463 | return retCode; |
| 3464 | } |
| 3465 | |
| 3466 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3467 | |
| 3468 | /** |
| 3469 | * limSendAddBss() |
| 3470 | * |
| 3471 | *FUNCTION: |
| 3472 | * |
| 3473 | *LOGIC: |
| 3474 | * 1) LIM receives eWNI_SME_JOIN_REQ |
| 3475 | * 2) For a valid eWNI_SME_JOIN_REQ, LIM sends |
| 3476 | * SIR_HAL_ADD_BSS_REQ to HAL |
| 3477 | * |
| 3478 | *ASSUMPTIONS: |
| 3479 | * JOIN REQ parameters are saved in pMac->lim.gLimMlmJoinReq |
| 3480 | * ADD BSS parameters can be obtained from two sources: |
| 3481 | * 1) pMac->lim.gLimMlmJoinReq |
| 3482 | * 2) beaconStruct, passed as paramter |
| 3483 | * So, if a reqd parameter is found in bssDescriptions |
| 3484 | * then it is given preference over beaconStruct |
| 3485 | * |
| 3486 | *NOTE: |
| 3487 | * |
| 3488 | * @param pMac Pointer to Global MAC structure |
| 3489 | * pAssocRsp contains the structured assoc/reassoc Response got from AP |
| 3490 | * beaconstruct Has the ProbeRsp/Beacon structured details |
| 3491 | * bssDescription bssDescription passed to PE from the SME |
| 3492 | * @return None |
| 3493 | */ |
| 3494 | |
| 3495 | tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, |
| 3496 | tpSchBeaconStruct pBeaconStruct, tpSirBssDescription bssDescription, tANI_U8 updateEntry, |
| 3497 | tpPESession psessionEntry) |
| 3498 | |
| 3499 | { |
| 3500 | tSirMsgQ msgQ; |
| 3501 | tpAddBssParams pAddBssParams = NULL; |
| 3502 | tANI_U32 retCode; |
| 3503 | tANI_U8 i; |
| 3504 | tpDphHashNode pStaDs = NULL; |
| 3505 | tANI_U8 chanWidthSupp = 0; |
krunal soni | 71343fb | 2013-09-16 16:16:26 -0700 | [diff] [blame] | 3506 | tANI_U32 shortGi20MhzSupport; |
| 3507 | tANI_U32 shortGi40MhzSupport; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3508 | // Package SIR_HAL_ADD_BSS_REQ message parameters |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3509 | pAddBssParams = vos_mem_malloc(sizeof( tAddBssParams )); |
| 3510 | if (NULL == pAddBssParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3511 | { |
| 3512 | limLog( pMac, LOGP, |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3513 | FL( "Unable to allocate memory during ADD_BSS" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3514 | retCode = eSIR_MEM_ALLOC_FAILED; |
| 3515 | goto returnFailure; |
| 3516 | } |
| 3517 | else |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3518 | vos_mem_set((tANI_U8 *) pAddBssParams, sizeof( tAddBssParams ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3519 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3520 | vos_mem_copy(pAddBssParams->bssId,bssDescription->bssId, |
| 3521 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3522 | // Fill in tAddBssParams selfMacAddr |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3523 | vos_mem_copy(pAddBssParams->selfMacAddr, |
| 3524 | psessionEntry->selfMacAddr, |
| 3525 | sizeof(tSirMacAddr)); |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3526 | |
| 3527 | limLog(pMac, LOG1, FL("sessionid: %d updateEntry = %d limsystemrole = %d "), |
| 3528 | psessionEntry->smeSessionId,updateEntry,psessionEntry->limSystemRole); |
| 3529 | |
| 3530 | limLog(pMac, LOG1, FL("BSSID: "MAC_ADDRESS_STR), |
| 3531 | MAC_ADDR_ARRAY(pAddBssParams->bssId)); |
| 3532 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3533 | if(psessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 3534 | { |
| 3535 | pAddBssParams->bssType = eSIR_BTAMP_AP_MODE; |
| 3536 | } |
| 3537 | else |
| 3538 | { |
| 3539 | pAddBssParams->bssType = eSIR_INFRASTRUCTURE_MODE; |
| 3540 | } |
| 3541 | |
| 3542 | pAddBssParams->operMode = BSS_OPERATIONAL_MODE_STA; |
| 3543 | |
| 3544 | /* Update PE session ID */ |
| 3545 | pAddBssParams->sessionId = psessionEntry->peSessionId; |
| 3546 | |
| 3547 | pAddBssParams->beaconInterval = bssDescription->beaconInterval; |
| 3548 | |
| 3549 | pAddBssParams->dtimPeriod = pBeaconStruct->tim.dtimPeriod; |
| 3550 | pAddBssParams->updateBss = updateEntry; |
| 3551 | |
| 3552 | |
| 3553 | pAddBssParams->cfParamSet.cfpCount = pBeaconStruct->cfParamSet.cfpCount; |
| 3554 | pAddBssParams->cfParamSet.cfpPeriod = pBeaconStruct->cfParamSet.cfpPeriod; |
| 3555 | pAddBssParams->cfParamSet.cfpMaxDuration = pBeaconStruct->cfParamSet.cfpMaxDuration; |
| 3556 | pAddBssParams->cfParamSet.cfpDurRemaining = pBeaconStruct->cfParamSet.cfpDurRemaining; |
| 3557 | |
| 3558 | pAddBssParams->rateSet.numRates = pAssocRsp->supportedRates.numRates; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3559 | vos_mem_copy(pAddBssParams->rateSet.rate, |
| 3560 | pAssocRsp->supportedRates.rate, pAssocRsp->supportedRates.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3561 | |
| 3562 | pAddBssParams->nwType = bssDescription->nwType; |
| 3563 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3564 | pAddBssParams->shortSlotTimeSupported = (tANI_U8)pAssocRsp->capabilityInfo.shortSlotTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3565 | pAddBssParams->llaCoexist = (tANI_U8) psessionEntry->beaconParams.llaCoexist; |
| 3566 | pAddBssParams->llbCoexist = (tANI_U8) psessionEntry->beaconParams.llbCoexist; |
| 3567 | pAddBssParams->llgCoexist = (tANI_U8) psessionEntry->beaconParams.llgCoexist; |
| 3568 | pAddBssParams->ht20Coexist = (tANI_U8) psessionEntry->beaconParams.ht20Coexist; |
| 3569 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3570 | limLog(pMac, LOG2, FL(" BSS Type %d Beacon Interval: %d dtimPeriod: %d " |
| 3571 | "cfpCount: %d"),pAddBssParams->bssType, pAddBssParams->beaconInterval, |
| 3572 | pAddBssParams->dtimPeriod, pAddBssParams->cfParamSet.cfpCount); |
| 3573 | |
| 3574 | limLog(pMac, LOG2, FL(" cfpPeriod: %d cfpMaxDuration: %d cfpDurRemaining:" |
| 3575 | " %d numRates: %d "),pAddBssParams->cfParamSet.cfpPeriod, |
| 3576 | pAddBssParams->cfParamSet.cfpMaxDuration, |
| 3577 | pAddBssParams->cfParamSet.cfpDurRemaining, |
| 3578 | pAddBssParams->rateSet.numRates); |
| 3579 | |
| 3580 | limLog(pMac, LOG2, FL("nwType:%d shortSlotTimeSupported: %d" |
| 3581 | "llaCoexist: %d llbCoexist: %d llgCoexist: %d ht20Coexist: %d"), |
| 3582 | pAddBssParams->nwType, pAddBssParams->shortSlotTimeSupported, |
| 3583 | pAddBssParams->llaCoexist, pAddBssParams->llbCoexist, |
| 3584 | pAddBssParams->llgCoexist, pAddBssParams->ht20Coexist); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3585 | |
| 3586 | // Use the advertised capabilities from the received beacon/PR |
| 3587 | |
| 3588 | |
| 3589 | if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) && ( pAssocRsp->HTCaps.present )) |
| 3590 | { |
| 3591 | pAddBssParams->htCapable = pAssocRsp->HTCaps.present; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3592 | limLog(pMac, LOG2, FL("htCapable: %d"),pAddBssParams->htCapable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3593 | if ( pBeaconStruct->HTInfo.present ) |
| 3594 | { |
| 3595 | pAddBssParams->htOperMode = (tSirMacHTOperatingMode)pAssocRsp->HTInfo.opMode; |
| 3596 | pAddBssParams->dualCTSProtection = ( tANI_U8 ) pAssocRsp->HTInfo.dualCTSProtection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3597 | chanWidthSupp = limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3598 | if( (pAssocRsp->HTCaps.supportedChannelWidthSet) && |
| 3599 | (chanWidthSupp) ) |
| 3600 | { |
| 3601 | pAddBssParams->txChannelWidthSet = ( tANI_U8 )pAssocRsp->HTInfo.recommendedTxWidthSet; |
| 3602 | pAddBssParams->currentExtChannel = pAssocRsp->HTInfo.secondaryChannelOffset; |
| 3603 | } |
| 3604 | else |
| 3605 | { |
| 3606 | pAddBssParams->txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3607 | pAddBssParams->currentExtChannel = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3608 | } |
| 3609 | pAddBssParams->llnNonGFCoexist = (tANI_U8)pAssocRsp->HTInfo.nonGFDevicesPresent; |
| 3610 | pAddBssParams->fLsigTXOPProtectionFullSupport = (tANI_U8)pAssocRsp->HTInfo.lsigTXOPProtectionFullSupport; |
| 3611 | pAddBssParams->fRIFSMode = pAssocRsp->HTInfo.rifsMode; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3612 | |
| 3613 | limLog(pMac, LOG2, FL("htOperMode: %d dualCTSProtection: %d " |
| 3614 | "txChannelWidthSet: %d currentExtChannel: %d "), |
| 3615 | pAddBssParams->htOperMode, pAddBssParams->dualCTSProtection, |
| 3616 | pAddBssParams->txChannelWidthSet,pAddBssParams->currentExtChannel); |
| 3617 | |
| 3618 | limLog(pMac, LOG2, FL("llnNonGFCoexist: %d " |
| 3619 | "fLsigTXOPProtectionFullSupport: %d fRIFSMode %d"), |
| 3620 | pAddBssParams->llnNonGFCoexist, |
| 3621 | pAddBssParams->fLsigTXOPProtectionFullSupport, |
| 3622 | pAddBssParams->fRIFSMode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3623 | } |
| 3624 | } |
| 3625 | |
| 3626 | pAddBssParams->currentOperChannel = bssDescription->channelId; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3627 | limLog(pMac, LOG2, FL("currentOperChannel %d"), |
| 3628 | pAddBssParams->currentOperChannel); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3629 | #ifdef WLAN_FEATURE_11AC |
| 3630 | if (psessionEntry->vhtCapability && ( pAssocRsp->VHTCaps.present )) |
| 3631 | { |
| 3632 | pAddBssParams->vhtCapable = pAssocRsp->VHTCaps.present; |
| 3633 | pAddBssParams->vhtTxChannelWidthSet = pAssocRsp->VHTOperation.chanWidth; |
| 3634 | pAddBssParams->currentExtChannel = limGet11ACPhyCBState ( pMac, |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 3635 | pAddBssParams->currentOperChannel, |
| 3636 | pAddBssParams->currentExtChannel, |
| 3637 | psessionEntry->apCenterChan, |
| 3638 | psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3639 | } |
| 3640 | else |
| 3641 | { |
| 3642 | pAddBssParams->vhtCapable = 0; |
| 3643 | } |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3644 | limLog(pMac, LOG2, FL("vhtCapable %d vhtTxChannelWidthSet %d " |
| 3645 | "currentExtChannel %d"),pAddBssParams->vhtCapable, |
| 3646 | pAddBssParams->vhtTxChannelWidthSet, |
| 3647 | pAddBssParams->currentExtChannel); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3648 | #endif |
| 3649 | |
| 3650 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3651 | // Populate the STA-related parameters here |
| 3652 | // Note that the STA here refers to the AP |
| 3653 | { |
| 3654 | /* staType = PEER*/ |
| 3655 | pAddBssParams->staContext.staType = STA_ENTRY_OTHER; // Identifying AP as an STA |
| 3656 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3657 | vos_mem_copy(pAddBssParams->staContext.bssId, |
| 3658 | bssDescription->bssId, |
| 3659 | sizeof( tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3660 | pAddBssParams->staContext.listenInterval = bssDescription->beaconInterval; |
| 3661 | |
| 3662 | /* Fill Assoc id from the dph table */ |
| 3663 | pStaDs = dphLookupHashEntry(pMac, pAddBssParams->staContext.bssId, |
| 3664 | &pAddBssParams->staContext.assocId, &psessionEntry->dph.dphHashTable); |
| 3665 | if (pStaDs == NULL) |
| 3666 | { |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 3667 | PELOGE(limLog(pMac, LOGE, FL("Couldn't get assoc id for " |
| 3668 | "MAC ADDR: " MAC_ADDRESS_STR), |
| 3669 | MAC_ADDR_ARRAY(pAddBssParams->staContext.staMac));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3670 | } |
| 3671 | pAddBssParams->staContext.uAPSD = 0; |
| 3672 | pAddBssParams->staContext.maxSPLen = 0; |
| 3673 | pAddBssParams->staContext.shortPreambleSupported = (tANI_U8)pAssocRsp->capabilityInfo.shortPreamble; |
| 3674 | pAddBssParams->staContext.updateSta = updateEntry; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3675 | |
| 3676 | limLog(pMac, LOG2, FL("StaContext: "MAC_ADDRESS_STR |
| 3677 | " shortPreambleSupported: %d"), |
| 3678 | MAC_ADDR_ARRAY(pAddBssParams->staContext.staMac), |
| 3679 | pAddBssParams->staContext.shortPreambleSupported); |
| 3680 | |
Kiran Kumar Lokere | eb7f235 | 2013-06-18 16:22:55 -0700 | [diff] [blame] | 3681 | if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) && pBeaconStruct->HTCaps.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3682 | { |
| 3683 | pAddBssParams->staContext.us32MaxAmpduDuration = 0; |
| 3684 | pAddBssParams->staContext.htCapable = 1; |
| 3685 | pAddBssParams->staContext.greenFieldCapable = ( tANI_U8 )pAssocRsp->HTCaps.greenField; |
| 3686 | pAddBssParams->staContext.lsigTxopProtection = ( tANI_U8 )pAssocRsp->HTCaps.lsigTXOPProtection; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3687 | limLog(pMac, LOG2,FL("StaContext htCapable: %d greenFieldCapable: %d " |
| 3688 | "lsigTxopProtection: %d"), pAddBssParams->staContext.htCapable, |
| 3689 | pAddBssParams->staContext.greenFieldCapable, |
| 3690 | pAddBssParams->staContext.lsigTxopProtection); |
Kiran Kumar Lokere | eb7f235 | 2013-06-18 16:22:55 -0700 | [diff] [blame] | 3691 | #ifdef WLAN_FEATURE_11AC |
| 3692 | if (psessionEntry->vhtCapability && pBeaconStruct->VHTCaps.present) |
| 3693 | { |
| 3694 | pAddBssParams->staContext.vhtCapable = 1; |
| 3695 | if ((pAssocRsp->VHTCaps.suBeamFormerCap || |
| 3696 | pAssocRsp->VHTCaps.muBeamformerCap) && |
| 3697 | psessionEntry->txBFIniFeatureEnabled) |
| 3698 | { |
| 3699 | pAddBssParams->staContext.vhtTxBFCapable = 1; |
| 3700 | } |
| 3701 | } |
| 3702 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3703 | if( (pAssocRsp->HTCaps.supportedChannelWidthSet) && |
| 3704 | (chanWidthSupp) ) |
| 3705 | { |
| 3706 | pAddBssParams->staContext.txChannelWidthSet = ( tANI_U8 )pAssocRsp->HTInfo.recommendedTxWidthSet; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3707 | #ifdef WLAN_FEATURE_11AC |
Kiran Kumar Lokere | eb7f235 | 2013-06-18 16:22:55 -0700 | [diff] [blame] | 3708 | if (pAddBssParams->staContext.vhtCapable) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3709 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3710 | pAddBssParams->staContext.vhtTxChannelWidthSet = pAssocRsp->VHTOperation.chanWidth; //pMac->lim.apChanWidth; |
| 3711 | } |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3712 | limLog(pMac, LOG2,FL("StaContext vhtCapable %d " |
| 3713 | "vhtTxChannelWidthSet: %d vhtTxBFCapable: %d"), |
| 3714 | pAddBssParams->staContext.vhtCapable, |
| 3715 | pAddBssParams->staContext.vhtTxChannelWidthSet, |
| 3716 | pAddBssParams->staContext.vhtTxBFCapable); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3717 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3718 | } |
| 3719 | else |
| 3720 | { |
| 3721 | pAddBssParams->staContext.txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 3722 | } |
| 3723 | pAddBssParams->staContext.mimoPS = (tSirMacHTMIMOPowerSaveState)pAssocRsp->HTCaps.mimoPowerSave; |
| 3724 | pAddBssParams->staContext.delBASupport = ( tANI_U8 )pAssocRsp->HTCaps.delayedBA; |
| 3725 | pAddBssParams->staContext.maxAmsduSize = ( tANI_U8 )pAssocRsp->HTCaps.maximalAMSDUsize; |
| 3726 | pAddBssParams->staContext.maxAmpduDensity = pAssocRsp->HTCaps.mpduDensity; |
| 3727 | pAddBssParams->staContext.fDsssCckMode40Mhz = (tANI_U8)pAssocRsp->HTCaps.dsssCckMode40MHz; |
krunal soni | 71343fb | 2013-09-16 16:16:26 -0700 | [diff] [blame] | 3728 | /* |
| 3729 | * We will check gShortGI20Mhz and gShortGI40Mhz from ini file. |
| 3730 | * if they are set then we will use what ever Assoc response coming |
| 3731 | * from AP supports. If these values are set as 0 in ini file then |
| 3732 | * we will hardcode this values to 0. |
| 3733 | */ |
| 3734 | if (HAL_STATUS_SUCCESS(ccmCfgGetInt |
| 3735 | (pMac, WNI_CFG_SHORT_GI_20MHZ, |
| 3736 | &shortGi20MhzSupport))) |
| 3737 | { |
| 3738 | if (VOS_TRUE == shortGi20MhzSupport) |
| 3739 | { |
| 3740 | pAddBssParams->staContext.fShortGI20Mhz = |
| 3741 | (tANI_U8)pAssocRsp->HTCaps.shortGI20MHz; |
| 3742 | } |
| 3743 | else |
| 3744 | { |
| 3745 | pAddBssParams->staContext.fShortGI20Mhz = VOS_FALSE; |
| 3746 | } |
| 3747 | } |
| 3748 | else |
| 3749 | { |
| 3750 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 20Mhz" |
| 3751 | "CFG,setting value to default"));) |
| 3752 | pAddBssParams->staContext.fShortGI20Mhz = |
| 3753 | WNI_CFG_SHORT_GI_20MHZ_STADEF; |
| 3754 | } |
| 3755 | |
| 3756 | if (HAL_STATUS_SUCCESS(ccmCfgGetInt |
| 3757 | (pMac, WNI_CFG_SHORT_GI_40MHZ, |
| 3758 | &shortGi40MhzSupport))) |
| 3759 | { |
| 3760 | if (VOS_TRUE == shortGi40MhzSupport) |
| 3761 | { |
| 3762 | pAddBssParams->staContext.fShortGI40Mhz = |
| 3763 | (tANI_U8)pAssocRsp->HTCaps.shortGI40MHz; |
| 3764 | } |
| 3765 | else |
| 3766 | { |
| 3767 | pAddBssParams->staContext.fShortGI40Mhz = VOS_FALSE; |
| 3768 | } |
| 3769 | } |
| 3770 | else |
| 3771 | { |
| 3772 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 40Mhz" |
| 3773 | "CFG,setting value to default"));) |
| 3774 | pAddBssParams->staContext.fShortGI40Mhz = |
| 3775 | WNI_CFG_SHORT_GI_40MHZ_STADEF; |
| 3776 | } |
| 3777 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3778 | pAddBssParams->staContext.maxAmpduSize= pAssocRsp->HTCaps.maxRxAMPDUFactor; |
Leela V Kiran Kumar Reddy Chirala | b1f7d34 | 2013-02-11 00:27:02 -0800 | [diff] [blame] | 3779 | if( pAddBssParams->staContext.vhtTxBFCapable && pMac->lim.disableLDPCWithTxbfAP ) |
| 3780 | { |
| 3781 | pAddBssParams->staContext.htLdpcCapable = 0; |
| 3782 | pAddBssParams->staContext.vhtLdpcCapable = 0; |
| 3783 | } |
| 3784 | else |
| 3785 | { |
| 3786 | pAddBssParams->staContext.htLdpcCapable = (tANI_U8)pAssocRsp->HTCaps.advCodingCap; |
| 3787 | pAddBssParams->staContext.vhtLdpcCapable = (tANI_U8)pAssocRsp->VHTCaps.ldpcCodingCap; |
| 3788 | } |
Gopichand Nakkala | b2d2c31 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 3789 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3790 | if( pBeaconStruct->HTInfo.present ) |
| 3791 | pAddBssParams->staContext.rifsMode = pAssocRsp->HTInfo.rifsMode; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3792 | |
| 3793 | limLog(pMac, LOG2, FL("StaContext txChannelWidthSet: %d mimoPS: %d" |
| 3794 | " delBASupport: %d maxAmsduSize: %d"), |
| 3795 | pAddBssParams->staContext.txChannelWidthSet, |
| 3796 | pAddBssParams->staContext.mimoPS, |
| 3797 | pAddBssParams->staContext.delBASupport, |
| 3798 | pAddBssParams->staContext.maxAmsduSize); |
| 3799 | |
| 3800 | limLog(pMac, LOG2, FL("maxAmpduDensity: %d fDsssCckMode40Mhz: %d " |
| 3801 | "fShortGI20Mhz: %d "),pAddBssParams->staContext.maxAmpduDensity, |
| 3802 | pAddBssParams->staContext.fDsssCckMode40Mhz, |
| 3803 | pAddBssParams->staContext.fShortGI20Mhz); |
| 3804 | |
| 3805 | limLog(pMac, LOG2, FL("fShortGI40Mh: %d maxAmpduSize: %d " |
| 3806 | "htLdpcCapable: %d vhtLdpcCapable: %d"), |
| 3807 | pAddBssParams->staContext.fShortGI40Mhz, |
| 3808 | pAddBssParams->staContext.maxAmpduSize, |
| 3809 | pAddBssParams->staContext.htLdpcCapable, |
| 3810 | pAddBssParams->staContext.vhtLdpcCapable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3811 | } |
| 3812 | |
Pratik Bhalgat | b5b19b0 | 2012-11-22 16:28:19 +0530 | [diff] [blame] | 3813 | //If WMM IE or 802.11E IE is not present and AP is HT AP then enable WMM |
| 3814 | if ((psessionEntry->limWmeEnabled && (pAssocRsp->wmeEdcaPresent || pAddBssParams->htCapable)) || |
| 3815 | (psessionEntry->limQosEnabled && (pAssocRsp->edcaPresent || pAddBssParams->htCapable))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3816 | pAddBssParams->staContext.wmmEnabled = 1; |
| 3817 | else |
| 3818 | pAddBssParams->staContext.wmmEnabled = 0; |
| 3819 | |
| 3820 | //Update the rates |
| 3821 | |
| 3822 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 3823 | if (pStaDs != NULL) |
| 3824 | { |
| 3825 | limFillSupportedRatesInfo(pMac, pStaDs, &pStaDs->supportedRates,psessionEntry); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3826 | vos_mem_copy((tANI_U8*)&pAddBssParams->staContext.supportedRates, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3827 | (tANI_U8*)&pStaDs->supportedRates, |
| 3828 | sizeof(tSirSupportedRates)); |
| 3829 | } |
| 3830 | else |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3831 | PELOGE(limLog(pMac, LOGE, FL("could not Update the supported rates."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3832 | |
| 3833 | } |
| 3834 | |
| 3835 | //Disable BA. It will be set as part of ADDBA negotiation. |
| 3836 | for( i = 0; i < STACFG_MAX_TC; i++ ) |
| 3837 | { |
| 3838 | pAddBssParams->staContext.staTCParams[i].txUseBA = eBA_DISABLE; |
| 3839 | pAddBssParams->staContext.staTCParams[i].rxUseBA = eBA_DISABLE; |
| 3840 | pAddBssParams->staContext.staTCParams[i].txBApolicy = eBA_POLICY_IMMEDIATE; |
| 3841 | pAddBssParams->staContext.staTCParams[i].rxBApolicy = eBA_POLICY_IMMEDIATE; |
| 3842 | } |
| 3843 | |
| 3844 | pAddBssParams->staContext.encryptType = psessionEntry->encryptType; |
| 3845 | |
| 3846 | #if defined WLAN_FEATURE_VOWIFI |
| 3847 | pAddBssParams->maxTxPower = psessionEntry->maxTxPower; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3848 | limLog(pMac, LOG2,FL("maxTxPower: %d"), |
| 3849 | pAddBssParams->maxTxPower); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3850 | #endif |
| 3851 | // FIXME_GEN4 - Any other value that can be used for initialization? |
| 3852 | pAddBssParams->status = eHAL_STATUS_SUCCESS; |
| 3853 | pAddBssParams->respReqd = true; |
| 3854 | |
| 3855 | pAddBssParams->halPersona = (tANI_U8)psessionEntry->pePersona; //update persona |
| 3856 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3857 | if (VOS_P2P_CLIENT_MODE == psessionEntry->pePersona) |
| 3858 | { |
| 3859 | pAddBssParams->staContext.p2pCapableSta = 1; |
| 3860 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3861 | |
Bansidhar Gopalachari | b099ac6 | 2013-06-12 19:02:39 -0700 | [diff] [blame] | 3862 | pAddBssParams->bSpectrumMgtEnabled = psessionEntry->spectrumMgtEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3863 | |
| 3864 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 3865 | pAddBssParams->extSetStaKeyParamValid = 0; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3866 | limLog(pMac, LOG2,FL("extSetStaKeyParamValid: %d"), |
| 3867 | pAddBssParams->extSetStaKeyParamValid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3868 | #endif |
| 3869 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3870 | #ifdef WLAN_FEATURE_11W |
| 3871 | if (psessionEntry->limRmfEnabled) |
| 3872 | { |
| 3873 | pAddBssParams->rmfEnabled = 1; |
| 3874 | pAddBssParams->staContext.rmfEnabled = 1; |
| 3875 | } |
| 3876 | #endif |
| 3877 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3878 | // Set a new state for MLME |
| 3879 | if( eLIM_MLM_WT_ASSOC_RSP_STATE == psessionEntry->limMlmState ) |
| 3880 | psessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_ASSOC_STATE; |
| 3881 | else |
| 3882 | psessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3883 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3884 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3885 | limLog(pMac, LOG2, FL("staContext wmmEnabled: %d encryptType: %d " |
| 3886 | "p2pCapableSta: %d"),pAddBssParams->staContext.wmmEnabled, |
| 3887 | pAddBssParams->staContext.encryptType, |
| 3888 | pAddBssParams->staContext.p2pCapableSta); |
| 3889 | |
| 3890 | limLog(pMac, LOG2, FL("bSpectrumMgtEnabled: %d halPersona: %d setting " |
| 3891 | "LimMlm state to %d"), pAddBssParams->bSpectrumMgtEnabled, |
| 3892 | pAddBssParams->halPersona, psessionEntry->limMlmState); |
| 3893 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3894 | //we need to defer the message until we get the response back from HAL. |
| 3895 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
| 3896 | |
| 3897 | msgQ.type = WDA_ADD_BSS_REQ; |
| 3898 | /** @ToDo : Update the Global counter to keeptrack of the PE <--> HAL messages*/ |
| 3899 | msgQ.reserved = 0; |
| 3900 | msgQ.bodyptr = pAddBssParams; |
| 3901 | msgQ.bodyval = 0; |
| 3902 | |
| 3903 | limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_BSS_REQ..." )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3904 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3905 | |
| 3906 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
| 3907 | if( eSIR_SUCCESS != retCode) |
| 3908 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3909 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3910 | vos_mem_free(pAddBssParams); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 3911 | limLog( pMac, LOGE, FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3912 | retCode ); |
| 3913 | goto returnFailure; |
| 3914 | |
| 3915 | } |
| 3916 | else |
| 3917 | return retCode; |
| 3918 | |
| 3919 | returnFailure: |
| 3920 | // Clean-up will be done by the caller... |
| 3921 | return retCode; |
| 3922 | } |
| 3923 | |
| 3924 | |
| 3925 | |
| 3926 | |
| 3927 | tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry, tpPESession psessionEntry) |
| 3928 | { |
| 3929 | tSirMsgQ msgQ; |
| 3930 | tpAddBssParams pAddBssParams = NULL; |
| 3931 | tANI_U32 retCode; |
| 3932 | tANI_U8 i; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3933 | tSchBeaconStruct *pBeaconStruct; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3934 | tANI_U8 chanWidthSupp = 0; |
krunal soni | 71343fb | 2013-09-16 16:16:26 -0700 | [diff] [blame] | 3935 | tANI_U32 shortGi20MhzSupport; |
| 3936 | tANI_U32 shortGi40MhzSupport; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3937 | tpSirBssDescription bssDescription = &psessionEntry->pLimJoinReq->bssDescription; |
| 3938 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3939 | pBeaconStruct = vos_mem_malloc(sizeof(tSchBeaconStruct)); |
| 3940 | if (NULL == pBeaconStruct) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3941 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3942 | limLog(pMac, LOGE, FL("Unable to allocate memory during ADD_BSS") ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3943 | return eSIR_MEM_ALLOC_FAILED; |
| 3944 | } |
| 3945 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3946 | |
| 3947 | // Package SIR_HAL_ADD_BSS_REQ message parameters |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3948 | pAddBssParams = vos_mem_malloc(sizeof(tAddBssParams)); |
| 3949 | if (NULL == pAddBssParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3950 | { |
| 3951 | limLog( pMac, LOGP, |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3952 | FL( "Unable to allocate memory during ADD_BSS" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3953 | retCode = eSIR_MEM_ALLOC_FAILED; |
| 3954 | goto returnFailure; |
| 3955 | } |
| 3956 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3957 | vos_mem_set((tANI_U8 *) pAddBssParams, sizeof( tAddBssParams ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3958 | |
| 3959 | |
| 3960 | limExtractApCapabilities( pMac, |
| 3961 | (tANI_U8 *) bssDescription->ieFields, |
| 3962 | limGetIElenFromBssDescription( bssDescription ), |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3963 | pBeaconStruct ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3964 | |
| 3965 | if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3966 | limDecideStaProtectionOnAssoc(pMac, pBeaconStruct, psessionEntry); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3967 | vos_mem_copy(pAddBssParams->bssId, bssDescription->bssId, |
| 3968 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3969 | |
| 3970 | // Fill in tAddBssParams selfMacAddr |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 3971 | vos_mem_copy(pAddBssParams->selfMacAddr, |
| 3972 | psessionEntry->selfMacAddr, |
| 3973 | sizeof(tSirMacAddr)); |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3974 | limLog(pMac, LOG1, FL("sessionid: %d updateEntry = %d limsystemrole = %d "), |
| 3975 | psessionEntry->smeSessionId,updateEntry,psessionEntry->limSystemRole); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3976 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3977 | limLog(pMac, LOG1, FL("BSSID: "MAC_ADDRESS_STR), |
| 3978 | MAC_ADDR_ARRAY(pAddBssParams->bssId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3979 | /* Incorrect BSS Type which caused UMA Descriptor to be overwritten on |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 3980 | * top of an already established Infra link. This lead to issues in |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3981 | * concurrent data transfer. |
| 3982 | */ |
| 3983 | |
| 3984 | pAddBssParams->bssType = psessionEntry->bssType;//eSIR_INFRASTRUCTURE_MODE; |
| 3985 | pAddBssParams->operMode = BSS_OPERATIONAL_MODE_STA; |
| 3986 | |
| 3987 | pAddBssParams->beaconInterval = bssDescription->beaconInterval; |
| 3988 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3989 | pAddBssParams->dtimPeriod = pBeaconStruct->tim.dtimPeriod; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3990 | pAddBssParams->updateBss = updateEntry; |
| 3991 | |
| 3992 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3993 | pAddBssParams->cfParamSet.cfpCount = pBeaconStruct->cfParamSet.cfpCount; |
| 3994 | pAddBssParams->cfParamSet.cfpPeriod = pBeaconStruct->cfParamSet.cfpPeriod; |
| 3995 | pAddBssParams->cfParamSet.cfpMaxDuration = pBeaconStruct->cfParamSet.cfpMaxDuration; |
| 3996 | pAddBssParams->cfParamSet.cfpDurRemaining = pBeaconStruct->cfParamSet.cfpDurRemaining; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3997 | |
| 3998 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3999 | pAddBssParams->rateSet.numRates = pBeaconStruct->supportedRates.numRates; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4000 | vos_mem_copy(pAddBssParams->rateSet.rate, |
| 4001 | pBeaconStruct->supportedRates.rate, pBeaconStruct->supportedRates.numRates); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4002 | |
| 4003 | pAddBssParams->nwType = bssDescription->nwType; |
| 4004 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4005 | pAddBssParams->shortSlotTimeSupported = (tANI_U8)pBeaconStruct->capabilityInfo.shortSlotTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4006 | pAddBssParams->llaCoexist = (tANI_U8) psessionEntry->beaconParams.llaCoexist; |
| 4007 | pAddBssParams->llbCoexist = (tANI_U8) psessionEntry->beaconParams.llbCoexist; |
| 4008 | pAddBssParams->llgCoexist = (tANI_U8) psessionEntry->beaconParams.llgCoexist; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4009 | pAddBssParams->ht20Coexist = (tANI_U8) psessionEntry->beaconParams.ht20Coexist; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4010 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4011 | limLog(pMac, LOG2, FL(" BSS Type %d Beacon Interval: %d dtimPeriod: %d " |
| 4012 | "cfpCount: %d"),pAddBssParams->bssType, pAddBssParams->beaconInterval, |
| 4013 | pAddBssParams->dtimPeriod, pAddBssParams->cfParamSet.cfpCount); |
| 4014 | |
| 4015 | limLog(pMac, LOG2, FL(" cfpPeriod: %d cfpMaxDuration: %d cfpDurRemaining:" |
| 4016 | " %d numRates: %d "),pAddBssParams->cfParamSet.cfpPeriod, |
| 4017 | pAddBssParams->cfParamSet.cfpMaxDuration, |
| 4018 | pAddBssParams->cfParamSet.cfpDurRemaining, |
| 4019 | pAddBssParams->rateSet.numRates); |
| 4020 | |
| 4021 | limLog(pMac, LOG2, FL("nwType:%d shortSlotTimeSupported: %d" |
| 4022 | "llaCoexist: %d llbCoexist: %d llgCoexist: %d ht20Coexist: %d"), |
| 4023 | pAddBssParams->nwType, pAddBssParams->shortSlotTimeSupported, |
| 4024 | pAddBssParams->llaCoexist, pAddBssParams->llbCoexist, |
| 4025 | pAddBssParams->llgCoexist, pAddBssParams->ht20Coexist); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4026 | // Use the advertised capabilities from the received beacon/PR |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4027 | if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) && ( pBeaconStruct->HTCaps.present )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4028 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4029 | pAddBssParams->htCapable = pBeaconStruct->HTCaps.present; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4030 | limLog(pMac, LOG2, FL("htCapable: %d"),pAddBssParams->htCapable); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4031 | if ( pBeaconStruct->HTInfo.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4032 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4033 | pAddBssParams->htOperMode = (tSirMacHTOperatingMode)pBeaconStruct->HTInfo.opMode; |
| 4034 | pAddBssParams->dualCTSProtection = ( tANI_U8 ) pBeaconStruct->HTInfo.dualCTSProtection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4035 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4036 | chanWidthSupp = limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, psessionEntry); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4037 | if( (pBeaconStruct->HTCaps.supportedChannelWidthSet) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4038 | (chanWidthSupp) ) |
| 4039 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4040 | pAddBssParams->txChannelWidthSet = ( tANI_U8 ) pBeaconStruct->HTInfo.recommendedTxWidthSet; |
| 4041 | pAddBssParams->currentExtChannel = pBeaconStruct->HTInfo.secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4042 | } |
| 4043 | else |
| 4044 | { |
| 4045 | pAddBssParams->txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4046 | pAddBssParams->currentExtChannel = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4047 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4048 | pAddBssParams->llnNonGFCoexist = (tANI_U8)pBeaconStruct->HTInfo.nonGFDevicesPresent; |
| 4049 | pAddBssParams->fLsigTXOPProtectionFullSupport = (tANI_U8)pBeaconStruct->HTInfo.lsigTXOPProtectionFullSupport; |
| 4050 | pAddBssParams->fRIFSMode = pBeaconStruct->HTInfo.rifsMode; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4051 | |
| 4052 | limLog(pMac, LOG2, FL("htOperMode: %d dualCTSProtection: %d " |
| 4053 | "txChannelWidthSet: %d currentExtChannel: %d "), |
| 4054 | pAddBssParams->htOperMode, pAddBssParams->dualCTSProtection, |
| 4055 | pAddBssParams->txChannelWidthSet,pAddBssParams->currentExtChannel); |
| 4056 | |
| 4057 | limLog(pMac, LOG2, FL("llnNonGFCoexist: %d " |
| 4058 | "fLsigTXOPProtectionFullSupport: %d fRIFSMode %d"), |
| 4059 | pAddBssParams->llnNonGFCoexist, |
| 4060 | pAddBssParams->fLsigTXOPProtectionFullSupport, |
| 4061 | pAddBssParams->fRIFSMode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4062 | } |
| 4063 | } |
| 4064 | |
| 4065 | pAddBssParams->currentOperChannel = bssDescription->channelId; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4066 | limLog(pMac, LOG2, FL("currentOperChannel %d"), |
| 4067 | pAddBssParams->currentOperChannel); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4068 | #ifdef WLAN_FEATURE_11AC |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4069 | if (psessionEntry->vhtCapability && ( pBeaconStruct->VHTCaps.present )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4070 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4071 | pAddBssParams->vhtCapable = pBeaconStruct->VHTCaps.present; |
| 4072 | pAddBssParams->vhtTxChannelWidthSet = pBeaconStruct->VHTOperation.chanWidth; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4073 | pAddBssParams->currentExtChannel = limGet11ACPhyCBState ( pMac, |
| 4074 | pAddBssParams->currentOperChannel, |
| 4075 | pAddBssParams->currentExtChannel, |
| 4076 | psessionEntry->apCenterChan, |
| 4077 | psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4078 | } |
| 4079 | else |
| 4080 | { |
| 4081 | pAddBssParams->vhtCapable = 0; |
| 4082 | } |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4083 | limLog(pMac, LOG2, FL("vhtCapable %d vhtTxChannelWidthSet %d " |
| 4084 | "currentExtChannel %d"),pAddBssParams->vhtCapable, |
| 4085 | pAddBssParams->vhtTxChannelWidthSet, |
| 4086 | pAddBssParams->currentExtChannel); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4087 | #endif |
| 4088 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4089 | // Populate the STA-related parameters here |
| 4090 | // Note that the STA here refers to the AP |
| 4091 | { |
| 4092 | pAddBssParams->staContext.staType = STA_ENTRY_OTHER; // Identifying AP as an STA |
| 4093 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4094 | vos_mem_copy(pAddBssParams->staContext.bssId, |
| 4095 | bssDescription->bssId, |
| 4096 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4097 | pAddBssParams->staContext.listenInterval = bssDescription->beaconInterval; |
| 4098 | |
| 4099 | pAddBssParams->staContext.assocId = 0; // Is SMAC OK with this? |
| 4100 | pAddBssParams->staContext.uAPSD = 0; |
| 4101 | pAddBssParams->staContext.maxSPLen = 0; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4102 | pAddBssParams->staContext.shortPreambleSupported = (tANI_U8)pBeaconStruct->capabilityInfo.shortPreamble; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4103 | pAddBssParams->staContext.updateSta = updateEntry; |
| 4104 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4105 | limLog(pMac, LOG2, FL("StaContext: "MAC_ADDRESS_STR |
| 4106 | " shortPreambleSupported: %d"), |
| 4107 | MAC_ADDR_ARRAY(pAddBssParams->staContext.staMac), |
| 4108 | pAddBssParams->staContext.shortPreambleSupported); |
| 4109 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4110 | if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) && ( pBeaconStruct->HTCaps.present )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4111 | { |
| 4112 | pAddBssParams->staContext.us32MaxAmpduDuration = 0; |
| 4113 | pAddBssParams->staContext.htCapable = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4114 | pAddBssParams->staContext.greenFieldCapable = ( tANI_U8 ) pBeaconStruct->HTCaps.greenField; |
| 4115 | pAddBssParams->staContext.lsigTxopProtection = ( tANI_U8 ) pBeaconStruct->HTCaps.lsigTXOPProtection; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4116 | limLog(pMac, LOG2, FL("StaContext htCapable: %d " |
| 4117 | "greenFieldCapable: %d lsigTxopProtection: %d"), |
| 4118 | pAddBssParams->staContext.htCapable, |
| 4119 | pAddBssParams->staContext.greenFieldCapable, |
| 4120 | pAddBssParams->staContext.lsigTxopProtection); |
Kiran Kumar Lokere | eb7f235 | 2013-06-18 16:22:55 -0700 | [diff] [blame] | 4121 | #ifdef WLAN_FEATURE_11AC |
| 4122 | if (psessionEntry->vhtCapability && pBeaconStruct->VHTCaps.present) |
| 4123 | { |
| 4124 | pAddBssParams->staContext.vhtCapable = 1; |
| 4125 | if ((pBeaconStruct->VHTCaps.suBeamFormerCap || |
| 4126 | pBeaconStruct->VHTCaps.muBeamformerCap) && |
| 4127 | psessionEntry->txBFIniFeatureEnabled ) |
| 4128 | { |
| 4129 | pAddBssParams->staContext.vhtTxBFCapable = 1; |
| 4130 | } |
| 4131 | } |
| 4132 | #endif |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4133 | if( (pBeaconStruct->HTCaps.supportedChannelWidthSet) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4134 | (chanWidthSupp) ) |
| 4135 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4136 | pAddBssParams->staContext.txChannelWidthSet = ( tANI_U8 )pBeaconStruct->HTInfo.recommendedTxWidthSet; |
Kiran Kumar Lokere | eb7f235 | 2013-06-18 16:22:55 -0700 | [diff] [blame] | 4137 | #ifdef WLAN_FEATURE_11AC |
| 4138 | if (pAddBssParams->staContext.vhtCapable) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4139 | { |
Kiran Kumar Lokere | eb7f235 | 2013-06-18 16:22:55 -0700 | [diff] [blame] | 4140 | pAddBssParams->staContext.vhtTxChannelWidthSet = |
| 4141 | pBeaconStruct->VHTOperation.chanWidth; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4142 | } |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4143 | limLog(pMac, LOG2,FL("StaContext vhtCapable %d " |
| 4144 | "vhtTxChannelWidthSet: %d vhtTxBFCapable: %d"), |
| 4145 | pAddBssParams->staContext.vhtCapable, |
| 4146 | pAddBssParams->staContext.vhtTxChannelWidthSet, |
| 4147 | pAddBssParams->staContext.vhtTxBFCapable); |
Kiran Kumar Lokere | eb7f235 | 2013-06-18 16:22:55 -0700 | [diff] [blame] | 4148 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4149 | } |
| 4150 | else |
| 4151 | { |
| 4152 | pAddBssParams->staContext.txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; |
| 4153 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4154 | pAddBssParams->staContext.mimoPS = (tSirMacHTMIMOPowerSaveState)pBeaconStruct->HTCaps.mimoPowerSave; |
| 4155 | pAddBssParams->staContext.delBASupport = ( tANI_U8 ) pBeaconStruct->HTCaps.delayedBA; |
| 4156 | pAddBssParams->staContext.maxAmsduSize = ( tANI_U8 ) pBeaconStruct->HTCaps.maximalAMSDUsize; |
| 4157 | pAddBssParams->staContext.maxAmpduDensity = pBeaconStruct->HTCaps.mpduDensity; |
| 4158 | pAddBssParams->staContext.fDsssCckMode40Mhz = (tANI_U8)pBeaconStruct->HTCaps.dsssCckMode40MHz; |
krunal soni | 71343fb | 2013-09-16 16:16:26 -0700 | [diff] [blame] | 4159 | /* |
| 4160 | * We will check gShortGI20Mhz and gShortGI40Mhz from ini file. |
| 4161 | * if they are set then we will use what ever Beacon coming from AP |
| 4162 | * supports. If these values are set as 0 in ini file then |
| 4163 | * we will hardcode this values to 0. |
| 4164 | */ |
| 4165 | if (HAL_STATUS_SUCCESS(ccmCfgGetInt |
| 4166 | (pMac, WNI_CFG_SHORT_GI_20MHZ, |
| 4167 | &shortGi20MhzSupport))) |
| 4168 | { |
| 4169 | if (VOS_TRUE == shortGi20MhzSupport) |
| 4170 | { |
| 4171 | pAddBssParams->staContext.fShortGI20Mhz = |
| 4172 | (tANI_U8)pBeaconStruct->HTCaps.shortGI20MHz; |
| 4173 | } |
| 4174 | else |
| 4175 | { |
| 4176 | pAddBssParams->staContext.fShortGI20Mhz = VOS_FALSE; |
| 4177 | } |
| 4178 | } |
| 4179 | else |
| 4180 | { |
| 4181 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 20Mhz" |
| 4182 | "CFG,setting value to default"));) |
| 4183 | pAddBssParams->staContext.fShortGI20Mhz = |
| 4184 | WNI_CFG_SHORT_GI_20MHZ_STADEF; |
| 4185 | } |
| 4186 | |
| 4187 | if (HAL_STATUS_SUCCESS(ccmCfgGetInt |
| 4188 | (pMac, WNI_CFG_SHORT_GI_40MHZ, |
| 4189 | &shortGi40MhzSupport))) |
| 4190 | { |
| 4191 | if (VOS_TRUE == shortGi40MhzSupport) |
| 4192 | { |
| 4193 | pAddBssParams->staContext.fShortGI40Mhz = |
| 4194 | (tANI_U8)pBeaconStruct->HTCaps.shortGI40MHz; |
| 4195 | } |
| 4196 | else |
| 4197 | { |
| 4198 | pAddBssParams->staContext.fShortGI40Mhz = VOS_FALSE; |
| 4199 | } |
| 4200 | } |
| 4201 | else |
| 4202 | { |
| 4203 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve shortGI 40Mhz" |
| 4204 | "CFG,setting value to default"));) |
| 4205 | pAddBssParams->staContext.fShortGI40Mhz = |
| 4206 | WNI_CFG_SHORT_GI_40MHZ_STADEF; |
| 4207 | } |
| 4208 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4209 | pAddBssParams->staContext.maxAmpduSize= pBeaconStruct->HTCaps.maxRxAMPDUFactor; |
Leela V Kiran Kumar Reddy Chirala | b1f7d34 | 2013-02-11 00:27:02 -0800 | [diff] [blame] | 4210 | if( pAddBssParams->staContext.vhtTxBFCapable && pMac->lim.disableLDPCWithTxbfAP ) |
| 4211 | { |
| 4212 | pAddBssParams->staContext.htLdpcCapable = 0; |
| 4213 | pAddBssParams->staContext.vhtLdpcCapable = 0; |
| 4214 | } |
| 4215 | else |
| 4216 | { |
| 4217 | pAddBssParams->staContext.htLdpcCapable = (tANI_U8)pBeaconStruct->HTCaps.advCodingCap; |
| 4218 | pAddBssParams->staContext.vhtLdpcCapable = (tANI_U8)pBeaconStruct->VHTCaps.ldpcCodingCap; |
| 4219 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4220 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4221 | if( pBeaconStruct->HTInfo.present ) |
| 4222 | pAddBssParams->staContext.rifsMode = pBeaconStruct->HTInfo.rifsMode; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4223 | limLog(pMac, LOG2, FL("StaContext txChannelWidthSet: %d mimoPS: %d" |
| 4224 | " delBASupport: %d maxAmsduSize: %d"), |
| 4225 | pAddBssParams->staContext.txChannelWidthSet, |
| 4226 | pAddBssParams->staContext.mimoPS, |
| 4227 | pAddBssParams->staContext.delBASupport, |
| 4228 | pAddBssParams->staContext.maxAmsduSize); |
| 4229 | |
| 4230 | limLog(pMac, LOG2, FL("maxAmpduDensity: %d fDsssCckMode40Mhz: %d " |
| 4231 | "fShortGI20Mhz: %d "),pAddBssParams->staContext.maxAmpduDensity, |
| 4232 | pAddBssParams->staContext.fDsssCckMode40Mhz, |
| 4233 | pAddBssParams->staContext.fShortGI20Mhz); |
| 4234 | |
| 4235 | limLog(pMac, LOG2, FL("fShortGI40Mh: %d maxAmpduSize: %d " |
| 4236 | "htLdpcCapable: %d vhtLdpcCapable: %d"), |
| 4237 | pAddBssParams->staContext.fShortGI40Mhz, |
| 4238 | pAddBssParams->staContext.maxAmpduSize, |
| 4239 | pAddBssParams->staContext.htLdpcCapable, |
| 4240 | pAddBssParams->staContext.vhtLdpcCapable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4241 | } |
| 4242 | |
Pratik Bhalgat | b5b19b0 | 2012-11-22 16:28:19 +0530 | [diff] [blame] | 4243 | //If WMM IE or 802.11E IE is not present and AP is HT AP then enable WMM |
| 4244 | if ((psessionEntry->limWmeEnabled && (pBeaconStruct->wmeEdcaPresent || pAddBssParams->staContext.htCapable)) || |
| 4245 | (psessionEntry->limQosEnabled && (pBeaconStruct->edcaPresent || pAddBssParams->staContext.htCapable))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4246 | pAddBssParams->staContext.wmmEnabled = 1; |
| 4247 | else |
| 4248 | pAddBssParams->staContext.wmmEnabled = 0; |
| 4249 | |
| 4250 | //Update the rates |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4251 | #ifdef WLAN_FEATURE_11AC |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 4252 | limPopulatePeerRateSet(pMac, &pAddBssParams->staContext.supportedRates, |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4253 | pBeaconStruct->HTCaps.supportedMCSSet, false,psessionEntry, |
| 4254 | &pBeaconStruct->VHTCaps); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4255 | #else |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 4256 | limPopulatePeerRateSet(pMac, &pAddBssParams->staContext.supportedRates, |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4257 | pBeaconStruct->HTCaps.supportedMCSSet, false,psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4258 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4259 | limFillSupportedRatesInfo(pMac, NULL, &pAddBssParams->staContext.supportedRates,psessionEntry); |
| 4260 | |
| 4261 | } |
| 4262 | |
| 4263 | |
| 4264 | //Disable BA. It will be set as part of ADDBA negotiation. |
| 4265 | for( i = 0; i < STACFG_MAX_TC; i++ ) |
| 4266 | { |
| 4267 | pAddBssParams->staContext.staTCParams[i].txUseBA = eBA_DISABLE; |
| 4268 | pAddBssParams->staContext.staTCParams[i].rxUseBA = eBA_DISABLE; |
| 4269 | pAddBssParams->staContext.staTCParams[i].txBApolicy = eBA_POLICY_IMMEDIATE; |
| 4270 | pAddBssParams->staContext.staTCParams[i].rxBApolicy = eBA_POLICY_IMMEDIATE; |
| 4271 | } |
| 4272 | |
| 4273 | pAddBssParams->staContext.encryptType = psessionEntry->encryptType; |
| 4274 | |
| 4275 | #if defined WLAN_FEATURE_VOWIFI |
| 4276 | pAddBssParams->maxTxPower = psessionEntry->maxTxPower; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4277 | limLog(pMac, LOG2,FL("maxTxPower: %d"), |
| 4278 | pAddBssParams->maxTxPower); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4279 | #endif |
| 4280 | |
| 4281 | pAddBssParams->status = eHAL_STATUS_SUCCESS; |
| 4282 | pAddBssParams->respReqd = true; |
| 4283 | |
| 4284 | pAddBssParams->staContext.sessionId = psessionEntry->peSessionId; |
| 4285 | pAddBssParams->sessionId = psessionEntry->peSessionId; |
| 4286 | |
| 4287 | pAddBssParams->halPersona = (tANI_U8)psessionEntry->pePersona; //update persona |
| 4288 | |
Bansidhar Gopalachari | b099ac6 | 2013-06-12 19:02:39 -0700 | [diff] [blame] | 4289 | pAddBssParams->bSpectrumMgtEnabled = psessionEntry->spectrumMgtEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4290 | |
| 4291 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 4292 | pAddBssParams->extSetStaKeyParamValid = 0; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4293 | limLog(pMac, LOG2,FL("extSetStaKeyParamValid: %d"), |
| 4294 | pAddBssParams->extSetStaKeyParamValid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4295 | #endif |
| 4296 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4297 | #ifdef WLAN_FEATURE_11W |
| 4298 | if (psessionEntry->limRmfEnabled) |
| 4299 | { |
| 4300 | pAddBssParams->rmfEnabled = 1; |
| 4301 | pAddBssParams->staContext.rmfEnabled = 1; |
| 4302 | } |
| 4303 | #endif |
| 4304 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4305 | // Set a new state for MLME |
| 4306 | |
| 4307 | //pMac->lim.gLimMlmState = eLIM_MLM_WT_ADD_BSS_RSP_PREASSOC_STATE; |
| 4308 | psessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_PREASSOC_STATE; |
| 4309 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4310 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4311 | |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4312 | limLog(pMac, LOG2, FL("staContext wmmEnabled: %d encryptType: %d " |
| 4313 | "p2pCapableSta: %d"),pAddBssParams->staContext.wmmEnabled, |
| 4314 | pAddBssParams->staContext.encryptType, |
| 4315 | pAddBssParams->staContext.p2pCapableSta); |
| 4316 | |
| 4317 | limLog(pMac, LOG2, FL("bSpectrumMgtEnabled: %d halPersona: %d setting " |
| 4318 | "LimMlm state to %d"), pAddBssParams->bSpectrumMgtEnabled, |
| 4319 | pAddBssParams->halPersona, psessionEntry->limMlmState); |
| 4320 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4321 | //we need to defer the message until we get the response back from HAL. |
| 4322 | SET_LIM_PROCESS_DEFD_MESGS(pMac, false); |
| 4323 | |
| 4324 | msgQ.type = WDA_ADD_BSS_REQ; |
| 4325 | /** @ToDo : Update the Global counter to keeptrack of the PE <--> HAL messages*/ |
| 4326 | msgQ.reserved = 0; |
| 4327 | msgQ.bodyptr = pAddBssParams; |
| 4328 | msgQ.bodyval = 0; |
| 4329 | |
| 4330 | limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_BSS_REQ..." )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4331 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4332 | |
| 4333 | retCode = wdaPostCtrlMsg( pMac, &msgQ ); |
| 4334 | if( eSIR_SUCCESS != retCode) |
| 4335 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4336 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4337 | vos_mem_free(pAddBssParams); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 4338 | limLog( pMac, LOGE, FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4339 | retCode ); |
| 4340 | goto returnFailure; |
| 4341 | |
| 4342 | } |
| 4343 | else |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4344 | { |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4345 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4346 | return retCode; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4347 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4348 | |
| 4349 | returnFailure: |
| 4350 | // Clean-up will be done by the caller... |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4351 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4352 | return retCode; |
| 4353 | } |
| 4354 | |
| 4355 | |
| 4356 | |
| 4357 | |
| 4358 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4359 | |
| 4360 | /** ------------------------------------------------------------- |
| 4361 | \fn limPrepareAndSendDelStaCnf |
| 4362 | \brief deletes DPH entry |
| 4363 | changes the MLM mode for station. |
| 4364 | calls limSendDelStaCnf |
| 4365 | \param tpAniSirGlobal pMac |
| 4366 | \param tpDphHashNode pStaDs |
| 4367 | \return none |
| 4368 | -------------------------------------------------------------*/ |
| 4369 | |
| 4370 | |
| 4371 | void |
| 4372 | limPrepareAndSendDelStaCnf(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tSirResultCodes statusCode,tpPESession psessionEntry) |
| 4373 | { |
| 4374 | tANI_U16 staDsAssocId = 0; |
| 4375 | tSirMacAddr staDsAddr; |
| 4376 | tLimMlmStaContext mlmStaContext; |
| 4377 | |
| 4378 | if(pStaDs == NULL) |
| 4379 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 4380 | PELOGW(limLog(pMac, LOGW, FL("pStaDs is NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4381 | return; |
| 4382 | } |
| 4383 | staDsAssocId = pStaDs->assocId; |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4384 | vos_mem_copy((tANI_U8 *)staDsAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4385 | pStaDs->staAddr, |
| 4386 | sizeof(tSirMacAddr)); |
| 4387 | |
| 4388 | mlmStaContext = pStaDs->mlmStaContext; |
Madan Mohan Koyyalamudi | e3830c4 | 2013-08-08 20:38:47 +0530 | [diff] [blame] | 4389 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 4390 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4391 | { |
Madan Mohan Koyyalamudi | e3830c4 | 2013-08-08 20:38:47 +0530 | [diff] [blame] | 4392 | limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4393 | } |
Madan Mohan Koyyalamudi | e3830c4 | 2013-08-08 20:38:47 +0530 | [diff] [blame] | 4394 | limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, psessionEntry); |
| 4395 | |
| 4396 | if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE)|| |
| 4397 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4398 | { |
| 4399 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Madan Mohan Koyyalamudi | e3830c4 | 2013-08-08 20:38:47 +0530 | [diff] [blame] | 4400 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, |
| 4401 | psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4402 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4403 | limSendDelStaCnf(pMac, staDsAddr, staDsAssocId, mlmStaContext, statusCode,psessionEntry); |
| 4404 | } |
| 4405 | |
| 4406 | /** ------------------------------------------------------------- |
| 4407 | \fn limGetStaRateMode |
| 4408 | \brief Gets the Station Rate Mode. |
| 4409 | \param tANI_U8 dot11Mode |
| 4410 | \return none |
| 4411 | -------------------------------------------------------------*/ |
| 4412 | tStaRateMode limGetStaRateMode(tANI_U8 dot11Mode) |
| 4413 | { |
| 4414 | switch(dot11Mode) |
| 4415 | { |
| 4416 | case WNI_CFG_DOT11_MODE_11A: |
| 4417 | return eSTA_11a; |
| 4418 | case WNI_CFG_DOT11_MODE_11B: |
| 4419 | return eSTA_11b; |
| 4420 | case WNI_CFG_DOT11_MODE_11G: |
| 4421 | return eSTA_11bg; |
| 4422 | case WNI_CFG_DOT11_MODE_11N: |
| 4423 | return eSTA_11n; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4424 | #ifdef WLAN_FEATURE_11AC |
| 4425 | case WNI_CFG_DOT11_MODE_11AC: |
| 4426 | return eSTA_11ac; |
| 4427 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4428 | case WNI_CFG_DOT11_MODE_ALL: |
| 4429 | default: |
| 4430 | return eSTA_11n; |
| 4431 | |
| 4432 | } |
| 4433 | } |
| 4434 | |
| 4435 | /** ------------------------------------------------------------- |
| 4436 | \fn limInitPreAuthTimerTable |
| 4437 | \brief Initialize the Pre Auth Tanle and creates the timer for |
| 4438 | each node for the timeout value got from cfg. |
| 4439 | \param tpAniSirGlobal pMac |
| 4440 | \param tpLimPreAuthTable pPreAuthTimerTable |
| 4441 | \return none |
| 4442 | -------------------------------------------------------------*/ |
| 4443 | void limInitPreAuthTimerTable(tpAniSirGlobal pMac, tpLimPreAuthTable pPreAuthTimerTable) |
| 4444 | { |
| 4445 | tANI_U32 cfgValue; |
| 4446 | tANI_U32 authNodeIdx; |
| 4447 | tpLimPreAuthNode pAuthNode = pPreAuthTimerTable->pTable; |
| 4448 | |
| 4449 | // Get AUTH_RSP Timers value |
| 4450 | |
| 4451 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_RSP_TIMEOUT, |
| 4452 | &cfgValue) != eSIR_SUCCESS) |
| 4453 | { |
| 4454 | /* |
| 4455 | ** Could not get AUTH_RSP timeout value |
| 4456 | ** from CFG. Log error. |
| 4457 | **/ |
| 4458 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 4459 | FL("could not retrieve AUTH_RSP timeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4460 | return; |
| 4461 | } |
| 4462 | |
| 4463 | cfgValue = SYS_MS_TO_TICKS(cfgValue); |
| 4464 | for(authNodeIdx=0; authNodeIdx<pPreAuthTimerTable->numEntry; authNodeIdx++, pAuthNode++) |
| 4465 | { |
| 4466 | if (tx_timer_create(&pAuthNode->timer, |
| 4467 | "AUTH RESPONSE TIMEOUT", |
| 4468 | limAuthResponseTimerHandler, |
| 4469 | authNodeIdx, |
| 4470 | cfgValue, |
| 4471 | 0, |
| 4472 | TX_NO_ACTIVATE) != TX_SUCCESS) |
| 4473 | { |
| 4474 | // Cannot create timer. Log error. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 4475 | limLog(pMac, LOGP, FL("Cannot create Auth Rsp timer of Index :%d."), authNodeIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4476 | return; |
| 4477 | } |
| 4478 | pAuthNode->authNodeIdx = (tANI_U8)authNodeIdx; |
| 4479 | pAuthNode->fFree = 1; |
| 4480 | } |
| 4481 | |
| 4482 | } |
| 4483 | |
| 4484 | /** ------------------------------------------------------------- |
| 4485 | \fn limAcquireFreePreAuthNode |
| 4486 | \brief Retrives a free Pre Auth node from Pre Auth Table. |
| 4487 | \param tpAniSirGlobal pMac |
| 4488 | \param tpLimPreAuthTable pPreAuthTimerTable |
| 4489 | \return none |
| 4490 | -------------------------------------------------------------*/ |
| 4491 | tLimPreAuthNode * limAcquireFreePreAuthNode(tpAniSirGlobal pMac, tpLimPreAuthTable pPreAuthTimerTable) |
| 4492 | { |
| 4493 | tANI_U32 i; |
| 4494 | tLimPreAuthNode *pTempNode = pPreAuthTimerTable->pTable; |
| 4495 | for (i=0; i<pPreAuthTimerTable->numEntry; i++,pTempNode++) |
| 4496 | { |
| 4497 | if (pTempNode->fFree == 1) |
| 4498 | { |
| 4499 | pTempNode->fFree = 0; |
| 4500 | return pTempNode; |
| 4501 | } |
| 4502 | } |
| 4503 | |
| 4504 | return NULL; |
| 4505 | } |
| 4506 | |
| 4507 | /** ------------------------------------------------------------- |
| 4508 | \fn limGetPreAuthNodeFromIndex |
| 4509 | \brief Depending on the Index this retrives the pre auth node. |
| 4510 | \param tpAniSirGlobal pMac |
| 4511 | \param tpLimPreAuthTable pAuthTable |
| 4512 | \param tANI_U32 authNodeIdx |
| 4513 | \return none |
| 4514 | -------------------------------------------------------------*/ |
| 4515 | tLimPreAuthNode * limGetPreAuthNodeFromIndex(tpAniSirGlobal pMac, |
| 4516 | tpLimPreAuthTable pAuthTable, tANI_U32 authNodeIdx) |
| 4517 | { |
| 4518 | if ((authNodeIdx >= pAuthTable->numEntry) || (pAuthTable->pTable == NULL)) |
| 4519 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 4520 | limLog(pMac, LOGE, FL("Invalid Auth Timer Index : %d NumEntry : %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4521 | authNodeIdx, pAuthTable->numEntry); |
| 4522 | return NULL; |
| 4523 | } |
| 4524 | |
| 4525 | return pAuthTable->pTable + authNodeIdx; |
| 4526 | } |
| 4527 | |
| 4528 | /* Util API to check if the channels supported by STA is within range */ |
| 4529 | tSirRetStatus limIsDot11hSupportedChannelsValid(tpAniSirGlobal pMac, tSirAssocReq *assoc) |
| 4530 | { |
| 4531 | /* |
| 4532 | * Allow all the stations to join with us. |
| 4533 | * 802.11h-2003 11.6.1 => An AP may use the supported channels list for associated STAs |
| 4534 | * as an input into an algorithm used to select a new channel for the BSS. |
| 4535 | * The specification of the algorithm is beyond the scope of this amendment. |
| 4536 | */ |
| 4537 | |
| 4538 | return (eSIR_SUCCESS); |
| 4539 | } |
| 4540 | |
| 4541 | /* Util API to check if the txpower supported by STA is within range */ |
| 4542 | tSirRetStatus limIsDot11hPowerCapabilitiesInRange(tpAniSirGlobal pMac, tSirAssocReq *assoc,tpPESession psessionEntry) |
| 4543 | { |
| 4544 | tPowerdBm localMaxTxPower; |
| 4545 | tANI_U32 localPwrConstraint; |
| 4546 | |
| 4547 | localMaxTxPower = cfgGetRegulatoryMaxTransmitPower(pMac, psessionEntry->currentOperChannel); |
| 4548 | |
| 4549 | if(wlan_cfgGetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, &localPwrConstraint) != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 4550 | limLog( pMac, LOGP, FL( "Unable to get Local Power Constraint from cfg" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4551 | return eSIR_FAILURE; |
| 4552 | } |
| 4553 | localMaxTxPower -= (tPowerdBm)localPwrConstraint; |
| 4554 | |
| 4555 | /** |
| 4556 | * The min Tx Power of the associating station should not be greater than (regulatory |
| 4557 | * max tx power - local power constraint configured on AP). |
| 4558 | */ |
| 4559 | if(assoc->powerCapability.minTxPower > localMaxTxPower) |
| 4560 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 4561 | limLog(pMac, LOGW, FL("minTxPower (STA) = %d, localMaxTxPower (AP) = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4562 | assoc->powerCapability.minTxPower, localMaxTxPower); |
| 4563 | return (eSIR_FAILURE); |
| 4564 | } |
| 4565 | |
| 4566 | return (eSIR_SUCCESS); |
| 4567 | } |
| 4568 | |
| 4569 | /** ------------------------------------------------------------- |
| 4570 | \fn limFillRxHighestSupportedRate |
| 4571 | \brief Fills in the Rx Highest Supported Data Rate field from |
| 4572 | \ the 'supported MCS set' field in HT capability element. |
| 4573 | \param tpAniSirGlobal pMac |
| 4574 | \param tpSirSupportedRates pRates |
| 4575 | \param tANI_U8* pSupportedMCSSet |
| 4576 | \return none |
| 4577 | -------------------------------------------------------------*/ |
| 4578 | void limFillRxHighestSupportedRate(tpAniSirGlobal pMac, tANI_U16 *rxHighestRate, tANI_U8* pSupportedMCSSet) |
| 4579 | { |
| 4580 | tSirMacRxHighestSupportRate *pRxHighestRate; |
| 4581 | tANI_U8 *pBuf; |
| 4582 | tANI_U16 rate=0; |
| 4583 | |
| 4584 | pBuf = pSupportedMCSSet + MCS_RX_HIGHEST_SUPPORTED_RATE_BYTE_OFFSET; |
| 4585 | rate = limGetU16(pBuf); |
| 4586 | |
| 4587 | pRxHighestRate = (tSirMacRxHighestSupportRate *) &rate; |
| 4588 | *rxHighestRate = pRxHighestRate->rate; |
| 4589 | |
| 4590 | return; |
| 4591 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4592 | |
| 4593 | #ifdef WLAN_FEATURE_11W |
| 4594 | /** ------------------------------------------------------------- |
| 4595 | \fn limSendSmeUnprotectedMgmtFrameInd |
| 4596 | \brief Forwards the unprotected management frame to SME. |
| 4597 | \param tpAniSirGlobal pMac |
| 4598 | \param frameType - 802.11 frame type |
| 4599 | \param frame - frame buffer |
| 4600 | \param sessionId - id for the current session |
| 4601 | \param psessionEntry - PE session context |
| 4602 | \return none |
| 4603 | -------------------------------------------------------------*/ |
| 4604 | void limSendSmeUnprotectedMgmtFrameInd( |
| 4605 | tpAniSirGlobal pMac, tANI_U8 frameType, |
| 4606 | tANI_U8 *frame, tANI_U32 frameLen, tANI_U16 sessionId, |
| 4607 | tpPESession psessionEntry) |
| 4608 | { |
| 4609 | tSirMsgQ mmhMsg; |
| 4610 | tSirSmeUnprotMgmtFrameInd * pSirSmeMgmtFrame = NULL; |
| 4611 | tANI_U16 length; |
| 4612 | |
| 4613 | length = sizeof(tSirSmeUnprotMgmtFrameInd) + frameLen; |
| 4614 | |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4615 | pSirSmeMgmtFrame = vos_mem_malloc(length); |
| 4616 | if (NULL == pSirSmeMgmtFrame) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4617 | { |
| 4618 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4619 | FL("AllocateMemory failed for tSirSmeUnprotectedMgmtFrameInd")); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4620 | return; |
| 4621 | } |
Bansidhar Gopalachari | 3999e2e | 2013-07-12 10:57:01 +0530 | [diff] [blame] | 4622 | vos_mem_set((void*)pSirSmeMgmtFrame, length, 0); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4623 | |
| 4624 | pSirSmeMgmtFrame->sessionId = sessionId; |
| 4625 | pSirSmeMgmtFrame->frameType = frameType; |
| 4626 | |
| 4627 | vos_mem_copy(pSirSmeMgmtFrame->frameBuf, frame, frameLen); |
| 4628 | pSirSmeMgmtFrame->frameLen = frameLen; |
| 4629 | |
| 4630 | mmhMsg.type = eWNI_SME_UNPROT_MGMT_FRM_IND; |
| 4631 | mmhMsg.bodyptr = pSirSmeMgmtFrame; |
| 4632 | mmhMsg.bodyval = 0; |
| 4633 | |
| 4634 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 4635 | return; |
| 4636 | } |
| 4637 | #endif |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4638 | |
| 4639 | #if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD) |
| 4640 | /** ------------------------------------------------------------- |
| 4641 | \fn limSendSmeTsmIEInd |
| 4642 | \brief Forwards the TSM IE information to SME. |
| 4643 | \param tpAniSirGlobal pMac |
| 4644 | \param psessionEntry - PE session context |
| 4645 | \param tid - traffic id |
| 4646 | \param state - tsm state (enabled/disabled) |
| 4647 | \param measurementInterval - measurement interval |
| 4648 | \return none |
| 4649 | -------------------------------------------------------------*/ |
| 4650 | void limSendSmeTsmIEInd(tpAniSirGlobal pMac, tpPESession psessionEntry, |
| 4651 | tANI_U8 tid, tANI_U8 state, tANI_U16 measInterval) |
| 4652 | { |
| 4653 | tSirMsgQ mmhMsg; |
| 4654 | tpSirSmeTsmIEInd pSirSmeTsmIeInd = NULL; |
| 4655 | |
| 4656 | if (!pMac || !psessionEntry) |
| 4657 | { |
| 4658 | return; |
| 4659 | } |
| 4660 | pSirSmeTsmIeInd = vos_mem_malloc(sizeof(tSirSmeTsmIEInd)); |
| 4661 | if (NULL == pSirSmeTsmIeInd) |
| 4662 | { |
| 4663 | limLog(pMac, LOGP, |
| 4664 | FL("AllocateMemory failed for tSirSmeTsmIEInd")); |
| 4665 | return; |
| 4666 | } |
| 4667 | vos_mem_set((void*)pSirSmeTsmIeInd, sizeof(tSirSmeTsmIEInd), 0); |
| 4668 | |
| 4669 | pSirSmeTsmIeInd->sessionId = psessionEntry->smeSessionId; |
| 4670 | pSirSmeTsmIeInd->tsmIe.tsid = tid; |
| 4671 | pSirSmeTsmIeInd->tsmIe.state= state; |
| 4672 | pSirSmeTsmIeInd->tsmIe.msmt_interval= measInterval; |
| 4673 | |
| 4674 | mmhMsg.type = eWNI_SME_TSM_IE_IND; |
| 4675 | mmhMsg.bodyptr = pSirSmeTsmIeInd; |
| 4676 | mmhMsg.bodyval = 0; |
| 4677 | |
| 4678 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 4679 | return; |
| 4680 | } |
| 4681 | #endif /* FEATURE_WLAN_CCX && FEATURE_WLAN_CCX_UPLOAD */ |
| 4682 | |
| 4683 | |