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