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