Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Abhishek Singh | 74037df | 2017-07-20 11:08:56 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 30 | * This file limPropExtsUtils.cc contains the utility functions |
| 31 | * to populate, parse proprietary extensions required to |
| 32 | * support ANI feature set. |
| 33 | * |
| 34 | * Author: Chandra Modumudi |
| 35 | * Date: 11/27/02 |
| 36 | * History:- |
| 37 | * Date Modified by Modification Information |
| 38 | * -------------------------------------------------------------------- |
| 39 | * |
| 40 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 41 | #include "aniGlobal.h" |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 42 | #include "wniCfg.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 43 | #include "sirCommon.h" |
| 44 | #include "sirDebug.h" |
| 45 | #include "utilsApi.h" |
| 46 | #include "cfgApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 47 | #include "limApi.h" |
| 48 | #include "limTypes.h" |
| 49 | #include "limUtils.h" |
| 50 | #include "limAssocUtils.h" |
| 51 | #include "limPropExtsUtils.h" |
| 52 | #include "limSerDesUtils.h" |
| 53 | #include "limTrace.h" |
| 54 | #include "limSession.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 55 | #define LIM_GET_NOISE_MAX_TRY 5 |
Sandeep Puligilla | a9eb9ad | 2014-05-27 14:42:50 +0530 | [diff] [blame] | 56 | #define LIM_OPERATING_EXT_IDENTIFIER 201 |
Yeshwanth Sriram Guntuka | 8d9b29c | 2017-12-12 15:44:57 +0530 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * limCheckOUI() - Check if the given OUI match in IE buffer |
| 60 | * @pMac: Pointer to Global MAC structure |
| 61 | * @pIE: Pointer to starting IE |
| 62 | * @ieLen: Length of all IEs |
| 63 | * |
| 64 | * Return: None |
| 65 | */ |
| 66 | static void limCheckOUI(tpAniSirGlobal pMac, tANI_U8 *pIE, tANI_U16 ieLen) |
| 67 | { |
| 68 | tANI_U16 left = ieLen; |
| 69 | tANI_U8 *ptr = pIE; |
| 70 | tANI_U8 elem_id, elem_len, oui_len, i=0; |
| 71 | |
| 72 | pMac->roam.configParam.agg_btc_sco_enabled = eANI_BOOLEAN_FALSE; |
| 73 | |
| 74 | if (!ptr || ieLen == 0) { |
| 75 | limLog(pMac, LOGE, FL("Invalid IEs")); |
| 76 | return; |
| 77 | } |
| 78 | if (!pMac->roam.configParam.num_ba_buff_btc_sco) |
| 79 | return; |
| 80 | |
| 81 | oui_len = 3; |
| 82 | while(i < oui_len && pMac->roam.configParam.agg_btc_sco_oui[i] == 0) |
| 83 | i+=1; |
| 84 | if (i == oui_len) { |
| 85 | /* |
| 86 | * If gEnableAggBTCScoOUI ini is not set, oui is set to all |
| 87 | * zeros and aggregation during SCO should be enabled for |
| 88 | * all APs. |
| 89 | */ |
| 90 | pMac->roam.configParam.agg_btc_sco_enabled = eANI_BOOLEAN_TRUE; |
| 91 | return; |
| 92 | } |
| 93 | |
| 94 | while (left >= 2) { |
| 95 | elem_id = ptr[0]; |
| 96 | elem_len = ptr[1]; |
| 97 | left -= 2; |
| 98 | if (elem_len > left) { |
| 99 | limLog(pMac, LOGE, FL("Invalid IEs eid: %d elem_len: %d left: %d"), |
| 100 | elem_id, elem_len, left); |
| 101 | return; |
| 102 | } |
| 103 | if (SIR_MAC_EID_VENDOR == elem_id) { |
| 104 | if (memcmp(&ptr[2], &pMac->roam.configParam.agg_btc_sco_oui, |
| 105 | oui_len) == 0) { |
| 106 | pMac->roam.configParam.agg_btc_sco_enabled = eANI_BOOLEAN_TRUE; |
| 107 | return; |
| 108 | } |
| 109 | } |
| 110 | left -= elem_len; |
| 111 | ptr += (elem_len + 2); |
| 112 | } |
| 113 | } |
| 114 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 115 | /** |
| 116 | * limExtractApCapability() |
| 117 | * |
| 118 | *FUNCTION: |
| 119 | * This function is called to extract AP's HCF/WME/WSM capability |
| 120 | * from the IEs received from it in Beacon/Probe Response frames |
| 121 | * |
| 122 | *LOGIC: |
| 123 | * |
| 124 | *ASSUMPTIONS: |
| 125 | * NA |
| 126 | * |
| 127 | *NOTE: |
| 128 | * |
| 129 | * @param pMac Pointer to Global MAC structure |
| 130 | * @param pIE Pointer to starting IE in Beacon/Probe Response |
| 131 | * @param ieLen Length of all IEs combined |
| 132 | * @param qosCap Bits are set according to capabilities |
| 133 | * @return 0 - If AP does not assert HCF capability & 1 - otherwise |
| 134 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 135 | void |
| 136 | limExtractApCapability(tpAniSirGlobal pMac, tANI_U8 *pIE, tANI_U16 ieLen, |
| 137 | tANI_U8 *qosCap, tANI_U16 *propCap, tANI_U8 *uapsd, |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 138 | tPowerdBm *localConstraint, |
| 139 | tpPESession psessionEntry |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 140 | ) |
| 141 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 142 | tSirProbeRespBeacon *pBeaconStruct; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 143 | #if !defined WLAN_FEATURE_VOWIFI |
| 144 | tANI_U32 localPowerConstraints = 0; |
| 145 | #endif |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 146 | |
| 147 | pBeaconStruct = vos_mem_malloc(sizeof(tSirProbeRespBeacon)); |
| 148 | |
| 149 | if ( NULL == pBeaconStruct ) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 150 | { |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 151 | limLog(pMac, LOGE, FL("Unable to allocate memory in limExtractApCapability") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 152 | return; |
| 153 | } |
| 154 | |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 155 | vos_mem_set( (tANI_U8 *) pBeaconStruct, sizeof(tSirProbeRespBeacon), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 156 | *qosCap = 0; |
| 157 | *propCap = 0; |
| 158 | *uapsd = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 159 | PELOG3(limLog( pMac, LOG3, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 160 | FL("In limExtractApCapability: The IE's being received are:")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 161 | sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG3, pIE, ieLen );) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 162 | if (sirParseBeaconIE(pMac, pBeaconStruct, pIE, (tANI_U32)ieLen) == eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 163 | { |
Pradeep Reddy POTTETI | a1314a8 | 2015-07-16 15:34:24 +0530 | [diff] [blame] | 164 | if (pBeaconStruct->wmeInfoPresent || pBeaconStruct->wmeEdcaPresent |
| 165 | || pBeaconStruct->HTCaps.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 166 | LIM_BSS_CAPS_SET(WME, *qosCap); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 167 | if (LIM_BSS_CAPS_GET(WME, *qosCap) && pBeaconStruct->wsmCapablePresent) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 168 | LIM_BSS_CAPS_SET(WSM, *qosCap); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 169 | if (pBeaconStruct->propIEinfo.aniIndicator && |
| 170 | pBeaconStruct->propIEinfo.capabilityPresent) |
| 171 | *propCap = pBeaconStruct->propIEinfo.capability; |
| 172 | if (pBeaconStruct->HTCaps.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 173 | pMac->lim.htCapabilityPresentInBeacon = 1; |
| 174 | else |
| 175 | pMac->lim.htCapabilityPresentInBeacon = 0; |
| 176 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 177 | #ifdef WLAN_FEATURE_11AC |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 178 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO_MED, |
Kanchanapally, Vidyullatha | 3f3b654 | 2015-08-21 14:38:49 +0530 | [diff] [blame] | 179 | "***beacon.VHTCaps.present*****=%d BSS_VHT_CAPABLE:%d", |
| 180 | pBeaconStruct->VHTCaps.present, |
| 181 | IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps)); |
Shailender Karmuchi | 08f87c2 | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 182 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO_MED, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 183 | "***beacon.SU Beamformer Capable*****=%d",pBeaconStruct->VHTCaps.suBeamFormerCap); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 184 | |
Kanchanapally, Vidyullatha | 3f3b654 | 2015-08-21 14:38:49 +0530 | [diff] [blame] | 185 | if (IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) |
| 186 | && pBeaconStruct->VHTOperation.present) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 187 | { |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 188 | psessionEntry->vhtCapabilityPresentInBeacon = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 189 | psessionEntry->apCenterChan = pBeaconStruct->VHTOperation.chanCenterFreqSeg1; |
| 190 | psessionEntry->apChanWidth = pBeaconStruct->VHTOperation.chanWidth; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 191 | } |
| 192 | else |
| 193 | { |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 194 | psessionEntry->vhtCapabilityPresentInBeacon = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 195 | } |
| 196 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 197 | // Extract the UAPSD flag from WMM Parameter element |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 198 | if (pBeaconStruct->wmeEdcaPresent) |
| 199 | *uapsd = pBeaconStruct->edcaParams.qosInfo.uapsd; |
Sandeep Puligilla | a9eb9ad | 2014-05-27 14:42:50 +0530 | [diff] [blame] | 200 | |
| 201 | /* Get MaxTxPwr from country IE if present. |
| 202 | If the channel number field has a positive integer value less |
| 203 | than 201, then it contains a positive integer value that indicates |
| 204 | the lowest channel number in the subband */ |
| 205 | |
| 206 | if (pBeaconStruct->countryInfoPresent && |
| 207 | pBeaconStruct->countryInfoParam.channelTransmitPower[0].channelNumber < LIM_OPERATING_EXT_IDENTIFIER ) |
| 208 | { |
| 209 | int i; |
| 210 | tANI_U8 firstChannel =0, numChannels =0; |
| 211 | tANI_U8 channel = psessionEntry->currentOperChannel; |
| 212 | |
| 213 | for (i=0; i < pBeaconStruct->countryInfoParam.numIntervals; ++i) |
| 214 | { |
| 215 | if (i >= COUNTRY_INFO_MAX_CHANNEL) |
| 216 | break; |
| 217 | |
| 218 | firstChannel = pBeaconStruct->countryInfoParam.channelTransmitPower[i].channelNumber; |
| 219 | numChannels = pBeaconStruct->countryInfoParam.channelTransmitPower[i].numChannel; |
| 220 | |
| 221 | if ((channel >= firstChannel) && |
| 222 | (channel < (firstChannel + numChannels))) |
| 223 | break; |
| 224 | } |
| 225 | |
| 226 | if (i < pBeaconStruct->countryInfoParam.numIntervals && i < COUNTRY_INFO_MAX_CHANNEL) |
| 227 | { |
| 228 | *localConstraint = pBeaconStruct->countryInfoParam.channelTransmitPower[i].maxTransmitPower; |
| 229 | } |
| 230 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 231 | #if defined FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 232 | /* If there is Power Constraint Element specifically, |
| 233 | * adapt to it. Hence there is else condition check |
| 234 | * for this if statement. |
| 235 | */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 236 | if ( pBeaconStruct->eseTxPwr.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 237 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 238 | *localConstraint = pBeaconStruct->eseTxPwr.power_limit; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 239 | } |
| 240 | #endif |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 241 | if (pBeaconStruct->powerConstraintPresent) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | { |
Sandeep Puligilla | a9eb9ad | 2014-05-27 14:42:50 +0530 | [diff] [blame] | 243 | *localConstraint -= pBeaconStruct->localPowerConstraint.localPowerConstraints; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 244 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 245 | #if !defined WLAN_FEATURE_VOWIFI |
Sandeep Puligilla | a9eb9ad | 2014-05-27 14:42:50 +0530 | [diff] [blame] | 246 | localPowerConstraints = (tANI_U32)pBeaconStruct->localPowerConstraint.localPowerConstraints; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 247 | if (cfgSetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, localPowerConstraints) != eSIR_SUCCESS) |
| 248 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 249 | limLog(pMac, LOGP, FL("Could not update local power constraint to cfg.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 250 | } |
| 251 | #endif |
Rajesh Babu Prathipati | 043149f | 2014-06-06 13:33:45 +0530 | [diff] [blame] | 252 | psessionEntry->countryInfoPresent = FALSE; /* Initializing before first use */ |
| 253 | if (pBeaconStruct->countryInfoPresent) |
| 254 | { |
| 255 | psessionEntry->countryInfoPresent = TRUE; |
| 256 | } |
Hu Wang | 5193b57 | 2016-08-11 10:04:47 +0800 | [diff] [blame] | 257 | /* Save the Extended caps from AP in probe resp or beacon */ |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 258 | if (pBeaconStruct->ExtCap.present) |
| 259 | { |
Hu Wang | 5193b57 | 2016-08-11 10:04:47 +0800 | [diff] [blame] | 260 | vos_mem_copy(&psessionEntry->ExtCap, &pBeaconStruct->ExtCap, sizeof(tDot11fIEExtCap)); |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 261 | } |
| 262 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 263 | } |
Abhishek Singh | 74037df | 2017-07-20 11:08:56 +0530 | [diff] [blame] | 264 | |
Yeshwanth Sriram Guntuka | 8d9b29c | 2017-12-12 15:44:57 +0530 | [diff] [blame] | 265 | limCheckOUI(pMac, pIE, ieLen); |
Abhishek Singh | 74037df | 2017-07-20 11:08:56 +0530 | [diff] [blame] | 266 | /* Update HS 2.0 Information Element */ |
| 267 | sir_copy_hs20_ie(&psessionEntry->hs20vendor_ie, |
| 268 | &pBeaconStruct->hs20vendor_ie); |
Madan Mohan Koyyalamudi | 9e8ce1f | 2013-07-11 10:40:43 +0530 | [diff] [blame] | 269 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 270 | return; |
| 271 | } /****** end limExtractApCapability() ******/ |
| 272 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 273 | /** |
| 274 | * limGetHTCBState |
| 275 | * |
| 276 | *FUNCTION: |
| 277 | * This routing provides the translation of Airgo Enum to HT enum for determining |
| 278 | * secondary channel offset. |
| 279 | * Airgo Enum is required for backward compatibility purposes. |
| 280 | * |
| 281 | * |
| 282 | *NOTE: |
| 283 | * |
| 284 | * @param pMac - Pointer to Global MAC structure |
| 285 | * @return The corresponding HT enumeration |
| 286 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 287 | ePhyChanBondState limGetHTCBState(ePhyChanBondState aniCBMode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 288 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 289 | switch ( aniCBMode ) |
| 290 | { |
| 291 | #ifdef WLAN_FEATURE_11AC |
| 292 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 293 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 294 | case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 295 | #endif |
| 296 | case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 297 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 298 | #ifdef WLAN_FEATURE_11AC |
| 299 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 300 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 301 | case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 302 | #endif |
| 303 | case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 304 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 305 | #ifdef WLAN_FEATURE_11AC |
| 306 | case PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 307 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 308 | #endif |
| 309 | default : |
| 310 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 311 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | } |
| 313 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 314 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 315 | * limGetStaPeerType |
| 316 | * |
| 317 | *FUNCTION: |
| 318 | * Based on a combination of the following - |
| 319 | * 1) tDphHashNode.aniPeer |
| 320 | * 2) tDphHashNode.propCapability |
| 321 | * this API determines if a given STA is an ANI peer or not |
| 322 | * |
| 323 | *LOGIC: |
| 324 | * |
| 325 | *ASSUMPTIONS: |
| 326 | * |
| 327 | *NOTE: |
| 328 | * |
| 329 | * @param pMac - Pointer to Global MAC structure |
| 330 | * @param pStaDs - Pointer to the tpDphHashNode of the STA |
| 331 | * under consideration |
| 332 | * @return tStaRateMode |
| 333 | */ |
| 334 | tStaRateMode limGetStaPeerType( tpAniSirGlobal pMac, |
| 335 | tpDphHashNode pStaDs, |
| 336 | tpPESession psessionEntry) |
| 337 | { |
| 338 | tStaRateMode staPeerType = eSTA_11b; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 339 | // Determine the peer-STA type |
| 340 | if( pStaDs->aniPeer ) |
| 341 | { |
| 342 | if(PROP_CAPABILITY_GET( TAURUS, pStaDs->propCapability )) |
| 343 | staPeerType = eSTA_TAURUS; |
| 344 | else if( PROP_CAPABILITY_GET( TITAN, pStaDs->propCapability )) |
| 345 | staPeerType = eSTA_TITAN; |
| 346 | else |
| 347 | staPeerType = eSTA_POLARIS; |
| 348 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 349 | #ifdef WLAN_FEATURE_11AC |
| 350 | else if(pStaDs->mlmStaContext.vhtCapability) |
| 351 | staPeerType = eSTA_11ac; |
| 352 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 353 | else if(pStaDs->mlmStaContext.htCapability) |
| 354 | staPeerType = eSTA_11n; |
| 355 | else if(pStaDs->erpEnabled) |
| 356 | staPeerType = eSTA_11bg; |
| 357 | else if(psessionEntry->limRFBand == SIR_BAND_5_GHZ) |
| 358 | staPeerType = eSTA_11a; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 359 | return staPeerType; |
| 360 | } |
| 361 | |