Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Abhishek Singh | c75726d | 2015-04-13 14:44:14 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -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. |
| 20 | */ |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 21 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 22 | /* |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file parserApi.cc contains the code for parsing |
| 30 | * 802.11 messages. |
| 31 | * Author: Pierre Vandwalle |
| 32 | * Date: 03/18/02 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | * |
| 37 | */ |
| 38 | |
| 39 | #include "sirApi.h" |
| 40 | #include "aniGlobal.h" |
| 41 | #include "parserApi.h" |
| 42 | #include "cfgApi.h" |
| 43 | #include "limUtils.h" |
| 44 | #include "utilsParser.h" |
| 45 | #include "limSerDesUtils.h" |
| 46 | #include "schApi.h" |
| 47 | #include "palApi.h" |
| 48 | #include "wmmApsd.h" |
| 49 | #if defined WLAN_FEATURE_VOWIFI |
| 50 | #include "rrmApi.h" |
| 51 | #endif |
| 52 | |
| 53 | |
| 54 | |
| 55 | //////////////////////////////////////////////////////////////////////// |
| 56 | void dot11fLog(tpAniSirGlobal pMac, int loglevel, const char *pString,...) |
| 57 | { |
| 58 | #ifdef WLAN_DEBUG |
| 59 | if( (tANI_U32)loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_DBG_MODULE_ID )] ) |
| 60 | { |
| 61 | return; |
| 62 | } |
| 63 | else |
| 64 | { |
| 65 | va_list marker; |
| 66 | |
| 67 | va_start( marker, pString ); /* Initialize variable arguments. */ |
| 68 | |
| 69 | logDebug(pMac, SIR_DBG_MODULE_ID, loglevel, pString, marker); |
| 70 | |
| 71 | va_end( marker ); /* Reset variable arguments. */ |
| 72 | } |
| 73 | #endif |
| 74 | } |
| 75 | |
| 76 | void |
| 77 | swapBitField16(tANI_U16 in, tANI_U16 *out) |
| 78 | { |
| 79 | # ifdef ANI_LITTLE_BIT_ENDIAN |
| 80 | *out = in; |
| 81 | # else // Big-Endian... |
| 82 | *out = ( ( in & 0x8000 ) >> 15 ) | |
| 83 | ( ( in & 0x4000 ) >> 13 ) | |
| 84 | ( ( in & 0x2000 ) >> 11 ) | |
| 85 | ( ( in & 0x1000 ) >> 9 ) | |
| 86 | ( ( in & 0x0800 ) >> 7 ) | |
| 87 | ( ( in & 0x0400 ) >> 5 ) | |
| 88 | ( ( in & 0x0200 ) >> 3 ) | |
| 89 | ( ( in & 0x0100 ) >> 1 ) | |
| 90 | ( ( in & 0x0080 ) << 1 ) | |
| 91 | ( ( in & 0x0040 ) << 3 ) | |
| 92 | ( ( in & 0x0020 ) << 5 ) | |
| 93 | ( ( in & 0x0010 ) << 7 ) | |
| 94 | ( ( in & 0x0008 ) << 9 ) | |
| 95 | ( ( in & 0x0004 ) << 11 ) | |
| 96 | ( ( in & 0x0002 ) << 13 ) | |
| 97 | ( ( in & 0x0001 ) << 15 ); |
| 98 | # endif // ANI_LITTLE_BIT_ENDIAN |
| 99 | } |
| 100 | |
| 101 | void |
| 102 | swapBitField32(tANI_U32 in, tANI_U32 *out) |
| 103 | { |
| 104 | # ifdef ANI_LITTLE_BIT_ENDIAN |
| 105 | *out = in; |
| 106 | # else // Big-Endian... |
| 107 | *out = ( ( in & 0x80000000 ) >> 31 ) | |
| 108 | ( ( in & 0x40000000 ) >> 29 ) | |
| 109 | ( ( in & 0x20000000 ) >> 27 ) | |
| 110 | ( ( in & 0x10000000 ) >> 25 ) | |
| 111 | ( ( in & 0x08000000 ) >> 23 ) | |
| 112 | ( ( in & 0x04000000 ) >> 21 ) | |
| 113 | ( ( in & 0x02000000 ) >> 19 ) | |
| 114 | ( ( in & 0x01000000 ) >> 17 ) | |
| 115 | ( ( in & 0x00800000 ) >> 15 ) | |
| 116 | ( ( in & 0x00400000 ) >> 13 ) | |
| 117 | ( ( in & 0x00200000 ) >> 11 ) | |
| 118 | ( ( in & 0x00100000 ) >> 9 ) | |
| 119 | ( ( in & 0x00080000 ) >> 7 ) | |
| 120 | ( ( in & 0x00040000 ) >> 5 ) | |
| 121 | ( ( in & 0x00020000 ) >> 3 ) | |
| 122 | ( ( in & 0x00010000 ) >> 1 ) | |
| 123 | ( ( in & 0x00008000 ) << 1 ) | |
| 124 | ( ( in & 0x00004000 ) << 3 ) | |
| 125 | ( ( in & 0x00002000 ) << 5 ) | |
| 126 | ( ( in & 0x00001000 ) << 7 ) | |
| 127 | ( ( in & 0x00000800 ) << 9 ) | |
| 128 | ( ( in & 0x00000400 ) << 11 ) | |
| 129 | ( ( in & 0x00000200 ) << 13 ) | |
| 130 | ( ( in & 0x00000100 ) << 15 ) | |
| 131 | ( ( in & 0x00000080 ) << 17 ) | |
| 132 | ( ( in & 0x00000040 ) << 19 ) | |
| 133 | ( ( in & 0x00000020 ) << 21 ) | |
| 134 | ( ( in & 0x00000010 ) << 23 ) | |
| 135 | ( ( in & 0x00000008 ) << 25 ) | |
| 136 | ( ( in & 0x00000004 ) << 27 ) | |
| 137 | ( ( in & 0x00000002 ) << 29 ) | |
| 138 | ( ( in & 0x00000001 ) << 31 ); |
| 139 | # endif // ANI_LITTLE_BIT_ENDIAN |
| 140 | } |
| 141 | |
| 142 | inline static void __printWMMParams(tpAniSirGlobal pMac, tDot11fIEWMMParams *pWmm) |
| 143 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 144 | limLog(pMac, LOG1, FL("WMM Parameters Received: ")); |
| 145 | limLog(pMac, LOG1, FL("BE: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 146 | pWmm->acbe_aifsn, pWmm->acbe_acm, pWmm->acbe_aci, pWmm->acbe_acwmin, pWmm->acbe_acwmax, pWmm->acbe_txoplimit); |
| 147 | |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 148 | limLog(pMac, LOG1, FL("BK: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 149 | pWmm->acbk_aifsn, pWmm->acbk_acm, pWmm->acbk_aci, pWmm->acbk_acwmin, pWmm->acbk_acwmax, pWmm->acbk_txoplimit); |
| 150 | |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 151 | limLog(pMac, LOG1, FL("VI: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 152 | pWmm->acvi_aifsn, pWmm->acvi_acm, pWmm->acvi_aci, pWmm->acvi_acwmin, pWmm->acvi_acwmax, pWmm->acvi_txoplimit); |
| 153 | |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 154 | limLog(pMac, LOG1, FL("VO: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 155 | pWmm->acvo_aifsn, pWmm->acvo_acm, pWmm->acvo_aci, pWmm->acvo_acwmin, pWmm->acvo_acwmax, pWmm->acvo_txoplimit); |
| 156 | |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | //////////////////////////////////////////////////////////////////////// |
| 161 | // Functions for populating "dot11f" style IEs |
| 162 | |
| 163 | |
| 164 | // return: >= 0, the starting location of the IE in rsnIEdata inside tSirRSNie |
| 165 | // < 0, cannot find |
| 166 | int FindIELocation( tpAniSirGlobal pMac, |
| 167 | tpSirRSNie pRsnIe, |
| 168 | tANI_U8 EID) |
| 169 | { |
| 170 | int idx, ieLen, bytesLeft; |
Madan Mohan Koyyalamudi | cae253a | 2012-11-06 19:10:35 -0800 | [diff] [blame] | 171 | int ret_val = -1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 172 | |
| 173 | // Here's what's going on: 'rsnIe' looks like this: |
| 174 | |
| 175 | // typedef struct sSirRSNie |
| 176 | // { |
| 177 | // tANI_U16 length; |
| 178 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 179 | // } tSirRSNie, *tpSirRSNie; |
| 180 | |
| 181 | // other code records both the WPA & RSN IEs (including their EIDs & |
| 182 | // lengths) into the array 'rsnIEdata'. We may have: |
| 183 | |
| 184 | // With WAPI support, there may be 3 IEs here |
| 185 | // It can be only WPA IE, or only RSN IE or only WAPI IE |
| 186 | // Or two or all three of them with no particular ordering |
| 187 | |
| 188 | // The if/then/else statements that follow are here to figure out |
| 189 | // whether we have the WPA IE, and where it is if we *do* have it. |
| 190 | |
| 191 | //Save the first IE length |
| 192 | ieLen = pRsnIe->rsnIEdata[ 1 ] + 2; |
| 193 | idx = 0; |
| 194 | bytesLeft = pRsnIe->length; |
| 195 | |
| 196 | while( 1 ) |
| 197 | { |
| 198 | if ( EID == pRsnIe->rsnIEdata[ idx ] ) |
| 199 | { |
| 200 | //Found it |
| 201 | return (idx); |
| 202 | } |
| 203 | else if ( EID != pRsnIe->rsnIEdata[ idx ] && |
| 204 | // & if no more IE, |
| 205 | bytesLeft <= (tANI_U16)( ieLen ) ) |
| 206 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 207 | dot11fLog( pMac, LOG3, FL("No IE (%d) in FindIELocation."), EID ); |
Madan Mohan Koyyalamudi | cae253a | 2012-11-06 19:10:35 -0800 | [diff] [blame] | 208 | return ret_val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 209 | } |
| 210 | bytesLeft -= ieLen; |
| 211 | ieLen = pRsnIe->rsnIEdata[ idx + 1 ] + 2; |
| 212 | idx += ieLen; |
| 213 | } |
| 214 | |
Madan Mohan Koyyalamudi | cae253a | 2012-11-06 19:10:35 -0800 | [diff] [blame] | 215 | return ret_val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | |
| 219 | tSirRetStatus |
| 220 | PopulateDot11fCapabilities(tpAniSirGlobal pMac, |
| 221 | tDot11fFfCapabilities *pDot11f, |
| 222 | tpPESession psessionEntry) |
| 223 | { |
| 224 | tANI_U16 cfg; |
| 225 | tSirRetStatus nSirStatus; |
| 226 | |
| 227 | nSirStatus = cfgGetCapabilityInfo( pMac, &cfg,psessionEntry ); |
| 228 | if ( eSIR_SUCCESS != nSirStatus ) |
| 229 | { |
| 230 | dot11fLog( pMac, LOGP, FL("Failed to retrieve the Capabilities b" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 231 | "itfield from CFG (%d)."), nSirStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 232 | return nSirStatus; |
| 233 | } |
| 234 | |
| 235 | #if 0 |
| 236 | if ( sirIsPropCapabilityEnabled( pMac, SIR_MAC_PROP_CAPABILITY_11EQOS ) ) |
| 237 | { |
| 238 | SIR_MAC_CLEAR_CAPABILITY( cfg, QOS ); |
| 239 | } |
| 240 | #endif |
| 241 | swapBitField16( cfg, ( tANI_U16* )pDot11f ); |
| 242 | |
| 243 | return eSIR_SUCCESS; |
| 244 | } // End PopulateDot11fCapabilities. |
| 245 | |
| 246 | tSirRetStatus |
| 247 | PopulateDot11fCapabilities2(tpAniSirGlobal pMac, |
| 248 | tDot11fFfCapabilities *pDot11f, |
| 249 | tpDphHashNode pSta, |
| 250 | tpPESession psessionEntry) |
| 251 | { |
| 252 | tANI_U16 cfg; |
| 253 | tSirRetStatus nSirStatus; |
| 254 | nSirStatus = cfgGetCapabilityInfo( pMac, &cfg ,psessionEntry); |
| 255 | if ( eSIR_SUCCESS != nSirStatus ) |
| 256 | { |
| 257 | dot11fLog( pMac, LOGP, FL("Failed to retrieve the Capabilities b" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 258 | "itfield from CFG (%d)."), nSirStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 259 | return nSirStatus; |
| 260 | } |
| 261 | |
| 262 | if ( ( NULL != pSta ) && pSta->aniPeer && |
| 263 | PROP_CAPABILITY_GET( 11EQOS, pSta->propCapability ) ) |
| 264 | { |
| 265 | SIR_MAC_CLEAR_CAPABILITY( cfg, QOS ); |
| 266 | } |
| 267 | |
| 268 | swapBitField16( cfg, ( tANI_U16* )pDot11f ); |
| 269 | |
| 270 | return eSIR_SUCCESS; |
| 271 | |
| 272 | } // End PopulateDot11fCapabilities2. |
| 273 | |
| 274 | void |
| 275 | PopulateDot11fChanSwitchAnn(tpAniSirGlobal pMac, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 276 | tDot11fIEChanSwitchAnn *pDot11f, |
| 277 | tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 279 | pDot11f->switchMode = psessionEntry->gLimChannelSwitch.switchMode; |
| 280 | pDot11f->newChannel = psessionEntry->gLimChannelSwitch.primaryChannel; |
| 281 | pDot11f->switchCount = ( tANI_U8 ) psessionEntry->gLimChannelSwitch.switchCount; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | |
| 283 | pDot11f->present = 1; |
| 284 | } // End PopulateDot11fChanSwitchAnn. |
| 285 | |
| 286 | void |
| 287 | PopulateDot11fExtChanSwitchAnn(tpAniSirGlobal pMac, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 288 | tDot11fIEExtChanSwitchAnn *pDot11f, |
| 289 | tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 290 | { |
| 291 | //Has to be updated on the cb state basis |
| 292 | pDot11f->secondaryChannelOffset = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 293 | psessionEntry->gLimChannelSwitch.secondarySubBand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 294 | |
| 295 | pDot11f->present = 1; |
| 296 | } |
| 297 | |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 298 | #ifdef WLAN_FEATURE_11AC |
| 299 | void |
| 300 | PopulateDot11fWiderBWChanSwitchAnn(tpAniSirGlobal pMac, |
| 301 | tDot11fIEWiderBWChanSwitchAnn *pDot11f, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 302 | tpPESession psessionEntry) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 303 | { |
| 304 | pDot11f->present = 1; |
| 305 | pDot11f->newChanWidth = psessionEntry->gLimWiderBWChannelSwitch.newChanWidth; |
| 306 | pDot11f->newCenterChanFreq0 = psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0; |
| 307 | pDot11f->newCenterChanFreq1 = psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1; |
| 308 | } |
| 309 | #endif |
| 310 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 311 | tSirRetStatus |
| 312 | PopulateDot11fCountry(tpAniSirGlobal pMac, |
| 313 | tDot11fIECountry *pDot11f, |
| 314 | tpPESession psessionEntry) |
| 315 | { |
| 316 | tANI_U32 len, maxlen, codelen; |
| 317 | tANI_U16 item; |
| 318 | tSirRetStatus nSirStatus; |
| 319 | tSirRFBand rfBand; |
| 320 | tANI_U8 temp[CFG_MAX_STR_LEN], code[3]; |
| 321 | |
| 322 | if (psessionEntry->lim11dEnabled ) |
| 323 | { |
| 324 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 325 | if (rfBand == SIR_BAND_5_GHZ) |
| 326 | { |
| 327 | item = WNI_CFG_MAX_TX_POWER_5; |
| 328 | maxlen = WNI_CFG_MAX_TX_POWER_5_LEN; |
| 329 | } |
| 330 | else |
| 331 | { |
| 332 | item = WNI_CFG_MAX_TX_POWER_2_4; |
| 333 | maxlen = WNI_CFG_MAX_TX_POWER_2_4_LEN; |
| 334 | } |
| 335 | |
| 336 | CFG_GET_STR( nSirStatus, pMac, item, temp, len, maxlen ); |
| 337 | |
| 338 | if ( 3 > len ) |
| 339 | { |
| 340 | // no limit on tx power, cannot include the IE because at least |
| 341 | // one (channel,num,tx power) must be present |
| 342 | return eSIR_SUCCESS; |
| 343 | } |
| 344 | |
| 345 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_COUNTRY_CODE, |
| 346 | code, codelen, 3 ); |
| 347 | |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 348 | vos_mem_copy( pDot11f->country, code, codelen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 349 | |
| 350 | if(len > MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE) |
| 351 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 352 | dot11fLog( pMac, LOGE, FL("len:%d is out of bounds, resetting."), len); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 353 | len = MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE; |
| 354 | } |
| 355 | |
| 356 | pDot11f->num_triplets = ( tANI_U8 ) ( len / 3 ); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 357 | vos_mem_copy( ( tANI_U8* )pDot11f->triplets, temp, len ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 358 | |
| 359 | pDot11f->present = 1; |
| 360 | } |
| 361 | |
| 362 | return eSIR_SUCCESS; |
| 363 | } // End PopulateDot11fCountry. |
| 364 | |
| 365 | tSirRetStatus |
| 366 | PopulateDot11fDSParams(tpAniSirGlobal pMac, |
| 367 | tDot11fIEDSParams *pDot11f, tANI_U8 channel, |
| 368 | tpPESession psessionEntry) |
| 369 | { |
Abhishek Singh | 883b5a1 | 2015-10-08 12:22:25 +0530 | [diff] [blame] | 370 | if (IS_24G_CH(channel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 371 | { |
| 372 | // .11b/g mode PHY => Include the DS Parameter Set IE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 373 | pDot11f->curr_channel = channel; |
| 374 | pDot11f->present = 1; |
| 375 | } |
| 376 | |
| 377 | return eSIR_SUCCESS; |
| 378 | } // End PopulateDot11fDSParams. |
| 379 | |
| 380 | #define SET_AIFSN(aifsn) (((aifsn) < 2) ? 2 : (aifsn)) |
| 381 | |
| 382 | |
| 383 | void |
| 384 | PopulateDot11fEDCAParamSet(tpAniSirGlobal pMac, |
| 385 | tDot11fIEEDCAParamSet *pDot11f, |
| 386 | tpPESession psessionEntry) |
| 387 | { |
| 388 | |
| 389 | if ( psessionEntry->limQosEnabled ) |
| 390 | { |
| 391 | //change to bitwise operation, after this is fixed in frames. |
| 392 | pDot11f->qos = (tANI_U8)(0xf0 & (psessionEntry->gLimEdcaParamSetCount << 4) ); |
| 393 | |
| 394 | // Fill each EDCA parameter set in order: be, bk, vi, vo |
| 395 | pDot11f->acbe_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[0].aci.aifsn) ); |
| 396 | pDot11f->acbe_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[0].aci.acm ); |
| 397 | pDot11f->acbe_aci = ( 0x3 & SIR_MAC_EDCAACI_BESTEFFORT ); |
| 398 | pDot11f->acbe_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[0].cw.min ); |
| 399 | pDot11f->acbe_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[0].cw.max ); |
| 400 | pDot11f->acbe_txoplimit = psessionEntry->gLimEdcaParamsBC[0].txoplimit; |
| 401 | |
| 402 | pDot11f->acbk_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[1].aci.aifsn) ); |
| 403 | pDot11f->acbk_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[1].aci.acm ); |
| 404 | pDot11f->acbk_aci = ( 0x3 & SIR_MAC_EDCAACI_BACKGROUND ); |
| 405 | pDot11f->acbk_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.min ); |
| 406 | pDot11f->acbk_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.max ); |
| 407 | pDot11f->acbk_txoplimit = psessionEntry->gLimEdcaParamsBC[1].txoplimit; |
| 408 | |
| 409 | pDot11f->acvi_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[2].aci.aifsn) ); |
| 410 | pDot11f->acvi_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[2].aci.acm ); |
| 411 | pDot11f->acvi_aci = ( 0x3 & SIR_MAC_EDCAACI_VIDEO ); |
| 412 | pDot11f->acvi_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.min ); |
| 413 | pDot11f->acvi_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.max ); |
| 414 | pDot11f->acvi_txoplimit = psessionEntry->gLimEdcaParamsBC[2].txoplimit; |
| 415 | |
| 416 | pDot11f->acvo_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[3].aci.aifsn) ); |
| 417 | pDot11f->acvo_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[3].aci.acm ); |
| 418 | pDot11f->acvo_aci = ( 0x3 & SIR_MAC_EDCAACI_VOICE ); |
| 419 | pDot11f->acvo_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].cw.min ); |
| 420 | pDot11f->acvo_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].cw.max ); |
| 421 | pDot11f->acvo_txoplimit = psessionEntry->gLimEdcaParamsBC[3].txoplimit; |
| 422 | |
| 423 | pDot11f->present = 1; |
| 424 | } |
| 425 | |
| 426 | } // End PopluateDot11fEDCAParamSet. |
| 427 | |
| 428 | tSirRetStatus |
| 429 | PopulateDot11fERPInfo(tpAniSirGlobal pMac, |
| 430 | tDot11fIEERPInfo *pDot11f, |
| 431 | tpPESession psessionEntry) |
| 432 | { |
| 433 | tSirRetStatus nSirStatus; |
| 434 | tANI_U32 val; |
| 435 | tSirRFBand rfBand = SIR_BAND_UNKNOWN; |
| 436 | |
| 437 | limGetRfBand(pMac, &rfBand, psessionEntry); |
| 438 | if(SIR_BAND_2_4_GHZ == rfBand) |
| 439 | { |
| 440 | pDot11f->present = 1; |
| 441 | |
| 442 | val = psessionEntry->cfgProtection.fromllb; |
| 443 | if(!val ){ |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 444 | dot11fLog( pMac, LOGE, FL("11B protection not enabled. Not populating ERP IE %d" ),val ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 445 | return eSIR_SUCCESS; |
| 446 | } |
| 447 | |
| 448 | if (psessionEntry->gLim11bParams.protectionEnabled) |
| 449 | { |
| 450 | pDot11f->non_erp_present = 1; |
| 451 | pDot11f->use_prot = 1; |
| 452 | } |
| 453 | |
| 454 | if ( psessionEntry->gLimOlbcParams.protectionEnabled ) |
| 455 | { |
| 456 | //FIXME_PROTECTION: we should be setting non_erp present also. |
| 457 | //check the test plan first. |
| 458 | pDot11f->use_prot = 1; |
| 459 | } |
| 460 | |
| 461 | |
| 462 | if((psessionEntry->gLimNoShortParams.numNonShortPreambleSta) |
| 463 | || !psessionEntry->beaconParams.fShortPreamble){ |
| 464 | pDot11f->barker_preamble = 1; |
| 465 | |
| 466 | } |
| 467 | // if protection always flag is set, advertise protection enabled |
| 468 | // regardless of legacy stations presence |
| 469 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_11G_PROTECTION_ALWAYS, val ); |
| 470 | |
| 471 | if ( val ) |
| 472 | { |
| 473 | pDot11f->use_prot = 1; |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | return eSIR_SUCCESS; |
| 478 | } // End PopulateDot11fERPInfo. |
| 479 | |
| 480 | tSirRetStatus |
| 481 | PopulateDot11fExtSuppRates(tpAniSirGlobal pMac, tANI_U8 nChannelNum, |
| 482 | tDot11fIEExtSuppRates *pDot11f, |
| 483 | tpPESession psessionEntry) |
| 484 | { |
| 485 | tSirRetStatus nSirStatus; |
| 486 | tANI_U32 nRates = 0; |
Sachin Ahuja | c772fd8 | 2015-09-08 17:12:19 +0530 | [diff] [blame] | 487 | tANI_U8 rates[SIR_MAC_RATESET_EID_MAX]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 488 | |
| 489 | /* Use the ext rates present in session entry whenever nChannelNum is set to OPERATIONAL |
| 490 | else use the ext supported rate set from CFG, which is fixed and does not change dynamically and is used for |
| 491 | sending mgmt frames (lile probe req) which need to go out before any session is present. |
| 492 | */ |
| 493 | if(POPULATE_DOT11F_RATES_OPERATIONAL == nChannelNum ) |
| 494 | { |
| 495 | if(psessionEntry != NULL) |
| 496 | { |
| 497 | nRates = psessionEntry->extRateSet.numRates; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 498 | vos_mem_copy( rates, psessionEntry->extRateSet.rate, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 499 | nRates); |
| 500 | } |
| 501 | else |
| 502 | { |
| 503 | dot11fLog( pMac, LOGE, FL("no session context exists while" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 504 | " populating Operational Rate Set")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 505 | } |
| 506 | } |
| 507 | else if ( HIGHEST_24GHZ_CHANNEL_NUM >= nChannelNum ) |
| 508 | { |
| 509 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET, |
| 510 | rates, nRates, WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN ); |
| 511 | } |
| 512 | |
| 513 | if ( 0 != nRates ) |
| 514 | { |
| 515 | pDot11f->num_rates = ( tANI_U8 )nRates; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 516 | vos_mem_copy( pDot11f->rates, rates, nRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 517 | pDot11f->present = 1; |
| 518 | } |
| 519 | |
| 520 | return eSIR_SUCCESS; |
| 521 | |
| 522 | } // End PopulateDot11fExtSuppRates. |
| 523 | |
| 524 | tSirRetStatus |
| 525 | PopulateDot11fExtSuppRates1(tpAniSirGlobal pMac, |
| 526 | tANI_U8 nChannelNum, |
| 527 | tDot11fIEExtSuppRates *pDot11f) |
| 528 | { |
| 529 | tANI_U32 nRates; |
| 530 | tSirRetStatus nSirStatus; |
| 531 | tANI_U8 rates[SIR_MAC_MAX_NUMBER_OF_RATES]; |
| 532 | |
| 533 | if ( 14 < nChannelNum ) |
| 534 | { |
| 535 | pDot11f->present = 0; |
| 536 | return eSIR_SUCCESS; |
| 537 | } |
| 538 | |
| 539 | // N.B. I have *no* idea why we're calling 'wlan_cfgGetStr' with an argument |
| 540 | // of WNI_CFG_SUPPORTED_RATES_11A here, but that's what was done |
| 541 | // previously & I'm afraid to change it! |
| 542 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_RATES_11A, |
| 543 | rates, nRates, SIR_MAC_MAX_NUMBER_OF_RATES ); |
| 544 | |
| 545 | if ( 0 != nRates ) |
| 546 | { |
| 547 | pDot11f->num_rates = ( tANI_U8 ) nRates; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 548 | vos_mem_copy( pDot11f->rates, rates, nRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 549 | pDot11f->present = 1; |
| 550 | } |
| 551 | |
| 552 | return eSIR_SUCCESS; |
| 553 | } // PopulateDot11fExtSuppRates1. |
| 554 | |
| 555 | tSirRetStatus |
| 556 | PopulateDot11fHTCaps(tpAniSirGlobal pMac, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 557 | tpPESession psessionEntry, |
| 558 | tDot11fIEHTCaps *pDot11f) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 559 | { |
| 560 | tANI_U32 nCfgValue, nCfgLen; |
| 561 | tANI_U8 nCfgValue8; |
| 562 | tSirRetStatus nSirStatus; |
| 563 | tSirMacHTParametersInfo *pHTParametersInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 564 | union { |
| 565 | tANI_U16 nCfgValue16; |
| 566 | tSirMacHTCapabilityInfo htCapInfo; |
| 567 | tSirMacExtendedHTCapabilityInfo extHtCapInfo; |
| 568 | } uHTCapabilityInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 569 | |
| 570 | tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo; |
| 571 | tSirMacASCapabilityInfo *pASCapabilityInfo; |
| 572 | |
| 573 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_CAP_INFO, nCfgValue ); |
| 574 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 575 | uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 576 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 577 | pDot11f->advCodingCap = uHTCapabilityInfo.htCapInfo.advCodingCap; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 578 | pDot11f->mimoPowerSave = uHTCapabilityInfo.htCapInfo.mimoPowerSave; |
| 579 | pDot11f->greenField = uHTCapabilityInfo.htCapInfo.greenField; |
| 580 | pDot11f->shortGI20MHz = uHTCapabilityInfo.htCapInfo.shortGI20MHz; |
| 581 | pDot11f->shortGI40MHz = uHTCapabilityInfo.htCapInfo.shortGI40MHz; |
| 582 | pDot11f->txSTBC = uHTCapabilityInfo.htCapInfo.txSTBC; |
| 583 | pDot11f->rxSTBC = uHTCapabilityInfo.htCapInfo.rxSTBC; |
| 584 | pDot11f->delayedBA = uHTCapabilityInfo.htCapInfo.delayedBA; |
| 585 | pDot11f->maximalAMSDUsize = uHTCapabilityInfo.htCapInfo.maximalAMSDUsize; |
| 586 | pDot11f->dsssCckMode40MHz = uHTCapabilityInfo.htCapInfo.dsssCckMode40MHz; |
| 587 | pDot11f->psmp = uHTCapabilityInfo.htCapInfo.psmp; |
| 588 | pDot11f->stbcControlFrame = uHTCapabilityInfo.htCapInfo.stbcControlFrame; |
| 589 | pDot11f->lsigTXOPProtection = uHTCapabilityInfo.htCapInfo.lsigTXOPProtection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 590 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 591 | // All sessionized entries will need the check below |
| 592 | if (psessionEntry == NULL) // Only in case of NO session |
| 593 | { |
| 594 | pDot11f->supportedChannelWidthSet = uHTCapabilityInfo.htCapInfo.supportedChannelWidthSet; |
| 595 | } |
| 596 | else |
| 597 | { |
| 598 | pDot11f->supportedChannelWidthSet = psessionEntry->htSupportedChannelWidthSet; |
| 599 | } |
| 600 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 601 | /* Ensure that shortGI40MHz is Disabled if supportedChannelWidthSet is |
| 602 | eHT_CHANNEL_WIDTH_20MHZ */ |
| 603 | if(pDot11f->supportedChannelWidthSet == eHT_CHANNEL_WIDTH_20MHZ) |
| 604 | { |
| 605 | pDot11f->shortGI40MHz = 0; |
| 606 | } |
| 607 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 608 | |
| 609 | |
| 610 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_AMPDU_PARAMS, nCfgValue ); |
| 611 | |
| 612 | nCfgValue8 = ( tANI_U8 ) nCfgValue; |
| 613 | pHTParametersInfo = ( tSirMacHTParametersInfo* ) &nCfgValue8; |
| 614 | |
| 615 | pDot11f->maxRxAMPDUFactor = pHTParametersInfo->maxRxAMPDUFactor; |
| 616 | pDot11f->mpduDensity = pHTParametersInfo->mpduDensity; |
| 617 | pDot11f->reserved1 = pHTParametersInfo->reserved; |
| 618 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 619 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_MCS_SET, |
| 620 | pDot11f->supportedMCSSet, nCfgLen, |
| 621 | SIZE_OF_SUPPORTED_MCS_SET ); |
| 622 | |
| 623 | |
| 624 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_EXT_HT_CAP_INFO, nCfgValue ); |
| 625 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 626 | uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; |
| 627 | |
| 628 | pDot11f->pco = uHTCapabilityInfo.extHtCapInfo.pco; |
| 629 | pDot11f->transitionTime = uHTCapabilityInfo.extHtCapInfo.transitionTime; |
| 630 | pDot11f->mcsFeedback = uHTCapabilityInfo.extHtCapInfo.mcsFeedback; |
| 631 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 632 | |
| 633 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_TX_BF_CAP, nCfgValue ); |
| 634 | |
| 635 | pTxBFCapabilityInfo = ( tSirMacTxBFCapabilityInfo* ) &nCfgValue; |
| 636 | pDot11f->txBF = pTxBFCapabilityInfo->txBF; |
| 637 | pDot11f->rxStaggeredSounding = pTxBFCapabilityInfo->rxStaggeredSounding; |
| 638 | pDot11f->txStaggeredSounding = pTxBFCapabilityInfo->txStaggeredSounding; |
| 639 | pDot11f->rxZLF = pTxBFCapabilityInfo->rxZLF; |
| 640 | pDot11f->txZLF = pTxBFCapabilityInfo->txZLF; |
| 641 | pDot11f->implicitTxBF = pTxBFCapabilityInfo->implicitTxBF; |
| 642 | pDot11f->calibration = pTxBFCapabilityInfo->calibration; |
| 643 | pDot11f->explicitCSITxBF = pTxBFCapabilityInfo->explicitCSITxBF; |
| 644 | pDot11f->explicitUncompressedSteeringMatrix = pTxBFCapabilityInfo->explicitUncompressedSteeringMatrix; |
| 645 | pDot11f->explicitBFCSIFeedback = pTxBFCapabilityInfo->explicitBFCSIFeedback; |
| 646 | pDot11f->explicitUncompressedSteeringMatrixFeedback = pTxBFCapabilityInfo->explicitUncompressedSteeringMatrixFeedback; |
| 647 | pDot11f->explicitCompressedSteeringMatrixFeedback = pTxBFCapabilityInfo->explicitCompressedSteeringMatrixFeedback; |
| 648 | pDot11f->csiNumBFAntennae = pTxBFCapabilityInfo->csiNumBFAntennae; |
| 649 | pDot11f->uncompressedSteeringMatrixBFAntennae = pTxBFCapabilityInfo->uncompressedSteeringMatrixBFAntennae; |
| 650 | pDot11f->compressedSteeringMatrixBFAntennae = pTxBFCapabilityInfo->compressedSteeringMatrixBFAntennae; |
| 651 | |
| 652 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_AS_CAP, nCfgValue ); |
| 653 | |
| 654 | nCfgValue8 = ( tANI_U8 ) nCfgValue; |
| 655 | |
| 656 | pASCapabilityInfo = ( tSirMacASCapabilityInfo* ) &nCfgValue8; |
| 657 | pDot11f->antennaSelection = pASCapabilityInfo->antennaSelection; |
| 658 | pDot11f->explicitCSIFeedbackTx = pASCapabilityInfo->explicitCSIFeedbackTx; |
| 659 | pDot11f->antennaIndicesFeedbackTx = pASCapabilityInfo->antennaIndicesFeedbackTx; |
| 660 | pDot11f->explicitCSIFeedback = pASCapabilityInfo->explicitCSIFeedback; |
| 661 | pDot11f->antennaIndicesFeedback = pASCapabilityInfo->antennaIndicesFeedback; |
| 662 | pDot11f->rxAS = pASCapabilityInfo->rxAS; |
| 663 | pDot11f->txSoundingPPDUs = pASCapabilityInfo->txSoundingPPDUs; |
| 664 | |
| 665 | pDot11f->present = 1; |
| 666 | |
| 667 | return eSIR_SUCCESS; |
| 668 | |
| 669 | } // End PopulateDot11fHTCaps. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 670 | #ifdef WLAN_FEATURE_11AC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 671 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 672 | void limLogVHTCap(tpAniSirGlobal pMac, |
| 673 | tDot11fIEVHTCaps *pDot11f) |
| 674 | { |
Madan Mohan Koyyalamudi | 2208f7b | 2012-09-28 14:29:07 -0700 | [diff] [blame] | 675 | #ifdef DUMP_MGMT_CNTNTS |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 676 | limLog(pMac, LOG1, FL("maxMPDULen (2): %d"), pDot11f->maxMPDULen); |
| 677 | limLog(pMac, LOG1, FL("supportedChannelWidthSet (2): %d"), pDot11f->supportedChannelWidthSet); |
| 678 | limLog(pMac, LOG1, FL("ldpcCodingCap (1): %d"), pDot11f->ldpcCodingCap); |
| 679 | limLog(pMac, LOG1, FL("shortGI80MHz (1): %d"), pDot11f->shortGI80MHz); |
| 680 | limLog(pMac, LOG1, FL("shortGI160and80plus80MHz (1): %d"), pDot11f->shortGI160and80plus80MHz); |
| 681 | limLog(pMac, LOG1, FL("txSTBC (1): %d"), pDot11f->txSTBC); |
| 682 | limLog(pMac, LOG1, FL("rxSTBC (3): %d"), pDot11f->rxSTBC); |
| 683 | limLog(pMac, LOG1, FL("suBeamFormerCap (1): %d"), pDot11f->suBeamFormerCap); |
| 684 | limLog(pMac, LOG1, FL("suBeamformeeCap (1): %d"), pDot11f->suBeamformeeCap); |
| 685 | limLog(pMac, LOG1, FL("csnofBeamformerAntSup (3): %d"), pDot11f->csnofBeamformerAntSup); |
| 686 | limLog(pMac, LOG1, FL("numSoundingDim (3): %d"), pDot11f->numSoundingDim); |
| 687 | limLog(pMac, LOG1, FL("muBeamformerCap (1): %d"), pDot11f->muBeamformerCap); |
| 688 | limLog(pMac, LOG1, FL("muBeamformeeCap (1): %d"), pDot11f->muBeamformeeCap); |
| 689 | limLog(pMac, LOG1, FL("vhtTXOPPS (1): %d"), pDot11f->vhtTXOPPS); |
| 690 | limLog(pMac, LOG1, FL("htcVHTCap (1): %d"), pDot11f->htcVHTCap); |
| 691 | limLog(pMac, LOG1, FL("maxAMPDULenExp (3): %d"), pDot11f->maxAMPDULenExp); |
| 692 | limLog(pMac, LOG1, FL("vhtLinkAdaptCap (2): %d"), pDot11f->vhtLinkAdaptCap); |
| 693 | limLog(pMac, LOG1, FL("rxAntPattern (1): %d"), pDot11f->vhtLinkAdaptCap); |
| 694 | limLog(pMac, LOG1, FL("txAntPattern (1): %d"), pDot11f->vhtLinkAdaptCap); |
| 695 | limLog(pMac, LOG1, FL("reserved1 (2): %d"), pDot11f->reserved1); |
| 696 | limLog(pMac, LOG1, FL("rxMCSMap (16): %d"), pDot11f->rxMCSMap); |
| 697 | limLog(pMac, LOG1, FL("rxHighSupDataRate (13): %d"), pDot11f->rxHighSupDataRate); |
| 698 | limLog(pMac, LOG1, FL("reserve (3): %d"), pDot11f->reserved2); |
| 699 | limLog(pMac, LOG1, FL("txMCSMap (16): %d"), pDot11f->txMCSMap); |
| 700 | limLog(pMac, LOG1, FL("txSupDataRate (13): %d"), pDot11f->txSupDataRate); |
| 701 | limLog(pMac, LOG1, FL("reserv (3): %d"), pDot11f->reserved3); |
Madan Mohan Koyyalamudi | 2208f7b | 2012-09-28 14:29:07 -0700 | [diff] [blame] | 702 | #endif /* DUMP_MGMT_CNTNTS */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 703 | } |
| 704 | |
| 705 | void limLogVHTOperation(tpAniSirGlobal pMac, |
| 706 | tDot11fIEVHTOperation *pDot11f) |
| 707 | { |
Madan Mohan Koyyalamudi | 2208f7b | 2012-09-28 14:29:07 -0700 | [diff] [blame] | 708 | #ifdef DUMP_MGMT_CNTNTS |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 709 | limLog(pMac, LOG1, FL("chanWidth : %d"), pDot11f->chanWidth); |
| 710 | limLog(pMac, LOG1, FL("chanCenterFreqSeg1: %d"), pDot11f->chanCenterFreqSeg1); |
| 711 | limLog(pMac, LOG1, FL("chanCenterFreqSeg2: %d"), pDot11f->chanCenterFreqSeg2); |
| 712 | limLog(pMac, LOG1, FL("basicMCSSet: %d"), pDot11f->basicMCSSet); |
Madan Mohan Koyyalamudi | 2208f7b | 2012-09-28 14:29:07 -0700 | [diff] [blame] | 713 | #endif /* DUMP_MGMT_CNTNTS */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 714 | } |
| 715 | |
| 716 | void limLogVHTExtBssLoad(tpAniSirGlobal pMac, |
| 717 | tDot11fIEVHTExtBssLoad *pDot11f) |
| 718 | { |
Madan Mohan Koyyalamudi | 2208f7b | 2012-09-28 14:29:07 -0700 | [diff] [blame] | 719 | #ifdef DUMP_MGMT_CNTNTS |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 720 | limLog(pMac, LOG1, FL("muMIMOCapStaCount : %d"), pDot11f->muMIMOCapStaCount); |
| 721 | limLog(pMac, LOG1, FL("ssUnderUtil: %d"), pDot11f->ssUnderUtil); |
| 722 | limLog(pMac, LOG1, FL("FortyMHzUtil: %d"), pDot11f->FortyMHzUtil); |
| 723 | limLog(pMac, LOG1, FL("EightyMHzUtil: %d"), pDot11f->EightyMHzUtil); |
| 724 | limLog(pMac, LOG1, FL("OneSixtyMHzUtil: %d"), pDot11f->OneSixtyMHzUtil); |
Madan Mohan Koyyalamudi | 2208f7b | 2012-09-28 14:29:07 -0700 | [diff] [blame] | 725 | #endif /* DUMP_MGMT_CNTNTS */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 726 | } |
| 727 | |
| 728 | |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 729 | void limLogOperatingMode( tpAniSirGlobal pMac, |
| 730 | tDot11fIEOperatingMode *pDot11f) |
| 731 | { |
Madan Mohan Koyyalamudi | 2208f7b | 2012-09-28 14:29:07 -0700 | [diff] [blame] | 732 | #ifdef DUMP_MGMT_CNTNTS |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 733 | limLog(pMac, LOG1, FL("ChanWidth : %d"), pDot11f->chanWidth); |
| 734 | limLog(pMac, LOG1, FL("reserved: %d"), pDot11f->reserved); |
| 735 | limLog(pMac, LOG1, FL("rxNSS: %d"), pDot11f->rxNSS); |
| 736 | limLog(pMac, LOG1, FL("rxNSS Type: %d"), pDot11f->rxNSSType); |
Madan Mohan Koyyalamudi | 2208f7b | 2012-09-28 14:29:07 -0700 | [diff] [blame] | 737 | #endif /* DUMP_MGMT_CNTNTS */ |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 738 | } |
| 739 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 740 | void limLogQosMapSet(tpAniSirGlobal pMac, tSirQosMapSet *pQosMapSet) |
| 741 | { |
| 742 | tANI_U8 i; |
| 743 | limLog(pMac, LOG1, FL("num of dscp exceptions : %d"), |
| 744 | pQosMapSet->num_dscp_exceptions); |
| 745 | for (i=0; i < pQosMapSet->num_dscp_exceptions; i++) |
| 746 | { |
| 747 | limLog(pMac, LOG1, FL("dscp value: %d"), |
| 748 | pQosMapSet->dscp_exceptions[i][0]); |
| 749 | limLog(pMac, LOG1, FL("User priority value: %d"), |
| 750 | pQosMapSet->dscp_exceptions[i][1]); |
| 751 | } |
| 752 | for (i=0;i<8;i++) |
| 753 | { |
| 754 | limLog(pMac, LOG1, FL("dscp low for up %d: %d"),i, |
| 755 | pQosMapSet->dscp_range[i][0]); |
| 756 | limLog(pMac, LOG1, FL("dscp high for up %d: %d"),i, |
| 757 | pQosMapSet->dscp_range[i][1]); |
| 758 | } |
| 759 | } |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 760 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 761 | tSirRetStatus |
| 762 | PopulateDot11fVHTCaps(tpAniSirGlobal pMac, |
Abhishek Singh | 6d5d29c | 2014-07-03 14:25:22 +0530 | [diff] [blame] | 763 | tDot11fIEVHTCaps *pDot11f, |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 764 | tANI_U8 nChannelNum, |
Abhishek Singh | 6d5d29c | 2014-07-03 14:25:22 +0530 | [diff] [blame] | 765 | tAniBool isProbeRspAssocRspBeacon) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 766 | { |
| 767 | tSirRetStatus nStatus; |
| 768 | tANI_U32 nCfgValue=0; |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 769 | tAniBool disableMcs9 = eSIR_FALSE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 770 | |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 771 | if (nChannelNum <= SIR_11B_CHANNEL_END) |
Sushant Kaushik | b2c92a8 | 2015-07-16 15:24:26 +0530 | [diff] [blame] | 772 | disableMcs9 = pMac->roam.configParam.channelBondingMode24GHz? |
| 773 | eSIR_FALSE:eSIR_TRUE; |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 774 | else |
| 775 | disableMcs9 = |
| 776 | pMac->roam.configParam.channelBondingMode5GHz? |
| 777 | eSIR_FALSE: eSIR_TRUE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 778 | pDot11f->present = 1; |
| 779 | |
| 780 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MAX_MPDU_LENGTH, nCfgValue ); |
| 781 | pDot11f->maxMPDULen = (nCfgValue & 0x0003); |
| 782 | |
| 783 | nCfgValue = 0; |
| 784 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, |
| 785 | nCfgValue ); |
| 786 | pDot11f->supportedChannelWidthSet = (nCfgValue & 0x0003); |
| 787 | |
| 788 | nCfgValue = 0; |
| 789 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_LDPC_CODING_CAP, nCfgValue ); |
| 790 | pDot11f->ldpcCodingCap = (nCfgValue & 0x0001); |
| 791 | |
| 792 | nCfgValue = 0; |
| 793 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SHORT_GI_80MHZ, nCfgValue ); |
| 794 | pDot11f->shortGI80MHz= (nCfgValue & 0x0001); |
| 795 | |
| 796 | nCfgValue = 0; |
| 797 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ, |
| 798 | nCfgValue ); |
| 799 | pDot11f->shortGI160and80plus80MHz = (nCfgValue & 0x0001); |
| 800 | |
Deepthi Gowri | 0c1e168 | 2015-06-19 12:57:53 +0530 | [diff] [blame] | 801 | if (nChannelNum && (SIR_BAND_2_4_GHZ == limGetRFBand(nChannelNum))) |
| 802 | { |
| 803 | pDot11f->shortGI80MHz = 0; |
| 804 | pDot11f->shortGI160and80plus80MHz = 0; |
| 805 | } |
| 806 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 807 | nCfgValue = 0; |
| 808 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TXSTBC, nCfgValue ); |
| 809 | pDot11f->txSTBC = (nCfgValue & 0x0001); |
| 810 | |
| 811 | nCfgValue = 0; |
| 812 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RXSTBC, nCfgValue ); |
| 813 | pDot11f->rxSTBC = (nCfgValue & 0x0007); |
| 814 | |
| 815 | nCfgValue = 0; |
| 816 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SU_BEAMFORMER_CAP, nCfgValue ); |
| 817 | pDot11f->suBeamFormerCap = (nCfgValue & 0x0001); |
| 818 | |
| 819 | nCfgValue = 0; |
| 820 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, nCfgValue ); |
| 821 | pDot11f->suBeamformeeCap = (nCfgValue & 0x0001); |
| 822 | |
| 823 | nCfgValue = 0; |
| 824 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, |
| 825 | nCfgValue ); |
| 826 | pDot11f->csnofBeamformerAntSup = (nCfgValue & 0x0007); |
| 827 | |
| 828 | nCfgValue = 0; |
| 829 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS, |
| 830 | nCfgValue ); |
| 831 | pDot11f->numSoundingDim = (nCfgValue & 0x0007); |
| 832 | |
Abhishek Singh | 6d5d29c | 2014-07-03 14:25:22 +0530 | [diff] [blame] | 833 | /* muBeamformerCap should be 0 for non AP and |
| 834 | * muBeamformeeCap should be 0 for AP |
| 835 | */ |
| 836 | if(eSIR_TRUE == isProbeRspAssocRspBeacon) |
| 837 | { |
| 838 | nCfgValue = 0; |
| 839 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MU_BEAMFORMER_CAP, nCfgValue ); |
| 840 | pDot11f->muBeamformerCap = (nCfgValue & 0x0001); |
| 841 | pDot11f->muBeamformeeCap = 0; |
| 842 | } |
| 843 | else |
| 844 | { |
| 845 | pDot11f->muBeamformerCap = 0; |
| 846 | nCfgValue = 0; |
| 847 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, nCfgValue ); |
| 848 | /* Enable only if FW and host both support the MU_MIMO feature |
| 849 | */ |
| 850 | pDot11f->muBeamformeeCap = IS_MUMIMO_BFORMEE_CAPABLE ? (nCfgValue & 0x0001): 0; |
| 851 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 852 | |
| 853 | nCfgValue = 0; |
| 854 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TXOP_PS, nCfgValue ); |
| 855 | pDot11f->vhtTXOPPS = (nCfgValue & 0x0001); |
| 856 | |
| 857 | nCfgValue = 0; |
| 858 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_HTC_VHTC_CAP, nCfgValue ); |
| 859 | pDot11f->htcVHTCap = (nCfgValue & 0x0001); |
| 860 | |
| 861 | nCfgValue = 0; |
| 862 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_AMPDU_LEN_EXPONENT, nCfgValue ); |
| 863 | pDot11f->maxAMPDULenExp = (nCfgValue & 0x0007); |
| 864 | |
| 865 | nCfgValue = 0; |
| 866 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_LINK_ADAPTATION_CAP, nCfgValue ); |
| 867 | pDot11f->vhtLinkAdaptCap = (nCfgValue & 0x0003); |
| 868 | |
| 869 | nCfgValue = 0; |
| 870 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RX_ANT_PATTERN, nCfgValue ); |
| 871 | pDot11f->rxAntPattern = nCfgValue; |
| 872 | |
| 873 | nCfgValue = 0; |
| 874 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TX_ANT_PATTERN, nCfgValue ); |
| 875 | pDot11f->txAntPattern = nCfgValue; |
| 876 | |
| 877 | pDot11f->reserved1= 0; |
| 878 | |
| 879 | nCfgValue = 0; |
| 880 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RX_MCS_MAP, nCfgValue ); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 881 | |
| 882 | if (eSIR_TRUE == disableMcs9) |
| 883 | nCfgValue = (nCfgValue & 0xFFFC) | 0x1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 884 | pDot11f->rxMCSMap = (nCfgValue & 0x0000FFFF); |
| 885 | |
| 886 | nCfgValue = 0; |
| 887 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE, |
| 888 | nCfgValue ); |
| 889 | pDot11f->rxHighSupDataRate = (nCfgValue & 0x00001FFF); |
| 890 | |
| 891 | pDot11f->reserved2= 0; |
| 892 | |
| 893 | nCfgValue = 0; |
| 894 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TX_MCS_MAP, nCfgValue ); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 895 | |
| 896 | if (eSIR_TRUE == disableMcs9) |
| 897 | nCfgValue = (nCfgValue & 0xFFFC) | 0x1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 898 | pDot11f->txMCSMap = (nCfgValue & 0x0000FFFF); |
| 899 | |
| 900 | nCfgValue = 0; |
| 901 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE, |
| 902 | nCfgValue ); |
| 903 | pDot11f->txSupDataRate = (nCfgValue & 0x00001FFF); |
| 904 | |
| 905 | pDot11f->reserved3= 0; |
| 906 | |
| 907 | limLogVHTCap(pMac, pDot11f); |
| 908 | |
| 909 | return eSIR_SUCCESS; |
| 910 | |
| 911 | } |
| 912 | |
| 913 | tSirRetStatus |
| 914 | PopulateDot11fVHTOperation(tpAniSirGlobal pMac, |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 915 | tDot11fIEVHTOperation *pDot11f, |
| 916 | tANI_U8 nChannelNum) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 917 | { |
| 918 | tSirRetStatus nStatus; |
| 919 | tANI_U32 nCfgValue=0; |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 920 | tAniBool disableMcs9 = eSIR_FALSE; |
| 921 | |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 922 | if (nChannelNum <= SIR_11B_CHANNEL_END) |
Sushant Kaushik | b2c92a8 | 2015-07-16 15:24:26 +0530 | [diff] [blame] | 923 | disableMcs9 = pMac->roam.configParam.channelBondingMode24GHz? |
| 924 | eSIR_FALSE:eSIR_TRUE; |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 925 | else |
| 926 | disableMcs9 = |
| 927 | pMac->roam.configParam.channelBondingMode5GHz? |
| 928 | eSIR_FALSE: eSIR_TRUE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 929 | |
| 930 | pDot11f->present = 1; |
| 931 | |
| 932 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_CHANNEL_WIDTH, nCfgValue ); |
| 933 | pDot11f->chanWidth = (tANI_U8)nCfgValue; |
| 934 | |
| 935 | nCfgValue = 0; |
| 936 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1, |
| 937 | nCfgValue ); |
| 938 | pDot11f->chanCenterFreqSeg1 = (tANI_U8)nCfgValue; |
| 939 | |
| 940 | nCfgValue = 0; |
| 941 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2, |
| 942 | nCfgValue ); |
| 943 | pDot11f->chanCenterFreqSeg2 = (tANI_U8)nCfgValue; |
| 944 | |
| 945 | nCfgValue = 0; |
| 946 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_BASIC_MCS_SET,nCfgValue ); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 947 | |
| 948 | if (eSIR_TRUE == disableMcs9) |
| 949 | nCfgValue = (nCfgValue & 0xFFFC) | 0x1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 950 | pDot11f->basicMCSSet = (tANI_U16)nCfgValue; |
| 951 | |
| 952 | limLogVHTOperation(pMac,pDot11f); |
| 953 | |
| 954 | return eSIR_SUCCESS; |
| 955 | |
| 956 | } |
| 957 | |
| 958 | tSirRetStatus |
| 959 | PopulateDot11fVHTExtBssLoad(tpAniSirGlobal pMac, |
| 960 | tDot11fIEVHTExtBssLoad *pDot11f) |
| 961 | { |
| 962 | tSirRetStatus nStatus; |
| 963 | tANI_U32 nCfgValue=0; |
| 964 | |
| 965 | pDot11f->present = 1; |
| 966 | |
| 967 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT, |
| 968 | nCfgValue ); |
| 969 | pDot11f->muMIMOCapStaCount = (tANI_U8)nCfgValue; |
| 970 | |
| 971 | nCfgValue = 0; |
| 972 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SS_UNDER_UTIL,nCfgValue ); |
| 973 | pDot11f->ssUnderUtil = (tANI_U8)nCfgValue; |
| 974 | |
| 975 | nCfgValue=0; |
| 976 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_40MHZ_UTILIZATION,nCfgValue ); |
| 977 | pDot11f->FortyMHzUtil = (tANI_U8)nCfgValue; |
| 978 | |
| 979 | nCfgValue=0; |
| 980 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_80MHZ_UTILIZATION,nCfgValue ); |
| 981 | pDot11f->EightyMHzUtil = (tANI_U8)nCfgValue; |
| 982 | |
| 983 | nCfgValue=0; |
| 984 | CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_160MHZ_UTILIZATION,nCfgValue ); |
| 985 | pDot11f->EightyMHzUtil = (tANI_U8)nCfgValue; |
| 986 | |
| 987 | limLogVHTExtBssLoad(pMac,pDot11f); |
| 988 | |
| 989 | return eSIR_SUCCESS; |
| 990 | } |
| 991 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 992 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 993 | tSirRetStatus |
| 994 | PopulateDot11fOBSSScanParameters(tpAniSirGlobal pMac, |
| 995 | tDot11fIEOBSSScanParameters *pDot11f, |
| 996 | tpPESession psessionEntry) |
| 997 | { |
| 998 | pDot11f->present = 1; |
| 999 | |
| 1000 | pDot11f->obssScanPassiveDwell = |
| 1001 | psessionEntry->obssHT40ScanParam.OBSSScanPassiveDwellTime; |
| 1002 | |
| 1003 | pDot11f->obssScanActiveDwell = |
| 1004 | psessionEntry->obssHT40ScanParam.OBSSScanActiveDwellTime; |
| 1005 | |
| 1006 | pDot11f->bssChannelWidthTriggerScanInterval = |
| 1007 | psessionEntry->obssHT40ScanParam.BSSChannelWidthTriggerScanInterval; |
| 1008 | |
| 1009 | pDot11f->obssScanPassiveTotalPerChannel = |
| 1010 | psessionEntry->obssHT40ScanParam.OBSSScanPassiveTotalPerChannel; |
| 1011 | |
| 1012 | pDot11f->obssScanActiveTotalPerChannel = |
| 1013 | psessionEntry->obssHT40ScanParam.OBSSScanActiveTotalPerChannel; |
| 1014 | |
| 1015 | pDot11f->bssWidthChannelTransitionDelayFactor = |
| 1016 | psessionEntry->obssHT40ScanParam.BSSWidthChannelTransitionDelayFactor; |
| 1017 | |
| 1018 | pDot11f->obssScanActivityThreshold = |
| 1019 | psessionEntry->obssHT40ScanParam.OBSSScanActivityThreshold; |
| 1020 | |
| 1021 | return eSIR_SUCCESS; |
| 1022 | } |
| 1023 | #endif |
| 1024 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 1025 | tSirRetStatus |
| 1026 | PopulateDot11fExtCap(tpAniSirGlobal pMac, |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1027 | tDot11fIEExtCap *pDot11f, |
| 1028 | tpPESession psessionEntry) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 1029 | { |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1030 | |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1031 | #ifdef WLAN_FEATURE_11AC |
Sushant Kaushik | c25b4fc | 2015-09-16 16:42:34 +0530 | [diff] [blame] | 1032 | if (psessionEntry->vhtCapability && |
| 1033 | psessionEntry->limSystemRole != eLIM_STA_IN_IBSS_ROLE ) |
Vinay Krishna Eranna | a493567 | 2014-07-15 20:34:25 +0530 | [diff] [blame] | 1034 | { |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1035 | pDot11f->operModeNotification = 1; |
Vinay Krishna Eranna | a493567 | 2014-07-15 20:34:25 +0530 | [diff] [blame] | 1036 | pDot11f->present = 1; |
| 1037 | } |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1038 | #endif |
| 1039 | /* while operating in 2.4GHz only then STA need to advertize |
| 1040 | the bss co-ex capability*/ |
| 1041 | if (psessionEntry->currentOperChannel <= RF_CHAN_14) |
| 1042 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 1043 | #ifdef WLAN_FEATURE_AP_HT40_24G |
Hardik Kantilal Patel | bca5b00 | 2015-01-19 15:30:18 +0530 | [diff] [blame] | 1044 | if(((IS_HT40_OBSS_SCAN_FEATURE_ENABLE) |
| 1045 | && pMac->roam.configParam.channelBondingMode24GHz) |
| 1046 | || pMac->roam.configParam.apHT40_24GEnabled) |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 1047 | #else |
Hardik Kantilal Patel | bca5b00 | 2015-01-19 15:30:18 +0530 | [diff] [blame] | 1048 | if((IS_HT40_OBSS_SCAN_FEATURE_ENABLE) |
| 1049 | && pMac->roam.configParam.channelBondingMode24GHz) |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 1050 | #endif |
Vinay Krishna Eranna | a493567 | 2014-07-15 20:34:25 +0530 | [diff] [blame] | 1051 | { |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1052 | pDot11f->bssCoexistMgmtSupport = 1; |
Vinay Krishna Eranna | a493567 | 2014-07-15 20:34:25 +0530 | [diff] [blame] | 1053 | pDot11f->present = 1; |
| 1054 | } |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1055 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 1056 | return eSIR_SUCCESS; |
| 1057 | } |
| 1058 | |
| 1059 | tSirRetStatus |
| 1060 | PopulateDot11fOperatingMode(tpAniSirGlobal pMac, |
| 1061 | tDot11fIEOperatingMode *pDot11f, |
| 1062 | tpPESession psessionEntry) |
| 1063 | { |
| 1064 | pDot11f->present = 1; |
| 1065 | |
| 1066 | pDot11f->chanWidth = psessionEntry->gLimOperatingMode.chanWidth; |
| 1067 | pDot11f->rxNSS = psessionEntry->gLimOperatingMode.rxNSS; |
| 1068 | pDot11f->rxNSSType = psessionEntry->gLimOperatingMode.rxNSSType; |
| 1069 | |
| 1070 | return eSIR_SUCCESS; |
| 1071 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1072 | |
| 1073 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1074 | tSirRetStatus |
| 1075 | PopulateDot11fHTInfo(tpAniSirGlobal pMac, |
| 1076 | tDot11fIEHTInfo *pDot11f, |
| 1077 | tpPESession psessionEntry ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1078 | { |
| 1079 | tANI_U32 nCfgValue, nCfgLen; |
| 1080 | tANI_U8 htInfoField1; |
| 1081 | tANI_U16 htInfoField2; |
| 1082 | tSirRetStatus nSirStatus; |
| 1083 | tSirMacHTInfoField1 *pHTInfoField1; |
| 1084 | tSirMacHTInfoField2 *pHTInfoField2; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1085 | union { |
| 1086 | tANI_U16 nCfgValue16; |
| 1087 | tSirMacHTInfoField3 infoField3; |
| 1088 | }uHTInfoField; |
| 1089 | union { |
| 1090 | tANI_U16 nCfgValue16; |
| 1091 | tSirMacHTInfoField2 infoField2; |
| 1092 | }uHTInfoField2={0}; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1093 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1094 | |
| 1095 | #if 0 |
| 1096 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_CURRENT_CHANNEL, nCfgValue ); |
| 1097 | #endif // TO SUPPORT BT-AMP |
Pratik Bhalgat | 91dfba7 | 2012-11-22 17:21:41 +0530 | [diff] [blame] | 1098 | |
| 1099 | if (NULL == psessionEntry) |
| 1100 | { |
| 1101 | PELOGE(limLog(pMac, LOG1, |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1102 | FL("Invalid session entry in PopulateDot11fHTInfo()"));) |
Pratik Bhalgat | 91dfba7 | 2012-11-22 17:21:41 +0530 | [diff] [blame] | 1103 | return eSIR_FAILURE; |
| 1104 | } |
| 1105 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1106 | pDot11f->primaryChannel = psessionEntry->currentOperChannel; |
| 1107 | |
| 1108 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD1, nCfgValue ); |
| 1109 | |
| 1110 | htInfoField1 = ( tANI_U8 ) nCfgValue; |
| 1111 | |
| 1112 | pHTInfoField1 = ( tSirMacHTInfoField1* ) &htInfoField1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1113 | pHTInfoField1->rifsMode = psessionEntry->beaconParams.fRIFSMode; |
| 1114 | pHTInfoField1->serviceIntervalGranularity = pMac->lim.gHTServiceIntervalGranularity; |
| 1115 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1116 | if (psessionEntry == NULL) |
| 1117 | { |
| 1118 | PELOGE(limLog(pMac, LOG1, |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1119 | FL("Keep the value retrieved from cfg for secondary channel offset and recommended Tx Width set"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1120 | } |
| 1121 | else |
| 1122 | { |
| 1123 | pHTInfoField1->secondaryChannelOffset = psessionEntry->htSecondaryChannelOffset; |
| 1124 | pHTInfoField1->recommendedTxWidthSet = psessionEntry->htRecommendedTxWidthSet; |
| 1125 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1126 | |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 1127 | if((psessionEntry) && (psessionEntry->limSystemRole == eLIM_AP_ROLE)){ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1128 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, nCfgValue ); |
| 1129 | |
| 1130 | uHTInfoField2.nCfgValue16 = nCfgValue & 0xFFFF; // this is added for fixing CRs on MDM9K platform - 257951, 259577 |
| 1131 | |
| 1132 | uHTInfoField2.infoField2.opMode = psessionEntry->htOperMode; |
| 1133 | uHTInfoField2.infoField2.nonGFDevicesPresent = psessionEntry->beaconParams.llnNonGFCoexist; |
| 1134 | uHTInfoField2.infoField2.obssNonHTStaPresent = psessionEntry->beaconParams.gHTObssMode; /*added for Obss */ |
| 1135 | |
| 1136 | uHTInfoField2.infoField2.reserved = 0; |
| 1137 | |
| 1138 | }else{ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1139 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, nCfgValue ); |
| 1140 | |
| 1141 | htInfoField2 = ( tANI_U16 ) nCfgValue; |
| 1142 | |
| 1143 | pHTInfoField2 = ( tSirMacHTInfoField2* ) &htInfoField2; |
| 1144 | pHTInfoField2->opMode = pMac->lim.gHTOperMode; |
| 1145 | pHTInfoField2->nonGFDevicesPresent = pMac->lim.gHTNonGFDevicesPresent; |
| 1146 | pHTInfoField2->obssNonHTStaPresent = pMac->lim.gHTObssMode; /*added for Obss */ |
| 1147 | |
| 1148 | pHTInfoField2->reserved = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1149 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1150 | |
| 1151 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD3, nCfgValue ); |
| 1152 | |
| 1153 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1154 | uHTInfoField.nCfgValue16 = nCfgValue & 0xFFFF; |
| 1155 | |
| 1156 | |
| 1157 | uHTInfoField.infoField3.basicSTBCMCS = pMac->lim.gHTSTBCBasicMCS; |
| 1158 | uHTInfoField.infoField3.dualCTSProtection = pMac->lim.gHTDualCTSProtection; |
| 1159 | uHTInfoField.infoField3.secondaryBeacon = pMac->lim.gHTSecondaryBeacon; |
| 1160 | uHTInfoField.infoField3.lsigTXOPProtectionFullSupport = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport; |
| 1161 | uHTInfoField.infoField3.pcoActive = pMac->lim.gHTPCOActive; |
| 1162 | uHTInfoField.infoField3.pcoPhase = pMac->lim.gHTPCOPhase; |
| 1163 | uHTInfoField.infoField3.reserved = 0; |
| 1164 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1165 | |
| 1166 | pDot11f->secondaryChannelOffset = pHTInfoField1->secondaryChannelOffset; |
| 1167 | pDot11f->recommendedTxWidthSet = pHTInfoField1->recommendedTxWidthSet; |
| 1168 | pDot11f->rifsMode = pHTInfoField1->rifsMode; |
| 1169 | pDot11f->controlledAccessOnly = pHTInfoField1->controlledAccessOnly; |
| 1170 | pDot11f->serviceIntervalGranularity = pHTInfoField1->serviceIntervalGranularity; |
| 1171 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1172 | pDot11f->opMode = uHTInfoField2.infoField2.opMode; |
| 1173 | pDot11f->nonGFDevicesPresent = uHTInfoField2.infoField2.nonGFDevicesPresent; |
| 1174 | pDot11f->obssNonHTStaPresent = uHTInfoField2.infoField2.obssNonHTStaPresent; |
| 1175 | pDot11f->reserved = uHTInfoField2.infoField2.reserved; |
| 1176 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1177 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1178 | pDot11f->basicSTBCMCS = uHTInfoField.infoField3.basicSTBCMCS; |
| 1179 | pDot11f->dualCTSProtection = uHTInfoField.infoField3.dualCTSProtection; |
| 1180 | pDot11f->secondaryBeacon = uHTInfoField.infoField3.secondaryBeacon; |
| 1181 | pDot11f->lsigTXOPProtectionFullSupport = uHTInfoField.infoField3.lsigTXOPProtectionFullSupport; |
| 1182 | pDot11f->pcoActive = uHTInfoField.infoField3.pcoActive; |
| 1183 | pDot11f->pcoPhase = uHTInfoField.infoField3.pcoPhase; |
| 1184 | pDot11f->reserved2 = uHTInfoField.infoField3.reserved; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1185 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_BASIC_MCS_SET, |
| 1186 | pDot11f->basicMCSSet, nCfgLen, |
| 1187 | SIZE_OF_BASIC_MCS_SET ); |
| 1188 | |
| 1189 | pDot11f->present = 1; |
| 1190 | |
| 1191 | return eSIR_SUCCESS; |
| 1192 | |
| 1193 | } // End PopulateDot11fHTInfo. |
| 1194 | |
| 1195 | void |
| 1196 | PopulateDot11fIBSSParams(tpAniSirGlobal pMac, |
| 1197 | tDot11fIEIBSSParams *pDot11f, tpPESession psessionEntry) |
| 1198 | { |
| 1199 | if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) |
| 1200 | { |
| 1201 | pDot11f->present = 1; |
| 1202 | // ATIM duration is always set to 0 |
| 1203 | pDot11f->atim = 0; |
| 1204 | } |
| 1205 | |
| 1206 | } // End PopulateDot11fIBSSParams. |
| 1207 | |
| 1208 | |
| 1209 | #ifdef ANI_SUPPORT_11H |
| 1210 | tSirRetStatus |
| 1211 | PopulateDot11fMeasurementReport0(tpAniSirGlobal pMac, |
| 1212 | tpSirMacMeasReqActionFrame pReq, |
| 1213 | tDot11fIEMeasurementReport *pDot11f) |
| 1214 | { |
| 1215 | pDot11f->token = pReq->measReqIE.measToken; |
| 1216 | pDot11f->late = 0; |
| 1217 | pDot11f->incapable = 0; |
| 1218 | pDot11f->refused = 1; |
| 1219 | pDot11f->type = SIR_MAC_BASIC_MEASUREMENT_TYPE; |
| 1220 | |
| 1221 | pDot11f->present = 1; |
| 1222 | |
| 1223 | return eSIR_SUCCESS; |
| 1224 | |
| 1225 | } // End PopulatedDot11fMeasurementReport0. |
| 1226 | |
| 1227 | tSirRetStatus |
| 1228 | PopulateDot11fMeasurementReport1(tpAniSirGlobal pMac, |
| 1229 | tpSirMacMeasReqActionFrame pReq, |
| 1230 | tDot11fIEMeasurementReport *pDot11f) |
| 1231 | { |
| 1232 | pDot11f->token = pReq->measReqIE.measToken; |
| 1233 | pDot11f->late = 0; |
| 1234 | pDot11f->incapable = 0; |
| 1235 | pDot11f->refused = 1; |
| 1236 | pDot11f->type = SIR_MAC_CCA_MEASUREMENT_TYPE; |
| 1237 | |
| 1238 | pDot11f->present = 1; |
| 1239 | |
| 1240 | return eSIR_SUCCESS; |
| 1241 | |
| 1242 | } // End PopulatedDot11fMeasurementReport1. |
| 1243 | |
| 1244 | tSirRetStatus |
| 1245 | PopulateDot11fMeasurementReport2(tpAniSirGlobal pMac, |
| 1246 | tpSirMacMeasReqActionFrame pReq, |
| 1247 | tDot11fIEMeasurementReport *pDot11f) |
| 1248 | { |
| 1249 | pDot11f->token = pReq->measReqIE.measToken; |
| 1250 | pDot11f->late = 0; |
| 1251 | pDot11f->incapable = 0; |
| 1252 | pDot11f->refused = 1; |
| 1253 | pDot11f->type = SIR_MAC_RPI_MEASUREMENT_TYPE; |
| 1254 | |
| 1255 | pDot11f->present = 1; |
| 1256 | |
| 1257 | return eSIR_SUCCESS; |
| 1258 | |
| 1259 | } // End PopulatedDot11fMeasurementReport2. |
| 1260 | #endif |
| 1261 | |
| 1262 | void |
| 1263 | PopulateDot11fPowerCaps(tpAniSirGlobal pMac, |
| 1264 | tDot11fIEPowerCaps *pCaps, |
| 1265 | tANI_U8 nAssocType, |
| 1266 | tpPESession psessionEntry) |
| 1267 | { |
| 1268 | if (nAssocType == LIM_REASSOC) |
| 1269 | { |
| 1270 | pCaps->minTxPower = psessionEntry->pLimReAssocReq->powerCap.minTxPower; |
| 1271 | pCaps->maxTxPower = psessionEntry->pLimReAssocReq->powerCap.maxTxPower; |
| 1272 | }else |
| 1273 | { |
| 1274 | pCaps->minTxPower = psessionEntry->pLimJoinReq->powerCap.minTxPower; |
| 1275 | pCaps->maxTxPower = psessionEntry->pLimJoinReq->powerCap.maxTxPower; |
| 1276 | |
| 1277 | } |
| 1278 | |
| 1279 | pCaps->present = 1; |
| 1280 | } // End PopulateDot11fPowerCaps. |
| 1281 | |
| 1282 | tSirRetStatus |
| 1283 | PopulateDot11fPowerConstraints(tpAniSirGlobal pMac, |
| 1284 | tDot11fIEPowerConstraints *pDot11f) |
| 1285 | { |
| 1286 | tANI_U32 cfg; |
| 1287 | tSirRetStatus nSirStatus; |
| 1288 | |
| 1289 | CFG_GET_INT( nSirStatus, pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, cfg ); |
| 1290 | |
| 1291 | pDot11f->localPowerConstraints = ( tANI_U8 )cfg; |
| 1292 | pDot11f->present = 1; |
| 1293 | |
| 1294 | return eSIR_SUCCESS; |
| 1295 | } // End PopulateDot11fPowerConstraints. |
| 1296 | |
| 1297 | void |
| 1298 | PopulateDot11fQOSCapsAp(tpAniSirGlobal pMac, |
| 1299 | tDot11fIEQOSCapsAp *pDot11f, tpPESession psessionEntry) |
| 1300 | { |
| 1301 | pDot11f->count = psessionEntry->gLimEdcaParamSetCount; |
| 1302 | pDot11f->reserved = 0; |
| 1303 | pDot11f->txopreq = 0; |
| 1304 | pDot11f->qreq = 0; |
| 1305 | pDot11f->qack = 0; |
| 1306 | pDot11f->present = 1; |
| 1307 | } // End PopulatedDot11fQOSCaps. |
| 1308 | |
| 1309 | void |
| 1310 | PopulateDot11fQOSCapsStation(tpAniSirGlobal pMac, |
| 1311 | tDot11fIEQOSCapsStation *pDot11f) |
| 1312 | { |
| 1313 | tANI_U32 val = 0; |
| 1314 | |
| 1315 | if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS) |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1316 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max SP Length "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1317 | |
| 1318 | pDot11f->more_data_ack = 0; |
| 1319 | pDot11f->max_sp_length = (tANI_U8)val; |
| 1320 | pDot11f->qack = 0; |
| 1321 | |
| 1322 | if (pMac->lim.gUapsdEnable) |
| 1323 | { |
| 1324 | pDot11f->acbe_uapsd = LIM_UAPSD_GET(ACBE, pMac->lim.gUapsdPerAcBitmask); |
| 1325 | pDot11f->acbk_uapsd = LIM_UAPSD_GET(ACBK, pMac->lim.gUapsdPerAcBitmask); |
| 1326 | pDot11f->acvi_uapsd = LIM_UAPSD_GET(ACVI, pMac->lim.gUapsdPerAcBitmask); |
| 1327 | pDot11f->acvo_uapsd = LIM_UAPSD_GET(ACVO, pMac->lim.gUapsdPerAcBitmask); |
| 1328 | } |
| 1329 | pDot11f->present = 1; |
| 1330 | } // End PopulatedDot11fQOSCaps. |
| 1331 | |
| 1332 | tSirRetStatus |
| 1333 | PopulateDot11fRSN(tpAniSirGlobal pMac, |
| 1334 | tpSirRSNie pRsnIe, |
| 1335 | tDot11fIERSN *pDot11f) |
| 1336 | { |
| 1337 | tANI_U32 status; |
| 1338 | int idx; |
| 1339 | |
| 1340 | if ( pRsnIe->length ) |
| 1341 | { |
| 1342 | if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_RSN ) ) ) |
| 1343 | { |
| 1344 | status = dot11fUnpackIeRSN( pMac, |
| 1345 | pRsnIe->rsnIEdata + idx + 2, //EID, length |
| 1346 | pRsnIe->rsnIEdata[ idx + 1 ], |
| 1347 | pDot11f ); |
| 1348 | if ( DOT11F_FAILED( status ) ) |
| 1349 | { |
| 1350 | dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fRS" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1351 | "N (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1352 | status ); |
| 1353 | return eSIR_FAILURE; |
| 1354 | } |
| 1355 | dot11fLog( pMac, LOG2, FL("dot11fUnpackIeRSN returned 0x%08x in " |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1356 | "PopulateDot11fRSN."), status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1357 | } |
| 1358 | |
| 1359 | } |
| 1360 | |
| 1361 | return eSIR_SUCCESS; |
| 1362 | } // End PopulateDot11fRSN. |
| 1363 | |
| 1364 | tSirRetStatus PopulateDot11fRSNOpaque( tpAniSirGlobal pMac, |
| 1365 | tpSirRSNie pRsnIe, |
| 1366 | tDot11fIERSNOpaque *pDot11f ) |
| 1367 | { |
| 1368 | int idx; |
| 1369 | |
| 1370 | if ( pRsnIe->length ) |
| 1371 | { |
| 1372 | if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_RSN ) ) ) |
| 1373 | { |
| 1374 | pDot11f->present = 1; |
| 1375 | pDot11f->num_data = pRsnIe->rsnIEdata[ idx + 1 ]; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 1376 | vos_mem_copy( pDot11f->data, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1377 | pRsnIe->rsnIEdata + idx + 2, // EID, len |
| 1378 | pRsnIe->rsnIEdata[ idx + 1 ] ); |
| 1379 | } |
| 1380 | } |
| 1381 | |
| 1382 | return eSIR_SUCCESS; |
| 1383 | |
| 1384 | } // End PopulateDot11fRSNOpaque. |
| 1385 | |
| 1386 | |
| 1387 | |
| 1388 | #if defined(FEATURE_WLAN_WAPI) |
| 1389 | |
| 1390 | tSirRetStatus |
| 1391 | PopulateDot11fWAPI(tpAniSirGlobal pMac, |
| 1392 | tpSirRSNie pRsnIe, |
| 1393 | tDot11fIEWAPI *pDot11f) |
| 1394 | { |
| 1395 | tANI_U32 status; |
| 1396 | int idx; |
| 1397 | |
| 1398 | if ( pRsnIe->length ) |
| 1399 | { |
| 1400 | if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_WAPI ) ) ) |
| 1401 | { |
| 1402 | status = dot11fUnpackIeWAPI( pMac, |
| 1403 | pRsnIe->rsnIEdata + idx + 2, //EID, length |
| 1404 | pRsnIe->rsnIEdata[ idx + 1 ], |
| 1405 | pDot11f ); |
| 1406 | if ( DOT11F_FAILED( status ) ) |
| 1407 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1408 | dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fWAPI (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1409 | status ); |
| 1410 | return eSIR_FAILURE; |
| 1411 | } |
| 1412 | dot11fLog( pMac, LOG2, FL("dot11fUnpackIeRSN returned 0x%08x in " |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1413 | "PopulateDot11fWAPI."), status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1414 | } |
| 1415 | } |
| 1416 | |
| 1417 | return eSIR_SUCCESS; |
| 1418 | } // End PopulateDot11fWAPI. |
| 1419 | |
| 1420 | tSirRetStatus PopulateDot11fWAPIOpaque( tpAniSirGlobal pMac, |
| 1421 | tpSirRSNie pRsnIe, |
| 1422 | tDot11fIEWAPIOpaque *pDot11f ) |
| 1423 | { |
| 1424 | int idx; |
| 1425 | |
| 1426 | if ( pRsnIe->length ) |
| 1427 | { |
| 1428 | if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_WAPI ) ) ) |
| 1429 | { |
| 1430 | pDot11f->present = 1; |
| 1431 | pDot11f->num_data = pRsnIe->rsnIEdata[ idx + 1 ]; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 1432 | vos_mem_copy ( pDot11f->data, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1433 | pRsnIe->rsnIEdata + idx + 2, // EID, len |
| 1434 | pRsnIe->rsnIEdata[ idx + 1 ] ); |
| 1435 | } |
| 1436 | } |
| 1437 | |
| 1438 | return eSIR_SUCCESS; |
| 1439 | |
| 1440 | } // End PopulateDot11fWAPIOpaque. |
| 1441 | |
| 1442 | |
| 1443 | #endif //defined(FEATURE_WLAN_WAPI) |
| 1444 | |
| 1445 | void |
| 1446 | PopulateDot11fSSID(tpAniSirGlobal pMac, |
| 1447 | tSirMacSSid *pInternal, |
| 1448 | tDot11fIESSID *pDot11f) |
| 1449 | { |
| 1450 | pDot11f->present = 1; |
| 1451 | pDot11f->num_ssid = pInternal->length; |
| 1452 | if ( pInternal->length ) |
| 1453 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 1454 | vos_mem_copy( ( tANI_U8* )pDot11f->ssid, ( tANI_U8* )&pInternal->ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1455 | pInternal->length ); |
| 1456 | } |
| 1457 | } // End PopulateDot11fSSID. |
| 1458 | |
| 1459 | tSirRetStatus |
| 1460 | PopulateDot11fSSID2(tpAniSirGlobal pMac, |
| 1461 | tDot11fIESSID *pDot11f) |
| 1462 | { |
| 1463 | tANI_U32 nCfg; |
| 1464 | tSirRetStatus nSirStatus; |
| 1465 | |
| 1466 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SSID, pDot11f->ssid, nCfg, 32 ); |
| 1467 | pDot11f->num_ssid = ( tANI_U8 )nCfg; |
| 1468 | pDot11f->present = 1; |
| 1469 | return eSIR_SUCCESS; |
| 1470 | } // End PopulateDot11fSSID2. |
| 1471 | |
| 1472 | void |
| 1473 | PopulateDot11fSchedule(tSirMacScheduleIE *pSchedule, |
| 1474 | tDot11fIESchedule *pDot11f) |
| 1475 | { |
| 1476 | pDot11f->aggregation = pSchedule->info.aggregation; |
| 1477 | pDot11f->tsid = pSchedule->info.tsid; |
| 1478 | pDot11f->direction = pSchedule->info.direction; |
| 1479 | pDot11f->reserved = pSchedule->info.rsvd; |
| 1480 | pDot11f->service_start_time = pSchedule->svcStartTime; |
| 1481 | pDot11f->service_interval = pSchedule->svcInterval; |
| 1482 | pDot11f->max_service_dur = pSchedule->maxSvcDuration; |
| 1483 | pDot11f->spec_interval = pSchedule->specInterval; |
| 1484 | |
| 1485 | pDot11f->present = 1; |
| 1486 | } // End PopulateDot11fSchedule. |
| 1487 | |
| 1488 | void |
| 1489 | PopulateDot11fSuppChannels(tpAniSirGlobal pMac, |
| 1490 | tDot11fIESuppChannels *pDot11f, |
| 1491 | tANI_U8 nAssocType, |
| 1492 | tpPESession psessionEntry) |
| 1493 | { |
| 1494 | tANI_U8 i; |
| 1495 | tANI_U8 *p; |
| 1496 | |
| 1497 | if (nAssocType == LIM_REASSOC) |
| 1498 | { |
| 1499 | p = ( tANI_U8* )psessionEntry->pLimReAssocReq->supportedChannels.channelList; |
| 1500 | pDot11f->num_bands = psessionEntry->pLimReAssocReq->supportedChannels.numChnl; |
| 1501 | }else |
| 1502 | { |
| 1503 | p = ( tANI_U8* )psessionEntry->pLimJoinReq->supportedChannels.channelList; |
| 1504 | pDot11f->num_bands = psessionEntry->pLimJoinReq->supportedChannels.numChnl; |
| 1505 | } |
| 1506 | for ( i = 0U; i < pDot11f->num_bands; ++i, ++p) |
| 1507 | { |
| 1508 | pDot11f->bands[i][0] = *p; |
| 1509 | pDot11f->bands[i][1] = 1; |
| 1510 | } |
| 1511 | |
| 1512 | pDot11f->present = 1; |
| 1513 | |
| 1514 | } // End PopulateDot11fSuppChannels. |
| 1515 | |
| 1516 | tSirRetStatus |
| 1517 | PopulateDot11fSuppRates(tpAniSirGlobal pMac, |
| 1518 | tANI_U8 nChannelNum, |
| 1519 | tDot11fIESuppRates *pDot11f,tpPESession psessionEntry) |
| 1520 | { |
| 1521 | tSirRetStatus nSirStatus; |
| 1522 | tANI_U32 nRates; |
| 1523 | tANI_U8 rates[SIR_MAC_MAX_NUMBER_OF_RATES]; |
| 1524 | |
| 1525 | /* Use the operational rates present in session entry whenever nChannelNum is set to OPERATIONAL |
| 1526 | else use the supported rate set from CFG, which is fixed and does not change dynamically and is used for |
| 1527 | sending mgmt frames (lile probe req) which need to go out before any session is present. |
| 1528 | */ |
| 1529 | if(POPULATE_DOT11F_RATES_OPERATIONAL == nChannelNum ) |
| 1530 | { |
| 1531 | #if 0 |
| 1532 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_OPERATIONAL_RATE_SET, |
| 1533 | rates, nRates, SIR_MAC_MAX_NUMBER_OF_RATES ); |
| 1534 | #endif //TO SUPPORT BT-AMP |
| 1535 | if(psessionEntry != NULL) |
| 1536 | { |
| 1537 | nRates = psessionEntry->rateSet.numRates; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 1538 | vos_mem_copy( rates, psessionEntry->rateSet.rate, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1539 | nRates); |
| 1540 | } |
| 1541 | else |
| 1542 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1543 | dot11fLog( pMac, LOGE, FL("no session context exists while populating Operational Rate Set")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1544 | nRates = 0; |
| 1545 | } |
| 1546 | } |
| 1547 | else if ( 14 >= nChannelNum ) |
| 1548 | { |
| 1549 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_RATES_11B, |
| 1550 | rates, nRates, SIR_MAC_MAX_NUMBER_OF_RATES ); |
| 1551 | } |
| 1552 | else |
| 1553 | { |
| 1554 | CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_RATES_11A, |
| 1555 | rates, nRates, SIR_MAC_MAX_NUMBER_OF_RATES ); |
| 1556 | } |
| 1557 | |
| 1558 | if ( 0 != nRates ) |
| 1559 | { |
| 1560 | pDot11f->num_rates = ( tANI_U8 )nRates; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 1561 | vos_mem_copy( pDot11f->rates, rates, nRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1562 | pDot11f->present = 1; |
| 1563 | } |
| 1564 | |
| 1565 | return eSIR_SUCCESS; |
| 1566 | |
| 1567 | } // End PopulateDot11fSuppRates. |
| 1568 | |
Masti, Narayanraddi | 4b359dd | 2015-02-03 15:49:29 +0530 | [diff] [blame] | 1569 | /** |
| 1570 | * PopulateDot11fRatesTdls() - populate supported rates and |
| 1571 | * extended supported rates IE. |
| 1572 | * @p_mac gloabl - header. |
| 1573 | * @p_supp_rates - pointer to supported rates IE |
| 1574 | * @p_ext_supp_rates - pointer to extended supported rates IE |
| 1575 | * |
| 1576 | * This function populates the supported rates and extended supported |
| 1577 | * rates IE based in the STA capability. If the number of rates |
| 1578 | * supported is less than MAX_NUM_SUPPORTED_RATES, only supported rates |
| 1579 | * IE is populated. |
| 1580 | * |
| 1581 | * Return: tSirRetStatus eSIR_SUCCESS on Success and eSIR_FAILURE |
| 1582 | * on failure. |
| 1583 | */ |
| 1584 | |
| 1585 | tSirRetStatus |
| 1586 | PopulateDot11fRatesTdls(tpAniSirGlobal p_mac, |
| 1587 | tDot11fIESuppRates *p_supp_rates, |
| 1588 | tDot11fIEExtSuppRates *p_ext_supp_rates) |
| 1589 | { |
| 1590 | tSirMacRateSet temp_rateset; |
| 1591 | tSirMacRateSet temp_rateset2; |
| 1592 | uint32_t val, i; |
| 1593 | uint32_t self_dot11mode = 0; |
| 1594 | |
| 1595 | wlan_cfgGetInt(p_mac, WNI_CFG_DOT11_MODE, &self_dot11mode); |
| 1596 | |
| 1597 | /** |
| 1598 | * Include 11b rates only when the device configured in |
| 1599 | * auto, 11a/b/g or 11b_only |
| 1600 | */ |
| 1601 | if ((self_dot11mode == WNI_CFG_DOT11_MODE_ALL) || |
| 1602 | (self_dot11mode == WNI_CFG_DOT11_MODE_11A) || |
| 1603 | (self_dot11mode == WNI_CFG_DOT11_MODE_11AC) || |
| 1604 | (self_dot11mode == WNI_CFG_DOT11_MODE_11N) || |
| 1605 | (self_dot11mode == WNI_CFG_DOT11_MODE_11G) || |
| 1606 | (self_dot11mode == WNI_CFG_DOT11_MODE_11B) ) |
| 1607 | { |
| 1608 | val = WNI_CFG_SUPPORTED_RATES_11B_LEN; |
| 1609 | wlan_cfgGetStr(p_mac, WNI_CFG_SUPPORTED_RATES_11B, |
| 1610 | (tANI_U8 *)&temp_rateset.rate, &val); |
| 1611 | temp_rateset.numRates = (tANI_U8) val; |
| 1612 | } |
| 1613 | else |
| 1614 | { |
| 1615 | temp_rateset.numRates = 0; |
| 1616 | } |
| 1617 | |
| 1618 | /* Include 11a rates when the device configured in non-11b mode */ |
| 1619 | if (!IS_DOT11_MODE_11B(self_dot11mode)) |
| 1620 | { |
| 1621 | val = WNI_CFG_SUPPORTED_RATES_11A_LEN; |
| 1622 | wlan_cfgGetStr(p_mac, WNI_CFG_SUPPORTED_RATES_11A, |
| 1623 | (tANI_U8 *)&temp_rateset2.rate, &val); |
| 1624 | temp_rateset2.numRates = (tANI_U8) val; |
| 1625 | } |
| 1626 | else |
| 1627 | { |
| 1628 | temp_rateset2.numRates = 0; |
| 1629 | } |
| 1630 | |
| 1631 | if ((temp_rateset.numRates + temp_rateset2.numRates) > |
| 1632 | SIR_MAC_MAX_NUMBER_OF_RATES) |
| 1633 | { |
| 1634 | limLog(p_mac, LOGP, FL("more than %d rates in CFG"), |
| 1635 | SIR_MAC_MAX_NUMBER_OF_RATES); |
| 1636 | return eSIR_FAILURE; |
| 1637 | } |
| 1638 | |
| 1639 | /** |
| 1640 | * copy all rates in temp_rateset, |
| 1641 | * there are SIR_MAC_MAX_NUMBER_OF_RATES rates max |
| 1642 | */ |
| 1643 | for (i = 0; i < temp_rateset2.numRates; i++) |
| 1644 | temp_rateset.rate[i + temp_rateset.numRates] = |
| 1645 | temp_rateset2.rate[i]; |
| 1646 | |
| 1647 | temp_rateset.numRates += temp_rateset2.numRates; |
| 1648 | |
| 1649 | if (temp_rateset.numRates <= MAX_NUM_SUPPORTED_RATES) |
| 1650 | { |
| 1651 | p_supp_rates->num_rates = temp_rateset.numRates; |
| 1652 | vos_mem_copy(p_supp_rates->rates, temp_rateset.rate, |
| 1653 | p_supp_rates->num_rates); |
| 1654 | p_supp_rates->present = 1; |
| 1655 | } |
| 1656 | else /* Populate extended capability as well */ |
| 1657 | { |
| 1658 | p_supp_rates->num_rates = MAX_NUM_SUPPORTED_RATES; |
| 1659 | vos_mem_copy(p_supp_rates->rates, temp_rateset.rate, |
| 1660 | p_supp_rates->num_rates); |
| 1661 | p_supp_rates->present = 1; |
| 1662 | p_ext_supp_rates->num_rates = temp_rateset.numRates - |
| 1663 | MAX_NUM_SUPPORTED_RATES; |
| 1664 | vos_mem_copy(p_ext_supp_rates->rates, |
| 1665 | (tANI_U8 *)temp_rateset.rate + |
| 1666 | MAX_NUM_SUPPORTED_RATES, |
| 1667 | p_ext_supp_rates->num_rates); |
| 1668 | p_ext_supp_rates->present = 1; |
| 1669 | } |
| 1670 | |
| 1671 | return eSIR_SUCCESS; |
| 1672 | |
| 1673 | } /* End PopulateDot11fRatesTdls */ |
| 1674 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1675 | tSirRetStatus |
| 1676 | PopulateDot11fTPCReport(tpAniSirGlobal pMac, |
| 1677 | tDot11fIETPCReport *pDot11f, |
| 1678 | tpPESession psessionEntry) |
| 1679 | { |
| 1680 | tANI_U16 staid, txPower; |
| 1681 | tSirRetStatus nSirStatus; |
| 1682 | |
| 1683 | nSirStatus = limGetMgmtStaid( pMac, &staid, psessionEntry); |
| 1684 | if ( eSIR_SUCCESS != nSirStatus ) |
| 1685 | { |
| 1686 | dot11fLog( pMac, LOG1, FL("Failed to get the STAID in Populat" |
| 1687 | "eDot11fTPCReport; limGetMgmtStaid " |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1688 | "returned status %d."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1689 | nSirStatus ); |
| 1690 | return eSIR_FAILURE; |
| 1691 | } |
| 1692 | |
| 1693 | // FramesToDo: This function was "misplaced" in the move to Gen4_TVM... |
| 1694 | // txPower = halGetRateToPwrValue( pMac, staid, pMac->lim.gLimCurrentChannelId, isBeacon ); |
| 1695 | txPower = 0; |
| 1696 | pDot11f->tx_power = ( tANI_U8 )txPower; |
| 1697 | pDot11f->link_margin = 0; |
| 1698 | pDot11f->present = 1; |
| 1699 | |
| 1700 | return eSIR_SUCCESS; |
| 1701 | } // End PopulateDot11fTPCReport. |
| 1702 | |
| 1703 | |
| 1704 | void PopulateDot11fTSInfo(tSirMacTSInfo *pInfo, |
| 1705 | tDot11fFfTSInfo *pDot11f) |
| 1706 | { |
| 1707 | pDot11f->traffic_type = pInfo->traffic.trafficType; |
| 1708 | pDot11f->tsid = pInfo->traffic.tsid; |
| 1709 | pDot11f->direction = pInfo->traffic.direction; |
| 1710 | pDot11f->access_policy = pInfo->traffic.accessPolicy; |
| 1711 | pDot11f->aggregation = pInfo->traffic.aggregation; |
| 1712 | pDot11f->psb = pInfo->traffic.psb; |
| 1713 | pDot11f->user_priority = pInfo->traffic.userPrio; |
| 1714 | pDot11f->tsinfo_ack_pol = pInfo->traffic.ackPolicy; |
| 1715 | pDot11f->schedule = pInfo->schedule.schedule; |
| 1716 | } // End PopulatedDot11fTSInfo. |
| 1717 | |
| 1718 | void PopulateDot11fWMM(tpAniSirGlobal pMac, |
| 1719 | tDot11fIEWMMInfoAp *pInfo, |
| 1720 | tDot11fIEWMMParams *pParams, |
| 1721 | tDot11fIEWMMCaps *pCaps, |
| 1722 | tpPESession psessionEntry) |
| 1723 | { |
| 1724 | if ( psessionEntry->limWmeEnabled ) |
| 1725 | { |
| 1726 | if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) |
| 1727 | { |
| 1728 | //if ( ! sirIsPropCapabilityEnabled( pMac, SIR_MAC_PROP_CAPABILITY_WME ) ) |
| 1729 | { |
| 1730 | PopulateDot11fWMMInfoAp( pMac, pInfo, psessionEntry ); |
| 1731 | } |
| 1732 | } |
| 1733 | else |
| 1734 | { |
| 1735 | { |
| 1736 | PopulateDot11fWMMParams( pMac, pParams, psessionEntry); |
| 1737 | } |
| 1738 | |
| 1739 | if ( psessionEntry->limWsmEnabled ) |
| 1740 | { |
| 1741 | PopulateDot11fWMMCaps( pCaps ); |
| 1742 | } |
| 1743 | } |
| 1744 | } |
| 1745 | } // End PopulateDot11fWMM. |
| 1746 | |
| 1747 | void PopulateDot11fWMMCaps(tDot11fIEWMMCaps *pCaps) |
| 1748 | { |
| 1749 | pCaps->version = SIR_MAC_OUI_VERSION_1; |
| 1750 | pCaps->qack = 0; |
| 1751 | pCaps->queue_request = 1; |
| 1752 | pCaps->txop_request = 0; |
| 1753 | pCaps->more_ack = 0; |
| 1754 | pCaps->present = 1; |
| 1755 | } // End PopulateDot11fWmmCaps. |
| 1756 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1757 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1758 | void PopulateDot11fReAssocTspec(tpAniSirGlobal pMac, tDot11fReAssocRequest *pReassoc, tpPESession psessionEntry) |
| 1759 | { |
| 1760 | tANI_U8 numTspecs = 0, idx; |
| 1761 | tTspecInfo *pTspec = NULL; |
| 1762 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1763 | numTspecs = psessionEntry->pLimReAssocReq->eseTspecInfo.numTspecs; |
| 1764 | pTspec = &psessionEntry->pLimReAssocReq->eseTspecInfo.tspec[0]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1765 | pReassoc->num_WMMTSPEC = numTspecs; |
| 1766 | if (numTspecs) { |
| 1767 | for (idx=0; idx<numTspecs; idx++) { |
| 1768 | PopulateDot11fWMMTSPEC(&pTspec->tspec, &pReassoc->WMMTSPEC[idx]); |
Sachin Ahuja | b0308c6 | 2014-07-01 17:02:54 +0530 | [diff] [blame] | 1769 | pTspec->tspec.mediumTime = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1770 | pTspec++; |
| 1771 | } |
| 1772 | } |
| 1773 | } |
| 1774 | #endif |
| 1775 | |
| 1776 | void PopulateDot11fWMMInfoAp(tpAniSirGlobal pMac, tDot11fIEWMMInfoAp *pInfo, |
| 1777 | tpPESession psessionEntry) |
| 1778 | { |
| 1779 | pInfo->version = SIR_MAC_OUI_VERSION_1; |
| 1780 | |
| 1781 | /* WMM Specification 3.1.3, 3.2.3 |
| 1782 | * An IBSS staion shall always use its default WMM parameters. |
| 1783 | */ |
| 1784 | if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) |
| 1785 | { |
| 1786 | pInfo->param_set_count = 0; |
| 1787 | pInfo->uapsd = 0; |
| 1788 | } |
| 1789 | else |
| 1790 | { |
| 1791 | pInfo->param_set_count = ( 0xf & psessionEntry->gLimEdcaParamSetCount ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1792 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE ){ |
| 1793 | pInfo->uapsd = ( 0x1 & psessionEntry->apUapsdEnable ); |
| 1794 | } |
| 1795 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1796 | pInfo->uapsd = ( 0x1 & pMac->lim.gUapsdEnable ); |
| 1797 | } |
| 1798 | pInfo->present = 1; |
| 1799 | } |
| 1800 | |
| 1801 | void PopulateDot11fWMMInfoStation(tpAniSirGlobal pMac, tDot11fIEWMMInfoStation *pInfo) |
| 1802 | { |
| 1803 | tANI_U32 val = 0; |
| 1804 | |
Sachin Ahuja | b3a1a15 | 2014-11-11 22:14:10 +0530 | [diff] [blame] | 1805 | limLog(pMac, LOG1, FL("populate WMM IE in Setup Request Frame")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1806 | pInfo->version = SIR_MAC_OUI_VERSION_1; |
| 1807 | pInfo->acvo_uapsd = LIM_UAPSD_GET(ACVO, pMac->lim.gUapsdPerAcBitmask); |
| 1808 | pInfo->acvi_uapsd = LIM_UAPSD_GET(ACVI, pMac->lim.gUapsdPerAcBitmask); |
| 1809 | pInfo->acbk_uapsd = LIM_UAPSD_GET(ACBK, pMac->lim.gUapsdPerAcBitmask); |
| 1810 | pInfo->acbe_uapsd = LIM_UAPSD_GET(ACBE, pMac->lim.gUapsdPerAcBitmask); |
| 1811 | |
| 1812 | if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS) |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1813 | PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max SP Length "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1814 | pInfo->max_sp_length = (tANI_U8)val; |
| 1815 | pInfo->present = 1; |
| 1816 | } |
| 1817 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1818 | void PopulateDot11fWMMParams(tpAniSirGlobal pMac, |
| 1819 | tDot11fIEWMMParams *pParams, |
| 1820 | tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1821 | { |
| 1822 | pParams->version = SIR_MAC_OUI_VERSION_1; |
| 1823 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1824 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 1825 | pParams->qosInfo = |
| 1826 | (psessionEntry->apUapsdEnable << 7) | ((tANI_U8)(0x0f & psessionEntry->gLimEdcaParamSetCount)); |
| 1827 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1828 | pParams->qosInfo = |
| 1829 | (pMac->lim.gUapsdEnable << 7) | ((tANI_U8)(0x0f & psessionEntry->gLimEdcaParamSetCount)); |
| 1830 | |
| 1831 | // Fill each EDCA parameter set in order: be, bk, vi, vo |
| 1832 | pParams->acbe_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[0].aci.aifsn) ); |
| 1833 | pParams->acbe_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[0].aci.acm ); |
| 1834 | pParams->acbe_aci = ( 0x3 & SIR_MAC_EDCAACI_BESTEFFORT ); |
| 1835 | pParams->acbe_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[0].cw.min ); |
| 1836 | pParams->acbe_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[0].cw.max ); |
| 1837 | pParams->acbe_txoplimit = psessionEntry->gLimEdcaParamsBC[0].txoplimit; |
| 1838 | |
| 1839 | pParams->acbk_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[1].aci.aifsn) ); |
| 1840 | pParams->acbk_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[1].aci.acm ); |
| 1841 | pParams->acbk_aci = ( 0x3 & SIR_MAC_EDCAACI_BACKGROUND ); |
| 1842 | pParams->acbk_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.min ); |
| 1843 | pParams->acbk_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.max ); |
| 1844 | pParams->acbk_txoplimit = psessionEntry->gLimEdcaParamsBC[1].txoplimit; |
| 1845 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1846 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE ) |
| 1847 | pParams->acvi_aifsn = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].aci.aifsn ); |
| 1848 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1849 | pParams->acvi_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[2].aci.aifsn) ); |
| 1850 | |
| 1851 | |
| 1852 | |
| 1853 | pParams->acvi_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[2].aci.acm ); |
| 1854 | pParams->acvi_aci = ( 0x3 & SIR_MAC_EDCAACI_VIDEO ); |
| 1855 | pParams->acvi_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.min ); |
| 1856 | pParams->acvi_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.max ); |
| 1857 | pParams->acvi_txoplimit = psessionEntry->gLimEdcaParamsBC[2].txoplimit; |
| 1858 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1859 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE ) |
| 1860 | pParams->acvo_aifsn = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].aci.aifsn ); |
| 1861 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1862 | pParams->acvo_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[3].aci.aifsn) ); |
| 1863 | |
| 1864 | pParams->acvo_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[3].aci.acm ); |
| 1865 | pParams->acvo_aci = ( 0x3 & SIR_MAC_EDCAACI_VOICE ); |
| 1866 | pParams->acvo_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].cw.min ); |
| 1867 | pParams->acvo_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].cw.max ); |
| 1868 | pParams->acvo_txoplimit = psessionEntry->gLimEdcaParamsBC[3].txoplimit; |
| 1869 | |
| 1870 | pParams->present = 1; |
| 1871 | |
| 1872 | } // End PopulateDot11fWMMParams. |
| 1873 | |
| 1874 | void PopulateDot11fWMMSchedule(tSirMacScheduleIE *pSchedule, |
| 1875 | tDot11fIEWMMSchedule *pDot11f) |
| 1876 | { |
| 1877 | pDot11f->version = 1; |
| 1878 | pDot11f->aggregation = pSchedule->info.aggregation; |
| 1879 | pDot11f->tsid = pSchedule->info.tsid; |
| 1880 | pDot11f->direction = pSchedule->info.direction; |
| 1881 | pDot11f->reserved = pSchedule->info.rsvd; |
| 1882 | pDot11f->service_start_time = pSchedule->svcStartTime; |
| 1883 | pDot11f->service_interval = pSchedule->svcInterval; |
| 1884 | pDot11f->max_service_dur = pSchedule->maxSvcDuration; |
| 1885 | pDot11f->spec_interval = pSchedule->specInterval; |
| 1886 | |
| 1887 | pDot11f->present = 1; |
| 1888 | } // End PopulateDot11fWMMSchedule. |
| 1889 | |
| 1890 | tSirRetStatus |
| 1891 | PopulateDot11fWPA(tpAniSirGlobal pMac, |
| 1892 | tpSirRSNie pRsnIe, |
| 1893 | tDot11fIEWPA *pDot11f) |
| 1894 | { |
| 1895 | tANI_U32 status; |
| 1896 | int idx; |
| 1897 | |
| 1898 | if ( pRsnIe->length ) |
| 1899 | { |
| 1900 | if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_WPA ) ) ) |
| 1901 | { |
| 1902 | status = dot11fUnpackIeWPA( pMac, |
| 1903 | pRsnIe->rsnIEdata + idx + 2 + 4, // EID, length, OUI |
| 1904 | pRsnIe->rsnIEdata[ idx + 1 ] - 4, // OUI |
| 1905 | pDot11f ); |
| 1906 | if ( DOT11F_FAILED( status ) ) |
| 1907 | { |
| 1908 | dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fWP" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1909 | "A (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1910 | status ); |
| 1911 | return eSIR_FAILURE; |
| 1912 | } |
| 1913 | } |
| 1914 | } |
| 1915 | |
| 1916 | return eSIR_SUCCESS; |
| 1917 | } // End PopulateDot11fWPA. |
| 1918 | |
| 1919 | |
| 1920 | |
| 1921 | tSirRetStatus PopulateDot11fWPAOpaque( tpAniSirGlobal pMac, |
| 1922 | tpSirRSNie pRsnIe, |
| 1923 | tDot11fIEWPAOpaque *pDot11f ) |
| 1924 | { |
| 1925 | int idx; |
| 1926 | |
| 1927 | if ( pRsnIe->length ) |
| 1928 | { |
| 1929 | if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_WPA ) ) ) |
| 1930 | { |
| 1931 | pDot11f->present = 1; |
| 1932 | pDot11f->num_data = pRsnIe->rsnIEdata[ idx + 1 ] - 4; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 1933 | vos_mem_copy( pDot11f->data, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1934 | pRsnIe->rsnIEdata + idx + 2 + 4, // EID, len, OUI |
| 1935 | pRsnIe->rsnIEdata[ idx + 1 ] - 4 ); // OUI |
| 1936 | } |
| 1937 | } |
| 1938 | |
| 1939 | return eSIR_SUCCESS; |
| 1940 | |
| 1941 | } // End PopulateDot11fWPAOpaque. |
| 1942 | |
| 1943 | //////////////////////////////////////////////////////////////////////// |
| 1944 | |
| 1945 | tSirRetStatus |
| 1946 | sirGetCfgPropCaps(tpAniSirGlobal pMac, tANI_U16 *caps) |
| 1947 | { |
| 1948 | #if 0 |
| 1949 | tANI_U32 val; |
| 1950 | |
| 1951 | *caps = 0; |
| 1952 | if (wlan_cfgGetInt(pMac, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED, &val) |
| 1953 | != eSIR_SUCCESS) |
| 1954 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1955 | limLog(pMac, LOGP, FL("could not retrieve PropFeature enabled flag")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1956 | return eSIR_FAILURE; |
| 1957 | } |
| 1958 | if (wlan_cfgGetInt(pMac, WNI_CFG_PROP_CAPABILITY, &val) != eSIR_SUCCESS) |
| 1959 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1960 | limLog(pMac, LOGP, FL("could not retrieve PROP_CAPABLITY flag")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1961 | return eSIR_FAILURE; |
| 1962 | } |
| 1963 | |
| 1964 | *caps = (tANI_U16) val; |
| 1965 | #endif |
| 1966 | return eSIR_SUCCESS; |
| 1967 | } |
| 1968 | |
| 1969 | tSirRetStatus |
| 1970 | sirConvertProbeReqFrame2Struct(tpAniSirGlobal pMac, |
| 1971 | tANI_U8 *pFrame, |
| 1972 | tANI_U32 nFrame, |
| 1973 | tpSirProbeReq pProbeReq) |
| 1974 | { |
| 1975 | tANI_U32 status; |
| 1976 | tDot11fProbeRequest pr; |
| 1977 | |
| 1978 | // Ok, zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 1979 | vos_mem_set( (tANI_U8*)pProbeReq, sizeof(tSirProbeReq), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1980 | |
| 1981 | // delegate to the framesc-generated code, |
| 1982 | status = dot11fUnpackProbeRequest(pMac, pFrame, nFrame, &pr); |
| 1983 | if ( DOT11F_FAILED( status ) ) |
| 1984 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1985 | limLog(pMac, LOGE, FL("Failed to parse a Probe Request (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1986 | status, nFrame); |
| 1987 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 1988 | return eSIR_FAILURE; |
| 1989 | } |
| 1990 | else if ( DOT11F_WARNED( status ) ) |
| 1991 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 1992 | limLog( pMac, LOGW, FL("There were warnings while unpacking a Probe Request (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1993 | status, nFrame ); |
| 1994 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 1995 | } |
| 1996 | |
| 1997 | // & "transliterate" from a 'tDot11fProbeRequestto' a 'tSirProbeReq'... |
| 1998 | if ( ! pr.SSID.present ) |
| 1999 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2000 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2001 | } |
| 2002 | else |
| 2003 | { |
| 2004 | pProbeReq->ssidPresent = 1; |
| 2005 | ConvertSSID( pMac, &pProbeReq->ssId, &pr.SSID ); |
| 2006 | } |
| 2007 | |
| 2008 | if ( ! pr.SuppRates.present ) |
| 2009 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2010 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2011 | return eSIR_FAILURE; |
| 2012 | } |
| 2013 | else |
| 2014 | { |
| 2015 | pProbeReq->suppRatesPresent = 1; |
| 2016 | ConvertSuppRates( pMac, &pProbeReq->supportedRates, &pr.SuppRates ); |
| 2017 | } |
| 2018 | |
| 2019 | if ( pr.ExtSuppRates.present ) |
| 2020 | { |
| 2021 | pProbeReq->extendedRatesPresent = 1; |
| 2022 | ConvertExtSuppRates( pMac, &pProbeReq->extendedRates, &pr.ExtSuppRates ); |
| 2023 | } |
| 2024 | |
| 2025 | if ( pr.HTCaps.present ) |
| 2026 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2027 | vos_mem_copy( &pProbeReq->HTCaps, &pr.HTCaps, sizeof( tDot11fIEHTCaps ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2028 | } |
| 2029 | |
| 2030 | if ( pr.WscProbeReq.present ) |
| 2031 | { |
| 2032 | pProbeReq->wscIePresent = 1; |
Rajesh Babu Prathipati | ddbe289 | 2014-07-01 18:57:16 +0530 | [diff] [blame] | 2033 | vos_mem_copy(&pProbeReq->probeReqWscIeInfo, &pr.WscProbeReq, sizeof(tDot11fIEWscProbeReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2034 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2035 | #ifdef WLAN_FEATURE_11AC |
| 2036 | if ( pr.VHTCaps.present ) |
| 2037 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2038 | vos_mem_copy( &pProbeReq->VHTCaps, &pr.VHTCaps, sizeof( tDot11fIEVHTCaps ) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2039 | } |
| 2040 | #endif |
| 2041 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2042 | |
| 2043 | if ( pr.P2PProbeReq.present ) |
| 2044 | { |
| 2045 | pProbeReq->p2pIePresent = 1; |
| 2046 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2047 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2048 | return eSIR_SUCCESS; |
| 2049 | |
| 2050 | } // End sirConvertProbeReqFrame2Struct. |
| 2051 | |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2052 | /* function ValidateAndRectifyIEs checks for the malformed frame. |
| 2053 | * The frame would contain fixed IEs of 12 bytes follwed by Variable IEs |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2054 | * (Tagged elements). |
| 2055 | * Every Tagged IE has tag number, tag length and data. Tag length indicates |
| 2056 | * the size of data in bytes. |
| 2057 | * This function checks for size of Frame recived with the sum of all IEs. |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2058 | * And also rectifies missing optional fields in IE. |
| 2059 | * |
| 2060 | * NOTE : Presently this function rectifies RSN capability in RSN IE, can |
| 2061 | * extended to rectify other optional fields in other IEs. |
| 2062 | * |
| 2063 | */ |
| 2064 | tSirRetStatus ValidateAndRectifyIEs(tpAniSirGlobal pMac, |
| 2065 | tANI_U8 *pMgmtFrame, |
| 2066 | tANI_U32 nFrameBytes, |
| 2067 | tANI_U32 *nMissingRsnBytes) |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2068 | { |
| 2069 | tANI_U32 length = SIZE_OF_FIXED_PARAM; |
| 2070 | tANI_U8 *refFrame; |
| 2071 | |
| 2072 | // Frame contains atleast one IE |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2073 | if (nFrameBytes > (SIZE_OF_FIXED_PARAM + 2)) |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2074 | { |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2075 | while (length < nFrameBytes) |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2076 | { |
| 2077 | /*refFrame points to next IE */ |
| 2078 | refFrame = pMgmtFrame + length; |
| 2079 | length += (tANI_U32)(SIZE_OF_TAG_PARAM_NUM + SIZE_OF_TAG_PARAM_LEN |
| 2080 | + (*(refFrame + SIZE_OF_TAG_PARAM_NUM))); |
| 2081 | } |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2082 | if (length != nFrameBytes) |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2083 | { |
| 2084 | /* Workaround : Some APs may not include RSN Capability but |
| 2085 | * the length of which is included in RSN IE length. |
| 2086 | * this may cause in updating RSN Capability with junk value. |
| 2087 | * To avoid this, add RSN Capability value with default value. |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2088 | * Going further we can have such workaround for other IEs |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2089 | */ |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2090 | if ((*refFrame == RSNIEID) && |
| 2091 | (length == (nFrameBytes + RSNIE_CAPABILITY_LEN))) |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2092 | { |
| 2093 | //Assume RSN Capability as 00 |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2094 | vos_mem_set( ( tANI_U8* ) (pMgmtFrame + (nFrameBytes)), |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2095 | RSNIE_CAPABILITY_LEN, DEFAULT_RSNIE_CAP_VAL ); |
Rashmi Ramanna | 2b55dc1 | 2014-06-10 22:56:20 +0530 | [diff] [blame] | 2096 | *nMissingRsnBytes = RSNIE_CAPABILITY_LEN; |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2097 | limLog(pMac, LOG1, |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2098 | FL("Added RSN Capability to the RSNIE as 0x00 0x00")); |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2099 | |
| 2100 | return eHAL_STATUS_SUCCESS; |
| 2101 | } |
| 2102 | return eSIR_FAILURE; |
| 2103 | } |
| 2104 | } |
Rashmi Ramanna | 6922be0 | 2014-05-29 19:37:58 +0530 | [diff] [blame] | 2105 | return eHAL_STATUS_SUCCESS; |
| 2106 | } |
| 2107 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2108 | tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac, |
| 2109 | tANI_U8 *pFrame, |
| 2110 | tANI_U32 nFrame, |
| 2111 | tpSirProbeRespBeacon pProbeResp) |
| 2112 | { |
| 2113 | tANI_U32 status; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2114 | tDot11fProbeResponse *pr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2115 | |
| 2116 | // Ok, zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2117 | vos_mem_set( ( tANI_U8* )pProbeResp, sizeof(tSirProbeRespBeacon), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2118 | |
Abhishek Singh | c75726d | 2015-04-13 14:44:14 +0530 | [diff] [blame] | 2119 | pr = vos_mem_vmalloc(sizeof(tDot11fProbeResponse)); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2120 | if ( NULL == pr ) |
| 2121 | status = eHAL_STATUS_FAILURE; |
| 2122 | else |
| 2123 | status = eHAL_STATUS_SUCCESS; |
| 2124 | if (!HAL_STATUS_SUCCESS(status)) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2125 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2126 | limLog(pMac, LOGE, FL("Failed to allocate memory") ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2127 | return eSIR_FAILURE; |
| 2128 | } |
| 2129 | |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2130 | vos_mem_set( ( tANI_U8* )pr, sizeof(tDot11fProbeResponse), 0 ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2131 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2132 | // delegate to the framesc-generated code, |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2133 | status = dot11fUnpackProbeResponse( pMac, pFrame, nFrame, pr ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2134 | if ( DOT11F_FAILED( status ) ) |
| 2135 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2136 | limLog(pMac, LOGE, FL("Failed to parse a Probe Response (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2137 | status, nFrame); |
| 2138 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
Abhishek Singh | c75726d | 2015-04-13 14:44:14 +0530 | [diff] [blame] | 2139 | vos_mem_vfree(pr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2140 | return eSIR_FAILURE; |
| 2141 | } |
| 2142 | else if ( DOT11F_WARNED( status ) ) |
| 2143 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2144 | limLog( pMac, LOGW, FL("There were warnings while unpacking a Probe Response (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2145 | status, nFrame ); |
| 2146 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 2147 | } |
| 2148 | |
| 2149 | // & "transliterate" from a 'tDot11fProbeResponse' to a 'tSirProbeRespBeacon'... |
| 2150 | |
| 2151 | // Timestamp |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2152 | vos_mem_copy( ( tANI_U8* )pProbeResp->timeStamp, ( tANI_U8* )&pr->TimeStamp, |
| 2153 | sizeof(tSirMacTimeStamp) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2154 | |
| 2155 | // Beacon Interval |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2156 | pProbeResp->beaconInterval = pr->BeaconInterval.interval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2157 | |
| 2158 | // Capabilities |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2159 | pProbeResp->capabilityInfo.ess = pr->Capabilities.ess; |
| 2160 | pProbeResp->capabilityInfo.ibss = pr->Capabilities.ibss; |
| 2161 | pProbeResp->capabilityInfo.cfPollable = pr->Capabilities.cfPollable; |
| 2162 | pProbeResp->capabilityInfo.cfPollReq = pr->Capabilities.cfPollReq; |
| 2163 | pProbeResp->capabilityInfo.privacy = pr->Capabilities.privacy; |
| 2164 | pProbeResp->capabilityInfo.shortPreamble = pr->Capabilities.shortPreamble; |
| 2165 | pProbeResp->capabilityInfo.pbcc = pr->Capabilities.pbcc; |
| 2166 | pProbeResp->capabilityInfo.channelAgility = pr->Capabilities.channelAgility; |
| 2167 | pProbeResp->capabilityInfo.spectrumMgt = pr->Capabilities.spectrumMgt; |
| 2168 | pProbeResp->capabilityInfo.qos = pr->Capabilities.qos; |
| 2169 | pProbeResp->capabilityInfo.shortSlotTime = pr->Capabilities.shortSlotTime; |
| 2170 | pProbeResp->capabilityInfo.apsd = pr->Capabilities.apsd; |
| 2171 | pProbeResp->capabilityInfo.rrm = pr->Capabilities.rrm; |
| 2172 | pProbeResp->capabilityInfo.dsssOfdm = pr->Capabilities.dsssOfdm; |
| 2173 | pProbeResp->capabilityInfo.delayedBA = pr->Capabilities.delayedBA; |
| 2174 | pProbeResp->capabilityInfo.immediateBA = pr->Capabilities.immediateBA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2175 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2176 | if ( ! pr->SSID.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2177 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2178 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2179 | } |
| 2180 | else |
| 2181 | { |
| 2182 | pProbeResp->ssidPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2183 | ConvertSSID( pMac, &pProbeResp->ssId, &pr->SSID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2184 | } |
| 2185 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2186 | if ( ! pr->SuppRates.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2187 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2188 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2189 | } |
| 2190 | else |
| 2191 | { |
| 2192 | pProbeResp->suppRatesPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2193 | ConvertSuppRates( pMac, &pProbeResp->supportedRates, &pr->SuppRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2194 | } |
| 2195 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2196 | if ( pr->ExtSuppRates.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2197 | { |
| 2198 | pProbeResp->extendedRatesPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2199 | ConvertExtSuppRates( pMac, &pProbeResp->extendedRates, &pr->ExtSuppRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2200 | } |
| 2201 | |
| 2202 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2203 | if ( pr->CFParams.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2204 | { |
| 2205 | pProbeResp->cfPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2206 | ConvertCFParams( pMac, &pProbeResp->cfParamSet, &pr->CFParams ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2207 | } |
| 2208 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2209 | if ( pr->Country.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2210 | { |
| 2211 | pProbeResp->countryInfoPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2212 | ConvertCountry( pMac, &pProbeResp->countryInfoParam, &pr->Country ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2213 | } |
| 2214 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2215 | if ( pr->EDCAParamSet.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2216 | { |
| 2217 | pProbeResp->edcaPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2218 | ConvertEDCAParam( pMac, &pProbeResp->edcaParams, &pr->EDCAParamSet ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2219 | } |
| 2220 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2221 | if ( pr->ChanSwitchAnn.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2222 | { |
| 2223 | pProbeResp->channelSwitchPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2224 | vos_mem_copy( &pProbeResp->channelSwitchIE, &pr->ChanSwitchAnn, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2225 | sizeof(tDot11fIEExtChanSwitchAnn) ); |
| 2226 | } |
| 2227 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2228 | if ( pr->ExtChanSwitchAnn.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2229 | { |
| 2230 | pProbeResp->extChannelSwitchPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2231 | vos_mem_copy ( &pProbeResp->extChannelSwitchIE, &pr->ExtChanSwitchAnn, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2232 | sizeof(tDot11fIEExtChanSwitchAnn) ); |
| 2233 | } |
| 2234 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2235 | if( pr->TPCReport.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2236 | { |
| 2237 | pProbeResp->tpcReportPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2238 | vos_mem_copy( &pProbeResp->tpcReport, &pr->TPCReport, sizeof(tDot11fIETPCReport)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2239 | } |
| 2240 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2241 | if( pr->PowerConstraints.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2242 | { |
| 2243 | pProbeResp->powerConstraintPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2244 | vos_mem_copy( &pProbeResp->localPowerConstraint, &pr->PowerConstraints, |
| 2245 | sizeof(tDot11fIEPowerConstraints)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2246 | } |
| 2247 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2248 | if ( pr->Quiet.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2249 | { |
| 2250 | pProbeResp->quietIEPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2251 | vos_mem_copy( &pProbeResp->quietIE, &pr->Quiet, sizeof(tDot11fIEQuiet) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2252 | } |
| 2253 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2254 | if ( pr->HTCaps.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2255 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2256 | vos_mem_copy( &pProbeResp->HTCaps, &pr->HTCaps, sizeof( tDot11fIEHTCaps ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2257 | } |
| 2258 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2259 | if ( pr->HTInfo.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2260 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2261 | vos_mem_copy( &pProbeResp->HTInfo, &pr->HTInfo, sizeof( tDot11fIEHTInfo ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2262 | } |
| 2263 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2264 | if ( pr->DSParams.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2265 | { |
| 2266 | pProbeResp->dsParamsPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2267 | pProbeResp->channelNumber = pr->DSParams.curr_channel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2268 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2269 | else if(pr->HTInfo.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2270 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2271 | pProbeResp->channelNumber = pr->HTInfo.primaryChannel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2272 | } |
| 2273 | |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 2274 | if ( pr->RSNOpaque.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2275 | { |
| 2276 | pProbeResp->rsnPresent = 1; |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 2277 | ConvertRSNOpaque( pMac, &pProbeResp->rsn, &pr->RSNOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2278 | } |
| 2279 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2280 | if ( pr->WPA.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2281 | { |
| 2282 | pProbeResp->wpaPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2283 | ConvertWPA( pMac, &pProbeResp->wpa, &pr->WPA ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2284 | } |
| 2285 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2286 | if ( pr->WMMParams.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2287 | { |
| 2288 | pProbeResp->wmeEdcaPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2289 | ConvertWMMParams( pMac, &pProbeResp->edcaParams, &pr->WMMParams ); |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2290 | PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Probe Response Frame!")); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2291 | __printWMMParams(pMac, &pr->WMMParams);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2292 | } |
| 2293 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2294 | if ( pr->WMMInfoAp.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2295 | { |
| 2296 | pProbeResp->wmeInfoPresent = 1; |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2297 | PELOG1(limLog(pMac, LOG1, FL("WMM Information Element present in Probe Response Frame!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2298 | } |
| 2299 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2300 | if ( pr->WMMCaps.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2301 | { |
| 2302 | pProbeResp->wsmCapablePresent = 1; |
| 2303 | } |
| 2304 | |
| 2305 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2306 | if ( pr->ERPInfo.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2307 | { |
| 2308 | pProbeResp->erpPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2309 | ConvertERPInfo( pMac, &pProbeResp->erpIEInfo, &pr->ERPInfo ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2310 | } |
| 2311 | |
| 2312 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2313 | if (pr->MobilityDomain.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2314 | { |
| 2315 | // MobilityDomain |
| 2316 | pProbeResp->mdiePresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2317 | vos_mem_copy( (tANI_U8 *)&(pProbeResp->mdie[0]), (tANI_U8 *)&(pr->MobilityDomain.MDID), |
| 2318 | sizeof(tANI_U16) ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2319 | pProbeResp->mdie[2] = ((pr->MobilityDomain.overDSCap << 0) | (pr->MobilityDomain.resourceReqCap << 1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2320 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2321 | limLog(pMac, LOG2, FL("mdie=%02x%02x%02x"), (unsigned int)pProbeResp->mdie[0], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2322 | (unsigned int)pProbeResp->mdie[1], (unsigned int)pProbeResp->mdie[2]); |
| 2323 | #endif |
| 2324 | } |
| 2325 | #endif |
| 2326 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2327 | #if defined FEATURE_WLAN_ESE |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2328 | if (pr->QBSSLoad.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2329 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2330 | vos_mem_copy(&pProbeResp->QBSSLoad, &pr->QBSSLoad, sizeof(tDot11fIEQBSSLoad)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2331 | } |
| 2332 | #endif |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2333 | if (pr->P2PProbeRes.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2334 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2335 | vos_mem_copy( &pProbeResp->P2PProbeRes, &pr->P2PProbeRes, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2336 | sizeof(tDot11fIEP2PProbeRes) ); |
| 2337 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2338 | #ifdef WLAN_FEATURE_11AC |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2339 | if ( pr->VHTCaps.present ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2340 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2341 | vos_mem_copy( &pProbeResp->VHTCaps, &pr->VHTCaps, sizeof( tDot11fIEVHTCaps ) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2342 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2343 | if ( pr->VHTOperation.present ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2344 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2345 | vos_mem_copy( &pProbeResp->VHTOperation, &pr->VHTOperation, sizeof( tDot11fIEVHTOperation) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2346 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2347 | if ( pr->VHTExtBssLoad.present ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2348 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2349 | vos_mem_copy( &pProbeResp->VHTExtBssLoad, &pr->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2350 | } |
| 2351 | #endif |
Abhishek Singh | c75726d | 2015-04-13 14:44:14 +0530 | [diff] [blame] | 2352 | vos_mem_vfree(pr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2353 | return eSIR_SUCCESS; |
| 2354 | |
| 2355 | } // End sirConvertProbeFrame2Struct. |
| 2356 | |
| 2357 | tSirRetStatus |
| 2358 | sirConvertAssocReqFrame2Struct(tpAniSirGlobal pMac, |
| 2359 | tANI_U8 *pFrame, |
| 2360 | tANI_U32 nFrame, |
| 2361 | tpSirAssocReq pAssocReq) |
| 2362 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2363 | tDot11fAssocRequest *ar; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2364 | tANI_U32 status; |
| 2365 | |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2366 | ar = vos_mem_malloc(sizeof(tDot11fAssocRequest)); |
| 2367 | if ( NULL == ar ) |
| 2368 | status = eHAL_STATUS_FAILURE; |
| 2369 | else |
| 2370 | status = eHAL_STATUS_SUCCESS; |
| 2371 | if (!HAL_STATUS_SUCCESS(status)) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2372 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2373 | limLog(pMac, LOGE, FL("Failed to allocate memory") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2374 | return eSIR_FAILURE; |
| 2375 | } |
| 2376 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2377 | vos_mem_set( ( tANI_U8* )pAssocReq, sizeof(tSirAssocReq), 0 ); |
| 2378 | vos_mem_set( ( tANI_U8* )ar, sizeof( tDot11fAssocRequest ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2379 | |
| 2380 | // delegate to the framesc-generated code, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2381 | status = dot11fUnpackAssocRequest( pMac, pFrame, nFrame, ar ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2382 | if ( DOT11F_FAILED( status ) ) |
| 2383 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2384 | limLog(pMac, LOGE, FL("Failed to parse an Association Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2385 | status, nFrame); |
| 2386 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2387 | vos_mem_free(ar); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2388 | return eSIR_FAILURE; |
| 2389 | } |
| 2390 | else if ( DOT11F_WARNED( status ) ) |
| 2391 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2392 | limLog( pMac, LOGW, FL("There were warnings while unpacking an Assoication Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2393 | status, nFrame ); |
| 2394 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 2395 | } |
| 2396 | |
| 2397 | // & "transliterate" from a 'tDot11fAssocRequest' to a 'tSirAssocReq'... |
| 2398 | |
| 2399 | // make sure this is seen as an assoc request |
| 2400 | pAssocReq->reassocRequest = 0; |
| 2401 | |
| 2402 | // Capabilities |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2403 | pAssocReq->capabilityInfo.ess = ar->Capabilities.ess; |
| 2404 | pAssocReq->capabilityInfo.ibss = ar->Capabilities.ibss; |
| 2405 | pAssocReq->capabilityInfo.cfPollable = ar->Capabilities.cfPollable; |
| 2406 | pAssocReq->capabilityInfo.cfPollReq = ar->Capabilities.cfPollReq; |
| 2407 | pAssocReq->capabilityInfo.privacy = ar->Capabilities.privacy; |
| 2408 | pAssocReq->capabilityInfo.shortPreamble = ar->Capabilities.shortPreamble; |
| 2409 | pAssocReq->capabilityInfo.pbcc = ar->Capabilities.pbcc; |
| 2410 | pAssocReq->capabilityInfo.channelAgility = ar->Capabilities.channelAgility; |
| 2411 | pAssocReq->capabilityInfo.spectrumMgt = ar->Capabilities.spectrumMgt; |
| 2412 | pAssocReq->capabilityInfo.qos = ar->Capabilities.qos; |
| 2413 | pAssocReq->capabilityInfo.shortSlotTime = ar->Capabilities.shortSlotTime; |
| 2414 | pAssocReq->capabilityInfo.apsd = ar->Capabilities.apsd; |
| 2415 | pAssocReq->capabilityInfo.rrm = ar->Capabilities.rrm; |
| 2416 | pAssocReq->capabilityInfo.dsssOfdm = ar->Capabilities.dsssOfdm; |
| 2417 | pAssocReq->capabilityInfo.delayedBA = ar->Capabilities.delayedBA; |
| 2418 | pAssocReq->capabilityInfo.immediateBA = ar->Capabilities.immediateBA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2419 | |
| 2420 | // Listen Interval |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2421 | pAssocReq->listenInterval = ar->ListenInterval.interval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2422 | |
| 2423 | // SSID |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2424 | if ( ar->SSID.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2425 | { |
| 2426 | pAssocReq->ssidPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2427 | ConvertSSID( pMac, &pAssocReq->ssId, &ar->SSID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2428 | } |
| 2429 | |
| 2430 | // Supported Rates |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2431 | if ( ar->SuppRates.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2432 | { |
| 2433 | pAssocReq->suppRatesPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2434 | ConvertSuppRates( pMac, &pAssocReq->supportedRates, &ar->SuppRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2435 | } |
| 2436 | |
| 2437 | // Extended Supported Rates |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2438 | if ( ar->ExtSuppRates.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2439 | { |
| 2440 | pAssocReq->extendedRatesPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2441 | ConvertExtSuppRates( pMac, &pAssocReq->extendedRates, &ar->ExtSuppRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2442 | } |
| 2443 | |
| 2444 | // QOS Capabilities: |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2445 | if ( ar->QOSCapsStation.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2446 | { |
| 2447 | pAssocReq->qosCapabilityPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2448 | ConvertQOSCapsStation( pMac, &pAssocReq->qosCapability, &ar->QOSCapsStation ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2449 | } |
| 2450 | |
| 2451 | // WPA |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2452 | if ( ar->WPAOpaque.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2453 | { |
| 2454 | pAssocReq->wpaPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2455 | ConvertWPAOpaque( pMac, &pAssocReq->wpa, &ar->WPAOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2456 | } |
| 2457 | |
| 2458 | // RSN |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2459 | if ( ar->RSNOpaque.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2460 | { |
| 2461 | pAssocReq->rsnPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2462 | ConvertRSNOpaque( pMac, &pAssocReq->rsn, &ar->RSNOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2463 | } |
| 2464 | |
| 2465 | // WSC IE |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2466 | if (ar->WscIEOpaque.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2467 | { |
| 2468 | pAssocReq->addIEPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2469 | ConvertWscOpaque(pMac, &pAssocReq->addIE, &ar->WscIEOpaque); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2470 | } |
| 2471 | |
| 2472 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2473 | if(ar->P2PIEOpaque.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2474 | { |
| 2475 | pAssocReq->addIEPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2476 | ConvertP2POpaque( pMac, &pAssocReq->addIE, &ar->P2PIEOpaque); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2477 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2478 | #ifdef WLAN_FEATURE_WFD |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2479 | if(ar->WFDIEOpaque.present) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2480 | { |
| 2481 | pAssocReq->addIEPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2482 | ConvertWFDOpaque( pMac, &pAssocReq->addIE, &ar->WFDIEOpaque); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2483 | } |
| 2484 | #endif |
| 2485 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2486 | // Power Capabilities |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2487 | if ( ar->PowerCaps.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2488 | { |
| 2489 | pAssocReq->powerCapabilityPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2490 | ConvertPowerCaps( pMac, &pAssocReq->powerCapability, &ar->PowerCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2491 | } |
| 2492 | |
| 2493 | // Supported Channels |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2494 | if ( ar->SuppChannels.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2495 | { |
| 2496 | pAssocReq->supportedChannelsPresent = 1; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2497 | ConvertSuppChannels( pMac, &pAssocReq->supportedChannels, &ar->SuppChannels ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2498 | } |
| 2499 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2500 | if ( ar->HTCaps.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2501 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2502 | vos_mem_copy( &pAssocReq->HTCaps, &ar->HTCaps, sizeof( tDot11fIEHTCaps ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2503 | } |
| 2504 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2505 | if ( ar->WMMInfoStation.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2506 | { |
| 2507 | pAssocReq->wmeInfoPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2508 | vos_mem_copy( &pAssocReq->WMMInfoStation, &ar->WMMInfoStation, |
| 2509 | sizeof( tDot11fIEWMMInfoStation ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2510 | |
| 2511 | } |
| 2512 | |
| 2513 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2514 | if ( ar->WMMCaps.present ) pAssocReq->wsmCapablePresent = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2515 | |
| 2516 | if ( ! pAssocReq->ssidPresent ) |
| 2517 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2518 | PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE."));) |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2519 | vos_mem_free(ar); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2520 | return eSIR_FAILURE; |
| 2521 | } |
| 2522 | |
| 2523 | if ( !pAssocReq->suppRatesPresent && !pAssocReq->extendedRatesPresent ) |
| 2524 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2525 | PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE."));) |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2526 | vos_mem_free(ar); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2527 | return eSIR_FAILURE; |
| 2528 | } |
| 2529 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2530 | #ifdef WLAN_FEATURE_11AC |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2531 | if ( ar->VHTCaps.present ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2532 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2533 | vos_mem_copy( &pAssocReq->VHTCaps, &ar->VHTCaps, sizeof( tDot11fIEVHTCaps ) ); |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2534 | limLog( pMac, LOGW, FL("Received Assoc Req with VHT Cap")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2535 | limLogVHTCap( pMac, &pAssocReq->VHTCaps); |
| 2536 | } |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2537 | if ( ar->OperatingMode.present ) |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 2538 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2539 | vos_mem_copy( &pAssocReq->operMode, &ar->OperatingMode, sizeof (tDot11fIEOperatingMode)); |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2540 | limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE")); |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 2541 | limLogOperatingMode( pMac, &pAssocReq->operMode); |
| 2542 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2543 | #endif |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2544 | vos_mem_free(ar); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2545 | return eSIR_SUCCESS; |
| 2546 | |
| 2547 | } // End sirConvertAssocReqFrame2Struct. |
| 2548 | |
| 2549 | tSirRetStatus |
| 2550 | sirConvertAssocRespFrame2Struct(tpAniSirGlobal pMac, |
| 2551 | tANI_U8 *pFrame, |
| 2552 | tANI_U32 nFrame, |
| 2553 | tpSirAssocRsp pAssocRsp) |
| 2554 | { |
| 2555 | static tDot11fAssocResponse ar; |
| 2556 | tANI_U32 status; |
| 2557 | tANI_U8 cnt =0; |
| 2558 | |
| 2559 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2560 | vos_mem_set( ( tANI_U8* )pAssocRsp, sizeof(tSirAssocRsp), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2561 | |
| 2562 | // delegate to the framesc-generated code, |
| 2563 | status = dot11fUnpackAssocResponse( pMac, pFrame, nFrame, &ar); |
| 2564 | if ( DOT11F_FAILED( status ) ) |
| 2565 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2566 | limLog(pMac, LOGE, FL("Failed to parse an Association Response (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2567 | status, nFrame); |
| 2568 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 2569 | return eSIR_FAILURE; |
| 2570 | } |
| 2571 | else if ( DOT11F_WARNED( status ) ) |
| 2572 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2573 | limLog( pMac, LOGW, FL("There were warnings while unpacking an Association Response (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2574 | status, nFrame ); |
| 2575 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 2576 | } |
| 2577 | |
| 2578 | // & "transliterate" from a 'tDot11fAssocResponse' a 'tSirAssocRsp'... |
| 2579 | |
| 2580 | // Capabilities |
| 2581 | pAssocRsp->capabilityInfo.ess = ar.Capabilities.ess; |
| 2582 | pAssocRsp->capabilityInfo.ibss = ar.Capabilities.ibss; |
| 2583 | pAssocRsp->capabilityInfo.cfPollable = ar.Capabilities.cfPollable; |
| 2584 | pAssocRsp->capabilityInfo.cfPollReq = ar.Capabilities.cfPollReq; |
| 2585 | pAssocRsp->capabilityInfo.privacy = ar.Capabilities.privacy; |
| 2586 | pAssocRsp->capabilityInfo.shortPreamble = ar.Capabilities.shortPreamble; |
| 2587 | pAssocRsp->capabilityInfo.pbcc = ar.Capabilities.pbcc; |
| 2588 | pAssocRsp->capabilityInfo.channelAgility = ar.Capabilities.channelAgility; |
| 2589 | pAssocRsp->capabilityInfo.spectrumMgt = ar.Capabilities.spectrumMgt; |
| 2590 | pAssocRsp->capabilityInfo.qos = ar.Capabilities.qos; |
| 2591 | pAssocRsp->capabilityInfo.shortSlotTime = ar.Capabilities.shortSlotTime; |
| 2592 | pAssocRsp->capabilityInfo.apsd = ar.Capabilities.apsd; |
| 2593 | pAssocRsp->capabilityInfo.rrm = ar.Capabilities.rrm; |
| 2594 | pAssocRsp->capabilityInfo.dsssOfdm = ar.Capabilities.dsssOfdm; |
| 2595 | pAssocRsp->capabilityInfo.delayedBA = ar.Capabilities.delayedBA; |
| 2596 | pAssocRsp->capabilityInfo.immediateBA = ar.Capabilities.immediateBA; |
| 2597 | |
| 2598 | pAssocRsp->statusCode = ar.Status.status; |
| 2599 | pAssocRsp->aid = ar.AID.associd; |
| 2600 | |
| 2601 | if ( ! ar.SuppRates.present ) |
| 2602 | { |
| 2603 | pAssocRsp->suppRatesPresent = 0; |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2604 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2605 | } |
| 2606 | else |
| 2607 | { |
| 2608 | pAssocRsp->suppRatesPresent = 1; |
| 2609 | ConvertSuppRates( pMac, &pAssocRsp->supportedRates, &ar.SuppRates ); |
| 2610 | } |
| 2611 | |
| 2612 | if ( ar.ExtSuppRates.present ) |
| 2613 | { |
| 2614 | pAssocRsp->extendedRatesPresent = 1; |
| 2615 | ConvertExtSuppRates( pMac, &pAssocRsp->extendedRates, &ar.ExtSuppRates ); |
| 2616 | } |
| 2617 | |
| 2618 | if ( ar.EDCAParamSet.present ) |
| 2619 | { |
| 2620 | pAssocRsp->edcaPresent = 1; |
| 2621 | ConvertEDCAParam( pMac, &pAssocRsp->edca, &ar.EDCAParamSet ); |
| 2622 | } |
Atul Mittal | bceb4a1 | 2014-11-27 18:50:19 +0530 | [diff] [blame] | 2623 | if (ar.ExtCap.present) |
| 2624 | { |
| 2625 | vos_mem_copy(&pAssocRsp->ExtCap, &ar.ExtCap, sizeof(tDot11fIEExtCap)); |
| 2626 | limLog(pMac, LOG1, |
| 2627 | FL("ExtCap is present, TDLSChanSwitProhibited: %d"), |
| 2628 | ar.ExtCap.TDLSChanSwitProhibited); |
| 2629 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2630 | if ( ar.WMMParams.present ) |
| 2631 | { |
| 2632 | pAssocRsp->wmeEdcaPresent = 1; |
| 2633 | ConvertWMMParams( pMac, &pAssocRsp->edca, &ar.WMMParams); |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 2634 | limLog(pMac, LOG1, FL("WMM Parameter Element present in Association Response Frame!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2635 | __printWMMParams(pMac, &ar.WMMParams); |
| 2636 | } |
| 2637 | |
| 2638 | if ( ar.HTCaps.present ) |
| 2639 | { |
Krishna Kumaar Natarajan | 025a860 | 2015-08-04 16:31:36 +0530 | [diff] [blame] | 2640 | limLog(pMac, LOG1, FL("Received Assoc Response with HT Cap")); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2641 | vos_mem_copy( &pAssocRsp->HTCaps, &ar.HTCaps, sizeof( tDot11fIEHTCaps ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2642 | } |
| 2643 | |
| 2644 | if ( ar.HTInfo.present ) |
Krishna Kumaar Natarajan | 025a860 | 2015-08-04 16:31:36 +0530 | [diff] [blame] | 2645 | { limLog(pMac, LOG1, FL("Received Assoc Response with HT Info")); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2646 | vos_mem_copy( &pAssocRsp->HTInfo, &ar.HTInfo, sizeof( tDot11fIEHTInfo ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2647 | } |
| 2648 | |
| 2649 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2650 | if (ar.MobilityDomain.present) |
| 2651 | { |
| 2652 | // MobilityDomain |
| 2653 | pAssocRsp->mdiePresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2654 | vos_mem_copy( (tANI_U8 *)&(pAssocRsp->mdie[0]), (tANI_U8 *)&(ar.MobilityDomain.MDID), |
| 2655 | sizeof(tANI_U16) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2656 | pAssocRsp->mdie[2] = ((ar.MobilityDomain.overDSCap << 0) | (ar.MobilityDomain.resourceReqCap << 1)); |
| 2657 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 2658 | limLog(pMac, LOG1, FL("new mdie=%02x%02x%02x"), (unsigned int)pAssocRsp->mdie[0], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2659 | (unsigned int)pAssocRsp->mdie[1], (unsigned int)pAssocRsp->mdie[2]); |
| 2660 | #endif |
| 2661 | } |
| 2662 | |
| 2663 | if ( ar.FTInfo.present ) |
| 2664 | { |
| 2665 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 2666 | limLog(pMac, LOG1, FL("FT Info present %d %d %d"), ar.FTInfo.R0KH_ID.num_PMK_R0_ID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2667 | ar.FTInfo.R0KH_ID.present, |
| 2668 | ar.FTInfo.R1KH_ID.present); |
| 2669 | #endif |
| 2670 | pAssocRsp->ftinfoPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2671 | vos_mem_copy( &pAssocRsp->FTInfo, &ar.FTInfo, sizeof(tDot11fIEFTInfo) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2672 | } |
| 2673 | #endif |
| 2674 | |
| 2675 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2676 | if (ar.num_RICDataDesc) { |
| 2677 | for (cnt=0; cnt < ar.num_RICDataDesc; cnt++) { |
| 2678 | if (ar.RICDataDesc[cnt].present) { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2679 | vos_mem_copy( &pAssocRsp->RICData[cnt], &ar.RICDataDesc[cnt], |
| 2680 | sizeof(tDot11fIERICDataDesc)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2681 | } |
| 2682 | } |
| 2683 | pAssocRsp->num_RICData = ar.num_RICDataDesc; |
| 2684 | pAssocRsp->ricPresent = TRUE; |
| 2685 | } |
| 2686 | #endif |
| 2687 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2688 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2689 | if (ar.num_WMMTSPEC) { |
| 2690 | pAssocRsp->num_tspecs = ar.num_WMMTSPEC; |
| 2691 | for (cnt=0; cnt < ar.num_WMMTSPEC; cnt++) { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2692 | vos_mem_copy( &pAssocRsp->TSPECInfo[cnt], &ar.WMMTSPEC[cnt], |
| 2693 | (sizeof(tDot11fIEWMMTSPEC)*ar.num_WMMTSPEC)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2694 | } |
| 2695 | pAssocRsp->tspecPresent = TRUE; |
| 2696 | } |
| 2697 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2698 | if(ar.ESETrafStrmMet.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2699 | { |
| 2700 | pAssocRsp->tsmPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2701 | vos_mem_copy(&pAssocRsp->tsmIE.tsid, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2702 | &ar.ESETrafStrmMet.tsid,sizeof(tSirMacESETSMIE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2703 | } |
| 2704 | #endif |
| 2705 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2706 | #ifdef WLAN_FEATURE_11AC |
| 2707 | if ( ar.VHTCaps.present ) |
| 2708 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2709 | vos_mem_copy( &pAssocRsp->VHTCaps, &ar.VHTCaps, sizeof( tDot11fIEVHTCaps ) ); |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 2710 | limLog( pMac, LOG1, FL("Received Assoc Response with VHT Cap")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2711 | limLogVHTCap(pMac, &pAssocRsp->VHTCaps); |
| 2712 | } |
| 2713 | if ( ar.VHTOperation.present ) |
| 2714 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2715 | vos_mem_copy( &pAssocRsp->VHTOperation, &ar.VHTOperation, sizeof( tDot11fIEVHTOperation) ); |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 2716 | limLog( pMac, LOG1, FL("Received Assoc Response with VHT Operation")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2717 | limLogVHTOperation(pMac, &pAssocRsp->VHTOperation); |
| 2718 | } |
| 2719 | #endif |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2720 | if(ar.OBSSScanParameters.present) |
| 2721 | { |
| 2722 | vos_mem_copy( &pAssocRsp->OBSSScanParameters, &ar.OBSSScanParameters, |
| 2723 | sizeof( tDot11fIEOBSSScanParameters)); |
| 2724 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 2725 | if ( ar.QosMapSet.present ) |
| 2726 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 2727 | pAssocRsp->QosMapSet.present = 1; |
| 2728 | ConvertQosMapsetFrame( pMac, &pAssocRsp->QosMapSet, &ar.QosMapSet); |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 2729 | limLog( pMac, LOG1, FL("Received Assoc Response with Qos Map Set")); |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 2730 | limLogQosMapSet(pMac, &pAssocRsp->QosMapSet); |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 2731 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2732 | return eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2733 | } // End sirConvertAssocRespFrame2Struct. |
| 2734 | |
| 2735 | tSirRetStatus |
| 2736 | sirConvertReassocReqFrame2Struct(tpAniSirGlobal pMac, |
| 2737 | tANI_U8 *pFrame, |
| 2738 | tANI_U32 nFrame, |
| 2739 | tpSirAssocReq pAssocReq) |
| 2740 | { |
| 2741 | static tDot11fReAssocRequest ar; |
| 2742 | tANI_U32 status; |
| 2743 | |
| 2744 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2745 | vos_mem_set( ( tANI_U8* )pAssocReq, sizeof(tSirAssocReq), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2746 | |
| 2747 | // delegate to the framesc-generated code, |
| 2748 | status = dot11fUnpackReAssocRequest( pMac, pFrame, nFrame, &ar ); |
| 2749 | if ( DOT11F_FAILED( status ) ) |
| 2750 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2751 | limLog(pMac, LOGE, FL("Failed to parse a Re-association Request (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2752 | status, nFrame); |
| 2753 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 2754 | return eSIR_FAILURE; |
| 2755 | } |
| 2756 | else if ( DOT11F_WARNED( status ) ) |
| 2757 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2758 | limLog( pMac, LOGW, FL("There were warnings while unpacking a Re-association Request (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2759 | status, nFrame ); |
| 2760 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 2761 | } |
| 2762 | |
| 2763 | // & "transliterate" from a 'tDot11fReAssocRequest' to a 'tSirAssocReq'... |
| 2764 | |
| 2765 | // make sure this is seen as a re-assoc request |
| 2766 | pAssocReq->reassocRequest = 1; |
| 2767 | |
| 2768 | // Capabilities |
| 2769 | pAssocReq->capabilityInfo.ess = ar.Capabilities.ess; |
| 2770 | pAssocReq->capabilityInfo.ibss = ar.Capabilities.ibss; |
| 2771 | pAssocReq->capabilityInfo.cfPollable = ar.Capabilities.cfPollable; |
| 2772 | pAssocReq->capabilityInfo.cfPollReq = ar.Capabilities.cfPollReq; |
| 2773 | pAssocReq->capabilityInfo.privacy = ar.Capabilities.privacy; |
| 2774 | pAssocReq->capabilityInfo.shortPreamble = ar.Capabilities.shortPreamble; |
| 2775 | pAssocReq->capabilityInfo.pbcc = ar.Capabilities.pbcc; |
| 2776 | pAssocReq->capabilityInfo.channelAgility = ar.Capabilities.channelAgility; |
| 2777 | pAssocReq->capabilityInfo.spectrumMgt = ar.Capabilities.spectrumMgt; |
| 2778 | pAssocReq->capabilityInfo.qos = ar.Capabilities.qos; |
| 2779 | pAssocReq->capabilityInfo.shortSlotTime = ar.Capabilities.shortSlotTime; |
| 2780 | pAssocReq->capabilityInfo.apsd = ar.Capabilities.apsd; |
| 2781 | pAssocReq->capabilityInfo.rrm = ar.Capabilities.rrm; |
| 2782 | pAssocReq->capabilityInfo.dsssOfdm = ar.Capabilities.dsssOfdm; |
| 2783 | pAssocReq->capabilityInfo.delayedBA = ar.Capabilities.delayedBA; |
| 2784 | pAssocReq->capabilityInfo.immediateBA = ar.Capabilities.immediateBA; |
| 2785 | |
| 2786 | // Listen Interval |
| 2787 | pAssocReq->listenInterval = ar.ListenInterval.interval; |
| 2788 | |
| 2789 | // SSID |
| 2790 | if ( ar.SSID.present ) |
| 2791 | { |
| 2792 | pAssocReq->ssidPresent = 1; |
| 2793 | ConvertSSID( pMac, &pAssocReq->ssId, &ar.SSID ); |
| 2794 | } |
| 2795 | |
| 2796 | // Supported Rates |
| 2797 | if ( ar.SuppRates.present ) |
| 2798 | { |
| 2799 | pAssocReq->suppRatesPresent = 1; |
| 2800 | ConvertSuppRates( pMac, &pAssocReq->supportedRates, &ar.SuppRates ); |
| 2801 | } |
| 2802 | |
| 2803 | // Extended Supported Rates |
| 2804 | if ( ar.ExtSuppRates.present ) |
| 2805 | { |
| 2806 | pAssocReq->extendedRatesPresent = 1; |
| 2807 | ConvertExtSuppRates( pMac, &pAssocReq->extendedRates, |
| 2808 | &ar.ExtSuppRates ); |
| 2809 | } |
| 2810 | |
| 2811 | // QOS Capabilities: |
| 2812 | if ( ar.QOSCapsStation.present ) |
| 2813 | { |
| 2814 | pAssocReq->qosCapabilityPresent = 1; |
| 2815 | ConvertQOSCapsStation( pMac, &pAssocReq->qosCapability, &ar.QOSCapsStation ); |
| 2816 | } |
| 2817 | |
| 2818 | // WPA |
| 2819 | if ( ar.WPAOpaque.present ) |
| 2820 | { |
| 2821 | pAssocReq->wpaPresent = 1; |
| 2822 | ConvertWPAOpaque( pMac, &pAssocReq->wpa, &ar.WPAOpaque ); |
| 2823 | } |
| 2824 | |
| 2825 | // RSN |
| 2826 | if ( ar.RSNOpaque.present ) |
| 2827 | { |
| 2828 | pAssocReq->rsnPresent = 1; |
| 2829 | ConvertRSNOpaque( pMac, &pAssocReq->rsn, &ar.RSNOpaque ); |
| 2830 | } |
| 2831 | |
| 2832 | |
| 2833 | // Power Capabilities |
| 2834 | if ( ar.PowerCaps.present ) |
| 2835 | { |
| 2836 | pAssocReq->powerCapabilityPresent = 1; |
| 2837 | ConvertPowerCaps( pMac, &pAssocReq->powerCapability, &ar.PowerCaps ); |
| 2838 | } |
| 2839 | |
| 2840 | // Supported Channels |
| 2841 | if ( ar.SuppChannels.present ) |
| 2842 | { |
| 2843 | pAssocReq->supportedChannelsPresent = 1; |
| 2844 | ConvertSuppChannels( pMac, &pAssocReq->supportedChannels, &ar.SuppChannels ); |
| 2845 | } |
| 2846 | |
| 2847 | if ( ar.HTCaps.present ) |
| 2848 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2849 | vos_mem_copy( &pAssocReq->HTCaps, &ar.HTCaps, sizeof( tDot11fIEHTCaps ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2850 | } |
| 2851 | |
| 2852 | if ( ar.WMMInfoStation.present ) |
| 2853 | { |
| 2854 | pAssocReq->wmeInfoPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2855 | vos_mem_copy( &pAssocReq->WMMInfoStation, &ar.WMMInfoStation, |
| 2856 | sizeof( tDot11fIEWMMInfoStation ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2857 | |
| 2858 | } |
| 2859 | |
| 2860 | if ( ar.WMMCaps.present ) pAssocReq->wsmCapablePresent = 1; |
| 2861 | |
| 2862 | if ( ! pAssocReq->ssidPresent ) |
| 2863 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2864 | PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2865 | return eSIR_FAILURE; |
| 2866 | } |
| 2867 | |
| 2868 | if ( ! pAssocReq->suppRatesPresent && ! pAssocReq->extendedRatesPresent ) |
| 2869 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2870 | PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2871 | return eSIR_FAILURE; |
| 2872 | } |
| 2873 | |
| 2874 | // Why no call to 'updateAssocReqFromPropCapability' here, like |
| 2875 | // there is in 'sirConvertAssocReqFrame2Struct'? |
| 2876 | |
| 2877 | // WSC IE |
| 2878 | if (ar.WscIEOpaque.present) |
| 2879 | { |
| 2880 | pAssocReq->addIEPresent = 1; |
| 2881 | ConvertWscOpaque(pMac, &pAssocReq->addIE, &ar.WscIEOpaque); |
| 2882 | } |
| 2883 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2884 | if(ar.P2PIEOpaque.present) |
| 2885 | { |
| 2886 | pAssocReq->addIEPresent = 1; |
| 2887 | ConvertP2POpaque( pMac, &pAssocReq->addIE, &ar.P2PIEOpaque); |
| 2888 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2889 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2890 | #ifdef WLAN_FEATURE_WFD |
| 2891 | if(ar.WFDIEOpaque.present) |
| 2892 | { |
| 2893 | pAssocReq->addIEPresent = 1; |
| 2894 | ConvertWFDOpaque( pMac, &pAssocReq->addIE, &ar.WFDIEOpaque); |
| 2895 | } |
| 2896 | #endif |
| 2897 | |
| 2898 | #ifdef WLAN_FEATURE_11AC |
| 2899 | if ( ar.VHTCaps.present ) |
| 2900 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2901 | vos_mem_copy( &pAssocReq->VHTCaps, &ar.VHTCaps, sizeof( tDot11fIEVHTCaps ) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2902 | } |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 2903 | if ( ar.OperatingMode.present ) |
| 2904 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 2905 | vos_mem_copy( &pAssocReq->operMode, &ar.OperatingMode, sizeof( tDot11fIEOperatingMode ) ); |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2906 | limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE")); |
Mohit Khanna | 7d5aeb2 | 2012-09-11 16:21:57 -0700 | [diff] [blame] | 2907 | limLogOperatingMode( pMac, &pAssocReq->operMode); |
| 2908 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2909 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2910 | return eSIR_SUCCESS; |
| 2911 | |
| 2912 | } // End sirConvertReassocReqFrame2Struct. |
| 2913 | |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2914 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2915 | #if defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2916 | tSirRetStatus |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2917 | sirFillBeaconMandatoryIEforEseBcnReport(tpAniSirGlobal pMac, |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2918 | tANI_U8 *pPayload, |
| 2919 | const tANI_U32 nPayload, |
| 2920 | tANI_U8 **outIeBuf, |
| 2921 | tANI_U32 *pOutIeLen) |
| 2922 | { |
| 2923 | tDot11fBeaconIEs *pBies = NULL; |
| 2924 | tANI_U32 status = eHAL_STATUS_SUCCESS; |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 2925 | tSirRetStatus retStatus = eSIR_SUCCESS; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2926 | tSirEseBcnReportMandatoryIe eseBcnReportMandatoryIe; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2927 | |
| 2928 | /* To store how many bytes are required to be allocated |
| 2929 | for Bcn report mandatory Ies */ |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 2930 | tANI_U16 numBytes = 0, freeBytes = 0; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2931 | tANI_U8 *pos = NULL; |
| 2932 | |
| 2933 | // Zero-init our [out] parameter, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2934 | vos_mem_set( (tANI_U8*)&eseBcnReportMandatoryIe, sizeof(eseBcnReportMandatoryIe), 0 ); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2935 | pBies = vos_mem_malloc(sizeof(tDot11fBeaconIEs)); |
| 2936 | if ( NULL == pBies ) |
| 2937 | status = eHAL_STATUS_FAILURE; |
| 2938 | else |
| 2939 | status = eHAL_STATUS_SUCCESS; |
| 2940 | if (!HAL_STATUS_SUCCESS(status)) |
| 2941 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2942 | limLog(pMac, LOGE, FL("Failed to allocate memory") ); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2943 | return eSIR_FAILURE; |
| 2944 | } |
| 2945 | // delegate to the framesc-generated code, |
| 2946 | status = dot11fUnpackBeaconIEs( pMac, pPayload, nPayload, pBies ); |
| 2947 | |
| 2948 | if ( DOT11F_FAILED( status ) ) |
| 2949 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2950 | limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes)"), |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2951 | status, nPayload); |
| 2952 | vos_mem_free(pBies); |
| 2953 | return eSIR_FAILURE; |
| 2954 | } |
| 2955 | else if ( DOT11F_WARNED( status ) ) |
| 2956 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2957 | limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes)"), |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2958 | status, nPayload ); |
| 2959 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) |
| 2960 | } |
| 2961 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2962 | // & "transliterate" from a 'tDot11fBeaconIEs' to a 'eseBcnReportMandatoryIe'... |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2963 | if ( !pBies->SSID.present ) |
| 2964 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2965 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2966 | } |
| 2967 | else |
| 2968 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2969 | eseBcnReportMandatoryIe.ssidPresent = 1; |
| 2970 | ConvertSSID( pMac, &eseBcnReportMandatoryIe.ssId, &pBies->SSID ); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2971 | /* 1 for EID, 1 for length and length bytes */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2972 | numBytes += 1 + 1 + eseBcnReportMandatoryIe.ssId.length; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2973 | } |
| 2974 | |
| 2975 | if ( !pBies->SuppRates.present ) |
| 2976 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2977 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2978 | } |
| 2979 | else |
| 2980 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2981 | eseBcnReportMandatoryIe.suppRatesPresent = 1; |
| 2982 | ConvertSuppRates( pMac, &eseBcnReportMandatoryIe.supportedRates, &pBies->SuppRates ); |
| 2983 | numBytes += 1 + 1 + eseBcnReportMandatoryIe.supportedRates.numRates; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2984 | } |
| 2985 | |
| 2986 | if ( pBies->FHParamSet.present) |
| 2987 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2988 | eseBcnReportMandatoryIe.fhParamPresent = 1; |
| 2989 | ConvertFHParams( pMac, &eseBcnReportMandatoryIe.fhParamSet, &pBies->FHParamSet ); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2990 | numBytes += 1 + 1 + SIR_MAC_FH_PARAM_SET_EID_MAX; |
| 2991 | } |
| 2992 | |
| 2993 | if ( pBies->DSParams.present ) |
| 2994 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2995 | eseBcnReportMandatoryIe.dsParamsPresent = 1; |
| 2996 | eseBcnReportMandatoryIe.dsParamSet.channelNumber = pBies->DSParams.curr_channel; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 2997 | numBytes += 1 + 1 + SIR_MAC_DS_PARAM_SET_EID_MAX; |
| 2998 | } |
| 2999 | |
| 3000 | if ( pBies->CFParams.present ) |
| 3001 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3002 | eseBcnReportMandatoryIe.cfPresent = 1; |
| 3003 | ConvertCFParams( pMac, &eseBcnReportMandatoryIe.cfParamSet, &pBies->CFParams ); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3004 | numBytes += 1 + 1 + SIR_MAC_CF_PARAM_SET_EID_MAX; |
| 3005 | } |
| 3006 | |
| 3007 | if ( pBies->IBSSParams.present ) |
| 3008 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3009 | eseBcnReportMandatoryIe.ibssParamPresent = 1; |
| 3010 | eseBcnReportMandatoryIe.ibssParamSet.atim = pBies->IBSSParams.atim; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3011 | numBytes += 1 + 1 + SIR_MAC_IBSS_PARAM_SET_EID_MAX; |
| 3012 | } |
| 3013 | |
| 3014 | if ( pBies->TIM.present ) |
| 3015 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3016 | eseBcnReportMandatoryIe.timPresent = 1; |
| 3017 | eseBcnReportMandatoryIe.tim.dtimCount = pBies->TIM.dtim_count; |
| 3018 | eseBcnReportMandatoryIe.tim.dtimPeriod = pBies->TIM.dtim_period; |
| 3019 | eseBcnReportMandatoryIe.tim.bitmapControl = pBies->TIM.bmpctl; |
| 3020 | /* As per the ESE spec, May truncate and report first 4 octets only */ |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3021 | numBytes += 1 + 1 + SIR_MAC_TIM_EID_MIN; |
| 3022 | } |
| 3023 | |
| 3024 | if ( pBies->RRMEnabledCap.present ) |
| 3025 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3026 | eseBcnReportMandatoryIe.rrmPresent = 1; |
| 3027 | vos_mem_copy( &eseBcnReportMandatoryIe.rmEnabledCapabilities, &pBies->RRMEnabledCap, sizeof( tDot11fIERRMEnabledCap ) ); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3028 | numBytes += 1 + 1 + SIR_MAC_RM_ENABLED_CAPABILITY_EID_MAX; |
| 3029 | } |
| 3030 | |
| 3031 | *outIeBuf = vos_mem_malloc(numBytes); |
| 3032 | if (NULL == *outIeBuf) |
| 3033 | { |
| 3034 | limLog(pMac, LOGP, FL("Memory Allocation failure")); |
| 3035 | vos_mem_free(pBies); |
| 3036 | return eSIR_FAILURE; |
| 3037 | } |
| 3038 | pos = *outIeBuf; |
| 3039 | *pOutIeLen = numBytes; |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3040 | freeBytes = numBytes; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3041 | |
| 3042 | /* Start filling the output Ie with Mandatory IE information */ |
| 3043 | /* Fill SSID IE */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3044 | if (eseBcnReportMandatoryIe.ssidPresent) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3045 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3046 | if (freeBytes < (1 + 1 + eseBcnReportMandatoryIe.ssId.length)) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3047 | { |
| 3048 | limLog(pMac, LOGP, FL("Insufficient memory to copy SSID")); |
| 3049 | retStatus = eSIR_FAILURE; |
| 3050 | goto err_bcnrep; |
| 3051 | } |
| 3052 | *pos = SIR_MAC_SSID_EID; |
| 3053 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3054 | *pos = eseBcnReportMandatoryIe.ssId.length; |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3055 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3056 | vos_mem_copy(pos, (tANI_U8*)eseBcnReportMandatoryIe.ssId.ssId, |
| 3057 | eseBcnReportMandatoryIe.ssId.length); |
| 3058 | pos += eseBcnReportMandatoryIe.ssId.length; |
| 3059 | freeBytes -= (1 + 1 + eseBcnReportMandatoryIe.ssId.length); |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3060 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3061 | |
| 3062 | /* Fill Supported Rates IE */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3063 | if (eseBcnReportMandatoryIe.suppRatesPresent) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3064 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3065 | if (freeBytes < (1 + 1 + eseBcnReportMandatoryIe.supportedRates.numRates)) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3066 | { |
| 3067 | limLog(pMac, LOGP, FL("Insufficient memory to copy Rates IE")); |
| 3068 | retStatus = eSIR_FAILURE; |
| 3069 | goto err_bcnrep; |
| 3070 | } |
| 3071 | *pos = SIR_MAC_RATESET_EID; |
| 3072 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3073 | *pos = eseBcnReportMandatoryIe.supportedRates.numRates; |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3074 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3075 | vos_mem_copy(pos, (tANI_U8*)eseBcnReportMandatoryIe.supportedRates.rate, |
| 3076 | eseBcnReportMandatoryIe.supportedRates.numRates); |
| 3077 | pos += eseBcnReportMandatoryIe.supportedRates.numRates; |
| 3078 | freeBytes -= (1 + 1 + eseBcnReportMandatoryIe.supportedRates.numRates); |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3079 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3080 | |
| 3081 | /* Fill FH Parameter set IE */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3082 | if (eseBcnReportMandatoryIe.fhParamPresent) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3083 | { |
| 3084 | if (freeBytes < (1 + 1 + SIR_MAC_FH_PARAM_SET_EID_MAX)) |
| 3085 | { |
| 3086 | limLog(pMac, LOGP, FL("Insufficient memory to copy FHIE")); |
| 3087 | retStatus = eSIR_FAILURE; |
| 3088 | goto err_bcnrep; |
| 3089 | } |
| 3090 | *pos = SIR_MAC_FH_PARAM_SET_EID; |
| 3091 | pos++; |
| 3092 | *pos = SIR_MAC_FH_PARAM_SET_EID_MAX; |
| 3093 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3094 | vos_mem_copy(pos, (tANI_U8*)&eseBcnReportMandatoryIe.fhParamSet, |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3095 | SIR_MAC_FH_PARAM_SET_EID_MAX); |
| 3096 | pos += SIR_MAC_FH_PARAM_SET_EID_MAX; |
| 3097 | freeBytes -= (1 + 1 + SIR_MAC_FH_PARAM_SET_EID_MAX); |
| 3098 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3099 | |
| 3100 | /* Fill DS Parameter set IE */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3101 | if (eseBcnReportMandatoryIe.dsParamsPresent) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3102 | { |
| 3103 | if (freeBytes < (1 + 1 + SIR_MAC_DS_PARAM_SET_EID_MAX)) |
| 3104 | { |
| 3105 | limLog(pMac, LOGP, FL("Insufficient memory to copy DS IE")); |
| 3106 | retStatus = eSIR_FAILURE; |
| 3107 | goto err_bcnrep; |
| 3108 | } |
| 3109 | *pos = SIR_MAC_DS_PARAM_SET_EID; |
| 3110 | pos++; |
| 3111 | *pos = SIR_MAC_DS_PARAM_SET_EID_MAX; |
| 3112 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3113 | *pos = eseBcnReportMandatoryIe.dsParamSet.channelNumber; |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3114 | pos += SIR_MAC_DS_PARAM_SET_EID_MAX; |
| 3115 | freeBytes -= (1 + 1 + SIR_MAC_DS_PARAM_SET_EID_MAX); |
| 3116 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3117 | |
| 3118 | /* Fill CF Parameter set */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3119 | if (eseBcnReportMandatoryIe.cfPresent) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3120 | { |
| 3121 | if (freeBytes < (1 + 1 + SIR_MAC_CF_PARAM_SET_EID_MAX)) |
| 3122 | { |
| 3123 | limLog(pMac, LOGP, FL("Insufficient memory to copy CF IE")); |
| 3124 | retStatus = eSIR_FAILURE; |
| 3125 | goto err_bcnrep; |
| 3126 | } |
| 3127 | *pos = SIR_MAC_CF_PARAM_SET_EID; |
| 3128 | pos++; |
| 3129 | *pos = SIR_MAC_CF_PARAM_SET_EID_MAX; |
| 3130 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3131 | vos_mem_copy(pos, (tANI_U8*)&eseBcnReportMandatoryIe.cfParamSet, |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3132 | SIR_MAC_CF_PARAM_SET_EID_MAX); |
| 3133 | pos += SIR_MAC_CF_PARAM_SET_EID_MAX; |
| 3134 | freeBytes -= (1 + 1 + SIR_MAC_CF_PARAM_SET_EID_MAX); |
| 3135 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3136 | |
| 3137 | /* Fill IBSS Parameter set IE */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3138 | if (eseBcnReportMandatoryIe.ibssParamPresent) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3139 | { |
| 3140 | if (freeBytes < (1 + 1 + SIR_MAC_IBSS_PARAM_SET_EID_MAX)) |
| 3141 | { |
| 3142 | limLog(pMac, LOGP, FL("Insufficient memory to copy IBSS IE")); |
| 3143 | retStatus = eSIR_FAILURE; |
| 3144 | goto err_bcnrep; |
| 3145 | } |
| 3146 | *pos = SIR_MAC_IBSS_PARAM_SET_EID; |
| 3147 | pos++; |
| 3148 | *pos = SIR_MAC_IBSS_PARAM_SET_EID_MAX; |
| 3149 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3150 | vos_mem_copy(pos, (tANI_U8*)&eseBcnReportMandatoryIe.ibssParamSet.atim, |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3151 | SIR_MAC_IBSS_PARAM_SET_EID_MAX); |
| 3152 | pos += SIR_MAC_IBSS_PARAM_SET_EID_MAX; |
| 3153 | freeBytes -= (1 + 1 + SIR_MAC_IBSS_PARAM_SET_EID_MAX); |
| 3154 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3155 | |
| 3156 | /* Fill TIM IE */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3157 | if (eseBcnReportMandatoryIe.timPresent) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3158 | { |
| 3159 | if (freeBytes < (1 + 1 + SIR_MAC_TIM_EID_MIN)) |
| 3160 | { |
| 3161 | limLog(pMac, LOGP, FL("Insufficient memory to copy TIM IE")); |
| 3162 | retStatus = eSIR_FAILURE; |
| 3163 | goto err_bcnrep; |
| 3164 | } |
| 3165 | *pos = SIR_MAC_TIM_EID; |
| 3166 | pos++; |
| 3167 | *pos = SIR_MAC_TIM_EID_MIN; |
| 3168 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3169 | vos_mem_copy(pos, (tANI_U8*)&eseBcnReportMandatoryIe.tim, |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3170 | SIR_MAC_TIM_EID_MIN); |
| 3171 | pos += SIR_MAC_TIM_EID_MIN; |
| 3172 | freeBytes -= (1 + 1 + SIR_MAC_TIM_EID_MIN); |
| 3173 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3174 | |
| 3175 | /* Fill RM Capability IE */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3176 | if (eseBcnReportMandatoryIe.rrmPresent) |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3177 | { |
| 3178 | if (freeBytes < (1 + 1 + SIR_MAC_RM_ENABLED_CAPABILITY_EID_MAX)) |
| 3179 | { |
| 3180 | limLog(pMac, LOGP, FL("Insufficient memory to copy RRM IE")); |
| 3181 | retStatus = eSIR_FAILURE; |
| 3182 | goto err_bcnrep; |
| 3183 | } |
| 3184 | *pos = SIR_MAC_RM_ENABLED_CAPABILITY_EID; |
| 3185 | pos++; |
| 3186 | *pos = SIR_MAC_RM_ENABLED_CAPABILITY_EID_MAX; |
| 3187 | pos++; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3188 | vos_mem_copy(pos, (tANI_U8*)&eseBcnReportMandatoryIe.rmEnabledCapabilities, |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3189 | SIR_MAC_RM_ENABLED_CAPABILITY_EID_MAX); |
| 3190 | freeBytes -= (1 + 1 + SIR_MAC_RM_ENABLED_CAPABILITY_EID_MAX); |
| 3191 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3192 | |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3193 | if (freeBytes != 0) |
| 3194 | { |
| 3195 | limLog(pMac, LOGP, FL("Mismatch in allocation and copying of IE in Bcn Rep")); |
| 3196 | retStatus = eSIR_FAILURE; |
| 3197 | } |
| 3198 | |
| 3199 | err_bcnrep: |
| 3200 | /* The message counter would not be incremented in case of |
| 3201 | * returning failure and hence next time, this function gets |
| 3202 | * called, it would be using the same msg ctr for a different |
| 3203 | * BSS.So, it is good to clear the memory allocated for a BSS |
| 3204 | * that is returning failure.On success, the caller would take |
| 3205 | * care of freeing up the memory*/ |
| 3206 | if (retStatus == eSIR_FAILURE) |
| 3207 | { |
| 3208 | vos_mem_free(*outIeBuf); |
| 3209 | *outIeBuf = NULL; |
| 3210 | } |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3211 | vos_mem_free(pBies); |
Varun Reddy Yeturu | cf02bc2 | 2013-12-06 18:18:50 -0800 | [diff] [blame] | 3212 | return retStatus; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3213 | } |
| 3214 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3215 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 3216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3217 | tSirRetStatus |
| 3218 | sirParseBeaconIE(tpAniSirGlobal pMac, |
| 3219 | tpSirProbeRespBeacon pBeaconStruct, |
| 3220 | tANI_U8 *pPayload, |
| 3221 | tANI_U32 nPayload) |
| 3222 | { |
| 3223 | tDot11fBeaconIEs *pBies; |
| 3224 | tANI_U32 status; |
| 3225 | |
| 3226 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3227 | vos_mem_set( ( tANI_U8* )pBeaconStruct, sizeof(tSirProbeRespBeacon), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3228 | |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3229 | pBies = vos_mem_malloc(sizeof(tDot11fBeaconIEs)); |
| 3230 | if ( NULL == pBies ) |
| 3231 | status = eHAL_STATUS_FAILURE; |
| 3232 | else |
| 3233 | status = eHAL_STATUS_SUCCESS; |
| 3234 | if (!HAL_STATUS_SUCCESS(status)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3235 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3236 | limLog(pMac, LOGE, FL("Failed to allocate memory") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3237 | return eSIR_FAILURE; |
| 3238 | } |
| 3239 | // delegate to the framesc-generated code, |
| 3240 | status = dot11fUnpackBeaconIEs( pMac, pPayload, nPayload, pBies ); |
| 3241 | |
| 3242 | if ( DOT11F_FAILED( status ) ) |
| 3243 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3244 | limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3245 | status, nPayload); |
| 3246 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3247 | vos_mem_free(pBies); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3248 | return eSIR_FAILURE; |
| 3249 | } |
| 3250 | else if ( DOT11F_WARNED( status ) ) |
| 3251 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3252 | limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3253 | status, nPayload ); |
| 3254 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) |
| 3255 | } |
| 3256 | |
| 3257 | // & "transliterate" from a 'tDot11fBeaconIEs' to a 'tSirProbeRespBeacon'... |
| 3258 | if ( ! pBies->SSID.present ) |
| 3259 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3260 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3261 | } |
| 3262 | else |
| 3263 | { |
| 3264 | pBeaconStruct->ssidPresent = 1; |
| 3265 | ConvertSSID( pMac, &pBeaconStruct->ssId, &pBies->SSID ); |
| 3266 | } |
| 3267 | |
| 3268 | if ( ! pBies->SuppRates.present ) |
| 3269 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3270 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3271 | } |
| 3272 | else |
| 3273 | { |
| 3274 | pBeaconStruct->suppRatesPresent = 1; |
| 3275 | ConvertSuppRates( pMac, &pBeaconStruct->supportedRates, &pBies->SuppRates ); |
| 3276 | } |
| 3277 | |
| 3278 | if ( pBies->ExtSuppRates.present ) |
| 3279 | { |
| 3280 | pBeaconStruct->extendedRatesPresent = 1; |
| 3281 | ConvertExtSuppRates( pMac, &pBeaconStruct->extendedRates, &pBies->ExtSuppRates ); |
| 3282 | } |
| 3283 | |
| 3284 | if ( pBies->CFParams.present ) |
| 3285 | { |
| 3286 | pBeaconStruct->cfPresent = 1; |
| 3287 | ConvertCFParams( pMac, &pBeaconStruct->cfParamSet, &pBies->CFParams ); |
| 3288 | } |
| 3289 | |
| 3290 | if ( pBies->TIM.present ) |
| 3291 | { |
| 3292 | pBeaconStruct->timPresent = 1; |
| 3293 | ConvertTIM( pMac, &pBeaconStruct->tim, &pBies->TIM ); |
| 3294 | } |
| 3295 | |
| 3296 | if ( pBies->Country.present ) |
| 3297 | { |
| 3298 | pBeaconStruct->countryInfoPresent = 1; |
| 3299 | ConvertCountry( pMac, &pBeaconStruct->countryInfoParam, &pBies->Country ); |
| 3300 | } |
| 3301 | |
| 3302 | // 11h IEs |
| 3303 | if(pBies->TPCReport.present) |
| 3304 | { |
| 3305 | pBeaconStruct->tpcReportPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3306 | vos_mem_copy( &pBeaconStruct->tpcReport, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3307 | &pBies->TPCReport, |
| 3308 | sizeof( tDot11fIETPCReport)); |
| 3309 | } |
| 3310 | |
| 3311 | if(pBies->PowerConstraints.present) |
| 3312 | { |
| 3313 | pBeaconStruct->powerConstraintPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3314 | vos_mem_copy( &pBeaconStruct->localPowerConstraint, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3315 | &pBies->PowerConstraints, |
| 3316 | sizeof(tDot11fIEPowerConstraints)); |
| 3317 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3318 | #ifdef FEATURE_WLAN_ESE |
| 3319 | if(pBies->ESETxmitPower.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3320 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3321 | pBeaconStruct->eseTxPwr.present = 1; |
| 3322 | pBeaconStruct->eseTxPwr.power_limit = pBies->ESETxmitPower.power_limit; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3323 | } |
| 3324 | if (pBies->QBSSLoad.present) |
| 3325 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3326 | vos_mem_copy( &pBeaconStruct->QBSSLoad, &pBies->QBSSLoad, sizeof(tDot11fIEQBSSLoad)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3327 | } |
| 3328 | #endif |
| 3329 | |
| 3330 | if ( pBies->EDCAParamSet.present ) |
| 3331 | { |
| 3332 | pBeaconStruct->edcaPresent = 1; |
| 3333 | ConvertEDCAParam( pMac, &pBeaconStruct->edcaParams, &pBies->EDCAParamSet ); |
| 3334 | } |
| 3335 | |
| 3336 | // QOS Capabilities: |
| 3337 | if ( pBies->QOSCapsAp.present ) |
| 3338 | { |
| 3339 | pBeaconStruct->qosCapabilityPresent = 1; |
| 3340 | ConvertQOSCaps( pMac, &pBeaconStruct->qosCapability, &pBies->QOSCapsAp ); |
| 3341 | } |
| 3342 | |
| 3343 | |
| 3344 | |
| 3345 | if ( pBies->ChanSwitchAnn.present ) |
| 3346 | { |
| 3347 | pBeaconStruct->channelSwitchPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3348 | vos_mem_copy( &pBeaconStruct->channelSwitchIE, &pBies->ChanSwitchAnn, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3349 | sizeof(tDot11fIEChanSwitchAnn)); |
| 3350 | } |
| 3351 | |
| 3352 | if ( pBies->ExtChanSwitchAnn.present) |
| 3353 | { |
| 3354 | pBeaconStruct->extChannelSwitchPresent= 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3355 | vos_mem_copy( &pBeaconStruct->extChannelSwitchIE, &pBies->ExtChanSwitchAnn, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3356 | sizeof(tDot11fIEExtChanSwitchAnn)); |
| 3357 | } |
| 3358 | |
| 3359 | if ( pBies->Quiet.present ) |
| 3360 | { |
| 3361 | pBeaconStruct->quietIEPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3362 | vos_mem_copy( &pBeaconStruct->quietIE, &pBies->Quiet, sizeof(tDot11fIEQuiet) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3363 | } |
| 3364 | |
| 3365 | if ( pBies->HTCaps.present ) |
| 3366 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3367 | vos_mem_copy( &pBeaconStruct->HTCaps, &pBies->HTCaps, sizeof( tDot11fIEHTCaps ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3368 | } |
| 3369 | |
| 3370 | if ( pBies->HTInfo.present ) |
| 3371 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3372 | vos_mem_copy( &pBeaconStruct->HTInfo, &pBies->HTInfo, sizeof( tDot11fIEHTInfo ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3373 | } |
| 3374 | |
| 3375 | if ( pBies->DSParams.present ) |
| 3376 | { |
| 3377 | pBeaconStruct->dsParamsPresent = 1; |
| 3378 | pBeaconStruct->channelNumber = pBies->DSParams.curr_channel; |
| 3379 | } |
| 3380 | else if(pBies->HTInfo.present) |
| 3381 | { |
| 3382 | pBeaconStruct->channelNumber = pBies->HTInfo.primaryChannel; |
| 3383 | } |
| 3384 | |
| 3385 | if ( pBies->RSN.present ) |
| 3386 | { |
| 3387 | pBeaconStruct->rsnPresent = 1; |
| 3388 | ConvertRSN( pMac, &pBeaconStruct->rsn, &pBies->RSN ); |
| 3389 | } |
| 3390 | |
| 3391 | if ( pBies->WPA.present ) |
| 3392 | { |
| 3393 | pBeaconStruct->wpaPresent = 1; |
| 3394 | ConvertWPA( pMac, &pBeaconStruct->wpa, &pBies->WPA ); |
| 3395 | } |
| 3396 | |
| 3397 | if ( pBies->WMMParams.present ) |
| 3398 | { |
| 3399 | pBeaconStruct->wmeEdcaPresent = 1; |
| 3400 | ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &pBies->WMMParams ); |
| 3401 | } |
| 3402 | |
| 3403 | if ( pBies->WMMInfoAp.present ) |
| 3404 | { |
| 3405 | pBeaconStruct->wmeInfoPresent = 1; |
| 3406 | } |
| 3407 | |
| 3408 | if ( pBies->WMMCaps.present ) |
| 3409 | { |
| 3410 | pBeaconStruct->wsmCapablePresent = 1; |
| 3411 | } |
| 3412 | |
| 3413 | |
| 3414 | if ( pBies->ERPInfo.present ) |
| 3415 | { |
| 3416 | pBeaconStruct->erpPresent = 1; |
| 3417 | ConvertERPInfo( pMac, &pBeaconStruct->erpIEInfo, &pBies->ERPInfo ); |
| 3418 | } |
| 3419 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3420 | #ifdef WLAN_FEATURE_11AC |
| 3421 | if ( pBies->VHTCaps.present ) |
| 3422 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3423 | pBeaconStruct->VHTCaps.present = 1; |
| 3424 | vos_mem_copy( &pBeaconStruct->VHTCaps, &pBies->VHTCaps, sizeof( tDot11fIEVHTCaps ) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3425 | } |
| 3426 | if ( pBies->VHTOperation.present ) |
| 3427 | { |
| 3428 | pBeaconStruct->VHTOperation.present = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3429 | vos_mem_copy( &pBeaconStruct->VHTOperation, &pBies->VHTOperation, |
| 3430 | sizeof( tDot11fIEVHTOperation) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3431 | } |
| 3432 | if ( pBies->VHTExtBssLoad.present ) |
| 3433 | { |
| 3434 | pBeaconStruct->VHTExtBssLoad.present = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3435 | vos_mem_copy( &pBeaconStruct->VHTExtBssLoad, &pBies->VHTExtBssLoad, |
| 3436 | sizeof( tDot11fIEVHTExtBssLoad) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3437 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 3438 | if( pBies->OperatingMode.present) |
| 3439 | { |
| 3440 | pBeaconStruct->OperatingMode.present = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3441 | vos_mem_copy( &pBeaconStruct->OperatingMode, &pBies->OperatingMode, |
| 3442 | sizeof( tDot11fIEOperatingMode) ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 3443 | } |
| 3444 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3445 | #endif |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3446 | vos_mem_free(pBies); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3447 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3448 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3449 | return eSIR_SUCCESS; |
| 3450 | |
| 3451 | } // End sirParseBeaconIE. |
| 3452 | |
| 3453 | tSirRetStatus |
| 3454 | sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac, |
| 3455 | tANI_U8 *pFrame, |
| 3456 | tpSirProbeRespBeacon pBeaconStruct) |
| 3457 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3458 | tDot11fBeacon *pBeacon; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3459 | tANI_U32 status, nPayload; |
| 3460 | tANI_U8 *pPayload; |
| 3461 | tpSirMacMgmtHdr pHdr; |
| 3462 | tANI_U8 mappedRXCh; |
Kiran Kumar Lokere | 79540f9 | 2013-04-25 17:32:16 -0700 | [diff] [blame] | 3463 | tANI_U8 rfBand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3464 | |
| 3465 | pPayload = WDA_GET_RX_MPDU_DATA( pFrame ); |
| 3466 | nPayload = WDA_GET_RX_PAYLOAD_LEN( pFrame ); |
| 3467 | pHdr = WDA_GET_RX_MAC_HEADER( pFrame ); |
| 3468 | mappedRXCh = WDA_GET_RX_CH( pFrame ); |
Kiran Kumar Lokere | 79540f9 | 2013-04-25 17:32:16 -0700 | [diff] [blame] | 3469 | rfBand = WDA_GET_RX_RFBAND( pFrame ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3470 | |
| 3471 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3472 | vos_mem_set( ( tANI_U8* )pBeaconStruct, sizeof(tSirProbeRespBeacon), 0 ); |
| 3473 | |
Abhishek Singh | c75726d | 2015-04-13 14:44:14 +0530 | [diff] [blame] | 3474 | pBeacon = vos_mem_vmalloc(sizeof(tDot11fBeacon)); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3475 | if ( NULL == pBeacon ) |
| 3476 | status = eHAL_STATUS_FAILURE; |
| 3477 | else |
| 3478 | status = eHAL_STATUS_SUCCESS; |
| 3479 | if (!HAL_STATUS_SUCCESS(status)) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3480 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3481 | limLog(pMac, LOGE, FL("Failed to allocate memory") ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3482 | return eSIR_FAILURE; |
| 3483 | } |
| 3484 | |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3485 | vos_mem_set( ( tANI_U8* )pBeacon, sizeof(tDot11fBeacon), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3486 | |
| 3487 | // get the MAC address out of the BD, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3488 | vos_mem_copy( pBeaconStruct->bssid, pHdr->sa, 6 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3489 | |
| 3490 | // delegate to the framesc-generated code, |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3491 | status = dot11fUnpackBeacon( pMac, pPayload, nPayload, pBeacon ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3492 | if ( DOT11F_FAILED( status ) ) |
| 3493 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3494 | limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3495 | status, nPayload); |
| 3496 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) |
Abhishek Singh | c75726d | 2015-04-13 14:44:14 +0530 | [diff] [blame] | 3497 | vos_mem_vfree(pBeacon); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3498 | return eSIR_FAILURE; |
| 3499 | } |
| 3500 | else if ( DOT11F_WARNED( status ) ) |
| 3501 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3502 | limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3503 | status, nPayload ); |
| 3504 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);) |
| 3505 | } |
| 3506 | |
| 3507 | // & "transliterate" from a 'tDot11fBeacon' to a 'tSirProbeRespBeacon'... |
| 3508 | // Timestamp |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3509 | vos_mem_copy( ( tANI_U8* )pBeaconStruct->timeStamp, ( tANI_U8* )&pBeacon->TimeStamp, |
| 3510 | sizeof(tSirMacTimeStamp) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3511 | |
| 3512 | // Beacon Interval |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3513 | pBeaconStruct->beaconInterval = pBeacon->BeaconInterval.interval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3514 | |
| 3515 | // Capabilities |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3516 | pBeaconStruct->capabilityInfo.ess = pBeacon->Capabilities.ess; |
| 3517 | pBeaconStruct->capabilityInfo.ibss = pBeacon->Capabilities.ibss; |
| 3518 | pBeaconStruct->capabilityInfo.cfPollable = pBeacon->Capabilities.cfPollable; |
| 3519 | pBeaconStruct->capabilityInfo.cfPollReq = pBeacon->Capabilities.cfPollReq; |
| 3520 | pBeaconStruct->capabilityInfo.privacy = pBeacon->Capabilities.privacy; |
| 3521 | pBeaconStruct->capabilityInfo.shortPreamble = pBeacon->Capabilities.shortPreamble; |
| 3522 | pBeaconStruct->capabilityInfo.pbcc = pBeacon->Capabilities.pbcc; |
| 3523 | pBeaconStruct->capabilityInfo.channelAgility = pBeacon->Capabilities.channelAgility; |
| 3524 | pBeaconStruct->capabilityInfo.spectrumMgt = pBeacon->Capabilities.spectrumMgt; |
| 3525 | pBeaconStruct->capabilityInfo.qos = pBeacon->Capabilities.qos; |
| 3526 | pBeaconStruct->capabilityInfo.shortSlotTime = pBeacon->Capabilities.shortSlotTime; |
| 3527 | pBeaconStruct->capabilityInfo.apsd = pBeacon->Capabilities.apsd; |
| 3528 | pBeaconStruct->capabilityInfo.rrm = pBeacon->Capabilities.rrm; |
| 3529 | pBeaconStruct->capabilityInfo.dsssOfdm = pBeacon->Capabilities.dsssOfdm; |
| 3530 | pBeaconStruct->capabilityInfo.delayedBA = pBeacon->Capabilities.delayedBA; |
| 3531 | pBeaconStruct->capabilityInfo.immediateBA = pBeacon->Capabilities.immediateBA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3532 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3533 | if ( ! pBeacon->SSID.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3534 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3535 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3536 | } |
| 3537 | else |
| 3538 | { |
| 3539 | pBeaconStruct->ssidPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3540 | ConvertSSID( pMac, &pBeaconStruct->ssId, &pBeacon->SSID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3541 | } |
| 3542 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3543 | if ( ! pBeacon->SuppRates.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3544 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3545 | PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3546 | } |
| 3547 | else |
| 3548 | { |
| 3549 | pBeaconStruct->suppRatesPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3550 | ConvertSuppRates( pMac, &pBeaconStruct->supportedRates, &pBeacon->SuppRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3551 | } |
| 3552 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3553 | if ( pBeacon->ExtSuppRates.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3554 | { |
| 3555 | pBeaconStruct->extendedRatesPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3556 | ConvertExtSuppRates( pMac, &pBeaconStruct->extendedRates, &pBeacon->ExtSuppRates ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3557 | } |
| 3558 | |
| 3559 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3560 | if ( pBeacon->CFParams.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3561 | { |
| 3562 | pBeaconStruct->cfPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3563 | ConvertCFParams( pMac, &pBeaconStruct->cfParamSet, &pBeacon->CFParams ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3564 | } |
| 3565 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3566 | if ( pBeacon->TIM.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3567 | { |
| 3568 | pBeaconStruct->timPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3569 | ConvertTIM( pMac, &pBeaconStruct->tim, &pBeacon->TIM ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3570 | } |
| 3571 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3572 | if ( pBeacon->Country.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3573 | { |
| 3574 | pBeaconStruct->countryInfoPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3575 | ConvertCountry( pMac, &pBeaconStruct->countryInfoParam, &pBeacon->Country ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3576 | } |
| 3577 | |
| 3578 | // QOS Capabilities: |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3579 | if ( pBeacon->QOSCapsAp.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3580 | { |
| 3581 | pBeaconStruct->qosCapabilityPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3582 | ConvertQOSCaps( pMac, &pBeaconStruct->qosCapability, &pBeacon->QOSCapsAp ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3583 | } |
| 3584 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3585 | if ( pBeacon->EDCAParamSet.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3586 | { |
| 3587 | pBeaconStruct->edcaPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3588 | ConvertEDCAParam( pMac, &pBeaconStruct->edcaParams, &pBeacon->EDCAParamSet ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3589 | } |
| 3590 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3591 | if ( pBeacon->ChanSwitchAnn.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3592 | { |
| 3593 | pBeaconStruct->channelSwitchPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3594 | vos_mem_copy( &pBeaconStruct->channelSwitchIE, &pBeacon->ChanSwitchAnn, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3595 | sizeof(tDot11fIEChanSwitchAnn) ); |
| 3596 | } |
| 3597 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3598 | if ( pBeacon->ExtChanSwitchAnn.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3599 | { |
| 3600 | pBeaconStruct->extChannelSwitchPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3601 | vos_mem_copy( &pBeaconStruct->extChannelSwitchIE, &pBeacon->ExtChanSwitchAnn, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3602 | sizeof(tDot11fIEExtChanSwitchAnn) ); |
| 3603 | } |
| 3604 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3605 | if( pBeacon->TPCReport.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3606 | { |
| 3607 | pBeaconStruct->tpcReportPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3608 | vos_mem_copy( &pBeaconStruct->tpcReport, &pBeacon->TPCReport, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3609 | sizeof(tDot11fIETPCReport)); |
| 3610 | } |
| 3611 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3612 | if( pBeacon->PowerConstraints.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3613 | { |
| 3614 | pBeaconStruct->powerConstraintPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3615 | vos_mem_copy( &pBeaconStruct->localPowerConstraint, &pBeacon->PowerConstraints, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3616 | sizeof(tDot11fIEPowerConstraints)); |
| 3617 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3618 | |
| 3619 | if ( pBeacon->Quiet.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3620 | { |
| 3621 | pBeaconStruct->quietIEPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3622 | vos_mem_copy( &pBeaconStruct->quietIE, &pBeacon->Quiet, sizeof(tDot11fIEQuiet)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3623 | } |
| 3624 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3625 | if ( pBeacon->HTCaps.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3626 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3627 | vos_mem_copy( &pBeaconStruct->HTCaps, &pBeacon->HTCaps, sizeof( tDot11fIEHTCaps ) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3628 | } |
| 3629 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3630 | if ( pBeacon->HTInfo.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3631 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3632 | vos_mem_copy( &pBeaconStruct->HTInfo, &pBeacon->HTInfo, sizeof( tDot11fIEHTInfo) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3633 | |
| 3634 | } |
| 3635 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3636 | if ( pBeacon->DSParams.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3637 | { |
| 3638 | pBeaconStruct->dsParamsPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3639 | pBeaconStruct->channelNumber = pBeacon->DSParams.curr_channel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3640 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3641 | else if(pBeacon->HTInfo.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3642 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3643 | pBeaconStruct->channelNumber = pBeacon->HTInfo.primaryChannel; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3644 | } |
| 3645 | else |
| 3646 | { |
Kiran Kumar Lokere | 79540f9 | 2013-04-25 17:32:16 -0700 | [diff] [blame] | 3647 | if ((!rfBand) || IS_5G_BAND(rfBand)) |
| 3648 | pBeaconStruct->channelNumber = limUnmapChannel(mappedRXCh); |
| 3649 | else if (IS_24G_BAND(rfBand)) |
| 3650 | pBeaconStruct->channelNumber = mappedRXCh; |
| 3651 | else |
| 3652 | { |
| 3653 | /*Only 0, 1, 2 are expected values for RF band from FW |
| 3654 | * if FW fixes are not present then rf band value will |
| 3655 | * be 0, else either 1 or 2 are expected from FW, 3 is |
| 3656 | * not expected from FW */ |
| 3657 | PELOGE(limLog(pMac, LOGE, |
| 3658 | FL("Channel info is not present in Beacon and" |
| 3659 | " mapping is not done correctly"));) |
| 3660 | pBeaconStruct->channelNumber = mappedRXCh; |
| 3661 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3662 | } |
| 3663 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3664 | if ( pBeacon->RSN.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3665 | { |
| 3666 | pBeaconStruct->rsnPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3667 | ConvertRSN( pMac, &pBeaconStruct->rsn, &pBeacon->RSN ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3668 | } |
| 3669 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3670 | if ( pBeacon->WPA.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3671 | { |
| 3672 | pBeaconStruct->wpaPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3673 | ConvertWPA( pMac, &pBeaconStruct->wpa, &pBeacon->WPA ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3674 | } |
| 3675 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3676 | if ( pBeacon->WMMParams.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3677 | { |
| 3678 | pBeaconStruct->wmeEdcaPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3679 | ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &pBeacon->WMMParams ); |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3680 | PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Beacon Frame!")); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3681 | __printWMMParams(pMac, &pBeacon->WMMParams); ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3682 | } |
| 3683 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3684 | if ( pBeacon->WMMInfoAp.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3685 | { |
| 3686 | pBeaconStruct->wmeInfoPresent = 1; |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3687 | PELOG1(limLog(pMac, LOG1, FL("WMM Info present in Beacon Frame!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3688 | } |
| 3689 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3690 | if ( pBeacon->WMMCaps.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3691 | { |
| 3692 | pBeaconStruct->wsmCapablePresent = 1; |
| 3693 | } |
| 3694 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3695 | if ( pBeacon->ERPInfo.present ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3696 | { |
| 3697 | pBeaconStruct->erpPresent = 1; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3698 | ConvertERPInfo( pMac, &pBeaconStruct->erpIEInfo, &pBeacon->ERPInfo ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3699 | } |
| 3700 | |
| 3701 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3702 | if (pBeacon->MobilityDomain.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3703 | { |
| 3704 | // MobilityDomain |
| 3705 | pBeaconStruct->mdiePresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3706 | vos_mem_copy( (tANI_U8 *)&(pBeaconStruct->mdie[0]), |
| 3707 | (tANI_U8 *)&(pBeacon->MobilityDomain.MDID), sizeof(tANI_U16) ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3708 | pBeaconStruct->mdie[2] = ((pBeacon->MobilityDomain.overDSCap << 0) | (pBeacon->MobilityDomain.resourceReqCap << 1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3709 | |
| 3710 | } |
| 3711 | #endif |
| 3712 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3713 | #ifdef FEATURE_WLAN_ESE |
| 3714 | if (pBeacon->ESETxmitPower.present) |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 3715 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3716 | //ESE Tx Power |
| 3717 | pBeaconStruct->eseTxPwr.present = 1; |
| 3718 | vos_mem_copy(&pBeaconStruct->eseTxPwr, |
| 3719 | &pBeacon->ESETxmitPower, |
| 3720 | sizeof(tDot11fIEESETxmitPower)); |
Madan Mohan Koyyalamudi | 016117f | 2013-08-06 16:42:11 +0530 | [diff] [blame] | 3721 | } |
| 3722 | #endif |
| 3723 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3724 | #ifdef WLAN_FEATURE_11AC |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3725 | if ( pBeacon->VHTCaps.present ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3726 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3727 | vos_mem_copy( &pBeaconStruct->VHTCaps, &pBeacon->VHTCaps, sizeof( tDot11fIEVHTCaps ) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3728 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3729 | if ( pBeacon->VHTOperation.present ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3730 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3731 | vos_mem_copy( &pBeaconStruct->VHTOperation, &pBeacon->VHTOperation, |
| 3732 | sizeof( tDot11fIEVHTOperation) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3733 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 3734 | if ( pBeacon->VHTExtBssLoad.present ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3735 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3736 | vos_mem_copy( &pBeaconStruct->VHTExtBssLoad, &pBeacon->VHTExtBssLoad, |
| 3737 | sizeof( tDot11fIEVHTExtBssLoad) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3738 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 3739 | if(pBeacon->OperatingMode.present) |
| 3740 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3741 | vos_mem_copy( &pBeaconStruct->OperatingMode, &pBeacon->OperatingMode, |
| 3742 | sizeof( tDot11fIEOperatingMode) ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 3743 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 3744 | if(pBeacon->WiderBWChanSwitchAnn.present) |
| 3745 | { |
| 3746 | pBeaconStruct->WiderBWChanSwitchAnnPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3747 | vos_mem_copy( &pBeaconStruct->WiderBWChanSwitchAnn, &pBeacon->WiderBWChanSwitchAnn, |
| 3748 | sizeof( tDot11fIEWiderBWChanSwitchAnn)); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 3749 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3750 | #endif |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 3751 | if(pBeacon->OBSSScanParameters.present) |
| 3752 | { |
| 3753 | vos_mem_copy( &pBeaconStruct->OBSSScanParameters, |
| 3754 | &pBeacon->OBSSScanParameters, |
| 3755 | sizeof( tDot11fIEOBSSScanParameters)); |
| 3756 | } |
Abhishek Singh | c75726d | 2015-04-13 14:44:14 +0530 | [diff] [blame] | 3757 | vos_mem_vfree(pBeacon); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3758 | return eSIR_SUCCESS; |
| 3759 | |
| 3760 | } // End sirConvertBeaconFrame2Struct. |
| 3761 | |
| 3762 | tSirRetStatus |
| 3763 | sirConvertAuthFrame2Struct(tpAniSirGlobal pMac, |
| 3764 | tANI_U8 *pFrame, |
| 3765 | tANI_U32 nFrame, |
| 3766 | tpSirMacAuthFrameBody pAuth) |
| 3767 | { |
| 3768 | static tDot11fAuthentication auth; |
| 3769 | tANI_U32 status; |
| 3770 | |
| 3771 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3772 | vos_mem_set( ( tANI_U8* )pAuth, sizeof(tSirMacAuthFrameBody), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3773 | |
| 3774 | // delegate to the framesc-generated code, |
| 3775 | status = dot11fUnpackAuthentication( pMac, pFrame, nFrame, &auth ); |
| 3776 | if ( DOT11F_FAILED( status ) ) |
| 3777 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3778 | limLog(pMac, LOGE, FL("Failed to parse an Authentication frame (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3779 | status, nFrame); |
| 3780 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 3781 | return eSIR_FAILURE; |
| 3782 | } |
| 3783 | else if ( DOT11F_WARNED( status ) ) |
| 3784 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3785 | limLog( pMac, LOGW, FL("There were warnings while unpacking an Authentication frame (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3786 | status, nFrame ); |
| 3787 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 3788 | } |
| 3789 | |
| 3790 | // & "transliterate" from a 'tDot11fAuthentication' to a 'tSirMacAuthFrameBody'... |
| 3791 | pAuth->authAlgoNumber = auth.AuthAlgo.algo; |
| 3792 | pAuth->authTransactionSeqNumber = auth.AuthSeqNo.no; |
| 3793 | pAuth->authStatusCode = auth.Status.status; |
| 3794 | |
| 3795 | if ( auth.ChallengeText.present ) |
| 3796 | { |
| 3797 | pAuth->type = SIR_MAC_CHALLENGE_TEXT_EID; |
| 3798 | pAuth->length = auth.ChallengeText.num_text; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3799 | vos_mem_copy( pAuth->challengeText, auth.ChallengeText.text, auth.ChallengeText.num_text ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3800 | } |
| 3801 | |
| 3802 | return eSIR_SUCCESS; |
| 3803 | |
| 3804 | } // End sirConvertAuthFrame2Struct. |
| 3805 | |
| 3806 | tSirRetStatus |
| 3807 | sirConvertAddtsReq2Struct(tpAniSirGlobal pMac, |
| 3808 | tANI_U8 *pFrame, |
| 3809 | tANI_U32 nFrame, |
| 3810 | tSirAddtsReqInfo *pAddTs) |
| 3811 | { |
| 3812 | tDot11fAddTSRequest addts = {{0}}; |
| 3813 | tDot11fWMMAddTSRequest wmmaddts = {{0}}; |
| 3814 | tANI_U8 j; |
| 3815 | tANI_U16 i; |
| 3816 | tANI_U32 status; |
| 3817 | |
| 3818 | if ( SIR_MAC_QOS_ADD_TS_REQ != *( pFrame + 1 ) ) |
| 3819 | { |
| 3820 | limLog( pMac, LOGE, FL("sirConvertAddtsReq2Struct invoked " |
| 3821 | "with an Action of %d; this is not " |
| 3822 | "supported & is probably an error."), |
| 3823 | *( pFrame + 1 ) ); |
| 3824 | return eSIR_FAILURE; |
| 3825 | } |
| 3826 | |
| 3827 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3828 | vos_mem_set( ( tANI_U8* )pAddTs, sizeof(tSirAddtsReqInfo), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3829 | |
| 3830 | // delegate to the framesc-generated code, |
| 3831 | switch ( *pFrame ) |
| 3832 | { |
| 3833 | case SIR_MAC_ACTION_QOS_MGMT: |
| 3834 | status = dot11fUnpackAddTSRequest( pMac, pFrame, nFrame, &addts ); |
| 3835 | break; |
| 3836 | case SIR_MAC_ACTION_WME: |
| 3837 | status = dot11fUnpackWMMAddTSRequest( pMac, pFrame, nFrame, &wmmaddts ); |
| 3838 | break; |
| 3839 | default: |
| 3840 | limLog( pMac, LOGE, FL("sirConvertAddtsReq2Struct invoked " |
| 3841 | "with a Category of %d; this is not" |
| 3842 | " supported & is probably an error."), |
| 3843 | *pFrame ); |
| 3844 | return eSIR_FAILURE; |
| 3845 | } |
| 3846 | |
| 3847 | if ( DOT11F_FAILED( status ) ) |
| 3848 | { |
| 3849 | limLog(pMac, LOGE, FL("Failed to parse an Add TS Request f" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3850 | "rame (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3851 | status, nFrame); |
| 3852 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 3853 | return eSIR_FAILURE; |
| 3854 | } |
| 3855 | else if ( DOT11F_WARNED( status ) ) |
| 3856 | { |
| 3857 | limLog( pMac, LOGW, FL("There were warnings while unpackin" |
| 3858 | "g an Add TS Request frame (0x%08x," |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3859 | "%d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3860 | status, nFrame ); |
| 3861 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 3862 | } |
| 3863 | |
| 3864 | // & "transliterate" from a 'tDot11fAddTSRequest' or a |
| 3865 | // 'tDot11WMMAddTSRequest' to a 'tSirMacAddtsReqInfo'... |
| 3866 | if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame ) |
| 3867 | { |
| 3868 | pAddTs->dialogToken = addts.DialogToken.token; |
| 3869 | |
| 3870 | if ( addts.TSPEC.present ) |
| 3871 | { |
| 3872 | ConvertTSPEC( pMac, &pAddTs->tspec, &addts.TSPEC ); |
| 3873 | } |
| 3874 | else |
| 3875 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3876 | limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Request.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3877 | return eSIR_FAILURE; |
| 3878 | } |
| 3879 | |
| 3880 | if ( addts.num_TCLAS ) |
| 3881 | { |
| 3882 | pAddTs->numTclas = (tANI_U8)addts.num_TCLAS; |
| 3883 | |
| 3884 | for ( i = 0U; i < addts.num_TCLAS; ++i ) |
| 3885 | { |
| 3886 | if ( eSIR_SUCCESS != ConvertTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.TCLAS[i] ) ) ) |
| 3887 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3888 | limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3889 | return eSIR_FAILURE; |
| 3890 | } |
| 3891 | } |
| 3892 | } |
| 3893 | |
| 3894 | if ( addts.TCLASSPROC.present ) |
| 3895 | { |
| 3896 | pAddTs->tclasProcPresent = 1; |
| 3897 | pAddTs->tclasProc = addts.TCLASSPROC.processing; |
| 3898 | } |
| 3899 | |
| 3900 | if ( addts.WMMTSPEC.present ) |
| 3901 | { |
| 3902 | pAddTs->wsmTspecPresent = 1; |
| 3903 | ConvertWMMTSPEC( pMac, &pAddTs->tspec, &addts.WMMTSPEC ); |
| 3904 | } |
| 3905 | |
| 3906 | if ( addts.num_WMMTCLAS ) |
| 3907 | { |
| 3908 | j = (tANI_U8)(pAddTs->numTclas + addts.num_WMMTCLAS); |
| 3909 | if ( SIR_MAC_TCLASIE_MAXNUM > j ) j = SIR_MAC_TCLASIE_MAXNUM; |
| 3910 | |
| 3911 | for ( i = pAddTs->numTclas; i < j; ++i ) |
| 3912 | { |
| 3913 | if ( eSIR_SUCCESS != ConvertWMMTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.WMMTCLAS[i] ) ) ) |
| 3914 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3915 | limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3916 | return eSIR_FAILURE; |
| 3917 | } |
| 3918 | } |
| 3919 | } |
| 3920 | |
| 3921 | if ( addts.WMMTCLASPROC.present ) |
| 3922 | { |
| 3923 | pAddTs->tclasProcPresent = 1; |
| 3924 | pAddTs->tclasProc = addts.WMMTCLASPROC.processing; |
| 3925 | } |
| 3926 | |
| 3927 | if ( 1 < pAddTs->numTclas && ( ! pAddTs->tclasProcPresent ) ) |
| 3928 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3929 | limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3930 | pAddTs->numTclas ); |
| 3931 | return eSIR_FAILURE; |
| 3932 | } |
| 3933 | } |
| 3934 | else |
| 3935 | { |
| 3936 | pAddTs->dialogToken = wmmaddts.DialogToken.token; |
| 3937 | |
| 3938 | if ( wmmaddts.WMMTSPEC.present ) |
| 3939 | { |
| 3940 | pAddTs->wmeTspecPresent = 1; |
| 3941 | ConvertWMMTSPEC( pMac, &pAddTs->tspec, &wmmaddts.WMMTSPEC ); |
| 3942 | } |
| 3943 | else |
| 3944 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 3945 | limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3946 | return eSIR_FAILURE; |
| 3947 | } |
| 3948 | } |
| 3949 | |
| 3950 | return eSIR_SUCCESS; |
| 3951 | |
| 3952 | } // End sirConvertAddtsReq2Struct. |
| 3953 | |
| 3954 | tSirRetStatus |
| 3955 | sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac, |
| 3956 | tANI_U8 *pFrame, |
| 3957 | tANI_U32 nFrame, |
| 3958 | tSirAddtsRspInfo *pAddTs) |
| 3959 | { |
| 3960 | tDot11fAddTSResponse addts = {{0}}; |
| 3961 | tDot11fWMMAddTSResponse wmmaddts = {{0}}; |
| 3962 | tANI_U8 j; |
| 3963 | tANI_U16 i; |
| 3964 | tANI_U32 status; |
| 3965 | |
| 3966 | if ( SIR_MAC_QOS_ADD_TS_RSP != *( pFrame + 1 ) ) |
| 3967 | { |
| 3968 | limLog( pMac, LOGE, FL("sirConvertAddtsRsp2Struct invoked " |
| 3969 | "with an Action of %d; this is not " |
| 3970 | "supported & is probably an error."), |
| 3971 | *( pFrame + 1 ) ); |
| 3972 | return eSIR_FAILURE; |
| 3973 | } |
| 3974 | |
| 3975 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 3976 | vos_mem_set( ( tANI_U8* )pAddTs, sizeof(tSirAddtsRspInfo), 0 ); |
| 3977 | vos_mem_set( ( tANI_U8* )&addts, sizeof(tDot11fAddTSResponse), 0 ); |
| 3978 | vos_mem_set( ( tANI_U8* )&wmmaddts, sizeof(tDot11fWMMAddTSResponse), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3979 | |
| 3980 | |
| 3981 | // delegate to the framesc-generated code, |
| 3982 | switch ( *pFrame ) |
| 3983 | { |
| 3984 | case SIR_MAC_ACTION_QOS_MGMT: |
| 3985 | status = dot11fUnpackAddTSResponse( pMac, pFrame, nFrame, &addts ); |
| 3986 | break; |
| 3987 | case SIR_MAC_ACTION_WME: |
| 3988 | status = dot11fUnpackWMMAddTSResponse( pMac, pFrame, nFrame, &wmmaddts ); |
| 3989 | break; |
| 3990 | default: |
| 3991 | limLog( pMac, LOGE, FL("sirConvertAddtsRsp2Struct invoked " |
| 3992 | "with a Category of %d; this is not" |
| 3993 | " supported & is probably an error."), |
| 3994 | *pFrame ); |
| 3995 | return eSIR_FAILURE; |
| 3996 | } |
| 3997 | |
| 3998 | if ( DOT11F_FAILED( status ) ) |
| 3999 | { |
| 4000 | limLog(pMac, LOGE, FL("Failed to parse an Add TS Response f" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4001 | "rame (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4002 | status, nFrame); |
| 4003 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4004 | return eSIR_FAILURE; |
| 4005 | } |
| 4006 | else if ( DOT11F_WARNED( status ) ) |
| 4007 | { |
| 4008 | limLog( pMac, LOGW, FL("There were warnings while unpackin" |
| 4009 | "g an Add TS Response frame (0x%08x," |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4010 | "%d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4011 | status, nFrame ); |
| 4012 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4013 | } |
| 4014 | |
| 4015 | // & "transliterate" from a 'tDot11fAddTSResponse' or a |
| 4016 | // 'tDot11WMMAddTSResponse' to a 'tSirMacAddtsRspInfo'... |
| 4017 | if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame ) |
| 4018 | { |
| 4019 | pAddTs->dialogToken = addts.DialogToken.token; |
| 4020 | pAddTs->status = ( tSirMacStatusCodes )addts.Status.status; |
| 4021 | |
| 4022 | if ( addts.TSDelay.present ) |
| 4023 | { |
| 4024 | ConvertTSDelay( pMac, &pAddTs->delay, &addts.TSDelay ); |
| 4025 | } |
| 4026 | |
| 4027 | // TS Delay is present iff status indicates its presence |
| 4028 | if ( eSIR_MAC_TS_NOT_CREATED_STATUS == pAddTs->status && ! addts.TSDelay.present ) |
| 4029 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4030 | limLog( pMac, LOGW, FL("Missing TSDelay IE.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4031 | } |
| 4032 | |
| 4033 | if ( addts.TSPEC.present ) |
| 4034 | { |
| 4035 | ConvertTSPEC( pMac, &pAddTs->tspec, &addts.TSPEC ); |
| 4036 | } |
| 4037 | else |
| 4038 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4039 | limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Response.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4040 | return eSIR_FAILURE; |
| 4041 | } |
| 4042 | |
| 4043 | if ( addts.num_TCLAS ) |
| 4044 | { |
| 4045 | pAddTs->numTclas = (tANI_U8)addts.num_TCLAS; |
| 4046 | |
| 4047 | for ( i = 0U; i < addts.num_TCLAS; ++i ) |
| 4048 | { |
| 4049 | if ( eSIR_SUCCESS != ConvertTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.TCLAS[i] ) ) ) |
| 4050 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4051 | limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4052 | return eSIR_FAILURE; |
| 4053 | } |
| 4054 | } |
| 4055 | } |
| 4056 | |
| 4057 | if ( addts.TCLASSPROC.present ) |
| 4058 | { |
| 4059 | pAddTs->tclasProcPresent = 1; |
| 4060 | pAddTs->tclasProc = addts.TCLASSPROC.processing; |
| 4061 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4062 | #ifdef FEATURE_WLAN_ESE |
| 4063 | if(addts.ESETrafStrmMet.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4064 | { |
| 4065 | pAddTs->tsmPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4066 | vos_mem_copy(&pAddTs->tsmIE.tsid, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4067 | &addts.ESETrafStrmMet.tsid,sizeof(tSirMacESETSMIE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4068 | } |
| 4069 | #endif |
| 4070 | if ( addts.Schedule.present ) |
| 4071 | { |
| 4072 | pAddTs->schedulePresent = 1; |
| 4073 | ConvertSchedule( pMac, &pAddTs->schedule, &addts.Schedule ); |
| 4074 | } |
| 4075 | |
| 4076 | if ( addts.WMMSchedule.present ) |
| 4077 | { |
| 4078 | pAddTs->schedulePresent = 1; |
| 4079 | ConvertWMMSchedule( pMac, &pAddTs->schedule, &addts.WMMSchedule ); |
| 4080 | } |
| 4081 | |
| 4082 | if ( addts.WMMTSPEC.present ) |
| 4083 | { |
| 4084 | pAddTs->wsmTspecPresent = 1; |
| 4085 | ConvertWMMTSPEC( pMac, &pAddTs->tspec, &addts.WMMTSPEC ); |
| 4086 | } |
| 4087 | |
| 4088 | if ( addts.num_WMMTCLAS ) |
| 4089 | { |
| 4090 | j = (tANI_U8)(pAddTs->numTclas + addts.num_WMMTCLAS); |
| 4091 | if ( SIR_MAC_TCLASIE_MAXNUM > j ) j = SIR_MAC_TCLASIE_MAXNUM; |
| 4092 | |
| 4093 | for ( i = pAddTs->numTclas; i < j; ++i ) |
| 4094 | { |
| 4095 | if ( eSIR_SUCCESS != ConvertWMMTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.WMMTCLAS[i] ) ) ) |
| 4096 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4097 | limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4098 | return eSIR_FAILURE; |
| 4099 | } |
| 4100 | } |
| 4101 | } |
| 4102 | |
| 4103 | if ( addts.WMMTCLASPROC.present ) |
| 4104 | { |
| 4105 | pAddTs->tclasProcPresent = 1; |
| 4106 | pAddTs->tclasProc = addts.WMMTCLASPROC.processing; |
| 4107 | } |
| 4108 | |
| 4109 | if ( 1 < pAddTs->numTclas && ( ! pAddTs->tclasProcPresent ) ) |
| 4110 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4111 | limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4112 | pAddTs->numTclas ); |
| 4113 | return eSIR_FAILURE; |
| 4114 | } |
| 4115 | } |
| 4116 | else |
| 4117 | { |
| 4118 | pAddTs->dialogToken = wmmaddts.DialogToken.token; |
| 4119 | pAddTs->status = ( tSirMacStatusCodes )wmmaddts.StatusCode.statusCode; |
| 4120 | |
| 4121 | if ( wmmaddts.WMMTSPEC.present ) |
| 4122 | { |
| 4123 | pAddTs->wmeTspecPresent = 1; |
| 4124 | ConvertWMMTSPEC( pMac, &pAddTs->tspec, &wmmaddts.WMMTSPEC ); |
| 4125 | } |
| 4126 | else |
| 4127 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4128 | limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4129 | return eSIR_FAILURE; |
| 4130 | } |
| 4131 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4132 | #ifdef FEATURE_WLAN_ESE |
| 4133 | if(wmmaddts.ESETrafStrmMet.present) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4134 | { |
| 4135 | pAddTs->tsmPresent = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4136 | vos_mem_copy(&pAddTs->tsmIE.tsid, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4137 | &wmmaddts.ESETrafStrmMet.tsid,sizeof(tSirMacESETSMIE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4138 | } |
| 4139 | #endif |
| 4140 | |
| 4141 | } |
| 4142 | |
| 4143 | return eSIR_SUCCESS; |
| 4144 | |
| 4145 | } // End sirConvertAddtsRsp2Struct. |
| 4146 | |
| 4147 | tSirRetStatus |
| 4148 | sirConvertDeltsReq2Struct(tpAniSirGlobal pMac, |
| 4149 | tANI_U8 *pFrame, |
| 4150 | tANI_U32 nFrame, |
| 4151 | tSirDeltsReqInfo *pDelTs) |
| 4152 | { |
| 4153 | tDot11fDelTS delts = {{0}}; |
| 4154 | tDot11fWMMDelTS wmmdelts = {{0}}; |
| 4155 | tANI_U32 status; |
| 4156 | |
| 4157 | if ( SIR_MAC_QOS_DEL_TS_REQ != *( pFrame + 1 ) ) |
| 4158 | { |
| 4159 | limLog( pMac, LOGE, FL("sirConvertDeltsRsp2Struct invoked " |
| 4160 | "with an Action of %d; this is not " |
| 4161 | "supported & is probably an error."), |
| 4162 | *( pFrame + 1 ) ); |
| 4163 | return eSIR_FAILURE; |
| 4164 | } |
| 4165 | |
| 4166 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4167 | vos_mem_set( ( tANI_U8* )pDelTs, sizeof(tSirDeltsReqInfo), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4168 | |
| 4169 | // delegate to the framesc-generated code, |
| 4170 | switch ( *pFrame ) |
| 4171 | { |
| 4172 | case SIR_MAC_ACTION_QOS_MGMT: |
| 4173 | status = dot11fUnpackDelTS( pMac, pFrame, nFrame, &delts ); |
| 4174 | break; |
| 4175 | case SIR_MAC_ACTION_WME: |
| 4176 | status = dot11fUnpackWMMDelTS( pMac, pFrame, nFrame, &wmmdelts ); |
| 4177 | break; |
| 4178 | default: |
| 4179 | limLog( pMac, LOGE, FL("sirConvertDeltsRsp2Struct invoked " |
| 4180 | "with a Category of %d; this is not" |
| 4181 | " supported & is probably an error."), |
| 4182 | *pFrame ); |
| 4183 | return eSIR_FAILURE; |
| 4184 | } |
| 4185 | |
| 4186 | if ( DOT11F_FAILED( status ) ) |
| 4187 | { |
| 4188 | limLog(pMac, LOGE, FL("Failed to parse an Del TS Request f" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4189 | "rame (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4190 | status, nFrame); |
| 4191 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4192 | return eSIR_FAILURE; |
| 4193 | } |
| 4194 | else if ( DOT11F_WARNED( status ) ) |
| 4195 | { |
| 4196 | dot11fLog( pMac, LOGW, FL("There were warnings while unpackin" |
| 4197 | "g an Del TS Request frame (0x%08x," |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4198 | "%d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4199 | status, nFrame ); |
| 4200 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4201 | } |
| 4202 | |
| 4203 | // & "transliterate" from a 'tDot11fDelTSResponse' or a |
| 4204 | // 'tDot11WMMDelTSResponse' to a 'tSirMacDeltsReqInfo'... |
| 4205 | if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame ) |
| 4206 | { |
| 4207 | pDelTs->tsinfo.traffic.trafficType = (tANI_U16)delts.TSInfo.traffic_type; |
| 4208 | pDelTs->tsinfo.traffic.tsid = (tANI_U16)delts.TSInfo.tsid; |
| 4209 | pDelTs->tsinfo.traffic.direction = (tANI_U16)delts.TSInfo.direction; |
| 4210 | pDelTs->tsinfo.traffic.accessPolicy = (tANI_U16)delts.TSInfo.access_policy; |
| 4211 | pDelTs->tsinfo.traffic.aggregation = (tANI_U16)delts.TSInfo.aggregation; |
| 4212 | pDelTs->tsinfo.traffic.psb = (tANI_U16)delts.TSInfo.psb; |
| 4213 | pDelTs->tsinfo.traffic.userPrio = (tANI_U16)delts.TSInfo.user_priority; |
| 4214 | pDelTs->tsinfo.traffic.ackPolicy = (tANI_U16)delts.TSInfo.tsinfo_ack_pol; |
| 4215 | |
| 4216 | pDelTs->tsinfo.schedule.schedule = (tANI_U8)delts.TSInfo.schedule; |
| 4217 | } |
| 4218 | else |
| 4219 | { |
| 4220 | if ( wmmdelts.WMMTSPEC.present ) |
| 4221 | { |
| 4222 | pDelTs->wmeTspecPresent = 1; |
| 4223 | ConvertWMMTSPEC( pMac, &pDelTs->tspec, &wmmdelts.WMMTSPEC ); |
| 4224 | } |
| 4225 | else |
| 4226 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4227 | dot11fLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4228 | return eSIR_FAILURE; |
| 4229 | } |
| 4230 | } |
| 4231 | |
| 4232 | return eSIR_SUCCESS; |
| 4233 | |
| 4234 | } // End sirConvertDeltsReq2Struct. |
| 4235 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 4236 | tSirRetStatus |
| 4237 | sirConvertQosMapConfigureFrame2Struct(tpAniSirGlobal pMac, |
| 4238 | tANI_U8 *pFrame, |
| 4239 | tANI_U32 nFrame, |
| 4240 | tSirQosMapSet *pQosMapSet) |
| 4241 | { |
| 4242 | tDot11fQosMapConfigure mapConfigure; |
| 4243 | tANI_U32 status; |
| 4244 | status = dot11fUnpackQosMapConfigure(pMac, pFrame, nFrame, &mapConfigure); |
| 4245 | if ( DOT11F_FAILED( status ) ) |
| 4246 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4247 | dot11fLog(pMac, LOGE, FL("Failed to parse Qos Map Configure frame (0x%08x, %d bytes):"), |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 4248 | status, nFrame); |
| 4249 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4250 | return eSIR_FAILURE; |
| 4251 | } |
| 4252 | else if ( DOT11F_WARNED( status ) ) |
| 4253 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4254 | dot11fLog( pMac, LOGW, FL("There were warnings while unpacking Qos Map Configure frame (0x%08x, %d bytes):"), |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 4255 | status, nFrame ); |
| 4256 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4257 | } |
| 4258 | pQosMapSet->present = mapConfigure.QosMapSet.present; |
| 4259 | ConvertQosMapsetFrame(pMac->hHdd, pQosMapSet, &mapConfigure.QosMapSet); |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 4260 | limLogQosMapSet(pMac, pQosMapSet); |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 4261 | return eSIR_SUCCESS; |
| 4262 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4263 | |
| 4264 | #ifdef ANI_SUPPORT_11H |
| 4265 | tSirRetStatus |
| 4266 | sirConvertTpcReqFrame2Struct(tpAniSirGlobal pMac, |
| 4267 | tANI_U8 *pFrame, |
| 4268 | tpSirMacTpcReqActionFrame pTpcReqFrame, |
| 4269 | tANI_U32 nFrame) |
| 4270 | { |
| 4271 | tDot11fTPCRequest req; |
| 4272 | tANI_U32 status; |
| 4273 | |
| 4274 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4275 | vos_mem_set( ( tANI_U8* )pTpcReqFrame, sizeof(tSirMacTpcReqActionFrame), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4276 | |
| 4277 | // delegate to the framesc-generated code, |
| 4278 | status = dot11fUnpackTPCRequest( pMac, pFrame, nFrame, &req ); |
| 4279 | if ( DOT11F_FAILED( status ) ) |
| 4280 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4281 | dot11fLog(pMac, LOGE, FL("Failed to parse a TPC Request frame (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4282 | status, nFrame); |
| 4283 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4284 | return eSIR_FAILURE; |
| 4285 | } |
| 4286 | else if ( DOT11F_WARNED( status ) ) |
| 4287 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4288 | dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a TPC Request frame (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4289 | status, nFrame ); |
| 4290 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4291 | } |
| 4292 | |
| 4293 | // & "transliterate" from a 'tDot11fTPCRequest' to a |
| 4294 | // 'tSirMacTpcReqActionFrame'... |
| 4295 | pTpcReqFrame->actionHeader.category = req.Category.category; |
| 4296 | pTpcReqFrame->actionHeader.actionID = req.Action.action; |
| 4297 | pTpcReqFrame->actionHeader.dialogToken = req.DialogToken.token; |
| 4298 | if ( req.TPCRequest.present ) |
| 4299 | { |
| 4300 | pTpcReqFrame->type = DOT11F_EID_TPCREQUEST; |
| 4301 | pTpcReqFrame->length = 0; |
| 4302 | } |
| 4303 | else |
| 4304 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4305 | dot11fLog( pMac, LOGW, FL("!!!Rcv TPC Req of inalid type!") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4306 | return eSIR_FAILURE; |
| 4307 | } |
| 4308 | |
| 4309 | return eSIR_SUCCESS; |
| 4310 | |
| 4311 | } // End sirConvertTpcReqFrame2Struct. |
| 4312 | |
| 4313 | |
| 4314 | tSirRetStatus |
| 4315 | sirConvertMeasReqFrame2Struct(tpAniSirGlobal pMac, |
| 4316 | tANI_U8 *pFrame, |
| 4317 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 4318 | tANI_U32 nFrame) |
| 4319 | { |
| 4320 | tDot11fMeasurementRequest mr; |
| 4321 | tANI_U32 status; |
| 4322 | |
| 4323 | // Zero-init our [out] parameter, |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4324 | vos_mem_set( ( tANI_U8* )pMeasReqFrame, sizeof(tpSirMacMeasReqActionFrame), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4325 | |
| 4326 | // delegate to the framesc-generated code, |
| 4327 | status = dot11fUnpackMeasurementRequest( pMac, pFrame, nFrame, &mr ); |
| 4328 | if ( DOT11F_FAILED( status ) ) |
| 4329 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4330 | dot11fLog(pMac, LOGE, FL("Failed to parse a Measurement Request frame (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4331 | status, nFrame); |
| 4332 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4333 | return eSIR_FAILURE; |
| 4334 | } |
| 4335 | else if ( DOT11F_WARNED( status ) ) |
| 4336 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4337 | dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a Measurement Request frame (0x%08x, %d bytes)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4338 | status, nFrame ); |
| 4339 | PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);) |
| 4340 | } |
| 4341 | |
| 4342 | // & "transliterate" from a 'tDot11fMeasurementRequest' to a |
| 4343 | // 'tpSirMacMeasReqActionFrame'... |
| 4344 | pMeasReqFrame->actionHeader.category = mr.Category.category; |
| 4345 | pMeasReqFrame->actionHeader.actionID = mr.Action.action; |
| 4346 | pMeasReqFrame->actionHeader.dialogToken = mr.DialogToken.token; |
| 4347 | |
| 4348 | if ( 0 == mr.num_MeasurementRequest ) |
| 4349 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4350 | dot11fLog( pMac, LOGE, FL("Missing mandatory IE in Measurement Request Frame.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4351 | return eSIR_FAILURE; |
| 4352 | } |
| 4353 | else if ( 1 < mr.num_MeasurementRequest ) |
| 4354 | { |
| 4355 | limLog( pMac, LOGW, FL("Warning: dropping extra Measurement Request IEs!") ); |
| 4356 | } |
| 4357 | |
| 4358 | pMeasReqFrame->measReqIE.type = DOT11F_EID_MEASUREMENTREQUEST; |
| 4359 | pMeasReqFrame->measReqIE.length = DOT11F_IE_MEASUREMENTREQUEST_MIN_LEN; |
| 4360 | pMeasReqFrame->measReqIE.measToken = mr.MeasurementRequest[0].measurement_token; |
| 4361 | pMeasReqFrame->measReqIE.measReqMode = ( mr.MeasurementRequest[0].reserved << 3 ) | |
| 4362 | ( mr.MeasurementRequest[0].enable << 2 ) | |
| 4363 | ( mr.MeasurementRequest[0].request << 1 ) | |
| 4364 | ( mr.MeasurementRequest[0].report /*<< 0*/ ); |
| 4365 | pMeasReqFrame->measReqIE.measType = mr.MeasurementRequest[0].measurement_type; |
| 4366 | |
| 4367 | pMeasReqFrame->measReqIE.measReqField.channelNumber = mr.MeasurementRequest[0].channel_no; |
| 4368 | |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4369 | vos_mem_copy( pMeasReqFrame->measReqIE.measReqField.measStartTime, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4370 | mr.MeasurementRequest[0].meas_start_time, 8 ); |
| 4371 | |
| 4372 | pMeasReqFrame->measReqIE.measReqField.measDuration = mr.MeasurementRequest[0].meas_duration; |
| 4373 | |
| 4374 | return eSIR_SUCCESS; |
| 4375 | |
| 4376 | } // End sirConvertMeasReqFrame2Struct. |
| 4377 | #endif |
| 4378 | |
| 4379 | |
| 4380 | void |
| 4381 | PopulateDot11fTSPEC(tSirMacTspecIE *pOld, |
| 4382 | tDot11fIETSPEC *pDot11f) |
| 4383 | { |
| 4384 | pDot11f->traffic_type = pOld->tsinfo.traffic.trafficType; |
| 4385 | pDot11f->tsid = pOld->tsinfo.traffic.tsid; |
| 4386 | pDot11f->direction = pOld->tsinfo.traffic.direction; |
| 4387 | pDot11f->access_policy = pOld->tsinfo.traffic.accessPolicy; |
| 4388 | pDot11f->aggregation = pOld->tsinfo.traffic.aggregation; |
| 4389 | pDot11f->psb = pOld->tsinfo.traffic.psb; |
| 4390 | pDot11f->user_priority = pOld->tsinfo.traffic.userPrio; |
| 4391 | pDot11f->tsinfo_ack_pol = pOld->tsinfo.traffic.ackPolicy; |
| 4392 | pDot11f->schedule = pOld->tsinfo.schedule.schedule; |
| 4393 | /* As defined in IEEE 802.11-2007, section 7.3.2.30 |
| 4394 | * Nominal MSDU size: Bit[0:14]=Size, Bit[15]=Fixed |
| 4395 | */ |
| 4396 | pDot11f->size = ( pOld->nomMsduSz & 0x7fff ); |
| 4397 | pDot11f->fixed = ( pOld->nomMsduSz & 0x8000 ) ? 1 : 0; |
| 4398 | pDot11f->max_msdu_size = pOld->maxMsduSz; |
| 4399 | pDot11f->min_service_int = pOld->minSvcInterval; |
| 4400 | pDot11f->max_service_int = pOld->maxSvcInterval; |
| 4401 | pDot11f->inactivity_int = pOld->inactInterval; |
| 4402 | pDot11f->suspension_int = pOld->suspendInterval; |
| 4403 | pDot11f->service_start_time = pOld->svcStartTime; |
| 4404 | pDot11f->min_data_rate = pOld->minDataRate; |
| 4405 | pDot11f->mean_data_rate = pOld->meanDataRate; |
| 4406 | pDot11f->peak_data_rate = pOld->peakDataRate; |
| 4407 | pDot11f->burst_size = pOld->maxBurstSz; |
| 4408 | pDot11f->delay_bound = pOld->delayBound; |
| 4409 | pDot11f->min_phy_rate = pOld->minPhyRate; |
| 4410 | pDot11f->surplus_bw_allowance = pOld->surplusBw; |
| 4411 | pDot11f->medium_time = pOld->mediumTime; |
| 4412 | |
| 4413 | pDot11f->present = 1; |
| 4414 | |
| 4415 | } // End PopulateDot11fTSPEC. |
| 4416 | |
| 4417 | void |
| 4418 | PopulateDot11fWMMTSPEC(tSirMacTspecIE *pOld, |
| 4419 | tDot11fIEWMMTSPEC *pDot11f) |
| 4420 | { |
| 4421 | pDot11f->traffic_type = pOld->tsinfo.traffic.trafficType; |
| 4422 | pDot11f->tsid = pOld->tsinfo.traffic.tsid; |
| 4423 | pDot11f->direction = pOld->tsinfo.traffic.direction; |
| 4424 | pDot11f->access_policy = pOld->tsinfo.traffic.accessPolicy; |
| 4425 | pDot11f->aggregation = pOld->tsinfo.traffic.aggregation; |
| 4426 | pDot11f->psb = pOld->tsinfo.traffic.psb; |
| 4427 | pDot11f->user_priority = pOld->tsinfo.traffic.userPrio; |
| 4428 | pDot11f->tsinfo_ack_pol = pOld->tsinfo.traffic.ackPolicy; |
| 4429 | pDot11f->burst_size_defn = pOld->tsinfo.traffic.burstSizeDefn; |
| 4430 | /* As defined in IEEE 802.11-2007, section 7.3.2.30 |
| 4431 | * Nominal MSDU size: Bit[0:14]=Size, Bit[15]=Fixed |
| 4432 | */ |
| 4433 | pDot11f->size = ( pOld->nomMsduSz & 0x7fff ); |
| 4434 | pDot11f->fixed = ( pOld->nomMsduSz & 0x8000 ) ? 1 : 0; |
| 4435 | pDot11f->max_msdu_size = pOld->maxMsduSz; |
| 4436 | pDot11f->min_service_int = pOld->minSvcInterval; |
| 4437 | pDot11f->max_service_int = pOld->maxSvcInterval; |
| 4438 | pDot11f->inactivity_int = pOld->inactInterval; |
| 4439 | pDot11f->suspension_int = pOld->suspendInterval; |
| 4440 | pDot11f->service_start_time = pOld->svcStartTime; |
| 4441 | pDot11f->min_data_rate = pOld->minDataRate; |
| 4442 | pDot11f->mean_data_rate = pOld->meanDataRate; |
| 4443 | pDot11f->peak_data_rate = pOld->peakDataRate; |
| 4444 | pDot11f->burst_size = pOld->maxBurstSz; |
| 4445 | pDot11f->delay_bound = pOld->delayBound; |
| 4446 | pDot11f->min_phy_rate = pOld->minPhyRate; |
| 4447 | pDot11f->surplus_bw_allowance = pOld->surplusBw; |
| 4448 | pDot11f->medium_time = pOld->mediumTime; |
| 4449 | |
| 4450 | pDot11f->version = 1; |
| 4451 | pDot11f->present = 1; |
| 4452 | |
| 4453 | } // End PopulateDot11fWMMTSPEC. |
| 4454 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4455 | #if defined(FEATURE_WLAN_ESE) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4456 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4457 | // Fill the ESE version currently supported |
| 4458 | void PopulateDot11fESEVersion(tDot11fIEESEVersion *pESEVersion) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4459 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4460 | pESEVersion->present = 1; |
| 4461 | pESEVersion->version = ESE_VERSION_SUPPORTED; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4462 | } |
| 4463 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4464 | // Fill the ESE ie for the station. |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4465 | // The State is Normal (1) |
| 4466 | // The MBSSID for station is set to 0. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4467 | void PopulateDot11fESERadMgmtCap(tDot11fIEESERadMgmtCap *pESERadMgmtCap) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4468 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4469 | pESERadMgmtCap->present = 1; |
| 4470 | pESERadMgmtCap->mgmt_state = RM_STATE_NORMAL; |
| 4471 | pESERadMgmtCap->mbssid_mask = 0; |
| 4472 | pESERadMgmtCap->reserved = 0; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4473 | } |
| 4474 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4475 | tSirRetStatus PopulateDot11fESECckmOpaque( tpAniSirGlobal pMac, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4476 | tpSirCCKMie pCCKMie, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4477 | tDot11fIEESECckmOpaque *pDot11f ) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4478 | { |
| 4479 | int idx; |
| 4480 | |
| 4481 | if ( pCCKMie->length ) |
| 4482 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4483 | if( 0 <= ( idx = FindIELocation( pMac, (tpSirRSNie)pCCKMie, DOT11F_EID_ESECCKMOPAQUE ) ) ) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4484 | { |
| 4485 | pDot11f->present = 1; |
| 4486 | pDot11f->num_data = pCCKMie->cckmIEdata[ idx + 1 ] - 4; // Dont include OUI |
Srinivas Girigowda | 6d1f906 | 2014-02-03 18:15:54 -0800 | [diff] [blame] | 4487 | vos_mem_copy(pDot11f->data, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4488 | pCCKMie->cckmIEdata + idx + 2 + 4, // EID, len, OUI |
| 4489 | pCCKMie->cckmIEdata[ idx + 1 ] - 4 ); // Skip OUI |
| 4490 | } |
| 4491 | } |
| 4492 | |
| 4493 | return eSIR_SUCCESS; |
| 4494 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4495 | } // End PopulateDot11fESECckmOpaque. |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4496 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4497 | void PopulateDot11TSRSIE(tpAniSirGlobal pMac, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4498 | tSirMacESETSRSIE *pOld, |
| 4499 | tDot11fIEESETrafStrmRateSet *pDot11f, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4500 | tANI_U8 rate_length) |
| 4501 | { |
| 4502 | pDot11f->tsid = pOld->tsid; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4503 | vos_mem_copy(pDot11f->tsrates, pOld->rates,rate_length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4504 | pDot11f->num_tsrates = rate_length; |
| 4505 | pDot11f->present = 1; |
| 4506 | } |
| 4507 | #endif |
| 4508 | |
| 4509 | |
| 4510 | tSirRetStatus |
| 4511 | PopulateDot11fTCLAS(tpAniSirGlobal pMac, |
| 4512 | tSirTclasInfo *pOld, |
| 4513 | tDot11fIETCLAS *pDot11f) |
| 4514 | { |
| 4515 | pDot11f->user_priority = pOld->tclas.userPrio; |
| 4516 | pDot11f->classifier_type = pOld->tclas.classifierType; |
| 4517 | pDot11f->classifier_mask = pOld->tclas.classifierMask; |
| 4518 | |
| 4519 | switch ( pDot11f->classifier_type ) |
| 4520 | { |
| 4521 | case SIR_MAC_TCLASTYPE_ETHERNET: |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4522 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.EthParams.source, |
| 4523 | ( tANI_U8* )&pOld->tclasParams.eth.srcAddr, 6 ); |
| 4524 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.EthParams.dest, |
| 4525 | ( tANI_U8* )&pOld->tclasParams.eth.dstAddr, 6 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4526 | pDot11f->info.EthParams.type = pOld->tclasParams.eth.type; |
| 4527 | break; |
| 4528 | case SIR_MAC_TCLASTYPE_TCPUDPIP: |
| 4529 | pDot11f->info.IpParams.version = pOld->version; |
| 4530 | if ( SIR_MAC_TCLAS_IPV4 == pDot11f->info.IpParams.version ) |
| 4531 | { |
Arun Kumar Khandavalli | 9558601 | 2014-02-25 12:09:40 +0530 | [diff] [blame] | 4532 | vos_mem_copy( pDot11f->info.IpParams.params. |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4533 | IpV4Params.source, |
Arun Kumar Khandavalli | 9558601 | 2014-02-25 12:09:40 +0530 | [diff] [blame] | 4534 | pOld->tclasParams.ipv4.srcIpAddr, 4 ); |
| 4535 | vos_mem_copy( pDot11f->info.IpParams.params. |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4536 | IpV4Params.dest, |
Arun Kumar Khandavalli | 9558601 | 2014-02-25 12:09:40 +0530 | [diff] [blame] | 4537 | pOld->tclasParams.ipv4.dstIpAddr, 4 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4538 | pDot11f->info.IpParams.params.IpV4Params.src_port = |
| 4539 | pOld->tclasParams.ipv4.srcPort; |
| 4540 | pDot11f->info.IpParams.params.IpV4Params.dest_port = |
| 4541 | pOld->tclasParams.ipv4.dstPort; |
| 4542 | pDot11f->info.IpParams.params.IpV4Params.DSCP = |
| 4543 | pOld->tclasParams.ipv4.dscp; |
| 4544 | pDot11f->info.IpParams.params.IpV4Params.proto = |
| 4545 | pOld->tclasParams.ipv4.protocol; |
| 4546 | pDot11f->info.IpParams.params.IpV4Params.reserved = |
| 4547 | pOld->tclasParams.ipv4.rsvd; |
| 4548 | } |
| 4549 | else |
| 4550 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4551 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.IpParams.params. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4552 | IpV6Params.source, |
| 4553 | ( tANI_U8* )pOld->tclasParams.ipv6.srcIpAddr, 16 ); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4554 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.IpParams.params. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4555 | IpV6Params.dest, |
| 4556 | ( tANI_U8* )pOld->tclasParams.ipv6.dstIpAddr, 16 ); |
| 4557 | pDot11f->info.IpParams.params.IpV6Params.src_port = |
| 4558 | pOld->tclasParams.ipv6.srcPort; |
| 4559 | pDot11f->info.IpParams.params.IpV6Params.dest_port = |
| 4560 | pOld->tclasParams.ipv6.dstPort; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4561 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.IpParams.params. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4562 | IpV6Params.flow_label, |
| 4563 | ( tANI_U8* )pOld->tclasParams.ipv6.flowLabel, 3 ); |
| 4564 | } |
| 4565 | break; |
| 4566 | case SIR_MAC_TCLASTYPE_8021DQ: |
| 4567 | pDot11f->info.Params8021dq.tag_type = pOld->tclasParams.t8021dq.tag; |
| 4568 | break; |
| 4569 | default: |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4570 | limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4571 | pDot11f->classifier_type ); |
| 4572 | return eSIR_FAILURE; |
| 4573 | } |
| 4574 | |
| 4575 | pDot11f->present = 1; |
| 4576 | |
| 4577 | return eSIR_SUCCESS; |
| 4578 | |
| 4579 | } // End PopulateDot11fTCLAS. |
| 4580 | |
| 4581 | tSirRetStatus |
| 4582 | PopulateDot11fWMMTCLAS(tpAniSirGlobal pMac, |
| 4583 | tSirTclasInfo *pOld, |
| 4584 | tDot11fIEWMMTCLAS *pDot11f) |
| 4585 | { |
| 4586 | pDot11f->version = 1; |
| 4587 | pDot11f->user_priority = pOld->tclas.userPrio; |
| 4588 | pDot11f->classifier_type = pOld->tclas.classifierType; |
| 4589 | pDot11f->classifier_mask = pOld->tclas.classifierMask; |
| 4590 | |
| 4591 | switch ( pDot11f->classifier_type ) |
| 4592 | { |
| 4593 | case SIR_MAC_TCLASTYPE_ETHERNET: |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4594 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.EthParams.source, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4595 | ( tANI_U8* )&pOld->tclasParams.eth.srcAddr, 6 ); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4596 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.EthParams.dest, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4597 | ( tANI_U8* )&pOld->tclasParams.eth.dstAddr, 6 ); |
| 4598 | pDot11f->info.EthParams.type = pOld->tclasParams.eth.type; |
| 4599 | break; |
| 4600 | case SIR_MAC_TCLASTYPE_TCPUDPIP: |
| 4601 | pDot11f->info.IpParams.version = pOld->version; |
| 4602 | if ( SIR_MAC_TCLAS_IPV4 == pDot11f->info.IpParams.version ) |
| 4603 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4604 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.IpParams.params. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4605 | IpV4Params.source, |
| 4606 | ( tANI_U8* )pOld->tclasParams.ipv4.srcIpAddr, 4 ); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4607 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.IpParams.params. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4608 | IpV4Params.dest, |
| 4609 | ( tANI_U8* )pOld->tclasParams.ipv4.dstIpAddr, 4 ); |
| 4610 | pDot11f->info.IpParams.params.IpV4Params.src_port = |
| 4611 | pOld->tclasParams.ipv4.srcPort; |
| 4612 | pDot11f->info.IpParams.params.IpV4Params.dest_port = |
| 4613 | pOld->tclasParams.ipv4.dstPort; |
| 4614 | pDot11f->info.IpParams.params.IpV4Params.DSCP = |
| 4615 | pOld->tclasParams.ipv4.dscp; |
| 4616 | pDot11f->info.IpParams.params.IpV4Params.proto = |
| 4617 | pOld->tclasParams.ipv4.protocol; |
| 4618 | pDot11f->info.IpParams.params.IpV4Params.reserved = |
| 4619 | pOld->tclasParams.ipv4.rsvd; |
| 4620 | } |
| 4621 | else |
| 4622 | { |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4623 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.IpParams.params. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4624 | IpV6Params.source, |
| 4625 | ( tANI_U8* )pOld->tclasParams.ipv6.srcIpAddr, 16 ); |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4626 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.IpParams.params. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4627 | IpV6Params.dest, |
| 4628 | ( tANI_U8* )pOld->tclasParams.ipv6.dstIpAddr, 16 ); |
| 4629 | pDot11f->info.IpParams.params.IpV6Params.src_port = |
| 4630 | pOld->tclasParams.ipv6.srcPort; |
| 4631 | pDot11f->info.IpParams.params.IpV6Params.dest_port = |
| 4632 | pOld->tclasParams.ipv6.dstPort; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4633 | vos_mem_copy( ( tANI_U8* )&pDot11f->info.IpParams.params. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4634 | IpV6Params.flow_label, |
| 4635 | ( tANI_U8* )pOld->tclasParams.ipv6.flowLabel, 3 ); |
| 4636 | } |
| 4637 | break; |
| 4638 | case SIR_MAC_TCLASTYPE_8021DQ: |
| 4639 | pDot11f->info.Params8021dq.tag_type = pOld->tclasParams.t8021dq.tag; |
| 4640 | break; |
| 4641 | default: |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4642 | limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4643 | pDot11f->classifier_type ); |
| 4644 | return eSIR_FAILURE; |
| 4645 | } |
| 4646 | |
| 4647 | pDot11f->present = 1; |
| 4648 | |
| 4649 | return eSIR_SUCCESS; |
| 4650 | |
| 4651 | } // End PopulateDot11fWMMTCLAS. |
| 4652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4653 | |
| 4654 | tSirRetStatus PopulateDot11fWsc(tpAniSirGlobal pMac, |
| 4655 | tDot11fIEWscBeacon *pDot11f) |
| 4656 | { |
| 4657 | |
| 4658 | tANI_U32 wpsState; |
| 4659 | |
| 4660 | pDot11f->Version.present = 1; |
| 4661 | pDot11f->Version.major = 0x01; |
| 4662 | pDot11f->Version.minor = 0x00; |
| 4663 | |
| 4664 | if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_STATE, &wpsState) != eSIR_SUCCESS) |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4665 | limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_STATE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4666 | |
| 4667 | pDot11f->WPSState.present = 1; |
| 4668 | pDot11f->WPSState.state = (tANI_U8) wpsState; |
| 4669 | |
| 4670 | pDot11f->APSetupLocked.present = 0; |
| 4671 | |
| 4672 | pDot11f->SelectedRegistrar.present = 0; |
| 4673 | |
| 4674 | pDot11f->DevicePasswordID.present = 0; |
| 4675 | |
| 4676 | pDot11f->SelectedRegistrarConfigMethods.present = 0; |
| 4677 | |
| 4678 | pDot11f->UUID_E.present = 0; |
| 4679 | |
| 4680 | pDot11f->RFBands.present = 0; |
| 4681 | |
| 4682 | pDot11f->present = 1; |
| 4683 | return eSIR_SUCCESS; |
| 4684 | } |
| 4685 | |
| 4686 | tSirRetStatus PopulateDot11fWscRegistrarInfo(tpAniSirGlobal pMac, |
| 4687 | tDot11fIEWscBeacon *pDot11f) |
| 4688 | { |
| 4689 | const struct sLimWscIeInfo *const pWscIeInfo = &(pMac->lim.wscIeInfo); |
| 4690 | tANI_U32 devicepasswdId; |
| 4691 | |
| 4692 | |
| 4693 | pDot11f->APSetupLocked.present = 1; |
| 4694 | pDot11f->APSetupLocked.fLocked = pWscIeInfo->apSetupLocked; |
| 4695 | |
| 4696 | pDot11f->SelectedRegistrar.present = 1; |
| 4697 | pDot11f->SelectedRegistrar.selected = pWscIeInfo->selectedRegistrar; |
| 4698 | |
| 4699 | if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_DEVICE_PASSWORD_ID, &devicepasswdId) != eSIR_SUCCESS) |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 4700 | limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_DEVICE_PASSWORD_ID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4701 | |
| 4702 | pDot11f->DevicePasswordID.present = 1; |
| 4703 | pDot11f->DevicePasswordID.id = (tANI_U16) devicepasswdId; |
| 4704 | |
| 4705 | pDot11f->SelectedRegistrarConfigMethods.present = 1; |
| 4706 | pDot11f->SelectedRegistrarConfigMethods.methods = pWscIeInfo->selectedRegistrarConfigMethods; |
| 4707 | |
| 4708 | // UUID_E and RF Bands are applicable only for dual band AP |
| 4709 | |
| 4710 | return eSIR_SUCCESS; |
| 4711 | } |
| 4712 | |
| 4713 | tSirRetStatus DePopulateDot11fWscRegistrarInfo(tpAniSirGlobal pMac, |
| 4714 | tDot11fIEWscBeacon *pDot11f) |
| 4715 | { |
| 4716 | pDot11f->APSetupLocked.present = 0; |
| 4717 | pDot11f->SelectedRegistrar.present = 0; |
| 4718 | pDot11f->DevicePasswordID.present = 0; |
| 4719 | pDot11f->SelectedRegistrarConfigMethods.present = 0; |
| 4720 | |
| 4721 | return eSIR_SUCCESS; |
| 4722 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4723 | tSirRetStatus PopulateDot11fProbeResWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscProbeRes *pDot11f, tpPESession psessionEntry) |
| 4724 | { |
| 4725 | |
| 4726 | tSirWPSProbeRspIE *pSirWPSProbeRspIE; |
| 4727 | |
| 4728 | pSirWPSProbeRspIE = &psessionEntry->APWPSIEs.SirWPSProbeRspIE; |
| 4729 | |
| 4730 | |
| 4731 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT) |
| 4732 | { |
| 4733 | pDot11f->present = 1; |
| 4734 | pDot11f->Version.present = 1; |
| 4735 | pDot11f->Version.major = (tANI_U8) ((pSirWPSProbeRspIE->Version & 0xF0)>>4); |
| 4736 | pDot11f->Version.minor = (tANI_U8) (pSirWPSProbeRspIE->Version & 0x0F); |
| 4737 | } |
| 4738 | else |
| 4739 | { |
| 4740 | pDot11f->present = 0; |
| 4741 | pDot11f->Version.present = 0; |
| 4742 | } |
| 4743 | |
| 4744 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_STATE_PRESENT) |
| 4745 | { |
| 4746 | |
| 4747 | pDot11f->WPSState.present = 1; |
| 4748 | pDot11f->WPSState.state = (tANI_U8)pSirWPSProbeRspIE->wpsState; |
| 4749 | } |
| 4750 | else |
| 4751 | pDot11f->WPSState.present = 0; |
| 4752 | |
| 4753 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT) |
| 4754 | { |
| 4755 | pDot11f->APSetupLocked.present = 1; |
| 4756 | pDot11f->APSetupLocked.fLocked = pSirWPSProbeRspIE->APSetupLocked; |
| 4757 | } |
| 4758 | else |
| 4759 | pDot11f->APSetupLocked.present = 0; |
| 4760 | |
| 4761 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT) |
| 4762 | { |
| 4763 | pDot11f->SelectedRegistrar.present = 1; |
| 4764 | pDot11f->SelectedRegistrar.selected = pSirWPSProbeRspIE->SelectedRegistra; |
| 4765 | } |
| 4766 | else |
| 4767 | pDot11f->SelectedRegistrar.present = 0; |
| 4768 | |
| 4769 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT) |
| 4770 | { |
| 4771 | pDot11f->DevicePasswordID.present = 1; |
| 4772 | pDot11f->DevicePasswordID.id = pSirWPSProbeRspIE->DevicePasswordID; |
| 4773 | } |
| 4774 | else |
| 4775 | pDot11f->DevicePasswordID.present = 0; |
| 4776 | |
| 4777 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT) |
| 4778 | { |
| 4779 | pDot11f->SelectedRegistrarConfigMethods.present = 1; |
| 4780 | pDot11f->SelectedRegistrarConfigMethods.methods = pSirWPSProbeRspIE->SelectedRegistraCfgMethod; |
| 4781 | } |
| 4782 | else |
| 4783 | pDot11f->SelectedRegistrarConfigMethods.present = 0; |
| 4784 | |
| 4785 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT) |
| 4786 | { |
| 4787 | pDot11f->ResponseType.present = 1; |
| 4788 | pDot11f->ResponseType.resType = pSirWPSProbeRspIE->ResponseType; |
| 4789 | } |
| 4790 | else |
| 4791 | pDot11f->ResponseType.present = 0; |
| 4792 | |
| 4793 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_UUIDE_PRESENT) |
| 4794 | { |
| 4795 | pDot11f->UUID_E.present = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4796 | vos_mem_copy(pDot11f->UUID_E.uuid, pSirWPSProbeRspIE->UUID_E, WNI_CFG_WPS_UUID_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4797 | } |
| 4798 | else |
| 4799 | pDot11f->UUID_E.present = 0; |
| 4800 | |
| 4801 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MANUFACTURE_PRESENT) |
| 4802 | { |
| 4803 | pDot11f->Manufacturer.present = 1; |
| 4804 | pDot11f->Manufacturer.num_name = pSirWPSProbeRspIE->Manufacture.num_name; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4805 | vos_mem_copy(pDot11f->Manufacturer.name, pSirWPSProbeRspIE->Manufacture.name, |
| 4806 | pSirWPSProbeRspIE->Manufacture.num_name); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4807 | } |
| 4808 | else |
| 4809 | pDot11f->Manufacturer.present = 0; |
| 4810 | |
| 4811 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MODELNUMBER_PRESENT) |
| 4812 | { |
| 4813 | pDot11f->ModelName.present = 1; |
| 4814 | pDot11f->ModelName.num_text = pSirWPSProbeRspIE->ModelName.num_text; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4815 | vos_mem_copy(pDot11f->ModelName.text, pSirWPSProbeRspIE->ModelName.text, |
| 4816 | pDot11f->ModelName.num_text); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4817 | } |
| 4818 | else |
| 4819 | pDot11f->ModelName.present = 0; |
| 4820 | |
| 4821 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MODELNUMBER_PRESENT) |
| 4822 | { |
| 4823 | pDot11f->ModelNumber.present = 1; |
| 4824 | pDot11f->ModelNumber.num_text = pSirWPSProbeRspIE->ModelNumber.num_text; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4825 | vos_mem_copy(pDot11f->ModelNumber.text, pSirWPSProbeRspIE->ModelNumber.text, |
| 4826 | pDot11f->ModelNumber.num_text); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4827 | } |
| 4828 | else |
| 4829 | pDot11f->ModelNumber.present = 0; |
| 4830 | |
| 4831 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT) |
| 4832 | { |
| 4833 | pDot11f->SerialNumber.present = 1; |
| 4834 | pDot11f->SerialNumber.num_text = pSirWPSProbeRspIE->SerialNumber.num_text; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4835 | vos_mem_copy(pDot11f->SerialNumber.text, pSirWPSProbeRspIE->SerialNumber.text, |
| 4836 | pDot11f->SerialNumber.num_text); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4837 | } |
| 4838 | else |
| 4839 | pDot11f->SerialNumber.present = 0; |
| 4840 | |
| 4841 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT) |
| 4842 | { |
| 4843 | pDot11f->PrimaryDeviceType.present = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4844 | vos_mem_copy(pDot11f->PrimaryDeviceType.oui, pSirWPSProbeRspIE->PrimaryDeviceOUI, |
| 4845 | sizeof(pSirWPSProbeRspIE->PrimaryDeviceOUI)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4846 | pDot11f->PrimaryDeviceType.primary_category = (tANI_U16)pSirWPSProbeRspIE->PrimaryDeviceCategory; |
| 4847 | pDot11f->PrimaryDeviceType.sub_category = (tANI_U16)pSirWPSProbeRspIE->DeviceSubCategory; |
| 4848 | } |
| 4849 | else |
| 4850 | pDot11f->PrimaryDeviceType.present = 0; |
| 4851 | |
| 4852 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_DEVICENAME_PRESENT) |
| 4853 | { |
| 4854 | pDot11f->DeviceName.present = 1; |
| 4855 | pDot11f->DeviceName.num_text = pSirWPSProbeRspIE->DeviceName.num_text; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4856 | vos_mem_copy(pDot11f->DeviceName.text, pSirWPSProbeRspIE->DeviceName.text, |
| 4857 | pDot11f->DeviceName.num_text); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4858 | } |
| 4859 | else |
| 4860 | pDot11f->DeviceName.present = 0; |
| 4861 | |
| 4862 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT) |
| 4863 | { |
| 4864 | pDot11f->ConfigMethods.present = 1; |
| 4865 | pDot11f->ConfigMethods.methods = pSirWPSProbeRspIE->ConfigMethod; |
| 4866 | } |
| 4867 | else |
| 4868 | pDot11f->ConfigMethods.present = 0; |
| 4869 | |
| 4870 | |
| 4871 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RF_BANDS_PRESENT) |
| 4872 | { |
| 4873 | pDot11f->RFBands.present = 1; |
| 4874 | pDot11f->RFBands.bands = pSirWPSProbeRspIE->RFBand; |
| 4875 | } |
| 4876 | else |
| 4877 | pDot11f->RFBands.present = 0; |
| 4878 | |
| 4879 | return eSIR_SUCCESS; |
| 4880 | } |
| 4881 | tSirRetStatus PopulateDot11fAssocResWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscAssocRes *pDot11f, tpPESession psessionEntry) |
| 4882 | { |
| 4883 | tSirWPSProbeRspIE *pSirWPSProbeRspIE; |
| 4884 | |
| 4885 | pSirWPSProbeRspIE = &psessionEntry->APWPSIEs.SirWPSProbeRspIE; |
| 4886 | |
| 4887 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT) |
| 4888 | { |
| 4889 | pDot11f->present = 1; |
| 4890 | pDot11f->Version.present = 1; |
| 4891 | pDot11f->Version.major = (tANI_U8) ((pSirWPSProbeRspIE->Version & 0xF0)>>4); |
| 4892 | pDot11f->Version.minor = (tANI_U8) (pSirWPSProbeRspIE->Version & 0x0F); |
| 4893 | } |
| 4894 | else |
| 4895 | { |
| 4896 | pDot11f->present = 0; |
| 4897 | pDot11f->Version.present = 0; |
| 4898 | } |
| 4899 | |
| 4900 | if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT) |
| 4901 | { |
| 4902 | pDot11f->ResponseType.present = 1; |
| 4903 | pDot11f->ResponseType.resType = pSirWPSProbeRspIE->ResponseType; |
| 4904 | } |
| 4905 | else |
| 4906 | pDot11f->ResponseType.present = 0; |
| 4907 | |
| 4908 | return eSIR_SUCCESS; |
| 4909 | } |
| 4910 | |
| 4911 | tSirRetStatus PopulateDot11fBeaconWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscBeacon *pDot11f, tpPESession psessionEntry) |
| 4912 | { |
| 4913 | |
| 4914 | tSirWPSBeaconIE *pSirWPSBeaconIE; |
| 4915 | |
| 4916 | pSirWPSBeaconIE = &psessionEntry->APWPSIEs.SirWPSBeaconIE; |
| 4917 | |
| 4918 | |
| 4919 | if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT) |
| 4920 | { |
| 4921 | pDot11f->present = 1; |
| 4922 | pDot11f->Version.present = 1; |
| 4923 | pDot11f->Version.major = (tANI_U8) ((pSirWPSBeaconIE->Version & 0xF0)>>4); |
| 4924 | pDot11f->Version.minor = (tANI_U8) (pSirWPSBeaconIE->Version & 0x0F); |
| 4925 | } |
| 4926 | else |
| 4927 | { |
| 4928 | pDot11f->present = 0; |
| 4929 | pDot11f->Version.present = 0; |
| 4930 | } |
| 4931 | |
| 4932 | if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_STATE_PRESENT) |
| 4933 | { |
| 4934 | |
| 4935 | pDot11f->WPSState.present = 1; |
| 4936 | pDot11f->WPSState.state = (tANI_U8)pSirWPSBeaconIE->wpsState; |
| 4937 | } |
| 4938 | else |
| 4939 | pDot11f->WPSState.present = 0; |
| 4940 | |
| 4941 | if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_APSETUPLOCK_PRESENT) |
| 4942 | { |
| 4943 | pDot11f->APSetupLocked.present = 1; |
| 4944 | pDot11f->APSetupLocked.fLocked = pSirWPSBeaconIE->APSetupLocked; |
| 4945 | } |
| 4946 | else |
| 4947 | pDot11f->APSetupLocked.present = 0; |
| 4948 | |
| 4949 | if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT) |
| 4950 | { |
| 4951 | pDot11f->SelectedRegistrar.present = 1; |
| 4952 | pDot11f->SelectedRegistrar.selected = pSirWPSBeaconIE->SelectedRegistra; |
| 4953 | } |
| 4954 | else |
| 4955 | pDot11f->SelectedRegistrar.present = 0; |
| 4956 | |
| 4957 | if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT) |
| 4958 | { |
| 4959 | pDot11f->DevicePasswordID.present = 1; |
| 4960 | pDot11f->DevicePasswordID.id = pSirWPSBeaconIE->DevicePasswordID; |
| 4961 | } |
| 4962 | else |
| 4963 | pDot11f->DevicePasswordID.present = 0; |
| 4964 | |
| 4965 | if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT) |
| 4966 | { |
| 4967 | pDot11f->SelectedRegistrarConfigMethods.present = 1; |
| 4968 | pDot11f->SelectedRegistrarConfigMethods.methods = pSirWPSBeaconIE->SelectedRegistraCfgMethod; |
| 4969 | } |
| 4970 | else |
| 4971 | pDot11f->SelectedRegistrarConfigMethods.present = 0; |
| 4972 | |
| 4973 | if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_UUIDE_PRESENT) |
| 4974 | { |
| 4975 | pDot11f->UUID_E.present = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 4976 | vos_mem_copy(pDot11f->UUID_E.uuid, pSirWPSBeaconIE->UUID_E, WNI_CFG_WPS_UUID_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4977 | } |
| 4978 | else |
| 4979 | pDot11f->UUID_E.present = 0; |
| 4980 | |
| 4981 | |
| 4982 | if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_RF_BANDS_PRESENT) |
| 4983 | { |
| 4984 | pDot11f->RFBands.present = 1; |
| 4985 | pDot11f->RFBands.bands = pSirWPSBeaconIE->RFBand; |
| 4986 | } |
| 4987 | else |
| 4988 | pDot11f->RFBands.present = 0; |
| 4989 | |
| 4990 | return eSIR_SUCCESS; |
| 4991 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4992 | tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac, |
| 4993 | tDot11fIEWscProbeRes *pDot11f) |
| 4994 | { |
| 4995 | tANI_U32 cfgMethods; |
| 4996 | tANI_U32 cfgStrLen; |
| 4997 | tANI_U32 val; |
| 4998 | tANI_U32 wpsVersion, wpsState; |
| 4999 | |
| 5000 | |
| 5001 | if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_VERSION, &wpsVersion) != eSIR_SUCCESS) |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 5002 | limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_VERSION ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5003 | |
| 5004 | pDot11f->Version.present = 1; |
| 5005 | pDot11f->Version.major = (tANI_U8) ((wpsVersion & 0xF0)>>4); |
| 5006 | pDot11f->Version.minor = (tANI_U8) (wpsVersion & 0x0F); |
| 5007 | |
| 5008 | if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_STATE, &wpsState) != eSIR_SUCCESS) |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 5009 | limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_STATE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5010 | |
| 5011 | pDot11f->WPSState.present = 1; |
| 5012 | pDot11f->WPSState.state = (tANI_U8) wpsState; |
| 5013 | |
| 5014 | pDot11f->APSetupLocked.present = 0; |
| 5015 | |
| 5016 | pDot11f->SelectedRegistrar.present = 0; |
| 5017 | |
| 5018 | pDot11f->DevicePasswordID.present = 0; |
| 5019 | |
| 5020 | pDot11f->SelectedRegistrarConfigMethods.present = 0; |
| 5021 | |
| 5022 | pDot11f->ResponseType.present = 1; |
| 5023 | if ((pMac->lim.wscIeInfo.reqType == REQ_TYPE_REGISTRAR) || |
| 5024 | (pMac->lim.wscIeInfo.reqType == REQ_TYPE_WLAN_MANAGER_REGISTRAR)){ |
| 5025 | pDot11f->ResponseType.resType = RESP_TYPE_ENROLLEE_OPEN_8021X; |
| 5026 | } |
| 5027 | else{ |
| 5028 | pDot11f->ResponseType.resType = RESP_TYPE_AP; |
| 5029 | } |
| 5030 | |
| 5031 | /* UUID is a 16 byte long binary. Still use wlan_cfgGetStr to get it. */ |
| 5032 | pDot11f->UUID_E.present = 1; |
| 5033 | cfgStrLen = WNI_CFG_WPS_UUID_LEN; |
| 5034 | if (wlan_cfgGetStr(pMac, |
| 5035 | WNI_CFG_WPS_UUID, |
| 5036 | pDot11f->UUID_E.uuid, |
| 5037 | &cfgStrLen) != eSIR_SUCCESS) |
| 5038 | { |
| 5039 | *(pDot11f->UUID_E.uuid) = '\0'; |
| 5040 | } |
| 5041 | |
| 5042 | pDot11f->Manufacturer.present = 1; |
| 5043 | cfgStrLen = WNI_CFG_MANUFACTURER_NAME_LEN - 1; |
| 5044 | if (wlan_cfgGetStr(pMac, |
| 5045 | WNI_CFG_MANUFACTURER_NAME, |
| 5046 | pDot11f->Manufacturer.name, |
| 5047 | &cfgStrLen) != eSIR_SUCCESS) |
| 5048 | { |
| 5049 | pDot11f->Manufacturer.num_name = 0; |
| 5050 | *(pDot11f->Manufacturer.name) = '\0'; |
| 5051 | } |
| 5052 | else |
| 5053 | { |
| 5054 | pDot11f->Manufacturer.num_name = (tANI_U8) (cfgStrLen & 0x000000FF); |
Sushant Kaushik | 4fed1e3 | 2015-02-21 12:43:46 +0530 | [diff] [blame] | 5055 | pDot11f->Manufacturer.name[cfgStrLen - 1] = '\0'; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5056 | } |
| 5057 | |
| 5058 | pDot11f->ModelName.present = 1; |
| 5059 | cfgStrLen = WNI_CFG_MODEL_NAME_LEN - 1; |
| 5060 | if (wlan_cfgGetStr(pMac, |
| 5061 | WNI_CFG_MODEL_NAME, |
| 5062 | pDot11f->ModelName.text, |
| 5063 | &cfgStrLen) != eSIR_SUCCESS) |
| 5064 | { |
| 5065 | pDot11f->ModelName.num_text = 0; |
| 5066 | *(pDot11f->ModelName.text) = '\0'; |
| 5067 | } |
| 5068 | else |
| 5069 | { |
| 5070 | pDot11f->ModelName.num_text = (tANI_U8) (cfgStrLen & 0x000000FF); |
Sushant Kaushik | 4fed1e3 | 2015-02-21 12:43:46 +0530 | [diff] [blame] | 5071 | pDot11f->ModelName.text[cfgStrLen - 1] = '\0'; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5072 | } |
| 5073 | |
| 5074 | pDot11f->ModelNumber.present = 1; |
| 5075 | cfgStrLen = WNI_CFG_MODEL_NUMBER_LEN - 1; |
| 5076 | if (wlan_cfgGetStr(pMac, |
| 5077 | WNI_CFG_MODEL_NUMBER, |
| 5078 | pDot11f->ModelNumber.text, |
| 5079 | &cfgStrLen) != eSIR_SUCCESS) |
| 5080 | { |
| 5081 | pDot11f->ModelNumber.num_text = 0; |
| 5082 | *(pDot11f->ModelNumber.text) = '\0'; |
| 5083 | } |
| 5084 | else |
| 5085 | { |
| 5086 | pDot11f->ModelNumber.num_text = (tANI_U8) (cfgStrLen & 0x000000FF); |
Sushant Kaushik | 4fed1e3 | 2015-02-21 12:43:46 +0530 | [diff] [blame] | 5087 | pDot11f->ModelNumber.text[cfgStrLen - 1] = '\0'; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5088 | } |
| 5089 | |
| 5090 | pDot11f->SerialNumber.present = 1; |
| 5091 | cfgStrLen = WNI_CFG_MANUFACTURER_PRODUCT_VERSION_LEN - 1; |
| 5092 | if (wlan_cfgGetStr(pMac, |
| 5093 | WNI_CFG_MANUFACTURER_PRODUCT_VERSION, |
| 5094 | pDot11f->SerialNumber.text, |
| 5095 | &cfgStrLen) != eSIR_SUCCESS) |
| 5096 | { |
| 5097 | pDot11f->SerialNumber.num_text = 0; |
| 5098 | *(pDot11f->SerialNumber.text) = '\0'; |
| 5099 | } |
| 5100 | else |
| 5101 | { |
| 5102 | pDot11f->SerialNumber.num_text = (tANI_U8) (cfgStrLen & 0x000000FF); |
Sushant Kaushik | 4fed1e3 | 2015-02-21 12:43:46 +0530 | [diff] [blame] | 5103 | pDot11f->SerialNumber.text[cfgStrLen - 1] = '\0'; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5104 | } |
| 5105 | |
| 5106 | pDot11f->PrimaryDeviceType.present = 1; |
| 5107 | |
| 5108 | if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY, &val) != eSIR_SUCCESS) |
| 5109 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 5110 | limLog(pMac, LOGP, FL("cfg get prim device category failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5111 | } |
| 5112 | else |
| 5113 | pDot11f->PrimaryDeviceType.primary_category = (tANI_U16) val; |
| 5114 | |
| 5115 | if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_PIMARY_DEVICE_OUI, &val) != eSIR_SUCCESS) |
| 5116 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 5117 | limLog(pMac, LOGP, FL("cfg get prim device OUI failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5118 | } |
| 5119 | else |
| 5120 | { |
| 5121 | *(pDot11f->PrimaryDeviceType.oui) = (tANI_U8)((val >> 24)& 0xff); |
| 5122 | *(pDot11f->PrimaryDeviceType.oui+1) = (tANI_U8)((val >> 16)& 0xff); |
| 5123 | *(pDot11f->PrimaryDeviceType.oui+2) = (tANI_U8)((val >> 8)& 0xff); |
| 5124 | *(pDot11f->PrimaryDeviceType.oui+3) = (tANI_U8)((val & 0xff)); |
| 5125 | } |
| 5126 | |
| 5127 | if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_DEVICE_SUB_CATEGORY, &val) != eSIR_SUCCESS) |
| 5128 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 5129 | limLog(pMac, LOGP, FL("cfg get prim device sub category failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5130 | } |
| 5131 | else |
| 5132 | pDot11f->PrimaryDeviceType.sub_category = (tANI_U16) val; |
| 5133 | |
| 5134 | pDot11f->DeviceName.present = 1; |
| 5135 | cfgStrLen = WNI_CFG_MANUFACTURER_PRODUCT_NAME_LEN - 1; |
| 5136 | if (wlan_cfgGetStr(pMac, |
| 5137 | WNI_CFG_MANUFACTURER_PRODUCT_NAME, |
| 5138 | pDot11f->DeviceName.text, |
| 5139 | &cfgStrLen) != eSIR_SUCCESS) |
| 5140 | { |
| 5141 | pDot11f->DeviceName.num_text = 0; |
| 5142 | *(pDot11f->DeviceName.text) = '\0'; |
| 5143 | } |
| 5144 | else |
| 5145 | { |
| 5146 | pDot11f->DeviceName.num_text = (tANI_U8) (cfgStrLen & 0x000000FF); |
Sushant Kaushik | 4fed1e3 | 2015-02-21 12:43:46 +0530 | [diff] [blame] | 5147 | pDot11f->DeviceName.text[cfgStrLen - 1] = '\0'; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5148 | } |
| 5149 | |
| 5150 | if (wlan_cfgGetInt(pMac, |
| 5151 | WNI_CFG_WPS_CFG_METHOD, |
| 5152 | &cfgMethods) != eSIR_SUCCESS) |
| 5153 | { |
| 5154 | pDot11f->ConfigMethods.present = 0; |
| 5155 | pDot11f->ConfigMethods.methods = 0; |
| 5156 | } |
| 5157 | else |
| 5158 | { |
| 5159 | pDot11f->ConfigMethods.present = 1; |
| 5160 | pDot11f->ConfigMethods.methods = (tANI_U16) (cfgMethods & 0x0000FFFF); |
| 5161 | } |
| 5162 | |
| 5163 | pDot11f->RFBands.present = 0; |
| 5164 | |
| 5165 | pDot11f->present = 1; |
| 5166 | return eSIR_SUCCESS; |
| 5167 | } |
| 5168 | |
| 5169 | tSirRetStatus PopulateDot11fWscRegistrarInfoInProbeRes(tpAniSirGlobal pMac, |
| 5170 | tDot11fIEWscProbeRes *pDot11f) |
| 5171 | { |
| 5172 | const struct sLimWscIeInfo *const pWscIeInfo = &(pMac->lim.wscIeInfo); |
| 5173 | tANI_U32 devicepasswdId; |
| 5174 | |
| 5175 | pDot11f->APSetupLocked.present = 1; |
| 5176 | pDot11f->APSetupLocked.fLocked = pWscIeInfo->apSetupLocked; |
| 5177 | |
| 5178 | pDot11f->SelectedRegistrar.present = 1; |
| 5179 | pDot11f->SelectedRegistrar.selected = pWscIeInfo->selectedRegistrar; |
| 5180 | |
| 5181 | if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_DEVICE_PASSWORD_ID, &devicepasswdId) != eSIR_SUCCESS) |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 5182 | limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_DEVICE_PASSWORD_ID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5183 | |
| 5184 | pDot11f->DevicePasswordID.present = 1; |
| 5185 | pDot11f->DevicePasswordID.id = (tANI_U16) devicepasswdId; |
| 5186 | |
| 5187 | pDot11f->SelectedRegistrarConfigMethods.present = 1; |
| 5188 | pDot11f->SelectedRegistrarConfigMethods.methods = pWscIeInfo->selectedRegistrarConfigMethods; |
| 5189 | |
| 5190 | // UUID_E and RF Bands are applicable only for dual band AP |
| 5191 | |
| 5192 | return eSIR_SUCCESS; |
| 5193 | } |
| 5194 | |
| 5195 | tSirRetStatus DePopulateDot11fWscRegistrarInfoInProbeRes(tpAniSirGlobal pMac, |
| 5196 | tDot11fIEWscProbeRes *pDot11f) |
| 5197 | { |
| 5198 | pDot11f->APSetupLocked.present = 0; |
| 5199 | pDot11f->SelectedRegistrar.present = 0; |
| 5200 | pDot11f->DevicePasswordID.present = 0; |
| 5201 | pDot11f->SelectedRegistrarConfigMethods.present = 0; |
| 5202 | |
| 5203 | return eSIR_SUCCESS; |
| 5204 | } |
| 5205 | |
| 5206 | tSirRetStatus PopulateDot11fAssocResWscIE(tpAniSirGlobal pMac, |
| 5207 | tDot11fIEWscAssocRes *pDot11f, |
| 5208 | tpSirAssocReq pRcvdAssocReq) |
| 5209 | { |
| 5210 | tDot11fIEWscAssocReq parsedWscAssocReq = { 0, }; |
| 5211 | tANI_U8 *wscIe; |
| 5212 | |
| 5213 | |
| 5214 | wscIe = limGetWscIEPtr(pMac, pRcvdAssocReq->addIE.addIEdata, pRcvdAssocReq->addIE.length); |
| 5215 | if(wscIe != NULL) |
| 5216 | { |
| 5217 | // retreive WSC IE from given AssocReq |
| 5218 | dot11fUnpackIeWscAssocReq( pMac, |
| 5219 | wscIe + 2 + 4, // EID, length, OUI |
| 5220 | wscIe[ 1 ] - 4, // length without OUI |
| 5221 | &parsedWscAssocReq ); |
| 5222 | pDot11f->present = 1; |
| 5223 | // version has to be 0x10 |
| 5224 | pDot11f->Version.present = 1; |
| 5225 | pDot11f->Version.major = 0x1; |
| 5226 | pDot11f->Version.minor = 0x0; |
| 5227 | |
| 5228 | pDot11f->ResponseType.present = 1; |
| 5229 | |
| 5230 | if ((parsedWscAssocReq.RequestType.reqType == REQ_TYPE_REGISTRAR) || |
| 5231 | (parsedWscAssocReq.RequestType.reqType == REQ_TYPE_WLAN_MANAGER_REGISTRAR)) |
| 5232 | { |
| 5233 | pDot11f->ResponseType.resType = RESP_TYPE_ENROLLEE_OPEN_8021X; |
| 5234 | } |
| 5235 | else |
| 5236 | { |
| 5237 | pDot11f->ResponseType.resType = RESP_TYPE_AP; |
| 5238 | } |
| 5239 | // Version infomration should be taken from our capability as well as peers |
| 5240 | // TODO: currently it takes from peers only |
| 5241 | if(parsedWscAssocReq.VendorExtension.present && |
| 5242 | parsedWscAssocReq.VendorExtension.Version2.present) |
| 5243 | { |
| 5244 | pDot11f->VendorExtension.present = 1; |
| 5245 | pDot11f->VendorExtension.vendorId[0] = 0x00; |
| 5246 | pDot11f->VendorExtension.vendorId[1] = 0x37; |
| 5247 | pDot11f->VendorExtension.vendorId[2] = 0x2A; |
| 5248 | pDot11f->VendorExtension.Version2.present = 1; |
| 5249 | pDot11f->VendorExtension.Version2.major = parsedWscAssocReq.VendorExtension.Version2.major; |
| 5250 | pDot11f->VendorExtension.Version2.minor = parsedWscAssocReq.VendorExtension.Version2.minor; |
| 5251 | } |
| 5252 | } |
| 5253 | return eSIR_SUCCESS; |
| 5254 | } |
| 5255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5256 | tSirRetStatus PopulateDot11AssocResP2PIE(tpAniSirGlobal pMac, |
| 5257 | tDot11fIEP2PAssocRes *pDot11f, |
| 5258 | tpSirAssocReq pRcvdAssocReq) |
| 5259 | { |
| 5260 | tANI_U8 *p2pIe; |
| 5261 | |
| 5262 | p2pIe = limGetP2pIEPtr(pMac, pRcvdAssocReq->addIE.addIEdata, pRcvdAssocReq->addIE.length); |
| 5263 | if(p2pIe != NULL) |
| 5264 | { |
| 5265 | pDot11f->present = 1; |
| 5266 | pDot11f->P2PStatus.present = 1; |
| 5267 | pDot11f->P2PStatus.status = eSIR_SUCCESS; |
| 5268 | pDot11f->ExtendedListenTiming.present = 0; |
| 5269 | } |
| 5270 | return eSIR_SUCCESS; |
| 5271 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5272 | |
| 5273 | #if defined WLAN_FEATURE_VOWIFI |
| 5274 | |
| 5275 | tSirRetStatus PopulateDot11fWFATPC( tpAniSirGlobal pMac, |
| 5276 | tDot11fIEWFATPC *pDot11f, tANI_U8 txPower, tANI_U8 linkMargin ) |
| 5277 | { |
| 5278 | pDot11f->txPower = txPower; |
| 5279 | pDot11f->linkMargin = linkMargin; |
| 5280 | pDot11f->present = 1; |
| 5281 | |
| 5282 | return eSIR_SUCCESS; |
| 5283 | } |
| 5284 | |
| 5285 | tSirRetStatus PopulateDot11fBeaconReport( tpAniSirGlobal pMac, tDot11fIEMeasurementReport *pDot11f, tSirMacBeaconReport *pBeaconReport ) |
| 5286 | { |
| 5287 | |
| 5288 | pDot11f->report.Beacon.regClass = pBeaconReport->regClass; |
| 5289 | pDot11f->report.Beacon.channel = pBeaconReport->channel; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 5290 | vos_mem_copy( pDot11f->report.Beacon.meas_start_time, pBeaconReport->measStartTime, |
| 5291 | sizeof(pDot11f->report.Beacon.meas_start_time) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5292 | pDot11f->report.Beacon.meas_duration = pBeaconReport->measDuration; |
| 5293 | pDot11f->report.Beacon.condensed_PHY = pBeaconReport->phyType; |
| 5294 | pDot11f->report.Beacon.reported_frame_type = !pBeaconReport->bcnProbeRsp; |
| 5295 | pDot11f->report.Beacon.RCPI = pBeaconReport->rcpi; |
| 5296 | pDot11f->report.Beacon.RSNI = pBeaconReport->rsni; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 5297 | vos_mem_copy( pDot11f->report.Beacon.BSSID, pBeaconReport->bssid, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5298 | pDot11f->report.Beacon.antenna_id = pBeaconReport->antennaId; |
| 5299 | pDot11f->report.Beacon.parent_TSF = pBeaconReport->parentTSF; |
| 5300 | |
| 5301 | if( pBeaconReport->numIes ) |
| 5302 | { |
| 5303 | pDot11f->report.Beacon.BeaconReportFrmBody.present = 1; |
Bansidhar Gopalachari | 0a96a38 | 2013-07-24 16:55:34 +0530 | [diff] [blame] | 5304 | vos_mem_copy( pDot11f->report.Beacon.BeaconReportFrmBody.reportedFields, |
| 5305 | pBeaconReport->Ies, pBeaconReport->numIes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5306 | pDot11f->report.Beacon.BeaconReportFrmBody.num_reportedFields = pBeaconReport->numIes; |
| 5307 | } |
| 5308 | |
| 5309 | return eSIR_SUCCESS; |
| 5310 | |
| 5311 | } |
| 5312 | |
| 5313 | tSirRetStatus PopulateDot11fRRMIe( tpAniSirGlobal pMac, tDot11fIERRMEnabledCap *pDot11f, tpPESession psessionEntry ) |
| 5314 | { |
| 5315 | tpRRMCaps pRrmCaps; |
| 5316 | |
| 5317 | pRrmCaps = rrmGetCapabilities( pMac, psessionEntry ); |
| 5318 | |
| 5319 | pDot11f->LinkMeasurement = pRrmCaps->LinkMeasurement ; |
| 5320 | pDot11f->NeighborRpt = pRrmCaps->NeighborRpt ; |
| 5321 | pDot11f->parallel = pRrmCaps->parallel ; |
| 5322 | pDot11f->repeated = pRrmCaps->repeated ; |
| 5323 | pDot11f->BeaconPassive = pRrmCaps->BeaconPassive ; |
| 5324 | pDot11f->BeaconActive = pRrmCaps->BeaconActive ; |
| 5325 | pDot11f->BeaconTable = pRrmCaps->BeaconTable ; |
| 5326 | pDot11f->BeaconRepCond = pRrmCaps->BeaconRepCond ; |
| 5327 | pDot11f->FrameMeasurement = pRrmCaps->FrameMeasurement ; |
| 5328 | pDot11f->ChannelLoad = pRrmCaps->ChannelLoad ; |
| 5329 | pDot11f->NoiseHistogram = pRrmCaps->NoiseHistogram ; |
| 5330 | pDot11f->statistics = pRrmCaps->statistics ; |
| 5331 | pDot11f->LCIMeasurement = pRrmCaps->LCIMeasurement ; |
| 5332 | pDot11f->LCIAzimuth = pRrmCaps->LCIAzimuth ; |
| 5333 | pDot11f->TCMCapability = pRrmCaps->TCMCapability ; |
| 5334 | pDot11f->triggeredTCM = pRrmCaps->triggeredTCM ; |
| 5335 | pDot11f->APChanReport = pRrmCaps->APChanReport ; |
| 5336 | pDot11f->RRMMIBEnabled = pRrmCaps->RRMMIBEnabled ; |
| 5337 | pDot11f->operatingChanMax = pRrmCaps->operatingChanMax ; |
| 5338 | pDot11f->nonOperatinChanMax = pRrmCaps->nonOperatingChanMax ; |
| 5339 | pDot11f->MeasurementPilot = pRrmCaps->MeasurementPilot ; |
| 5340 | pDot11f->MeasurementPilotEnabled = pRrmCaps->MeasurementPilotEnabled ; |
| 5341 | pDot11f->NeighborTSFOffset = pRrmCaps->NeighborTSFOffset ; |
| 5342 | pDot11f->RCPIMeasurement = pRrmCaps->RCPIMeasurement ; |
| 5343 | pDot11f->RSNIMeasurement = pRrmCaps->RSNIMeasurement ; |
| 5344 | pDot11f->BssAvgAccessDelay = pRrmCaps->BssAvgAccessDelay ; |
| 5345 | pDot11f->BSSAvailAdmission = pRrmCaps->BSSAvailAdmission ; |
| 5346 | pDot11f->AntennaInformation = pRrmCaps->AntennaInformation ; |
| 5347 | |
| 5348 | pDot11f->present = 1; |
| 5349 | return eSIR_SUCCESS; |
| 5350 | } |
| 5351 | #endif |
| 5352 | |
| 5353 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 5354 | void PopulateMDIE( tpAniSirGlobal pMac, |
| 5355 | tDot11fIEMobilityDomain *pDot11f, tANI_U8 mdie[SIR_MDIE_SIZE] ) |
| 5356 | { |
| 5357 | pDot11f->present = 1; |
| 5358 | pDot11f->MDID = (tANI_U16)((mdie[1] << 8) | (mdie[0])); |
| 5359 | |
| 5360 | // Plugfest fix |
| 5361 | pDot11f->overDSCap = (mdie[2] & 0x01); |
| 5362 | pDot11f->resourceReqCap = ((mdie[2] >> 1) & 0x01); |
| 5363 | |
| 5364 | } |
| 5365 | |
| 5366 | void PopulateFTInfo( tpAniSirGlobal pMac, |
| 5367 | tDot11fIEFTInfo *pDot11f ) |
| 5368 | { |
| 5369 | pDot11f->present = 1; |
| 5370 | pDot11f->IECount = 0; //TODO: put valid data during reassoc. |
| 5371 | //All other info is zero. |
| 5372 | |
| 5373 | } |
| 5374 | #endif |
| 5375 | |
| 5376 | void PopulateDot11fAssocRspRates ( tpAniSirGlobal pMac, tDot11fIESuppRates *pSupp, |
| 5377 | tDot11fIEExtSuppRates *pExt, tANI_U16 *_11bRates, tANI_U16 *_11aRates ) |
| 5378 | { |
| 5379 | tANI_U8 num_supp = 0, num_ext = 0; |
| 5380 | tANI_U8 i,j; |
| 5381 | |
| 5382 | for( i = 0 ; (i < SIR_NUM_11B_RATES && _11bRates[i]) ; i++, num_supp++ ) |
| 5383 | { |
| 5384 | pSupp->rates[num_supp] = (tANI_U8)_11bRates[i]; |
| 5385 | } |
| 5386 | for( j = 0 ; (j < SIR_NUM_11A_RATES && _11aRates[j]) ; j++ ) |
| 5387 | { |
| 5388 | if( num_supp < 8 ) |
| 5389 | pSupp->rates[num_supp++] = (tANI_U8)_11aRates[j]; |
| 5390 | else |
| 5391 | pExt->rates[num_ext++] = (tANI_U8)_11aRates[j]; |
| 5392 | } |
| 5393 | |
| 5394 | if( num_supp ) |
| 5395 | { |
| 5396 | pSupp->num_rates = num_supp; |
| 5397 | pSupp->present = 1; |
| 5398 | } |
| 5399 | if( num_ext ) |
| 5400 | { |
| 5401 | pExt->num_rates = num_ext; |
| 5402 | pExt->present = 1; |
| 5403 | } |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 5404 | } |
| 5405 | |
| 5406 | void PopulateDot11fTimeoutInterval( tpAniSirGlobal pMac, |
| 5407 | tDot11fIETimeoutInterval *pDot11f, |
| 5408 | tANI_U8 type, tANI_U32 value ) |
| 5409 | { |
| 5410 | pDot11f->present = 1; |
| 5411 | pDot11f->timeoutType = type; |
| 5412 | pDot11f->timeoutValue = value; |
| 5413 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5414 | // parserApi.c ends here. |