Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 41 | /** |
| 42 | * \file limSendManagementFrames.c |
| 43 | * |
| 44 | * \brief Code for preparing and sending 802.11 Management frames |
| 45 | * |
| 46 | * Copyright (C) 2005-2007 Airgo Networks, Incorporated |
| 47 | * |
| 48 | */ |
| 49 | |
| 50 | #include "sirApi.h" |
| 51 | #include "aniGlobal.h" |
| 52 | #include "sirMacProtDef.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 53 | #include "cfgApi.h" |
| 54 | #include "utilsApi.h" |
| 55 | #include "limTypes.h" |
| 56 | #include "limUtils.h" |
| 57 | #include "limSecurityUtils.h" |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 58 | #include "limPropExtsUtils.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 59 | #include "dot11f.h" |
| 60 | #include "limStaHashApi.h" |
| 61 | #include "schApi.h" |
| 62 | #include "limSendMessages.h" |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 63 | #include "limAssocUtils.h" |
| 64 | #include "limFT.h" |
| 65 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 66 | #if defined WLAN_FEATURE_VOWIFI |
| 67 | #include "rrmApi.h" |
| 68 | #endif |
| 69 | |
| 70 | #ifdef FEATURE_WLAN_CCX |
| 71 | #include <limCcxparserApi.h> |
| 72 | #endif |
| 73 | #include "wlan_qct_wda.h" |
| 74 | #ifdef WLAN_FEATURE_11W |
| 75 | #include "dot11fdefs.h" |
| 76 | #endif |
| 77 | |
| 78 | |
| 79 | //////////////////////////////////////////////////////////////////////// |
| 80 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 81 | |
| 82 | /** |
| 83 | * |
| 84 | * \brief This function is called by various LIM modules to prepare the |
| 85 | * 802.11 frame MAC header |
| 86 | * |
| 87 | * |
| 88 | * \param pMac Pointer to Global MAC structure |
| 89 | * |
| 90 | * \param pBD Pointer to the frame buffer that needs to be populate |
| 91 | * |
| 92 | * \param type Type of the frame |
| 93 | * |
| 94 | * \param subType Subtype of the frame |
| 95 | * |
| 96 | * \return eHalStatus |
| 97 | * |
| 98 | * |
| 99 | * The pFrameBuf argument points to the beginning of the frame buffer to |
| 100 | * which - a) The 802.11 MAC header is set b) Following this MAC header |
| 101 | * will be the MGMT frame payload The payload itself is populated by the |
| 102 | * caller API |
| 103 | * |
| 104 | * |
| 105 | */ |
| 106 | |
| 107 | tSirRetStatus limPopulateMacHeader( tpAniSirGlobal pMac, |
| 108 | tANI_U8* pBD, |
| 109 | tANI_U8 type, |
| 110 | tANI_U8 subType, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 111 | tSirMacAddr peerAddr, tSirMacAddr selfMacAddr) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 112 | { |
| 113 | tSirRetStatus statusCode = eSIR_SUCCESS; |
| 114 | tpSirMacMgmtHdr pMacHdr; |
| 115 | |
| 116 | /// Prepare MAC management header |
| 117 | pMacHdr = (tpSirMacMgmtHdr) (pBD); |
| 118 | |
| 119 | // Prepare FC |
| 120 | pMacHdr->fc.protVer = SIR_MAC_PROTOCOL_VERSION; |
| 121 | pMacHdr->fc.type = type; |
| 122 | pMacHdr->fc.subType = subType; |
| 123 | |
| 124 | // Prepare Address 1 |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 125 | vos_mem_copy( (tANI_U8 *) pMacHdr->da, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 126 | (tANI_U8 *) peerAddr, |
| 127 | sizeof( tSirMacAddr )); |
| 128 | |
| 129 | // Prepare Address 2 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | sirCopyMacAddr(pMacHdr->sa,selfMacAddr); |
| 131 | |
| 132 | // Prepare Address 3 |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 133 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 134 | (tANI_U8 *) peerAddr, |
| 135 | sizeof( tSirMacAddr )); |
| 136 | return statusCode; |
| 137 | } /*** end limPopulateMacHeader() ***/ |
| 138 | |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 139 | #ifdef WLAN_FEATURE_11W |
| 140 | /** |
| 141 | * |
| 142 | * \brief This function is called by various LIM modules to correctly set |
| 143 | * the Protected bit in the Frame Control Field of the 802.11 frame MAC header |
| 144 | * |
| 145 | * |
| 146 | * \param pMac Pointer to Global MAC structure |
| 147 | * |
| 148 | * \param psessionEntry Pointer to session corresponding to the connection |
| 149 | * |
| 150 | * \param peer Peer address of the STA to which the frame is to be sent |
| 151 | * |
| 152 | * \param pMacHdr Pointer to the frame MAC header |
| 153 | * |
| 154 | * \return nothing |
| 155 | * |
| 156 | * |
| 157 | */ |
| 158 | void |
| 159 | limSetProtectedBit(tpAniSirGlobal pMac, |
| 160 | tpPESession psessionEntry, |
| 161 | tSirMacAddr peer, |
| 162 | tpSirMacMgmtHdr pMacHdr) |
| 163 | { |
| 164 | tANI_U16 aid; |
| 165 | tpDphHashNode pStaDs; |
| 166 | |
| 167 | if( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 168 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 169 | { |
| 170 | |
| 171 | pStaDs = dphLookupHashEntry( pMac, peer, &aid, &psessionEntry->dph.dphHashTable ); |
| 172 | if( pStaDs != NULL ) |
| 173 | if( pStaDs->rmfEnabled ) |
| 174 | pMacHdr->fc.wep = 1; |
| 175 | } |
| 176 | else if ( psessionEntry->limRmfEnabled ) |
| 177 | pMacHdr->fc.wep = 1; |
| 178 | } /*** end limSetProtectedBit() ***/ |
| 179 | #endif |
| 180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 181 | /** |
| 182 | * \brief limSendProbeReqMgmtFrame |
| 183 | * |
| 184 | * |
| 185 | * \param pMac Pointer to Global MAC structure |
| 186 | * |
| 187 | * \param pSsid SSID to be sent in Probe Request frame |
| 188 | * |
| 189 | * \param bssid BSSID to be sent in Probe Request frame |
| 190 | * |
| 191 | * \param nProbeDelay probe delay to be used before sending Probe Request |
| 192 | * frame |
| 193 | * |
| 194 | * \param nChannelNum Channel # on which the Probe Request is going out |
| 195 | * |
| 196 | * \param nAdditionalIELen if non-zero, include pAdditionalIE in the Probe Request frame |
| 197 | * |
| 198 | * \param pAdditionalIE if nAdditionalIELen is non zero, include this field in the Probe Request frame |
| 199 | * |
| 200 | * This function is called by various LIM modules to send Probe Request frame |
| 201 | * during active scan/learn phase. |
| 202 | * Probe request is sent out in the following scenarios: |
| 203 | * --heartbeat failure: session needed |
| 204 | * --join req: session needed |
| 205 | * --foreground scan: no session |
| 206 | * --background scan: no session |
| 207 | * --schBeaconProcessing: to get EDCA parameters: session needed |
| 208 | * |
| 209 | * |
| 210 | */ |
| 211 | tSirRetStatus |
| 212 | limSendProbeReqMgmtFrame(tpAniSirGlobal pMac, |
| 213 | tSirMacSSid *pSsid, |
| 214 | tSirMacAddr bssid, |
| 215 | tANI_U8 nChannelNum, |
| 216 | tSirMacAddr SelfMacAddr, |
| 217 | tANI_U32 dot11mode, |
| 218 | tANI_U32 nAdditionalIELen, |
| 219 | tANI_U8 *pAdditionalIE) |
| 220 | { |
| 221 | tDot11fProbeRequest pr; |
| 222 | tANI_U32 nStatus, nBytes, nPayload; |
| 223 | tSirRetStatus nSirStatus; |
| 224 | tANI_U8 *pFrame; |
| 225 | void *pPacket; |
| 226 | eHalStatus halstatus; |
| 227 | tpPESession psessionEntry; |
| 228 | tANI_U8 sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 229 | tANI_U8 *p2pIe = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 230 | tANI_U8 txFlag = 0; |
| 231 | |
| 232 | #ifndef GEN4_SCAN |
| 233 | return eSIR_FAILURE; |
| 234 | #endif |
| 235 | |
| 236 | #if defined ( ANI_DVT_DEBUG ) |
| 237 | return eSIR_FAILURE; |
| 238 | #endif |
| 239 | |
| 240 | /* |
| 241 | * session context may or may not be present, when probe request needs to be sent out. |
| 242 | * following cases exist: |
| 243 | * --heartbeat failure: session needed |
| 244 | * --join req: session needed |
| 245 | * --foreground scan: no session |
| 246 | * --background scan: no session |
| 247 | * --schBeaconProcessing: to get EDCA parameters: session needed |
| 248 | * If session context does not exist, some IEs will be populated from CFGs, |
| 249 | * e.g. Supported and Extended rate set IEs |
| 250 | */ |
| 251 | psessionEntry = peFindSessionByBssid(pMac,bssid,&sessionId); |
| 252 | |
| 253 | // The scheme here is to fill out a 'tDot11fProbeRequest' structure |
| 254 | // and then hand it off to 'dot11fPackProbeRequest' (for |
| 255 | // serialization). We start by zero-initializing the structure: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 256 | vos_mem_set(( tANI_U8* )&pr, sizeof( pr ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 257 | |
| 258 | // & delegating to assorted helpers: |
| 259 | PopulateDot11fSSID( pMac, pSsid, &pr.SSID ); |
| 260 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 261 | if( nAdditionalIELen && pAdditionalIE ) |
| 262 | { |
| 263 | p2pIe = limGetP2pIEPtr(pMac, pAdditionalIE, nAdditionalIELen); |
| 264 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 265 | /* Don't include 11b rate only when device is doing P2P Search */ |
| 266 | if( ( WNI_CFG_DOT11_MODE_11B != dot11mode ) && |
| 267 | ( p2pIe != NULL ) && |
| 268 | /* Don't include 11b rate if it is a P2P serach or probe request is sent by P2P Client */ |
| 269 | ( ( ( pMac->lim.gpLimMlmScanReq != NULL ) && |
| 270 | pMac->lim.gpLimMlmScanReq->p2pSearch ) || |
| 271 | ( ( psessionEntry != NULL ) && |
| 272 | ( VOS_P2P_CLIENT_MODE == psessionEntry->pePersona ) ) |
| 273 | ) |
| 274 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 275 | { |
| 276 | /* In the below API pass channel number > 14, do that it fills only |
| 277 | * 11a rates in supported rates */ |
| 278 | PopulateDot11fSuppRates( pMac, 15, &pr.SuppRates,psessionEntry); |
| 279 | } |
| 280 | else |
| 281 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | PopulateDot11fSuppRates( pMac, nChannelNum, |
| 283 | &pr.SuppRates,psessionEntry); |
| 284 | |
| 285 | if ( WNI_CFG_DOT11_MODE_11B != dot11mode ) |
| 286 | { |
| 287 | PopulateDot11fExtSuppRates1( pMac, nChannelNum, &pr.ExtSuppRates ); |
| 288 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 289 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 290 | |
| 291 | #if defined WLAN_FEATURE_VOWIFI |
| 292 | //Table 7-14 in IEEE Std. 802.11k-2008 says |
| 293 | //DS params "can" be present in RRM is disabled and "is" present if |
| 294 | //RRM is enabled. It should be ok even if we add it into probe req when |
| 295 | //RRM is not enabled. |
| 296 | PopulateDot11fDSParams( pMac, &pr.DSParams, nChannelNum, psessionEntry ); |
| 297 | //Call RRM module to get the tx power for management used. |
| 298 | { |
| 299 | tANI_U8 txPower = (tANI_U8) rrmGetMgmtTxPower( pMac, psessionEntry ); |
| 300 | PopulateDot11fWFATPC( pMac, &pr.WFATPC, txPower, 0 ); |
| 301 | } |
| 302 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 303 | |
| 304 | if (psessionEntry != NULL ) { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 305 | psessionEntry->htCapability = IS_DOT11_MODE_HT(dot11mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 306 | //Include HT Capability IE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 307 | if (psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 308 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 309 | PopulateDot11fHTCaps( pMac, psessionEntry, &pr.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 310 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 311 | } else { //psessionEntry == NULL |
| 312 | if (IS_DOT11_MODE_HT(dot11mode)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 313 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 314 | PopulateDot11fHTCaps( pMac, psessionEntry, &pr.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 315 | } |
| 316 | } |
Gopichand Nakkala | 40bc650 | 2012-12-20 16:55:36 -0800 | [diff] [blame] | 317 | |
| 318 | /* Set channelbonding information as "disabled" when tunned to a 2.4 GHz channel */ |
| 319 | if( nChannelNum <= SIR_11B_CHANNEL_END) |
| 320 | { |
| 321 | pr.HTCaps.supportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; |
| 322 | pr.HTCaps.shortGI40MHz = 0; |
| 323 | } |
| 324 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 325 | #ifdef WLAN_FEATURE_11AC |
| 326 | if (psessionEntry != NULL ) { |
| 327 | psessionEntry->vhtCapability = IS_DOT11_MODE_VHT(dot11mode); |
| 328 | //Include HT Capability IE |
| 329 | if (psessionEntry->vhtCapability) |
| 330 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 331 | PopulateDot11fVHTCaps( pMac, &pr.VHTCaps ); |
| 332 | } |
| 333 | } else { |
| 334 | if (IS_DOT11_MODE_VHT(dot11mode)) |
| 335 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 336 | PopulateDot11fVHTCaps( pMac, &pr.VHTCaps ); |
| 337 | } |
| 338 | } |
| 339 | #endif |
| 340 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 341 | |
| 342 | // That's it-- now we pack it. First, how much space are we going to |
| 343 | // need? |
| 344 | nStatus = dot11fGetPackedProbeRequestSize( pMac, &pr, &nPayload ); |
| 345 | if ( DOT11F_FAILED( nStatus ) ) |
| 346 | { |
| 347 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 348 | "or a Probe Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 349 | // We'll fall back on the worst case scenario: |
| 350 | nPayload = sizeof( tDot11fProbeRequest ); |
| 351 | } |
| 352 | else if ( DOT11F_WARNED( nStatus ) ) |
| 353 | { |
| 354 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 355 | "the packed size for a Probe Request (" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 356 | "0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | } |
| 358 | |
| 359 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAdditionalIELen; |
| 360 | |
| 361 | // Ok-- try to allocate some memory: |
| 362 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 363 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 364 | ( void** ) &pPacket ); |
| 365 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 366 | { |
| 367 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Pro" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 368 | "be Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 369 | return eSIR_MEM_ALLOC_FAILED; |
| 370 | } |
| 371 | |
| 372 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 373 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 374 | |
| 375 | // Next, we fill out the buffer descriptor: |
| 376 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 377 | SIR_MAC_MGMT_PROBE_REQ, bssid, SelfMacAddr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 378 | if ( eSIR_SUCCESS != nSirStatus ) |
| 379 | { |
| 380 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 381 | "tor for a Probe Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 382 | nSirStatus ); |
| 383 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 384 | ( void* ) pFrame, ( void* ) pPacket ); |
| 385 | return nSirStatus; // allocated! |
| 386 | } |
| 387 | |
| 388 | // That done, pack the Probe Request: |
| 389 | nStatus = dot11fPackProbeRequest( pMac, &pr, pFrame + |
| 390 | sizeof( tSirMacMgmtHdr ), |
| 391 | nPayload, &nPayload ); |
| 392 | if ( DOT11F_FAILED( nStatus ) ) |
| 393 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 394 | limLog( pMac, LOGE, FL("Failed to pack a Probe Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 395 | nStatus ); |
| 396 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 397 | return eSIR_FAILURE; // allocated! |
| 398 | } |
| 399 | else if ( DOT11F_WARNED( nStatus ) ) |
| 400 | { |
| 401 | limLog( pMac, LOGW, FL("There were warnings while packing a P" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 402 | "robe Request (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 403 | } |
| 404 | |
| 405 | // Append any AddIE if present. |
| 406 | if( nAdditionalIELen ) |
| 407 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 408 | vos_mem_copy( pFrame+sizeof(tSirMacMgmtHdr)+nPayload, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 409 | pAdditionalIE, nAdditionalIELen ); |
| 410 | nPayload += nAdditionalIELen; |
| 411 | } |
| 412 | |
| 413 | /* If this probe request is sent during P2P Search State, then we need |
| 414 | * to send it at OFDM rate. |
| 415 | */ |
| 416 | if( ( SIR_BAND_5_GHZ == limGetRFBand(nChannelNum)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 417 | || (( pMac->lim.gpLimMlmScanReq != NULL) && |
| 418 | pMac->lim.gpLimMlmScanReq->p2pSearch ) |
Gopichand Nakkala | 6796721 | 2013-02-15 17:31:15 +0530 | [diff] [blame] | 419 | /* For unicast probe req mgmt from Join function |
| 420 | we don't set above variables. So we need to add |
| 421 | one more check whether it is pePersona is P2P_CLIENT or not */ |
| 422 | || ( ( psessionEntry != NULL ) && |
| 423 | ( VOS_P2P_CLIENT_MODE == psessionEntry->pePersona ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 424 | ) |
| 425 | { |
| 426 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 427 | } |
| 428 | |
| 429 | |
| 430 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) sizeof(tSirMacMgmtHdr) + nPayload, |
| 431 | HAL_TXRX_FRM_802_11_MGMT, |
| 432 | ANI_TXDIR_TODS, |
| 433 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 434 | limTxComplete, pFrame, txFlag ); |
| 435 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 436 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 437 | limLog( pMac, LOGE, FL("could not send Probe Request frame!" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 438 | //Pkt will be freed up by the callback |
| 439 | return eSIR_FAILURE; |
| 440 | } |
| 441 | |
| 442 | return eSIR_SUCCESS; |
| 443 | } // End limSendProbeReqMgmtFrame. |
| 444 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 445 | tSirRetStatus limGetAddnIeForProbeResp(tpAniSirGlobal pMac, |
| 446 | tANI_U8* addIE, tANI_U16 *addnIELen, |
| 447 | tANI_U8 probeReqP2pIe) |
| 448 | { |
| 449 | /* If Probe request doesn't have P2P IE, then take out P2P IE |
| 450 | from additional IE */ |
| 451 | if(!probeReqP2pIe) |
| 452 | { |
| 453 | tANI_U8* tempbuf = NULL; |
| 454 | tANI_U16 tempLen = 0; |
| 455 | int left = *addnIELen; |
| 456 | v_U8_t *ptr = addIE; |
| 457 | v_U8_t elem_id, elem_len; |
| 458 | |
| 459 | if(NULL == addIE) |
| 460 | { |
| 461 | PELOGE(limLog(pMac, LOGE, |
| 462 | FL(" NULL addIE pointer"));) |
| 463 | return eSIR_FAILURE; |
| 464 | } |
| 465 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 466 | tempbuf = vos_mem_malloc(left); |
| 467 | if ( NULL == tempbuf ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 468 | { |
| 469 | PELOGE(limLog(pMac, LOGE, |
| 470 | FL("Unable to allocate memory to store addn IE"));) |
| 471 | return eSIR_MEM_ALLOC_FAILED; |
| 472 | } |
| 473 | |
| 474 | while(left >= 2) |
| 475 | { |
| 476 | elem_id = ptr[0]; |
| 477 | elem_len = ptr[1]; |
| 478 | left -= 2; |
| 479 | if(elem_len > left) |
| 480 | { |
| 481 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 482 | FL("****Invalid IEs eid = %d elem_len=%d left=%d*****"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 483 | elem_id,elem_len,left); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 484 | vos_mem_free(tempbuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 485 | return eSIR_FAILURE; |
| 486 | } |
| 487 | if ( !( (SIR_MAC_EID_VENDOR == elem_id) && |
| 488 | (memcmp(&ptr[2], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE)==0) ) ) |
| 489 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 490 | vos_mem_copy (tempbuf + tempLen, &ptr[0], elem_len + 2); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 491 | tempLen += (elem_len + 2); |
| 492 | } |
| 493 | left -= elem_len; |
| 494 | ptr += (elem_len + 2); |
| 495 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 496 | vos_mem_copy (addIE, tempbuf, tempLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 497 | *addnIELen = tempLen; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 498 | vos_mem_free(tempbuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 499 | } |
| 500 | return eSIR_SUCCESS; |
| 501 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 502 | |
| 503 | void |
| 504 | limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, |
| 505 | tSirMacAddr peerMacAddr, |
| 506 | tpAniSSID pSsid, |
| 507 | short nStaId, |
| 508 | tANI_U8 nKeepAlive, |
| 509 | tpPESession psessionEntry, |
| 510 | tANI_U8 probeReqP2pIe) |
| 511 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 512 | tDot11fProbeResponse *pFrm; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 513 | tSirRetStatus nSirStatus; |
| 514 | tANI_U32 cfg, nPayload, nBytes, nStatus; |
| 515 | tpSirMacMgmtHdr pMacHdr; |
| 516 | tANI_U8 *pFrame; |
| 517 | void *pPacket; |
| 518 | eHalStatus halstatus; |
| 519 | tANI_U32 addnIEPresent; |
| 520 | tANI_U32 addnIE1Len=0; |
| 521 | tANI_U32 addnIE2Len=0; |
| 522 | tANI_U32 addnIE3Len=0; |
| 523 | tANI_U16 totalAddnIeLen = 0; |
| 524 | tANI_U32 wpsApEnable=0, tmp; |
| 525 | tANI_U8 txFlag = 0; |
| 526 | tANI_U8 *addIE = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 527 | tANI_U8 *pP2pIe = NULL; |
| 528 | tANI_U8 noaLen = 0; |
| 529 | tANI_U8 total_noaLen = 0; |
| 530 | tANI_U8 noaStream[SIR_MAX_NOA_ATTR_LEN |
| 531 | + SIR_P2P_IE_HEADER_LEN]; |
| 532 | tANI_U8 noaIe[SIR_MAX_NOA_ATTR_LEN + SIR_P2P_IE_HEADER_LEN]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 533 | |
| 534 | if(pMac->gDriverType == eDRIVER_TYPE_MFG) // We don't answer requests |
| 535 | { |
| 536 | return; // in this case. |
| 537 | } |
| 538 | |
| 539 | if(NULL == psessionEntry) |
| 540 | { |
| 541 | return; |
| 542 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 543 | |
| 544 | pFrm = vos_mem_malloc(sizeof(tDot11fProbeResponse)); |
| 545 | if ( NULL == pFrm ) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 546 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 547 | limLog(pMac, LOGE, FL("Unable to allocate memory in limSendProbeRspMgmtFrame") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 548 | return; |
| 549 | } |
| 550 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 551 | // Fill out 'frm', after which we'll just hand the struct off to |
| 552 | // 'dot11fPackProbeResponse'. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 553 | vos_mem_set(( tANI_U8* )pFrm, sizeof( tDot11fProbeResponse ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 554 | |
| 555 | // Timestamp to be updated by TFP, below. |
| 556 | |
| 557 | // Beacon Interval: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 558 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 559 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 560 | pFrm->BeaconInterval.interval = pMac->sch.schObject.gSchBeaconInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 561 | } |
| 562 | else |
| 563 | { |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 564 | nSirStatus = wlan_cfgGetInt( pMac, WNI_CFG_BEACON_INTERVAL, &cfg); |
| 565 | if (eSIR_SUCCESS != nSirStatus) |
| 566 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 567 | limLog( pMac, LOGP, FL("Failed to retrieve WNI_CFG_BEACON_INTERVAL from CFG (%d)."), |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 568 | nSirStatus ); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 569 | vos_mem_free(pFrm); |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 570 | return; |
| 571 | } |
| 572 | pFrm->BeaconInterval.interval = ( tANI_U16 ) cfg; |
Madan Mohan Koyyalamudi | c0d1b3f | 2012-11-13 10:41:07 -0800 | [diff] [blame] | 573 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 574 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 575 | PopulateDot11fCapabilities( pMac, &pFrm->Capabilities, psessionEntry ); |
| 576 | PopulateDot11fSSID( pMac, ( tSirMacSSid* )pSsid, &pFrm->SSID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 577 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 578 | &pFrm->SuppRates,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 579 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 580 | PopulateDot11fDSParams( pMac, &pFrm->DSParams, psessionEntry->currentOperChannel,psessionEntry); |
| 581 | PopulateDot11fIBSSParams( pMac, &pFrm->IBSSParams, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 582 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 583 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 584 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 585 | { |
| 586 | if(psessionEntry->wps_state != SAP_WPS_DISABLED) |
| 587 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 588 | PopulateDot11fProbeResWPSIEs(pMac, &pFrm->WscProbeRes, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 589 | } |
| 590 | } |
| 591 | else |
| 592 | { |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 593 | if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_ENABLE, &tmp) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 594 | limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_ENABLE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 595 | |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 596 | wpsApEnable = tmp & WNI_CFG_WPS_ENABLE_AP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 597 | |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 598 | if (wpsApEnable) |
| 599 | { |
| 600 | PopulateDot11fWscInProbeRes(pMac, &pFrm->WscProbeRes); |
| 601 | } |
| 602 | |
| 603 | if (pMac->lim.wscIeInfo.probeRespWscEnrollmentState == eLIM_WSC_ENROLL_BEGIN) |
| 604 | { |
| 605 | PopulateDot11fWscRegistrarInfoInProbeRes(pMac, &pFrm->WscProbeRes); |
| 606 | pMac->lim.wscIeInfo.probeRespWscEnrollmentState = eLIM_WSC_ENROLL_IN_PROGRESS; |
| 607 | } |
| 608 | |
| 609 | if (pMac->lim.wscIeInfo.wscEnrollmentState == eLIM_WSC_ENROLL_END) |
| 610 | { |
| 611 | DePopulateDot11fWscRegistrarInfoInProbeRes(pMac, &pFrm->WscProbeRes); |
| 612 | pMac->lim.wscIeInfo.probeRespWscEnrollmentState = eLIM_WSC_ENROLL_NOOP; |
| 613 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 614 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 615 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 616 | PopulateDot11fCountry( pMac, &pFrm->Country, psessionEntry); |
| 617 | PopulateDot11fEDCAParamSet( pMac, &pFrm->EDCAParamSet, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 618 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 619 | |
| 620 | if (psessionEntry->dot11mode != WNI_CFG_DOT11_MODE_11B) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 621 | PopulateDot11fERPInfo( pMac, &pFrm->ERPInfo, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 622 | |
| 623 | |
| 624 | // N.B. In earlier implementations, the RSN IE would be placed in |
| 625 | // the frame here, before the WPA IE, if 'RSN_BEFORE_WPA' was defined. |
| 626 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 627 | &pFrm->ExtSuppRates, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 628 | |
| 629 | //Populate HT IEs, when operating in 11n or Taurus modes. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 630 | if ( psessionEntry->htCapability ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 631 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 632 | PopulateDot11fHTCaps( pMac, psessionEntry, &pFrm->HTCaps ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 633 | PopulateDot11fHTInfo( pMac, &pFrm->HTInfo, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 634 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 635 | #ifdef WLAN_FEATURE_11AC |
| 636 | if(psessionEntry->vhtCapability) |
| 637 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 638 | limLog( pMac, LOGW, FL("Populate VHT IE in Probe Response")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 639 | PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps ); |
| 640 | PopulateDot11fVHTOperation( pMac, &pFrm->VHTOperation ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 641 | // we do not support multi users yet |
| 642 | //PopulateDot11fVHTExtBssLoad( pMac, &frm.VHTExtBssLoad ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 643 | PopulateDot11fExtCap( pMac, &pFrm->ExtCap); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 644 | } |
| 645 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 646 | |
krunal soni | 4f087d2 | 2013-07-29 16:32:26 -0700 | [diff] [blame] | 647 | if (psessionEntry->oxygenNwkIniFeatureEnabled && |
| 648 | (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole)) { |
| 649 | if (wlan_cfgGetInt(pMac, WNI_CFG_OXYGEN_NETWORK_DATA, |
| 650 | &tmp) != eSIR_SUCCESS){ |
| 651 | limLog(pMac, LOGW, FL("Unable to get WNI_CFG_OXYGEN_NETWORK_DATA")); |
| 652 | } |
| 653 | else { |
| 654 | pFrm->OxygenNetwork.present = 1; |
| 655 | pFrm->OxygenNetwork.data = (tmp & 0xffff); |
| 656 | } |
| 657 | } |
| 658 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 659 | if ( psessionEntry->pLimStartBssReq ) |
| 660 | { |
| 661 | PopulateDot11fWPA( pMac, &( psessionEntry->pLimStartBssReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 662 | &pFrm->WPA ); |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 663 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimStartBssReq->rsnIE ), |
| 664 | &pFrm->RSNOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 665 | } |
| 666 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 667 | PopulateDot11fWMM( pMac, &pFrm->WMMInfoAp, &pFrm->WMMParams, &pFrm->WMMCaps, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 668 | |
| 669 | #if defined(FEATURE_WLAN_WAPI) |
| 670 | if( psessionEntry->pLimStartBssReq ) |
| 671 | { |
| 672 | PopulateDot11fWAPI( pMac, &( psessionEntry->pLimStartBssReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 673 | &pFrm->WAPI ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 674 | } |
| 675 | |
| 676 | #endif // defined(FEATURE_WLAN_WAPI) |
| 677 | |
| 678 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 679 | nStatus = dot11fGetPackedProbeResponseSize( pMac, pFrm, &nPayload ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 680 | if ( DOT11F_FAILED( nStatus ) ) |
| 681 | { |
| 682 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 683 | "or a Probe Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 684 | nStatus ); |
| 685 | // We'll fall back on the worst case scenario: |
| 686 | nPayload = sizeof( tDot11fProbeResponse ); |
| 687 | } |
| 688 | else if ( DOT11F_WARNED( nStatus ) ) |
| 689 | { |
| 690 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 691 | "the packed size for a Probe Response " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 692 | "(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 693 | } |
| 694 | |
| 695 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 696 | |
| 697 | addnIEPresent = false; |
| 698 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 699 | if( pMac->lim.gpLimRemainOnChanReq ) |
| 700 | { |
| 701 | nBytes += (pMac->lim.gpLimRemainOnChanReq->length - sizeof( tSirRemainOnChnReq ) ); |
| 702 | } |
| 703 | //Only use CFG for non-listen mode. This CFG is not working for concurrency |
| 704 | //In listening mode, probe rsp IEs is passed in the message from SME to PE |
| 705 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 706 | { |
| 707 | |
| 708 | if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_RSP_ADDNIE_FLAG, |
| 709 | &addnIEPresent) != eSIR_SUCCESS) |
| 710 | { |
| 711 | limLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_FLAG")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 712 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 713 | return; |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | if (addnIEPresent) |
| 718 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 719 | |
| 720 | addIE = vos_mem_malloc(WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN*3); |
| 721 | if ( NULL == addIE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 722 | { |
| 723 | PELOGE(limLog(pMac, LOGE, |
| 724 | FL("Unable to allocate memory to store addn IE"));) |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 725 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 726 | return; |
| 727 | } |
| 728 | |
| 729 | //Probe rsp IE available |
| 730 | if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, |
| 731 | WNI_CFG_PROBE_RSP_ADDNIE_DATA1, &addnIE1Len) ) |
| 732 | { |
| 733 | limLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 length")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 734 | vos_mem_free(addIE); |
| 735 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 736 | return; |
| 737 | } |
| 738 | if (addnIE1Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN && addnIE1Len && |
| 739 | (nBytes + addnIE1Len) <= SIR_MAX_PACKET_SIZE) |
| 740 | { |
| 741 | if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, |
| 742 | WNI_CFG_PROBE_RSP_ADDNIE_DATA1, &addIE[0], |
| 743 | &addnIE1Len) ) |
| 744 | { |
| 745 | limLog(pMac, LOGP, |
| 746 | FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 String")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 747 | vos_mem_free(addIE); |
| 748 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 749 | return; |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | //Probe rsp IE available |
| 754 | if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, |
| 755 | WNI_CFG_PROBE_RSP_ADDNIE_DATA2, &addnIE2Len) ) |
| 756 | { |
| 757 | limLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA2 length")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 758 | vos_mem_free(addIE); |
| 759 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 760 | return; |
| 761 | } |
| 762 | if (addnIE2Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA2_LEN && addnIE2Len && |
| 763 | (nBytes + addnIE2Len) <= SIR_MAX_PACKET_SIZE) |
| 764 | { |
| 765 | if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, |
| 766 | WNI_CFG_PROBE_RSP_ADDNIE_DATA2, &addIE[addnIE1Len], |
| 767 | &addnIE2Len) ) |
| 768 | { |
| 769 | limLog(pMac, LOGP, |
| 770 | FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA2 String")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 771 | vos_mem_free(addIE); |
| 772 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 773 | return; |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | //Probe rsp IE available |
| 778 | if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, |
| 779 | WNI_CFG_PROBE_RSP_ADDNIE_DATA3, &addnIE3Len) ) |
| 780 | { |
| 781 | limLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA3 length")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 782 | vos_mem_free(addIE); |
| 783 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 784 | return; |
| 785 | } |
| 786 | if (addnIE3Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA3_LEN && addnIE3Len && |
| 787 | (nBytes + addnIE3Len) <= SIR_MAX_PACKET_SIZE) |
| 788 | { |
| 789 | if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, |
| 790 | WNI_CFG_PROBE_RSP_ADDNIE_DATA3, |
| 791 | &addIE[addnIE1Len + addnIE2Len], |
| 792 | &addnIE3Len) ) |
| 793 | { |
| 794 | limLog(pMac, LOGP, |
| 795 | FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA3 String")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 796 | vos_mem_free(addIE); |
| 797 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 798 | return; |
| 799 | } |
| 800 | } |
| 801 | totalAddnIeLen = addnIE1Len + addnIE2Len + addnIE3Len; |
| 802 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 803 | if(eSIR_SUCCESS != limGetAddnIeForProbeResp(pMac, addIE, &totalAddnIeLen, probeReqP2pIe)) |
| 804 | { |
| 805 | limLog(pMac, LOGP, |
| 806 | FL("Unable to get final Additional IE for Probe Req")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 807 | vos_mem_free(addIE); |
| 808 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 809 | return; |
| 810 | } |
| 811 | nBytes = nBytes + totalAddnIeLen; |
| 812 | |
| 813 | if (probeReqP2pIe) |
| 814 | { |
| 815 | pP2pIe = limGetP2pIEPtr(pMac, &addIE[0], totalAddnIeLen); |
| 816 | if (pP2pIe != NULL) |
| 817 | { |
| 818 | //get NoA attribute stream P2P IE |
| 819 | noaLen = limGetNoaAttrStream(pMac, noaStream, psessionEntry); |
| 820 | if (noaLen != 0) |
| 821 | { |
| 822 | total_noaLen = limBuildP2pIe(pMac, &noaIe[0], |
| 823 | &noaStream[0], noaLen); |
| 824 | nBytes = nBytes + total_noaLen; |
| 825 | } |
| 826 | } |
| 827 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 828 | } |
| 829 | |
| 830 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 831 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 832 | ( void** ) &pPacket ); |
| 833 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 834 | { |
| 835 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Pro" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 836 | "be Response."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 837 | if ( addIE != NULL ) |
| 838 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 839 | vos_mem_free(addIE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 840 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 841 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 842 | return; |
| 843 | } |
| 844 | |
| 845 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 846 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 847 | |
| 848 | // Next, we fill out the buffer descriptor: |
| 849 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 850 | SIR_MAC_MGMT_PROBE_RSP, peerMacAddr,psessionEntry->selfMacAddr); |
| 851 | if ( eSIR_SUCCESS != nSirStatus ) |
| 852 | { |
| 853 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 854 | "tor for a Probe Response (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 855 | nSirStatus ); |
| 856 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 857 | ( void* ) pFrame, ( void* ) pPacket ); |
| 858 | if ( addIE != NULL ) |
| 859 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 860 | vos_mem_free(addIE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 861 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 862 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 863 | return; |
| 864 | } |
| 865 | |
| 866 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 867 | |
| 868 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 869 | |
| 870 | // That done, pack the Probe Response: |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 871 | nStatus = dot11fPackProbeResponse( pMac, pFrm, pFrame + sizeof(tSirMacMgmtHdr), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 872 | nPayload, &nPayload ); |
| 873 | if ( DOT11F_FAILED( nStatus ) ) |
| 874 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 875 | limLog( pMac, LOGE, FL("Failed to pack a Probe Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 876 | nStatus ); |
| 877 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 878 | if ( addIE != NULL ) |
| 879 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 880 | vos_mem_free(addIE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 881 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 882 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 883 | return; // allocated! |
| 884 | } |
| 885 | else if ( DOT11F_WARNED( nStatus ) ) |
| 886 | { |
| 887 | limLog( pMac, LOGW, FL("There were warnings while packing a P" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 888 | "robe Response (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 889 | } |
| 890 | |
| 891 | PELOG3(limLog( pMac, LOG3, FL("Sending Probe Response frame to ") ); |
| 892 | limPrintMacAddr( pMac, peerMacAddr, LOG3 );) |
| 893 | |
| 894 | pMac->sys.probeRespond++; |
| 895 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 896 | if( pMac->lim.gpLimRemainOnChanReq ) |
| 897 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 898 | vos_mem_copy ( pFrame+sizeof(tSirMacMgmtHdr)+nPayload, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 899 | pMac->lim.gpLimRemainOnChanReq->probeRspIe, (pMac->lim.gpLimRemainOnChanReq->length - sizeof( tSirRemainOnChnReq )) ); |
| 900 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 901 | |
| 902 | if ( addnIEPresent ) |
| 903 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 904 | vos_mem_copy(pFrame+sizeof(tSirMacMgmtHdr)+nPayload, &addIE[0], totalAddnIeLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 905 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 906 | if (noaLen != 0) |
| 907 | { |
Krunal Soni | 81b2426 | 2013-05-15 17:46:41 -0700 | [diff] [blame] | 908 | if (total_noaLen > (SIR_MAX_NOA_ATTR_LEN + SIR_P2P_IE_HEADER_LEN)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 909 | { |
| 910 | limLog(pMac, LOGE, |
| 911 | FL("Not able to insert NoA because of length constraint")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 912 | vos_mem_free(addIE); |
| 913 | vos_mem_free(pFrm); |
Krunal Soni | 81b2426 | 2013-05-15 17:46:41 -0700 | [diff] [blame] | 914 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 915 | ( void* ) pFrame, ( void* ) pPacket ); |
| 916 | return; |
| 917 | } |
| 918 | else |
| 919 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 920 | vos_mem_copy( &pFrame[nBytes - (total_noaLen)], |
Krunal Soni | 81b2426 | 2013-05-15 17:46:41 -0700 | [diff] [blame] | 921 | &noaIe[0], total_noaLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 922 | } |
| 923 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 924 | |
| 925 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 926 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 927 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 928 | ) |
| 929 | { |
| 930 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 931 | } |
| 932 | |
| 933 | // Queue Probe Response frame in high priority WQ |
| 934 | halstatus = halTxFrame( ( tHalHandle ) pMac, pPacket, |
| 935 | ( tANI_U16 ) nBytes, |
| 936 | HAL_TXRX_FRM_802_11_MGMT, |
| 937 | ANI_TXDIR_TODS, |
| 938 | 7,//SMAC_SWBD_TX_TID_MGMT_LOW, |
| 939 | limTxComplete, pFrame, txFlag ); |
| 940 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 941 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 942 | limLog( pMac, LOGE, FL("Could not send Probe Response.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 943 | //Pkt will be freed up by the callback |
| 944 | } |
| 945 | |
| 946 | if ( addIE != NULL ) |
| 947 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 948 | vos_mem_free(addIE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 949 | } |
| 950 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 951 | vos_mem_free(pFrm); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 952 | return; |
| 953 | |
| 954 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 955 | } // End limSendProbeRspMgmtFrame. |
| 956 | |
| 957 | void |
| 958 | limSendAddtsReqActionFrame(tpAniSirGlobal pMac, |
| 959 | tSirMacAddr peerMacAddr, |
| 960 | tSirAddtsReqInfo *pAddTS, |
| 961 | tpPESession psessionEntry) |
| 962 | { |
| 963 | tANI_U16 i; |
| 964 | tANI_U8 *pFrame; |
| 965 | tSirRetStatus nSirStatus; |
| 966 | tDot11fAddTSRequest AddTSReq; |
| 967 | tDot11fWMMAddTSRequest WMMAddTSReq; |
| 968 | tANI_U32 nPayload, nBytes, nStatus; |
| 969 | tpSirMacMgmtHdr pMacHdr; |
| 970 | void *pPacket; |
| 971 | #ifdef FEATURE_WLAN_CCX |
| 972 | tANI_U32 phyMode; |
| 973 | #endif |
| 974 | eHalStatus halstatus; |
| 975 | tANI_U8 txFlag = 0; |
| 976 | |
| 977 | if(NULL == psessionEntry) |
| 978 | { |
| 979 | return; |
| 980 | } |
| 981 | |
| 982 | if ( ! pAddTS->wmeTspecPresent ) |
| 983 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 984 | vos_mem_set(( tANI_U8* )&AddTSReq, sizeof( AddTSReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 985 | |
| 986 | AddTSReq.Action.action = SIR_MAC_QOS_ADD_TS_REQ; |
| 987 | AddTSReq.DialogToken.token = pAddTS->dialogToken; |
| 988 | AddTSReq.Category.category = SIR_MAC_ACTION_QOS_MGMT; |
| 989 | if ( pAddTS->lleTspecPresent ) |
| 990 | { |
| 991 | PopulateDot11fTSPEC( &pAddTS->tspec, &AddTSReq.TSPEC ); |
| 992 | } |
| 993 | else |
| 994 | { |
| 995 | PopulateDot11fWMMTSPEC( &pAddTS->tspec, &AddTSReq.WMMTSPEC ); |
| 996 | } |
| 997 | |
| 998 | if ( pAddTS->lleTspecPresent ) |
| 999 | { |
| 1000 | AddTSReq.num_WMMTCLAS = 0; |
| 1001 | AddTSReq.num_TCLAS = pAddTS->numTclas; |
| 1002 | for ( i = 0; i < pAddTS->numTclas; ++i) |
| 1003 | { |
| 1004 | PopulateDot11fTCLAS( pMac, &pAddTS->tclasInfo[i], |
| 1005 | &AddTSReq.TCLAS[i] ); |
| 1006 | } |
| 1007 | } |
| 1008 | else |
| 1009 | { |
| 1010 | AddTSReq.num_TCLAS = 0; |
| 1011 | AddTSReq.num_WMMTCLAS = pAddTS->numTclas; |
| 1012 | for ( i = 0; i < pAddTS->numTclas; ++i) |
| 1013 | { |
| 1014 | PopulateDot11fWMMTCLAS( pMac, &pAddTS->tclasInfo[i], |
| 1015 | &AddTSReq.WMMTCLAS[i] ); |
| 1016 | } |
| 1017 | } |
| 1018 | |
| 1019 | if ( pAddTS->tclasProcPresent ) |
| 1020 | { |
| 1021 | if ( pAddTS->lleTspecPresent ) |
| 1022 | { |
| 1023 | AddTSReq.TCLASSPROC.processing = pAddTS->tclasProc; |
| 1024 | AddTSReq.TCLASSPROC.present = 1; |
| 1025 | } |
| 1026 | else |
| 1027 | { |
| 1028 | AddTSReq.WMMTCLASPROC.version = 1; |
| 1029 | AddTSReq.WMMTCLASPROC.processing = pAddTS->tclasProc; |
| 1030 | AddTSReq.WMMTCLASPROC.present = 1; |
| 1031 | } |
| 1032 | } |
| 1033 | |
| 1034 | nStatus = dot11fGetPackedAddTSRequestSize( pMac, &AddTSReq, &nPayload ); |
| 1035 | if ( DOT11F_FAILED( nStatus ) ) |
| 1036 | { |
| 1037 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1038 | "or an Add TS Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1039 | nStatus ); |
| 1040 | // We'll fall back on the worst case scenario: |
| 1041 | nPayload = sizeof( tDot11fAddTSRequest ); |
| 1042 | } |
| 1043 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1044 | { |
| 1045 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 1046 | "the packed size for an Add TS Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1047 | " (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1048 | } |
| 1049 | } |
| 1050 | else |
| 1051 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1052 | vos_mem_set(( tANI_U8* )&WMMAddTSReq, sizeof( WMMAddTSReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1053 | |
| 1054 | WMMAddTSReq.Action.action = SIR_MAC_QOS_ADD_TS_REQ; |
| 1055 | WMMAddTSReq.DialogToken.token = pAddTS->dialogToken; |
| 1056 | WMMAddTSReq.Category.category = SIR_MAC_ACTION_WME; |
| 1057 | |
| 1058 | // WMM spec 2.2.10 - status code is only filled in for ADDTS response |
| 1059 | WMMAddTSReq.StatusCode.statusCode = 0; |
| 1060 | |
| 1061 | PopulateDot11fWMMTSPEC( &pAddTS->tspec, &WMMAddTSReq.WMMTSPEC ); |
| 1062 | #ifdef FEATURE_WLAN_CCX |
| 1063 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 1064 | |
| 1065 | if( phyMode == WNI_CFG_PHY_MODE_11G || phyMode == WNI_CFG_PHY_MODE_11A) |
| 1066 | { |
| 1067 | pAddTS->tsrsIE.rates[0] = TSRS_11AG_RATE_6MBPS; |
| 1068 | } |
| 1069 | else |
| 1070 | { |
| 1071 | pAddTS->tsrsIE.rates[0] = TSRS_11B_RATE_5_5MBPS; |
| 1072 | } |
| 1073 | PopulateDot11TSRSIE(pMac,&pAddTS->tsrsIE, &WMMAddTSReq.CCXTrafStrmRateSet,sizeof(tANI_U8)); |
| 1074 | #endif |
| 1075 | // fillWmeTspecIE |
| 1076 | |
| 1077 | nStatus = dot11fGetPackedWMMAddTSRequestSize( pMac, &WMMAddTSReq, &nPayload ); |
| 1078 | if ( DOT11F_FAILED( nStatus ) ) |
| 1079 | { |
| 1080 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1081 | "or a WMM Add TS Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1082 | nStatus ); |
| 1083 | // We'll fall back on the worst case scenario: |
| 1084 | nPayload = sizeof( tDot11fAddTSRequest ); |
| 1085 | } |
| 1086 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1087 | { |
| 1088 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 1089 | "the packed size for a WMM Add TS Requ" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1090 | "est (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1091 | } |
| 1092 | } |
| 1093 | |
| 1094 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 1095 | |
| 1096 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1097 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 1098 | ( void** ) &pPacket ); |
| 1099 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1100 | { |
| 1101 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for an Ad" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1102 | "d TS Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1103 | return; |
| 1104 | } |
| 1105 | |
| 1106 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1107 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1108 | |
| 1109 | // Next, we fill out the buffer descriptor: |
| 1110 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 1111 | SIR_MAC_MGMT_ACTION, peerMacAddr,psessionEntry->selfMacAddr); |
| 1112 | if ( eSIR_SUCCESS != nSirStatus ) |
| 1113 | { |
| 1114 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1115 | "tor for an Add TS Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1116 | nSirStatus ); |
| 1117 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1118 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1119 | return; |
| 1120 | } |
| 1121 | |
| 1122 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 1123 | |
| 1124 | #if 0 |
| 1125 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 1126 | if ( eSIR_SUCCESS != wlan_cfgGetStr( pMac, WNI_CFG_BSSID, |
| 1127 | ( tANI_U8* )pMacHdr->bssId, &cfgLen ) ) |
| 1128 | { |
| 1129 | limLog( pMac, LOGP, FL("Failed to retrieve WNI_CFG_BSSID whil" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1130 | "e sending an Add TS Request.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1131 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1132 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1133 | return; |
| 1134 | } |
| 1135 | #endif //TO SUPPORT BT-AMP |
| 1136 | |
| 1137 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 1138 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1139 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 1140 | limSetProtectedBit(pMac, psessionEntry, peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1141 | #endif |
| 1142 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1143 | // That done, pack the struct: |
| 1144 | if ( ! pAddTS->wmeTspecPresent ) |
| 1145 | { |
| 1146 | nStatus = dot11fPackAddTSRequest( pMac, &AddTSReq, |
| 1147 | pFrame + sizeof(tSirMacMgmtHdr), |
| 1148 | nPayload, &nPayload ); |
| 1149 | if ( DOT11F_FAILED( nStatus ) ) |
| 1150 | { |
| 1151 | limLog( pMac, LOGE, FL("Failed to pack an Add TS Request " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1152 | "(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1153 | nStatus ); |
| 1154 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1155 | return; // allocated! |
| 1156 | } |
| 1157 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1158 | { |
| 1159 | limLog( pMac, LOGW, FL("There were warnings while packing" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1160 | "an Add TS Request (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1161 | } |
| 1162 | } |
| 1163 | else |
| 1164 | { |
| 1165 | nStatus = dot11fPackWMMAddTSRequest( pMac, &WMMAddTSReq, |
| 1166 | pFrame + sizeof(tSirMacMgmtHdr), |
| 1167 | nPayload, &nPayload ); |
| 1168 | if ( DOT11F_FAILED( nStatus ) ) |
| 1169 | { |
| 1170 | limLog( pMac, LOGE, FL("Failed to pack a WMM Add TS Reque" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1171 | "st (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1172 | nStatus ); |
| 1173 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1174 | return; // allocated! |
| 1175 | } |
| 1176 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1177 | { |
| 1178 | limLog( pMac, LOGW, FL("There were warnings while packing" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1179 | "a WMM Add TS Request (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1180 | } |
| 1181 | } |
| 1182 | |
| 1183 | PELOG3(limLog( pMac, LOG3, FL("Sending an Add TS Request frame to ") ); |
| 1184 | limPrintMacAddr( pMac, peerMacAddr, LOG3 );) |
| 1185 | |
| 1186 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1187 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 1188 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1189 | ) |
| 1190 | { |
| 1191 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 1192 | } |
| 1193 | |
| 1194 | // Queue Addts Response frame in high priority WQ |
| 1195 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 1196 | HAL_TXRX_FRM_802_11_MGMT, |
| 1197 | ANI_TXDIR_TODS, |
| 1198 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 1199 | limTxComplete, pFrame, txFlag ); |
| 1200 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1201 | { |
| 1202 | limLog( pMac, LOGE, FL( "*** Could not send an Add TS Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1203 | " (%X) ***" ), halstatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1204 | //Pkt will be freed up by the callback |
| 1205 | } |
| 1206 | |
| 1207 | } // End limSendAddtsReqActionFrame. |
| 1208 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1209 | |
| 1210 | |
| 1211 | void |
| 1212 | limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, |
| 1213 | tANI_U16 statusCode, |
| 1214 | tANI_U16 aid, |
| 1215 | tSirMacAddr peerMacAddr, |
| 1216 | tANI_U8 subType, |
| 1217 | tpDphHashNode pSta,tpPESession psessionEntry) |
| 1218 | { |
| 1219 | static tDot11fAssocResponse frm; |
| 1220 | tANI_U8 *pFrame, *macAddr; |
| 1221 | tpSirMacMgmtHdr pMacHdr; |
| 1222 | tSirRetStatus nSirStatus; |
| 1223 | tANI_U8 lleMode = 0, fAddTS, edcaInclude = 0; |
| 1224 | tHalBitVal qosMode, wmeMode; |
| 1225 | tANI_U32 nPayload, nBytes, nStatus; |
| 1226 | void *pPacket; |
| 1227 | eHalStatus halstatus; |
| 1228 | tUpdateBeaconParams beaconParams; |
| 1229 | tANI_U8 txFlag = 0; |
| 1230 | tANI_U32 addnIEPresent = false; |
| 1231 | tANI_U32 addnIELen=0; |
| 1232 | tANI_U8 addIE[WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN]; |
| 1233 | tpSirAssocReq pAssocReq = NULL; |
| 1234 | |
| 1235 | if(NULL == psessionEntry) |
| 1236 | { |
| 1237 | return; |
| 1238 | } |
| 1239 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1240 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1241 | |
| 1242 | limGetQosMode(psessionEntry, &qosMode); |
| 1243 | limGetWmeMode(psessionEntry, &wmeMode); |
| 1244 | |
| 1245 | // An Add TS IE is added only if the AP supports it and the requesting |
| 1246 | // STA sent a traffic spec. |
| 1247 | fAddTS = ( qosMode && pSta && pSta->qos.addtsPresent ) ? 1 : 0; |
| 1248 | |
| 1249 | PopulateDot11fCapabilities( pMac, &frm.Capabilities, psessionEntry ); |
| 1250 | |
| 1251 | frm.Status.status = statusCode; |
| 1252 | |
| 1253 | frm.AID.associd = aid | LIM_AID_MASK; |
| 1254 | |
| 1255 | if ( NULL == pSta ) |
| 1256 | { |
| 1257 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, &frm.SuppRates,psessionEntry); |
| 1258 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, &frm.ExtSuppRates, psessionEntry ); |
| 1259 | } |
| 1260 | else |
| 1261 | { |
| 1262 | PopulateDot11fAssocRspRates( pMac, &frm.SuppRates, &frm.ExtSuppRates, |
| 1263 | pSta->supportedRates.llbRates, pSta->supportedRates.llaRates ); |
| 1264 | } |
| 1265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1266 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 1267 | { |
| 1268 | if( pSta != NULL && eSIR_SUCCESS == statusCode ) |
| 1269 | { |
| 1270 | pAssocReq = |
| 1271 | (tpSirAssocReq) psessionEntry->parsedAssocReq[pSta->assocId]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1272 | /* populate P2P IE in AssocRsp when assocReq from the peer includes P2P IE */ |
| 1273 | if( pAssocReq != NULL && pAssocReq->addIEPresent ) { |
| 1274 | PopulateDot11AssocResP2PIE(pMac, &frm.P2PAssocRes, pAssocReq); |
| 1275 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1276 | } |
| 1277 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1278 | |
| 1279 | if ( NULL != pSta ) |
| 1280 | { |
| 1281 | if ( eHAL_SET == qosMode ) |
| 1282 | { |
| 1283 | if ( pSta->lleEnabled ) |
| 1284 | { |
| 1285 | lleMode = 1; |
| 1286 | if ( ( ! pSta->aniPeer ) || ( ! PROP_CAPABILITY_GET( 11EQOS, pSta->propCapability ) ) ) |
| 1287 | { |
| 1288 | PopulateDot11fEDCAParamSet( pMac, &frm.EDCAParamSet, psessionEntry); |
| 1289 | |
| 1290 | // FramesToDo:... |
| 1291 | // if ( fAddTS ) |
| 1292 | // { |
| 1293 | // tANI_U8 *pAf = pBody; |
| 1294 | // *pAf++ = SIR_MAC_QOS_ACTION_EID; |
| 1295 | // tANI_U32 tlen; |
| 1296 | // status = sirAddtsRspFill(pMac, pAf, statusCode, &pSta->qos.addts, NULL, |
| 1297 | // &tlen, bufLen - frameLen); |
| 1298 | // } // End if on Add TS. |
| 1299 | } |
| 1300 | } // End if on .11e enabled in 'pSta'. |
| 1301 | } // End if on QOS Mode on. |
| 1302 | |
| 1303 | if ( ( ! lleMode ) && ( eHAL_SET == wmeMode ) && pSta->wmeEnabled ) |
| 1304 | { |
| 1305 | if ( ( ! pSta->aniPeer ) || ( ! PROP_CAPABILITY_GET( WME, pSta->propCapability ) ) ) |
| 1306 | { |
| 1307 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1308 | PopulateDot11fWMMParams( pMac, &frm.WMMParams, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1309 | |
| 1310 | if ( pSta->wsmEnabled ) |
| 1311 | { |
| 1312 | PopulateDot11fWMMCaps(&frm.WMMCaps ); |
| 1313 | } |
| 1314 | } |
| 1315 | } |
| 1316 | |
| 1317 | if ( pSta->aniPeer ) |
| 1318 | { |
| 1319 | if ( ( lleMode && PROP_CAPABILITY_GET( 11EQOS, pSta->propCapability ) ) || |
| 1320 | ( pSta->wmeEnabled && PROP_CAPABILITY_GET( WME, pSta->propCapability ) ) ) |
| 1321 | { |
| 1322 | edcaInclude = 1; |
| 1323 | } |
| 1324 | |
| 1325 | } // End if on Airgo peer. |
| 1326 | |
| 1327 | if ( pSta->mlmStaContext.htCapability && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1328 | psessionEntry->htCapability ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1329 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1330 | PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1331 | PopulateDot11fHTInfo( pMac, &frm.HTInfo, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1332 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1333 | |
| 1334 | #ifdef WLAN_FEATURE_11AC |
| 1335 | if( pSta->mlmStaContext.vhtCapability && |
| 1336 | psessionEntry->vhtCapability ) |
| 1337 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1338 | limLog( pMac, LOGW, FL("Populate VHT IEs in Assoc Response")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1339 | PopulateDot11fVHTCaps( pMac, &frm.VHTCaps ); |
| 1340 | PopulateDot11fVHTOperation( pMac, &frm.VHTOperation); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 1341 | PopulateDot11fExtCap( pMac, &frm.ExtCap); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1342 | } |
| 1343 | #endif |
| 1344 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1345 | } // End if on non-NULL 'pSta'. |
| 1346 | |
| 1347 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1348 | vos_mem_set(( tANI_U8* )&beaconParams, sizeof( tUpdateBeaconParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1349 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1350 | if( psessionEntry->limSystemRole == eLIM_AP_ROLE ){ |
| 1351 | if(psessionEntry->gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
| 1352 | limDecideApProtection(pMac, peerMacAddr, &beaconParams,psessionEntry); |
| 1353 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1354 | |
| 1355 | limUpdateShortPreamble(pMac, peerMacAddr, &beaconParams, psessionEntry); |
| 1356 | limUpdateShortSlotTime(pMac, peerMacAddr, &beaconParams, psessionEntry); |
| 1357 | |
| 1358 | beaconParams.bssIdx = psessionEntry->bssIdx; |
| 1359 | |
| 1360 | //Send message to HAL about beacon parameter change. |
| 1361 | if(beaconParams.paramChangeBitmap) |
| 1362 | { |
| 1363 | schSetFixedBeaconFields(pMac,psessionEntry); |
| 1364 | limSendBeaconParams(pMac, &beaconParams, psessionEntry ); |
| 1365 | } |
| 1366 | |
| 1367 | // Allocate a buffer for this frame: |
| 1368 | nStatus = dot11fGetPackedAssocResponseSize( pMac, &frm, &nPayload ); |
| 1369 | if ( DOT11F_FAILED( nStatus ) ) |
| 1370 | { |
| 1371 | limLog( pMac, LOGE, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1372 | "or an Association Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1373 | nStatus ); |
| 1374 | return; |
| 1375 | } |
| 1376 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1377 | { |
| 1378 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 1379 | "the packed size for an Association Re" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1380 | "sponse (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1381 | } |
| 1382 | |
| 1383 | nBytes = sizeof( tSirMacMgmtHdr ) + nPayload; |
| 1384 | |
| 1385 | if ( pAssocReq != NULL ) |
| 1386 | { |
| 1387 | if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOC_RSP_ADDNIE_FLAG, |
| 1388 | &addnIEPresent) != eSIR_SUCCESS) |
| 1389 | { |
| 1390 | limLog(pMac, LOGP, FL("Unable to get WNI_CFG_ASSOC_RSP_ADDNIE_FLAG")); |
| 1391 | return; |
| 1392 | } |
| 1393 | |
| 1394 | if (addnIEPresent) |
| 1395 | { |
| 1396 | //Assoc rsp IE available |
| 1397 | if (wlan_cfgGetStrLen(pMac, WNI_CFG_ASSOC_RSP_ADDNIE_DATA, |
| 1398 | &addnIELen) != eSIR_SUCCESS) |
| 1399 | { |
| 1400 | limLog(pMac, LOGP, FL("Unable to get WNI_CFG_ASSOC_RSP_ADDNIE_DATA length")); |
| 1401 | return; |
| 1402 | } |
| 1403 | |
| 1404 | if (addnIELen <= WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN && addnIELen && |
| 1405 | (nBytes + addnIELen) <= SIR_MAX_PACKET_SIZE) |
| 1406 | { |
| 1407 | if (wlan_cfgGetStr(pMac, WNI_CFG_ASSOC_RSP_ADDNIE_DATA, |
| 1408 | &addIE[0], &addnIELen) == eSIR_SUCCESS) |
| 1409 | { |
| 1410 | nBytes = nBytes + addnIELen; |
| 1411 | } |
| 1412 | } |
| 1413 | } |
| 1414 | } |
| 1415 | |
| 1416 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1417 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 1418 | ( void** ) &pPacket ); |
| 1419 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1420 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1421 | limLog(pMac, LOGP, FL("Call to bufAlloc failed for RE/ASSOC RSP.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1422 | return; |
| 1423 | } |
| 1424 | |
| 1425 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1426 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1427 | |
| 1428 | // Next, we fill out the buffer descriptor: |
| 1429 | nSirStatus = limPopulateMacHeader( pMac, |
| 1430 | pFrame, |
| 1431 | SIR_MAC_MGMT_FRAME, |
| 1432 | ( LIM_ASSOC == subType ) ? |
| 1433 | SIR_MAC_MGMT_ASSOC_RSP : |
| 1434 | SIR_MAC_MGMT_REASSOC_RSP, |
| 1435 | peerMacAddr,psessionEntry->selfMacAddr); |
| 1436 | if ( eSIR_SUCCESS != nSirStatus ) |
| 1437 | { |
| 1438 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1439 | "tor for an Association Response (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1440 | nSirStatus ); |
| 1441 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1442 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1443 | return; |
| 1444 | } |
| 1445 | |
| 1446 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 1447 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1448 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 1449 | |
| 1450 | nStatus = dot11fPackAssocResponse( pMac, &frm, |
| 1451 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 1452 | nPayload, &nPayload ); |
| 1453 | if ( DOT11F_FAILED( nStatus ) ) |
| 1454 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1455 | limLog( pMac, LOGE, FL("Failed to pack an Association Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1456 | nStatus ); |
| 1457 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1458 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1459 | return; // allocated! |
| 1460 | } |
| 1461 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1462 | { |
| 1463 | limLog( pMac, LOGW, FL("There were warnings while packing an " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1464 | "Association Response (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1465 | } |
| 1466 | |
| 1467 | macAddr = pMacHdr->da; |
| 1468 | |
| 1469 | if (subType == LIM_ASSOC) |
| 1470 | { |
| 1471 | PELOG1(limLog(pMac, LOG1, |
| 1472 | FL("*** Sending Assoc Resp status %d aid %d to "), |
| 1473 | statusCode, aid);) |
| 1474 | } |
| 1475 | else{ |
| 1476 | PELOG1(limLog(pMac, LOG1, |
| 1477 | FL("*** Sending ReAssoc Resp status %d aid %d to "), |
| 1478 | statusCode, aid);) |
| 1479 | } |
| 1480 | PELOG1(limPrintMacAddr(pMac, pMacHdr->da, LOG1);) |
| 1481 | |
| 1482 | if ( addnIEPresent ) |
| 1483 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1484 | vos_mem_copy ( pFrame+sizeof(tSirMacMgmtHdr)+nPayload, &addIE[0], addnIELen ) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1485 | } |
| 1486 | |
| 1487 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1488 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 1489 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1490 | ) |
| 1491 | { |
| 1492 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 1493 | } |
| 1494 | |
| 1495 | /// Queue Association Response frame in high priority WQ |
| 1496 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 1497 | HAL_TXRX_FRM_802_11_MGMT, |
| 1498 | ANI_TXDIR_TODS, |
| 1499 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 1500 | limTxComplete, pFrame, txFlag ); |
| 1501 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1502 | { |
| 1503 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1504 | FL("*** Could not Send Re/AssocRsp, retCode=%X ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1505 | nSirStatus); |
| 1506 | |
| 1507 | //Pkt will be freed up by the callback |
| 1508 | } |
| 1509 | |
| 1510 | // update the ANI peer station count |
| 1511 | //FIXME_PROTECTION : take care of different type of station |
| 1512 | // counter inside this function. |
| 1513 | limUtilCountStaAdd(pMac, pSta, psessionEntry); |
| 1514 | |
| 1515 | } // End limSendAssocRspMgmtFrame. |
| 1516 | |
| 1517 | |
| 1518 | |
| 1519 | void |
| 1520 | limSendAddtsRspActionFrame(tpAniSirGlobal pMac, |
| 1521 | tSirMacAddr peer, |
| 1522 | tANI_U16 nStatusCode, |
| 1523 | tSirAddtsReqInfo *pAddTS, |
| 1524 | tSirMacScheduleIE *pSchedule, |
| 1525 | tpPESession psessionEntry) |
| 1526 | { |
| 1527 | tANI_U8 *pFrame; |
| 1528 | tpSirMacMgmtHdr pMacHdr; |
| 1529 | tDot11fAddTSResponse AddTSRsp; |
| 1530 | tDot11fWMMAddTSResponse WMMAddTSRsp; |
| 1531 | tSirRetStatus nSirStatus; |
| 1532 | tANI_U32 i, nBytes, nPayload, nStatus; |
| 1533 | void *pPacket; |
| 1534 | eHalStatus halstatus; |
| 1535 | tANI_U8 txFlag = 0; |
| 1536 | |
| 1537 | if(NULL == psessionEntry) |
| 1538 | { |
| 1539 | return; |
| 1540 | } |
| 1541 | |
| 1542 | if ( ! pAddTS->wmeTspecPresent ) |
| 1543 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1544 | vos_mem_set( ( tANI_U8* )&AddTSRsp, sizeof( AddTSRsp ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1545 | |
| 1546 | AddTSRsp.Category.category = SIR_MAC_ACTION_QOS_MGMT; |
| 1547 | AddTSRsp.Action.action = SIR_MAC_QOS_ADD_TS_RSP; |
| 1548 | AddTSRsp.DialogToken.token = pAddTS->dialogToken; |
| 1549 | AddTSRsp.Status.status = nStatusCode; |
| 1550 | |
| 1551 | // The TsDelay information element is only filled in for a specific |
| 1552 | // status code: |
| 1553 | if ( eSIR_MAC_TS_NOT_CREATED_STATUS == nStatusCode ) |
| 1554 | { |
| 1555 | if ( pAddTS->wsmTspecPresent ) |
| 1556 | { |
| 1557 | AddTSRsp.WMMTSDelay.version = 1; |
| 1558 | AddTSRsp.WMMTSDelay.delay = 10; |
| 1559 | AddTSRsp.WMMTSDelay.present = 1; |
| 1560 | } |
| 1561 | else |
| 1562 | { |
| 1563 | AddTSRsp.TSDelay.delay = 10; |
| 1564 | AddTSRsp.TSDelay.present = 1; |
| 1565 | } |
| 1566 | } |
| 1567 | |
| 1568 | if ( pAddTS->wsmTspecPresent ) |
| 1569 | { |
| 1570 | PopulateDot11fWMMTSPEC( &pAddTS->tspec, &AddTSRsp.WMMTSPEC ); |
| 1571 | } |
| 1572 | else |
| 1573 | { |
| 1574 | PopulateDot11fTSPEC( &pAddTS->tspec, &AddTSRsp.TSPEC ); |
| 1575 | } |
| 1576 | |
| 1577 | if ( pAddTS->wsmTspecPresent ) |
| 1578 | { |
| 1579 | AddTSRsp.num_WMMTCLAS = 0; |
| 1580 | AddTSRsp.num_TCLAS = pAddTS->numTclas; |
| 1581 | for ( i = 0; i < AddTSRsp.num_TCLAS; ++i) |
| 1582 | { |
| 1583 | PopulateDot11fTCLAS( pMac, &pAddTS->tclasInfo[i], |
| 1584 | &AddTSRsp.TCLAS[i] ); |
| 1585 | } |
| 1586 | } |
| 1587 | else |
| 1588 | { |
| 1589 | AddTSRsp.num_TCLAS = 0; |
| 1590 | AddTSRsp.num_WMMTCLAS = pAddTS->numTclas; |
| 1591 | for ( i = 0; i < AddTSRsp.num_WMMTCLAS; ++i) |
| 1592 | { |
| 1593 | PopulateDot11fWMMTCLAS( pMac, &pAddTS->tclasInfo[i], |
| 1594 | &AddTSRsp.WMMTCLAS[i] ); |
| 1595 | } |
| 1596 | } |
| 1597 | |
| 1598 | if ( pAddTS->tclasProcPresent ) |
| 1599 | { |
| 1600 | if ( pAddTS->wsmTspecPresent ) |
| 1601 | { |
| 1602 | AddTSRsp.WMMTCLASPROC.version = 1; |
| 1603 | AddTSRsp.WMMTCLASPROC.processing = pAddTS->tclasProc; |
| 1604 | AddTSRsp.WMMTCLASPROC.present = 1; |
| 1605 | } |
| 1606 | else |
| 1607 | { |
| 1608 | AddTSRsp.TCLASSPROC.processing = pAddTS->tclasProc; |
| 1609 | AddTSRsp.TCLASSPROC.present = 1; |
| 1610 | } |
| 1611 | } |
| 1612 | |
| 1613 | // schedule element is included only if requested in the tspec and we are |
| 1614 | // using hcca (or both edca and hcca) |
| 1615 | // 11e-D8.0 is inconsistent on whether the schedule element is included |
| 1616 | // based on tspec schedule bit or not. Sec 7.4.2.2. says one thing but |
| 1617 | // pg 46, line 17-18 says something else. So just include it and let the |
| 1618 | // sta figure it out |
| 1619 | if ((pSchedule != NULL) && |
| 1620 | ((pAddTS->tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) || |
| 1621 | (pAddTS->tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH))) |
| 1622 | { |
| 1623 | if ( pAddTS->wsmTspecPresent ) |
| 1624 | { |
| 1625 | PopulateDot11fWMMSchedule( pSchedule, &AddTSRsp.WMMSchedule ); |
| 1626 | } |
| 1627 | else |
| 1628 | { |
| 1629 | PopulateDot11fSchedule( pSchedule, &AddTSRsp.Schedule ); |
| 1630 | } |
| 1631 | } |
| 1632 | |
| 1633 | nStatus = dot11fGetPackedAddTSResponseSize( pMac, &AddTSRsp, &nPayload ); |
| 1634 | if ( DOT11F_FAILED( nStatus ) ) |
| 1635 | { |
| 1636 | limLog( pMac, LOGP, FL("Failed to calculate the packed si" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1637 | "ze for an Add TS Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1638 | nStatus ); |
| 1639 | // We'll fall back on the worst case scenario: |
| 1640 | nPayload = sizeof( tDot11fAddTSResponse ); |
| 1641 | } |
| 1642 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1643 | { |
| 1644 | limLog( pMac, LOGW, FL("There were warnings while calcula" |
| 1645 | "tingthe packed size for an Add TS" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1646 | " Response (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1647 | } |
| 1648 | } |
| 1649 | else |
| 1650 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1651 | vos_mem_set( ( tANI_U8* )&WMMAddTSRsp, sizeof( WMMAddTSRsp ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1652 | |
| 1653 | WMMAddTSRsp.Category.category = SIR_MAC_ACTION_WME; |
| 1654 | WMMAddTSRsp.Action.action = SIR_MAC_QOS_ADD_TS_RSP; |
| 1655 | WMMAddTSRsp.DialogToken.token = pAddTS->dialogToken; |
| 1656 | WMMAddTSRsp.StatusCode.statusCode = (tANI_U8)nStatusCode; |
| 1657 | |
| 1658 | PopulateDot11fWMMTSPEC( &pAddTS->tspec, &WMMAddTSRsp.WMMTSPEC ); |
| 1659 | |
| 1660 | nStatus = dot11fGetPackedWMMAddTSResponseSize( pMac, &WMMAddTSRsp, &nPayload ); |
| 1661 | if ( DOT11F_FAILED( nStatus ) ) |
| 1662 | { |
| 1663 | limLog( pMac, LOGP, FL("Failed to calculate the packed si" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1664 | "ze for a WMM Add TS Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1665 | nStatus ); |
| 1666 | // We'll fall back on the worst case scenario: |
| 1667 | nPayload = sizeof( tDot11fWMMAddTSResponse ); |
| 1668 | } |
| 1669 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1670 | { |
| 1671 | limLog( pMac, LOGW, FL("There were warnings while calcula" |
| 1672 | "tingthe packed size for a WMM Add" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1673 | "TS Response (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1674 | } |
| 1675 | } |
| 1676 | |
| 1677 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 1678 | |
| 1679 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 1680 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1681 | { |
| 1682 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for an Ad" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1683 | "d TS Response."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1684 | return; |
| 1685 | } |
| 1686 | |
| 1687 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1688 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1689 | |
| 1690 | // Next, we fill out the buffer descriptor: |
| 1691 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 1692 | SIR_MAC_MGMT_ACTION, peer,psessionEntry->selfMacAddr); |
| 1693 | if ( eSIR_SUCCESS != nSirStatus ) |
| 1694 | { |
| 1695 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1696 | "tor for an Add TS Response (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1697 | nSirStatus ); |
| 1698 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1699 | return; // allocated! |
| 1700 | } |
| 1701 | |
| 1702 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 1703 | |
| 1704 | |
| 1705 | #if 0 |
| 1706 | if ( eSIR_SUCCESS != wlan_cfgGetStr( pMac, WNI_CFG_BSSID, |
| 1707 | ( tANI_U8* )pMacHdr->bssId, &cfgLen ) ) |
| 1708 | { |
| 1709 | limLog( pMac, LOGP, FL("Failed to retrieve WNI_CFG_BSSID whil" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1710 | "e sending an Add TS Response.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1711 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1712 | return; // allocated! |
| 1713 | } |
| 1714 | #endif //TO SUPPORT BT-AMP |
| 1715 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 1716 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1717 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 1718 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1719 | #endif |
| 1720 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1721 | // That done, pack the struct: |
| 1722 | if ( ! pAddTS->wmeTspecPresent ) |
| 1723 | { |
| 1724 | nStatus = dot11fPackAddTSResponse( pMac, &AddTSRsp, |
| 1725 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 1726 | nPayload, &nPayload ); |
| 1727 | if ( DOT11F_FAILED( nStatus ) ) |
| 1728 | { |
| 1729 | limLog( pMac, LOGE, FL("Failed to pack an Add TS Response " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1730 | "(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1731 | nStatus ); |
| 1732 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1733 | return; |
| 1734 | } |
| 1735 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1736 | { |
| 1737 | limLog( pMac, LOGW, FL("There were warnings while packing" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1738 | "an Add TS Response (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1739 | } |
| 1740 | } |
| 1741 | else |
| 1742 | { |
| 1743 | nStatus = dot11fPackWMMAddTSResponse( pMac, &WMMAddTSRsp, |
| 1744 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 1745 | nPayload, &nPayload ); |
| 1746 | if ( DOT11F_FAILED( nStatus ) ) |
| 1747 | { |
| 1748 | limLog( pMac, LOGE, FL("Failed to pack a WMM Add TS Response " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1749 | "(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1750 | nStatus ); |
| 1751 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1752 | return; |
| 1753 | } |
| 1754 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1755 | { |
| 1756 | limLog( pMac, LOGW, FL("There were warnings while packing" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1757 | "a WMM Add TS Response (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1758 | } |
| 1759 | } |
| 1760 | |
| 1761 | PELOG1(limLog( pMac, LOG1, FL("Sending an Add TS Response (status %d) to "), |
| 1762 | nStatusCode ); |
| 1763 | limPrintMacAddr( pMac, pMacHdr->da, LOG1 );) |
| 1764 | |
| 1765 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1766 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 1767 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1768 | ) |
| 1769 | { |
| 1770 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 1771 | } |
| 1772 | |
| 1773 | // Queue the frame in high priority WQ: |
| 1774 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 1775 | HAL_TXRX_FRM_802_11_MGMT, |
| 1776 | ANI_TXDIR_TODS, |
| 1777 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 1778 | limTxComplete, pFrame, txFlag ); |
| 1779 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1780 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1781 | limLog( pMac, LOGE, FL("Failed to send Add TS Response (%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1782 | nSirStatus ); |
| 1783 | //Pkt will be freed up by the callback |
| 1784 | } |
| 1785 | |
| 1786 | } // End limSendAddtsRspActionFrame. |
| 1787 | |
| 1788 | void |
| 1789 | limSendDeltsReqActionFrame(tpAniSirGlobal pMac, |
| 1790 | tSirMacAddr peer, |
| 1791 | tANI_U8 wmmTspecPresent, |
| 1792 | tSirMacTSInfo *pTsinfo, |
| 1793 | tSirMacTspecIE *pTspecIe, |
| 1794 | tpPESession psessionEntry) |
| 1795 | { |
| 1796 | tANI_U8 *pFrame; |
| 1797 | tpSirMacMgmtHdr pMacHdr; |
| 1798 | tDot11fDelTS DelTS; |
| 1799 | tDot11fWMMDelTS WMMDelTS; |
| 1800 | tSirRetStatus nSirStatus; |
| 1801 | tANI_U32 nBytes, nPayload, nStatus; |
| 1802 | void *pPacket; |
| 1803 | eHalStatus halstatus; |
| 1804 | tANI_U8 txFlag = 0; |
| 1805 | |
| 1806 | if(NULL == psessionEntry) |
| 1807 | { |
| 1808 | return; |
| 1809 | } |
| 1810 | |
| 1811 | if ( ! wmmTspecPresent ) |
| 1812 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1813 | vos_mem_set( ( tANI_U8* )&DelTS, sizeof( DelTS ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1814 | |
| 1815 | DelTS.Category.category = SIR_MAC_ACTION_QOS_MGMT; |
| 1816 | DelTS.Action.action = SIR_MAC_QOS_DEL_TS_REQ; |
| 1817 | PopulateDot11fTSInfo( pTsinfo, &DelTS.TSInfo ); |
| 1818 | |
| 1819 | nStatus = dot11fGetPackedDelTSSize( pMac, &DelTS, &nPayload ); |
| 1820 | if ( DOT11F_FAILED( nStatus ) ) |
| 1821 | { |
| 1822 | limLog( pMac, LOGP, FL("Failed to calculate the packed si" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1823 | "ze for a Del TS (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1824 | nStatus ); |
| 1825 | // We'll fall back on the worst case scenario: |
| 1826 | nPayload = sizeof( tDot11fDelTS ); |
| 1827 | } |
| 1828 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1829 | { |
| 1830 | limLog( pMac, LOGW, FL("There were warnings while calcula" |
| 1831 | "ting the packed size for a Del TS" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1832 | " (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1833 | } |
| 1834 | } |
| 1835 | else |
| 1836 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1837 | vos_mem_set( ( tANI_U8* )&WMMDelTS, sizeof( WMMDelTS ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1838 | |
| 1839 | WMMDelTS.Category.category = SIR_MAC_ACTION_WME; |
| 1840 | WMMDelTS.Action.action = SIR_MAC_QOS_DEL_TS_REQ; |
| 1841 | WMMDelTS.DialogToken.token = 0; |
| 1842 | WMMDelTS.StatusCode.statusCode = 0; |
| 1843 | PopulateDot11fWMMTSPEC( pTspecIe, &WMMDelTS.WMMTSPEC ); |
| 1844 | nStatus = dot11fGetPackedWMMDelTSSize( pMac, &WMMDelTS, &nPayload ); |
| 1845 | if ( DOT11F_FAILED( nStatus ) ) |
| 1846 | { |
| 1847 | limLog( pMac, LOGP, FL("Failed to calculate the packed si" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1848 | "ze for a WMM Del TS (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1849 | nStatus ); |
| 1850 | // We'll fall back on the worst case scenario: |
| 1851 | nPayload = sizeof( tDot11fDelTS ); |
| 1852 | } |
| 1853 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1854 | { |
| 1855 | limLog( pMac, LOGW, FL("There were warnings while calcula" |
| 1856 | "ting the packed size for a WMM De" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1857 | "l TS (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1858 | } |
| 1859 | } |
| 1860 | |
| 1861 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 1862 | |
| 1863 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 1864 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1865 | { |
| 1866 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for an Ad" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1867 | "d TS Response."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1868 | return; |
| 1869 | } |
| 1870 | |
| 1871 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 1872 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1873 | |
| 1874 | // Next, we fill out the buffer descriptor: |
| 1875 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 1876 | SIR_MAC_MGMT_ACTION, peer, |
| 1877 | psessionEntry->selfMacAddr); |
| 1878 | if ( eSIR_SUCCESS != nSirStatus ) |
| 1879 | { |
| 1880 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1881 | "tor for an Add TS Response (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1882 | nSirStatus ); |
| 1883 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1884 | return; // allocated! |
| 1885 | } |
| 1886 | |
| 1887 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 1888 | |
| 1889 | #if 0 |
| 1890 | |
| 1891 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 1892 | if ( eSIR_SUCCESS != wlan_cfgGetStr( pMac, WNI_CFG_BSSID, |
| 1893 | ( tANI_U8* )pMacHdr->bssId, &cfgLen ) ) |
| 1894 | { |
| 1895 | limLog( pMac, LOGP, FL("Failed to retrieve WNI_CFG_BSSID whil" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1896 | "e sending an Add TS Response.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1897 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1898 | return; // allocated! |
| 1899 | } |
| 1900 | #endif //TO SUPPORT BT-AMP |
| 1901 | sirCopyMacAddr(pMacHdr->bssId, psessionEntry->bssId); |
| 1902 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1903 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 1904 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1905 | #endif |
| 1906 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1907 | // That done, pack the struct: |
| 1908 | if ( !wmmTspecPresent ) |
| 1909 | { |
| 1910 | nStatus = dot11fPackDelTS( pMac, &DelTS, |
| 1911 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 1912 | nPayload, &nPayload ); |
| 1913 | if ( DOT11F_FAILED( nStatus ) ) |
| 1914 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1915 | limLog( pMac, LOGE, FL("Failed to pack a Del TS frame (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1916 | nStatus ); |
| 1917 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1918 | return; // allocated! |
| 1919 | } |
| 1920 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1921 | { |
| 1922 | limLog( pMac, LOGW, FL("There were warnings while packing" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1923 | "a Del TS frame (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1924 | } |
| 1925 | } |
| 1926 | else |
| 1927 | { |
| 1928 | nStatus = dot11fPackWMMDelTS( pMac, &WMMDelTS, |
| 1929 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 1930 | nPayload, &nPayload ); |
| 1931 | if ( DOT11F_FAILED( nStatus ) ) |
| 1932 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1933 | limLog( pMac, LOGE, FL("Failed to pack a WMM Del TS frame (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1934 | nStatus ); |
| 1935 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1936 | return; // allocated! |
| 1937 | } |
| 1938 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1939 | { |
| 1940 | limLog( pMac, LOGW, FL("There were warnings while packing" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1941 | "a WMM Del TS frame (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1942 | } |
| 1943 | } |
| 1944 | |
| 1945 | PELOG1(limLog(pMac, LOG1, FL("Sending DELTS REQ (size %d) to "), nBytes); |
| 1946 | limPrintMacAddr(pMac, pMacHdr->da, LOG1);) |
| 1947 | |
| 1948 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1949 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 1950 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1951 | ) |
| 1952 | { |
| 1953 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 1954 | } |
| 1955 | |
| 1956 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 1957 | HAL_TXRX_FRM_802_11_MGMT, |
| 1958 | ANI_TXDIR_TODS, |
| 1959 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 1960 | limTxComplete, pFrame, txFlag ); |
| 1961 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1962 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1963 | limLog( pMac, LOGE, FL("Failed to send Del TS (%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1964 | nSirStatus ); |
| 1965 | //Pkt will be freed up by the callback |
| 1966 | } |
| 1967 | |
| 1968 | } // End limSendDeltsReqActionFrame. |
| 1969 | |
| 1970 | void |
| 1971 | limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, |
| 1972 | tLimMlmAssocReq *pMlmAssocReq, |
| 1973 | tpPESession psessionEntry) |
| 1974 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1975 | tDot11fAssocRequest *pFrm; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1976 | tANI_U16 caps; |
| 1977 | tANI_U8 *pFrame; |
| 1978 | tSirRetStatus nSirStatus; |
| 1979 | tLimMlmAssocCnf mlmAssocCnf; |
| 1980 | tANI_U32 nBytes, nPayload, nStatus; |
| 1981 | tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; |
| 1982 | void *pPacket; |
| 1983 | eHalStatus halstatus; |
| 1984 | tANI_U16 nAddIELen; |
| 1985 | tANI_U8 *pAddIE; |
| 1986 | tANI_U8 *wpsIe = NULL; |
| 1987 | #if defined WLAN_FEATURE_VOWIFI |
| 1988 | tANI_U8 PowerCapsPopulated = FALSE; |
| 1989 | #endif |
| 1990 | tANI_U8 txFlag = 0; |
| 1991 | |
| 1992 | if(NULL == psessionEntry) |
| 1993 | { |
| 1994 | return; |
| 1995 | } |
| 1996 | |
| 1997 | if(NULL == psessionEntry->pLimJoinReq) |
| 1998 | { |
| 1999 | return; |
| 2000 | } |
| 2001 | |
| 2002 | /* check this early to avoid unncessary operation */ |
| 2003 | if(NULL == psessionEntry->pLimJoinReq) |
| 2004 | { |
| 2005 | return; |
| 2006 | } |
| 2007 | nAddIELen = psessionEntry->pLimJoinReq->addIEAssoc.length; |
| 2008 | pAddIE = psessionEntry->pLimJoinReq->addIEAssoc.addIEdata; |
| 2009 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2010 | pFrm = vos_mem_malloc(sizeof(tDot11fAssocRequest)); |
| 2011 | if ( NULL == pFrm ) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2012 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2013 | limLog(pMac, LOGE, FL("Unable to allocate memory in limSendAssocReqMgmtFrame") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2014 | return; |
| 2015 | } |
| 2016 | |
| 2017 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2018 | vos_mem_set( ( tANI_U8* )pFrm, sizeof( tDot11fAssocRequest ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2019 | |
| 2020 | caps = pMlmAssocReq->capabilityInfo; |
| 2021 | if ( PROP_CAPABILITY_GET( 11EQOS, psessionEntry->limCurrentBssPropCap ) ) |
| 2022 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 2023 | #if defined(FEATURE_WLAN_WAPI) |
| 2024 | /* CR: 262463 : |
| 2025 | According to WAPI standard: |
| 2026 | 7.3.1.4 Capability Information field |
| 2027 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 2028 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 2029 | Reassociation management frames. */ |
| 2030 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 2031 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 2032 | #endif |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2033 | swapBitField16(caps, ( tANI_U16* )&pFrm->Capabilities ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2034 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2035 | pFrm->ListenInterval.interval = pMlmAssocReq->listenInterval; |
| 2036 | PopulateDot11fSSID2( pMac, &pFrm->SSID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2037 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2038 | &pFrm->SuppRates,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2039 | |
| 2040 | fQosEnabled = ( psessionEntry->limQosEnabled) && |
| 2041 | SIR_MAC_GET_QOS( psessionEntry->limCurrentBssCaps ); |
| 2042 | |
| 2043 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 2044 | LIM_BSS_CAPS_GET( WME, psessionEntry->limCurrentBssQosCaps ); |
| 2045 | |
| 2046 | // We prefer .11e asociations: |
| 2047 | if ( fQosEnabled ) fWmeEnabled = false; |
| 2048 | |
| 2049 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 2050 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limCurrentBssQosCaps ); |
| 2051 | |
| 2052 | if ( psessionEntry->lim11hEnable && |
| 2053 | psessionEntry->pLimJoinReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 2054 | { |
| 2055 | #if defined WLAN_FEATURE_VOWIFI |
| 2056 | PowerCapsPopulated = TRUE; |
| 2057 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2058 | PopulateDot11fPowerCaps( pMac, &pFrm->PowerCaps, LIM_ASSOC,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2059 | #endif |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2060 | PopulateDot11fSuppChannels( pMac, &pFrm->SuppChannels, LIM_ASSOC,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2061 | |
| 2062 | } |
| 2063 | |
| 2064 | #if defined WLAN_FEATURE_VOWIFI |
| 2065 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2066 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2067 | { |
| 2068 | if (PowerCapsPopulated == FALSE) |
| 2069 | { |
| 2070 | PowerCapsPopulated = TRUE; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2071 | PopulateDot11fPowerCaps(pMac, &pFrm->PowerCaps, LIM_ASSOC, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2072 | } |
| 2073 | } |
| 2074 | #endif |
| 2075 | |
| 2076 | if ( fQosEnabled && |
| 2077 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limCurrentBssPropCap))) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2078 | PopulateDot11fQOSCapsStation( pMac, &pFrm->QOSCapsStation ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2079 | |
| 2080 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2081 | &pFrm->ExtSuppRates, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2082 | |
| 2083 | #if defined WLAN_FEATURE_VOWIFI |
| 2084 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2085 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2086 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2087 | PopulateDot11fRRMIe( pMac, &pFrm->RRMEnabledCap, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2088 | } |
| 2089 | #endif |
| 2090 | // The join request *should* contain zero or one of the WPA and RSN |
| 2091 | // IEs. The payload send along with the request is a |
| 2092 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 2093 | |
| 2094 | // typedef struct sSirRSNie |
| 2095 | // { |
| 2096 | // tANI_U16 length; |
| 2097 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 2098 | // } tSirRSNie, *tpSirRSNie; |
| 2099 | |
| 2100 | // So, we should be able to make the following two calls harmlessly, |
| 2101 | // since they do nothing if they don't find the given IE in the |
| 2102 | // bytestream with which they're provided. |
| 2103 | |
| 2104 | // The net effect of this will be to faithfully transmit whatever |
| 2105 | // security IE is in the join request. |
| 2106 | |
| 2107 | // *However*, if we're associating for the purpose of WPS |
| 2108 | // enrollment, and we've been configured to indicate that by |
| 2109 | // eliding the WPA or RSN IE, we just skip this: |
| 2110 | if( nAddIELen && pAddIE ) |
| 2111 | { |
| 2112 | wpsIe = limGetWscIEPtr (pMac, pAddIE, nAddIELen); |
| 2113 | } |
| 2114 | if ( NULL == wpsIe ) |
| 2115 | { |
| 2116 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2117 | &pFrm->RSNOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2118 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2119 | &pFrm->WPAOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2120 | #if defined(FEATURE_WLAN_WAPI) |
| 2121 | PopulateDot11fWAPIOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2122 | &pFrm->WAPIOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2123 | #endif // defined(FEATURE_WLAN_WAPI) |
| 2124 | } |
| 2125 | |
| 2126 | // include WME EDCA IE as well |
| 2127 | if ( fWmeEnabled ) |
| 2128 | { |
| 2129 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limCurrentBssPropCap ) ) |
| 2130 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2131 | PopulateDot11fWMMInfoStation( pMac, &pFrm->WMMInfoStation ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2132 | } |
| 2133 | |
| 2134 | if ( fWsmEnabled && |
| 2135 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limCurrentBssPropCap ))) |
| 2136 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2137 | PopulateDot11fWMMCaps( &pFrm->WMMCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2138 | } |
| 2139 | } |
| 2140 | |
| 2141 | //Populate HT IEs, when operating in 11n or Taurus modes AND |
| 2142 | //when AP is also operating in 11n mode. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2143 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2144 | pMac->lim.htCapabilityPresentInBeacon) |
| 2145 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2146 | PopulateDot11fHTCaps( pMac, psessionEntry, &pFrm->HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2147 | #ifdef DISABLE_GF_FOR_INTEROP |
| 2148 | |
| 2149 | /* |
| 2150 | * To resolve the interop problem with Broadcom AP, |
| 2151 | * where TQ STA could not pass traffic with GF enabled, |
| 2152 | * TQ STA will do Greenfield only with TQ AP, for |
| 2153 | * everybody else it will be turned off. |
| 2154 | */ |
| 2155 | |
| 2156 | if( (psessionEntry->pLimJoinReq != NULL) && (!psessionEntry->pLimJoinReq->bssDescription.aniIndicator)) |
| 2157 | { |
| 2158 | limLog( pMac, LOG1, FL("Sending Assoc Req to Non-TQ AP, Turning off Greenfield")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2159 | pFrm->HTCaps.greenField = WNI_CFG_GREENFIELD_CAPABILITY_DISABLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2160 | } |
| 2161 | #endif |
| 2162 | |
| 2163 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2164 | #ifdef WLAN_FEATURE_11AC |
| 2165 | if ( psessionEntry->vhtCapability && |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2166 | psessionEntry->vhtCapabilityPresentInBeacon) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2167 | { |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 2168 | limLog( pMac, LOG1, FL("Populate VHT IEs in Assoc Request")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2169 | PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps ); |
| 2170 | PopulateDot11fExtCap( pMac, &pFrm->ExtCap); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2171 | } |
| 2172 | #endif |
| 2173 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2174 | |
| 2175 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2176 | if (psessionEntry->pLimJoinReq->is11Rconnection) |
| 2177 | { |
| 2178 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2179 | limLog( pMac, LOG1, FL("mdie = %02x %02x %02x"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2180 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[0], |
| 2181 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[1], |
| 2182 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[2]); |
| 2183 | #endif |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2184 | PopulateMDIE( pMac, &pFrm->MobilityDomain, |
| 2185 | psessionEntry->pLimJoinReq->bssDescription.mdie); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2186 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2187 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2188 | { |
| 2189 | // No 11r IEs dont send any MDIE |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2190 | limLog( pMac, LOG1, FL("MDIE not present")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2191 | } |
| 2192 | #endif |
| 2193 | |
| 2194 | #ifdef FEATURE_WLAN_CCX |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2195 | /* CCX Version IE will be included in association request |
| 2196 | when CCX is enabled on DUT through ini */ |
| 2197 | if (psessionEntry->pLimJoinReq->isCCXFeatureIniEnabled) |
| 2198 | { |
| 2199 | PopulateDot11fCCXVersion(&pFrm->CCXVersion); |
| 2200 | } |
| 2201 | /* For CCX Associations fill the CCX IEs */ |
| 2202 | if (psessionEntry->isCCXconnection && |
| 2203 | psessionEntry->pLimJoinReq->isCCXFeatureIniEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2204 | { |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2205 | #ifndef FEATURE_DISABLE_RM |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2206 | PopulateDot11fCCXRadMgmtCap(&pFrm->CCXRadMgmtCap); |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2207 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2208 | } |
| 2209 | #endif |
| 2210 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2211 | nStatus = dot11fGetPackedAssocRequestSize( pMac, pFrm, &nPayload ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2212 | if ( DOT11F_FAILED( nStatus ) ) |
| 2213 | { |
| 2214 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2215 | "or an Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2216 | nStatus ); |
| 2217 | // We'll fall back on the worst case scenario: |
| 2218 | nPayload = sizeof( tDot11fAssocRequest ); |
| 2219 | } |
| 2220 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2221 | { |
| 2222 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 2223 | "the packed size for an Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2224 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2225 | } |
| 2226 | |
| 2227 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
| 2228 | |
| 2229 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2230 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 2231 | ( void** ) &pPacket ); |
| 2232 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2233 | { |
| 2234 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for an As" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2235 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2236 | |
| 2237 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2238 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2239 | |
| 2240 | |
| 2241 | /* Update PE session id*/ |
| 2242 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 2243 | |
| 2244 | mlmAssocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 2245 | |
| 2246 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2247 | ( void* ) pFrame, ( void* ) pPacket ); |
| 2248 | |
| 2249 | limPostSmeMessage( pMac, LIM_MLM_ASSOC_CNF, |
| 2250 | ( tANI_U32* ) &mlmAssocCnf); |
| 2251 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2252 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2253 | return; |
| 2254 | } |
| 2255 | |
| 2256 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2257 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2258 | |
| 2259 | // Next, we fill out the buffer descriptor: |
| 2260 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 2261 | SIR_MAC_MGMT_ASSOC_REQ, psessionEntry->bssId,psessionEntry->selfMacAddr); |
| 2262 | if ( eSIR_SUCCESS != nSirStatus ) |
| 2263 | { |
| 2264 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2265 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2266 | nSirStatus ); |
| 2267 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2268 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2269 | return; |
| 2270 | } |
| 2271 | |
| 2272 | |
| 2273 | // That done, pack the Probe Request: |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2274 | nStatus = dot11fPackAssocRequest( pMac, pFrm, pFrame + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2275 | sizeof(tSirMacMgmtHdr), |
| 2276 | nPayload, &nPayload ); |
| 2277 | if ( DOT11F_FAILED( nStatus ) ) |
| 2278 | { |
| 2279 | limLog( pMac, LOGE, FL("Failed to pack a Probe Response (0x%0" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2280 | "8x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2281 | nStatus ); |
| 2282 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2283 | ( void* ) pFrame, ( void* ) pPacket ); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2284 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2285 | return; |
| 2286 | } |
| 2287 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2288 | { |
| 2289 | limLog( pMac, LOGW, FL("There were warnings while packing a P" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2290 | "robe Response (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2291 | } |
| 2292 | |
| 2293 | PELOG1(limLog( pMac, LOG1, FL("*** Sending Association Request length %d" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2294 | "to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2295 | nBytes );) |
| 2296 | // limPrintMacAddr( pMac, bssid, LOG1 ); |
| 2297 | |
| 2298 | if( psessionEntry->assocReq != NULL ) |
| 2299 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2300 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2301 | psessionEntry->assocReq = NULL; |
| 2302 | } |
| 2303 | |
| 2304 | if( nAddIELen ) |
| 2305 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2306 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 2307 | pAddIE, |
| 2308 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2309 | nPayload += nAddIELen; |
| 2310 | } |
| 2311 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2312 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 2313 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2314 | { |
| 2315 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));) |
| 2316 | } |
| 2317 | else |
| 2318 | { |
| 2319 | //Store the Assoc request. This is sent to csr/hdd in join cnf response. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2320 | vos_mem_copy( psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2321 | psessionEntry->assocReqLen = nPayload; |
| 2322 | } |
| 2323 | |
| 2324 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2325 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 2326 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2327 | ) |
| 2328 | { |
| 2329 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 2330 | } |
| 2331 | |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 2332 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) |
| 2333 | { |
| 2334 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 2335 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 2336 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2337 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 2338 | HAL_TXRX_FRM_802_11_MGMT, |
| 2339 | ANI_TXDIR_TODS, |
| 2340 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 2341 | limTxComplete, pFrame, txFlag ); |
| 2342 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2343 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2344 | limLog( pMac, LOGE, FL("Failed to send Association Request (%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2345 | halstatus ); |
| 2346 | //Pkt will be freed up by the callback |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2347 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2348 | return; |
| 2349 | } |
| 2350 | |
| 2351 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2352 | vos_mem_free(pMlmAssocReq); |
| 2353 | vos_mem_free(pFrm); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2354 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2355 | } // End limSendAssocReqMgmtFrame |
| 2356 | |
| 2357 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2358 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2359 | /*------------------------------------------------------------------------------------ |
| 2360 | * |
| 2361 | * Send Reassoc Req with FTIEs. |
| 2362 | * |
| 2363 | *----------------------------------------------------------------------------------- |
| 2364 | */ |
| 2365 | void |
| 2366 | limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, |
| 2367 | tLimMlmReassocReq *pMlmReassocReq,tpPESession psessionEntry) |
| 2368 | { |
| 2369 | static tDot11fReAssocRequest frm; |
| 2370 | tANI_U16 caps; |
| 2371 | tANI_U8 *pFrame; |
| 2372 | tSirRetStatus nSirStatus; |
| 2373 | tANI_U32 nBytes, nPayload, nStatus; |
| 2374 | tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; |
| 2375 | void *pPacket; |
| 2376 | eHalStatus halstatus; |
| 2377 | #if defined WLAN_FEATURE_VOWIFI |
| 2378 | tANI_U8 PowerCapsPopulated = FALSE; |
| 2379 | #endif |
| 2380 | tANI_U16 ft_ies_length = 0; |
| 2381 | tANI_U8 *pBody; |
| 2382 | tANI_U16 nAddIELen; |
| 2383 | tANI_U8 *pAddIE; |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2384 | #if defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2385 | tANI_U8 *wpsIe = NULL; |
| 2386 | #endif |
| 2387 | tANI_U8 txFlag = 0; |
| 2388 | |
| 2389 | if (NULL == psessionEntry) |
| 2390 | { |
| 2391 | return; |
| 2392 | } |
| 2393 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2394 | /* check this early to avoid unncessary operation */ |
| 2395 | if(NULL == psessionEntry->pLimReAssocReq) |
| 2396 | { |
| 2397 | return; |
| 2398 | } |
| 2399 | nAddIELen = psessionEntry->pLimReAssocReq->addIEAssoc.length; |
| 2400 | pAddIE = psessionEntry->pLimReAssocReq->addIEAssoc.addIEdata; |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 2401 | limLog( pMac, LOG1, FL("limSendReassocReqWithFTIEsMgmtFrame received in " |
| 2402 | "state (%d)."), psessionEntry->limMlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2403 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2404 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2405 | |
| 2406 | caps = pMlmReassocReq->capabilityInfo; |
| 2407 | if (PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap)) |
| 2408 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 2409 | #if defined(FEATURE_WLAN_WAPI) |
| 2410 | /* CR: 262463 : |
| 2411 | According to WAPI standard: |
| 2412 | 7.3.1.4 Capability Information field |
| 2413 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 2414 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 2415 | Reassociation management frames. */ |
| 2416 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 2417 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 2418 | #endif |
| 2419 | swapBitField16(caps, ( tANI_U16* )&frm.Capabilities ); |
| 2420 | |
| 2421 | frm.ListenInterval.interval = pMlmReassocReq->listenInterval; |
| 2422 | |
| 2423 | // Get the old bssid of the older AP. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2424 | vos_mem_copy( ( tANI_U8* )frm.CurrentAPAddress.mac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2425 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, 6); |
| 2426 | |
| 2427 | PopulateDot11fSSID2( pMac, &frm.SSID ); |
| 2428 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 2429 | &frm.SuppRates,psessionEntry); |
| 2430 | |
| 2431 | fQosEnabled = ( psessionEntry->limQosEnabled) && |
| 2432 | SIR_MAC_GET_QOS( psessionEntry->limReassocBssCaps ); |
| 2433 | |
| 2434 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 2435 | LIM_BSS_CAPS_GET( WME, psessionEntry->limReassocBssQosCaps ); |
| 2436 | |
| 2437 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 2438 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limReassocBssQosCaps ); |
| 2439 | |
| 2440 | if ( psessionEntry->lim11hEnable && |
| 2441 | psessionEntry->pLimReAssocReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 2442 | { |
| 2443 | #if defined WLAN_FEATURE_VOWIFI |
| 2444 | PowerCapsPopulated = TRUE; |
| 2445 | |
| 2446 | PopulateDot11fPowerCaps( pMac, &frm.PowerCaps, LIM_REASSOC,psessionEntry); |
| 2447 | PopulateDot11fSuppChannels( pMac, &frm.SuppChannels, LIM_REASSOC,psessionEntry); |
| 2448 | #endif |
| 2449 | } |
| 2450 | |
| 2451 | #if defined WLAN_FEATURE_VOWIFI |
| 2452 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2453 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2454 | { |
| 2455 | if (PowerCapsPopulated == FALSE) |
| 2456 | { |
| 2457 | PowerCapsPopulated = TRUE; |
| 2458 | PopulateDot11fPowerCaps(pMac, &frm.PowerCaps, LIM_REASSOC, psessionEntry); |
| 2459 | } |
| 2460 | } |
| 2461 | #endif |
| 2462 | |
| 2463 | if ( fQosEnabled && |
| 2464 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap ) )) |
| 2465 | { |
| 2466 | PopulateDot11fQOSCapsStation( pMac, &frm.QOSCapsStation ); |
| 2467 | } |
| 2468 | |
| 2469 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 2470 | &frm.ExtSuppRates, psessionEntry ); |
| 2471 | |
| 2472 | #if defined WLAN_FEATURE_VOWIFI |
| 2473 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2474 | SIR_MAC_GET_RRM( psessionEntry->limReassocBssCaps ) ) |
| 2475 | { |
| 2476 | PopulateDot11fRRMIe( pMac, &frm.RRMEnabledCap, psessionEntry ); |
| 2477 | } |
| 2478 | #endif |
| 2479 | |
| 2480 | // Ideally this should be enabled for 11r also. But 11r does |
| 2481 | // not follow the usual norm of using the Opaque object |
| 2482 | // for rsnie and fties. Instead we just add |
| 2483 | // the rsnie and fties at the end of the pack routine for 11r. |
| 2484 | // This should ideally! be fixed. |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2485 | #if defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2486 | // |
| 2487 | // The join request *should* contain zero or one of the WPA and RSN |
| 2488 | // IEs. The payload send along with the request is a |
| 2489 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 2490 | |
| 2491 | // typedef struct sSirRSNie |
| 2492 | // { |
| 2493 | // tANI_U16 length; |
| 2494 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 2495 | // } tSirRSNie, *tpSirRSNie; |
| 2496 | |
| 2497 | // So, we should be able to make the following two calls harmlessly, |
| 2498 | // since they do nothing if they don't find the given IE in the |
| 2499 | // bytestream with which they're provided. |
| 2500 | |
| 2501 | // The net effect of this will be to faithfully transmit whatever |
| 2502 | // security IE is in the join request. |
| 2503 | |
| 2504 | // *However*, if we're associating for the purpose of WPS |
| 2505 | // enrollment, and we've been configured to indicate that by |
| 2506 | // eliding the WPA or RSN IE, we just skip this: |
| 2507 | if (!psessionEntry->is11Rconnection) |
| 2508 | { |
| 2509 | if( nAddIELen && pAddIE ) |
| 2510 | { |
| 2511 | wpsIe = limGetWscIEPtr(pMac, pAddIE, nAddIELen); |
| 2512 | } |
| 2513 | if ( NULL == wpsIe ) |
| 2514 | { |
| 2515 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2516 | &frm.RSNOpaque ); |
| 2517 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2518 | &frm.WPAOpaque ); |
| 2519 | } |
| 2520 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2521 | #ifdef FEATURE_WLAN_CCX |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2522 | if (psessionEntry->pLimReAssocReq->cckmIE.length) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2523 | { |
| 2524 | PopulateDot11fCCXCckmOpaque( pMac, &( psessionEntry->pLimReAssocReq->cckmIE ), |
| 2525 | &frm.CCXCckmOpaque ); |
| 2526 | } |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2527 | #endif //FEATURE_WLAN_CCX |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2528 | } |
| 2529 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2530 | #ifdef FEATURE_WLAN_CCX |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2531 | /* CCX Version IE will be included in reassociation request |
| 2532 | when CCX is enabled on DUT through ini */ |
| 2533 | if (psessionEntry->pLimReAssocReq->isCCXFeatureIniEnabled) |
| 2534 | { |
| 2535 | PopulateDot11fCCXVersion(&frm.CCXVersion); |
| 2536 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2537 | // For CCX Associations fill the CCX IEs |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2538 | if (psessionEntry->isCCXconnection && |
| 2539 | psessionEntry->pLimReAssocReq->isCCXFeatureIniEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2540 | { |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2541 | #ifndef FEATURE_DISABLE_RM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2542 | PopulateDot11fCCXRadMgmtCap(&frm.CCXRadMgmtCap); |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2543 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2544 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2545 | #endif //FEATURE_WLAN_CCX |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2546 | #endif //FEATURE_WLAN_CCX || FEATURE_WLAN_LFR |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2547 | |
| 2548 | // include WME EDCA IE as well |
| 2549 | if ( fWmeEnabled ) |
| 2550 | { |
| 2551 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limReassocBssPropCap ) ) |
| 2552 | { |
| 2553 | PopulateDot11fWMMInfoStation( pMac, &frm.WMMInfoStation ); |
| 2554 | } |
| 2555 | |
| 2556 | if ( fWsmEnabled && |
| 2557 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limReassocBssPropCap ))) |
| 2558 | { |
| 2559 | PopulateDot11fWMMCaps( &frm.WMMCaps ); |
| 2560 | } |
| 2561 | #ifdef FEATURE_WLAN_CCX |
| 2562 | if (psessionEntry->isCCXconnection) |
| 2563 | { |
| 2564 | PopulateDot11fReAssocTspec(pMac, &frm, psessionEntry); |
| 2565 | |
| 2566 | // Populate the TSRS IE if TSPEC is included in the reassoc request |
| 2567 | if (psessionEntry->pLimReAssocReq->ccxTspecInfo.numTspecs) |
| 2568 | { |
| 2569 | tANI_U32 phyMode; |
| 2570 | tSirMacCCXTSRSIE tsrsIE; |
| 2571 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2572 | |
| 2573 | tsrsIE.tsid = 0; |
| 2574 | if( phyMode == WNI_CFG_PHY_MODE_11G || phyMode == WNI_CFG_PHY_MODE_11A) |
| 2575 | { |
| 2576 | tsrsIE.rates[0] = TSRS_11AG_RATE_6MBPS; |
| 2577 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2578 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2579 | { |
| 2580 | tsrsIE.rates[0] = TSRS_11B_RATE_5_5MBPS; |
| 2581 | } |
| 2582 | PopulateDot11TSRSIE(pMac,&tsrsIE, &frm.CCXTrafStrmRateSet, sizeof(tANI_U8)); |
| 2583 | } |
| 2584 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2585 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2586 | } |
| 2587 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2588 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2589 | pMac->lim.htCapabilityPresentInBeacon) |
| 2590 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2591 | PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2592 | } |
| 2593 | |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 2594 | #if defined WLAN_FEATURE_VOWIFI_11R |
Gopichand Nakkala | 0ac5506 | 2013-04-08 14:43:07 +0530 | [diff] [blame] | 2595 | if ( psessionEntry->pLimReAssocReq->bssDescription.mdiePresent && (0 == pMac->ft.ftSmeContext.reassoc_ft_ies_length) |
| 2596 | #if defined FEATURE_WLAN_CCX |
| 2597 | && !psessionEntry->isCCXconnection |
| 2598 | #endif |
| 2599 | ) |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 2600 | { |
| 2601 | PopulateMDIE( pMac, &frm.MobilityDomain, psessionEntry->pLimReAssocReq->bssDescription.mdie); |
| 2602 | } |
| 2603 | #endif |
| 2604 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2605 | nStatus = dot11fGetPackedReAssocRequestSize( pMac, &frm, &nPayload ); |
| 2606 | if ( DOT11F_FAILED( nStatus ) ) |
| 2607 | { |
| 2608 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2609 | "or a Re-Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2610 | nStatus ); |
| 2611 | // We'll fall back on the worst case scenario: |
| 2612 | nPayload = sizeof( tDot11fReAssocRequest ); |
| 2613 | } |
| 2614 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2615 | { |
| 2616 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 2617 | "the packed size for a Re-Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2618 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2619 | } |
| 2620 | |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 2621 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2622 | |
| 2623 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 2624 | limLog( pMac, LOG1, FL("FT IE Reassoc Req (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2625 | pMac->ft.ftSmeContext.reassoc_ft_ies_length); |
| 2626 | #endif |
| 2627 | |
| 2628 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2629 | if (psessionEntry->is11Rconnection) |
| 2630 | { |
| 2631 | ft_ies_length = pMac->ft.ftSmeContext.reassoc_ft_ies_length; |
| 2632 | } |
| 2633 | #endif |
| 2634 | |
| 2635 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2636 | ( tANI_U16 )nBytes+ft_ies_length, ( void** ) &pFrame, |
| 2637 | ( void** ) &pPacket ); |
| 2638 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2639 | { |
| 2640 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2641 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2642 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Re-As" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2643 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2644 | goto end; |
| 2645 | } |
| 2646 | |
| 2647 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2648 | vos_mem_set( pFrame, nBytes + ft_ies_length, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2649 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 2650 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 2651 | limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2652 | #endif |
| 2653 | // Next, we fill out the buffer descriptor: |
| 2654 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 2655 | SIR_MAC_MGMT_REASSOC_REQ, |
| 2656 | psessionEntry->limReAssocbssId,psessionEntry->selfMacAddr); |
| 2657 | if ( eSIR_SUCCESS != nSirStatus ) |
| 2658 | { |
| 2659 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2660 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2661 | nSirStatus ); |
| 2662 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 2663 | goto end; |
| 2664 | } |
| 2665 | |
| 2666 | |
| 2667 | // That done, pack the ReAssoc Request: |
| 2668 | nStatus = dot11fPackReAssocRequest( pMac, &frm, pFrame + |
| 2669 | sizeof(tSirMacMgmtHdr), |
| 2670 | nPayload, &nPayload ); |
| 2671 | if ( DOT11F_FAILED( nStatus ) ) |
| 2672 | { |
| 2673 | limLog( pMac, LOGE, FL("Failed to pack a Re-Association Reque" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2674 | "st (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2675 | nStatus ); |
| 2676 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 2677 | goto end; |
| 2678 | } |
| 2679 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2680 | { |
| 2681 | limLog( pMac, LOGW, FL("There were warnings while packing a R" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2682 | "e-Association Request (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2683 | } |
| 2684 | |
| 2685 | PELOG3(limLog( pMac, LOG3, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2686 | FL("*** Sending Re-Association Request length %d %d to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2687 | nBytes, nPayload );) |
| 2688 | if( psessionEntry->assocReq != NULL ) |
| 2689 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2690 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2691 | psessionEntry->assocReq = NULL; |
| 2692 | } |
| 2693 | |
| 2694 | if( nAddIELen ) |
| 2695 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2696 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 2697 | pAddIE, |
| 2698 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2699 | nPayload += nAddIELen; |
| 2700 | } |
| 2701 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2702 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 2703 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2704 | { |
| 2705 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));) |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2706 | } |
| 2707 | else |
| 2708 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2709 | //Store the Assoc request. This is sent to csr/hdd in join cnf response. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2710 | vos_mem_copy( psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2711 | psessionEntry->assocReqLen = nPayload; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2712 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2713 | |
| 2714 | if (psessionEntry->is11Rconnection) |
| 2715 | { |
| 2716 | { |
| 2717 | int i = 0; |
| 2718 | |
| 2719 | pBody = pFrame + nBytes; |
| 2720 | for (i=0; i<ft_ies_length; i++) |
| 2721 | { |
| 2722 | *pBody = pMac->ft.ftSmeContext.reassoc_ft_ies[i]; |
| 2723 | pBody++; |
| 2724 | } |
| 2725 | } |
| 2726 | } |
| 2727 | |
| 2728 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 2729 | PELOGE(limLog(pMac, LOG1, FL("Re-assoc Req Frame is: ")); |
| 2730 | sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2731 | (tANI_U8 *)pFrame, |
| 2732 | (nBytes + ft_ies_length));) |
| 2733 | #endif |
| 2734 | |
| 2735 | |
| 2736 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2737 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 2738 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2739 | ) |
| 2740 | { |
| 2741 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 2742 | } |
| 2743 | |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 2744 | if( NULL != psessionEntry->assocReq ) |
| 2745 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2746 | vos_mem_free(psessionEntry->assocReq); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 2747 | psessionEntry->assocReq = NULL; |
| 2748 | } |
| 2749 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2750 | psessionEntry->assocReq = vos_mem_malloc(ft_ies_length); |
| 2751 | if ( NULL == psessionEntry->assocReq ) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 2752 | { |
| 2753 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));) |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 2754 | psessionEntry->assocReqLen = 0; |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 2755 | } |
| 2756 | else |
| 2757 | { |
| 2758 | //Store the Assoc request. This is sent to csr/hdd in join cnf response. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2759 | vos_mem_copy( psessionEntry->assocReq, pMac->ft.ftSmeContext.reassoc_ft_ies, |
| 2760 | (ft_ies_length)); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 2761 | psessionEntry->assocReqLen = (ft_ies_length); |
| 2762 | } |
| 2763 | |
| 2764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2765 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (nBytes + ft_ies_length), |
| 2766 | HAL_TXRX_FRM_802_11_MGMT, |
| 2767 | ANI_TXDIR_TODS, |
| 2768 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 2769 | limTxComplete, pFrame, txFlag ); |
| 2770 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2771 | { |
| 2772 | limLog( pMac, LOGE, FL("Failed to send Re-Association Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2773 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2774 | nSirStatus ); |
| 2775 | //Pkt will be freed up by the callback |
| 2776 | goto end; |
| 2777 | } |
| 2778 | |
| 2779 | end: |
| 2780 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2781 | vos_mem_free( pMlmReassocReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2782 | psessionEntry->pLimMlmReassocReq = NULL; |
| 2783 | |
| 2784 | } |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 2785 | |
| 2786 | void limSendRetryReassocReqFrame(tpAniSirGlobal pMac, |
| 2787 | tLimMlmReassocReq *pMlmReassocReq, |
| 2788 | tpPESession psessionEntry) |
| 2789 | { |
| 2790 | tLimMlmReassocCnf mlmReassocCnf; // keep sme |
| 2791 | tLimMlmReassocReq *pTmpMlmReassocReq = NULL; |
| 2792 | if(NULL == pTmpMlmReassocReq) |
| 2793 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2794 | pTmpMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); |
| 2795 | if ( NULL == pTmpMlmReassocReq ) goto end; |
| 2796 | vos_mem_set( pTmpMlmReassocReq, sizeof(tLimMlmReassocReq), 0); |
| 2797 | vos_mem_copy( pTmpMlmReassocReq, pMlmReassocReq, sizeof(tLimMlmReassocReq)); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 2798 | } |
| 2799 | |
| 2800 | // Prepare and send Reassociation request frame |
| 2801 | // start reassoc timer. |
| 2802 | pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; |
| 2803 | // Start reassociation failure timer |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 2804 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_REASSOC_FAIL_TIMER)); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 2805 | if (tx_timer_activate(&pMac->lim.limTimers.gLimReassocFailureTimer) |
| 2806 | != TX_SUCCESS) |
| 2807 | { |
| 2808 | // Could not start reassoc failure timer. |
| 2809 | // Log error |
| 2810 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2811 | FL("could not start Reassociation failure timer")); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 2812 | // Return Reassoc confirm with |
| 2813 | // Resources Unavailable |
| 2814 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 2815 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 2816 | goto end; |
| 2817 | } |
| 2818 | |
| 2819 | limSendReassocReqWithFTIEsMgmtFrame(pMac, pTmpMlmReassocReq, psessionEntry); |
| 2820 | return; |
| 2821 | |
| 2822 | end: |
| 2823 | // Free up buffer allocated for reassocReq |
| 2824 | if (pMlmReassocReq != NULL) |
| 2825 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2826 | vos_mem_free(pMlmReassocReq); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 2827 | pMlmReassocReq = NULL; |
| 2828 | } |
| 2829 | if (pTmpMlmReassocReq != NULL) |
| 2830 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2831 | vos_mem_free(pTmpMlmReassocReq); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 2832 | pTmpMlmReassocReq = NULL; |
| 2833 | } |
| 2834 | mlmReassocCnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; |
| 2835 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 2836 | /* Update PE sessio Id*/ |
| 2837 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 2838 | |
| 2839 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 2840 | } |
| 2841 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2842 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 2843 | |
| 2844 | |
| 2845 | void |
| 2846 | limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, |
| 2847 | tLimMlmReassocReq *pMlmReassocReq,tpPESession psessionEntry) |
| 2848 | { |
| 2849 | static tDot11fReAssocRequest frm; |
| 2850 | tANI_U16 caps; |
| 2851 | tANI_U8 *pFrame; |
| 2852 | tSirRetStatus nSirStatus; |
| 2853 | tANI_U32 nBytes, nPayload, nStatus; |
| 2854 | tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; |
| 2855 | void *pPacket; |
| 2856 | eHalStatus halstatus; |
| 2857 | tANI_U16 nAddIELen; |
| 2858 | tANI_U8 *pAddIE; |
| 2859 | tANI_U8 *wpsIe = NULL; |
| 2860 | tANI_U8 txFlag = 0; |
| 2861 | #if defined WLAN_FEATURE_VOWIFI |
| 2862 | tANI_U8 PowerCapsPopulated = FALSE; |
| 2863 | #endif |
| 2864 | |
| 2865 | if(NULL == psessionEntry) |
| 2866 | { |
| 2867 | return; |
| 2868 | } |
| 2869 | |
| 2870 | /* check this early to avoid unncessary operation */ |
| 2871 | if(NULL == psessionEntry->pLimReAssocReq) |
| 2872 | { |
| 2873 | return; |
| 2874 | } |
| 2875 | nAddIELen = psessionEntry->pLimReAssocReq->addIEAssoc.length; |
| 2876 | pAddIE = psessionEntry->pLimReAssocReq->addIEAssoc.addIEdata; |
| 2877 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2878 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2879 | |
| 2880 | caps = pMlmReassocReq->capabilityInfo; |
| 2881 | if (PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap)) |
| 2882 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 2883 | #if defined(FEATURE_WLAN_WAPI) |
| 2884 | /* CR: 262463 : |
| 2885 | According to WAPI standard: |
| 2886 | 7.3.1.4 Capability Information field |
| 2887 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 2888 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 2889 | Reassociation management frames. */ |
| 2890 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 2891 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 2892 | #endif |
| 2893 | swapBitField16(caps, ( tANI_U16* )&frm.Capabilities ); |
| 2894 | |
| 2895 | frm.ListenInterval.interval = pMlmReassocReq->listenInterval; |
| 2896 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 2897 | vos_mem_copy(( tANI_U8* )frm.CurrentAPAddress.mac, |
| 2898 | ( tANI_U8* )psessionEntry->bssId, 6 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2899 | |
| 2900 | PopulateDot11fSSID2( pMac, &frm.SSID ); |
| 2901 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 2902 | &frm.SuppRates,psessionEntry); |
| 2903 | |
| 2904 | fQosEnabled = ( psessionEntry->limQosEnabled ) && |
| 2905 | SIR_MAC_GET_QOS( psessionEntry->limReassocBssCaps ); |
| 2906 | |
| 2907 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 2908 | LIM_BSS_CAPS_GET( WME, psessionEntry->limReassocBssQosCaps ); |
| 2909 | |
| 2910 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 2911 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limReassocBssQosCaps ); |
| 2912 | |
| 2913 | |
| 2914 | if ( psessionEntry->lim11hEnable && |
| 2915 | psessionEntry->pLimReAssocReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 2916 | { |
| 2917 | #if defined WLAN_FEATURE_VOWIFI |
| 2918 | PowerCapsPopulated = TRUE; |
| 2919 | PopulateDot11fPowerCaps( pMac, &frm.PowerCaps, LIM_REASSOC,psessionEntry); |
| 2920 | PopulateDot11fSuppChannels( pMac, &frm.SuppChannels, LIM_REASSOC,psessionEntry); |
| 2921 | #endif |
| 2922 | } |
| 2923 | |
| 2924 | #if defined WLAN_FEATURE_VOWIFI |
| 2925 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2926 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2927 | { |
| 2928 | if (PowerCapsPopulated == FALSE) |
| 2929 | { |
| 2930 | PowerCapsPopulated = TRUE; |
| 2931 | PopulateDot11fPowerCaps(pMac, &frm.PowerCaps, LIM_REASSOC, psessionEntry); |
| 2932 | } |
| 2933 | } |
| 2934 | #endif |
| 2935 | |
| 2936 | if ( fQosEnabled && |
| 2937 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap ) )) |
| 2938 | { |
| 2939 | PopulateDot11fQOSCapsStation( pMac, &frm.QOSCapsStation ); |
| 2940 | } |
| 2941 | |
| 2942 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 2943 | &frm.ExtSuppRates, psessionEntry ); |
| 2944 | |
| 2945 | #if defined WLAN_FEATURE_VOWIFI |
| 2946 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2947 | SIR_MAC_GET_RRM( psessionEntry->limReassocBssCaps ) ) |
| 2948 | { |
| 2949 | PopulateDot11fRRMIe( pMac, &frm.RRMEnabledCap, psessionEntry ); |
| 2950 | } |
| 2951 | #endif |
| 2952 | // The join request *should* contain zero or one of the WPA and RSN |
| 2953 | // IEs. The payload send along with the request is a |
| 2954 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 2955 | |
| 2956 | // typedef struct sSirRSNie |
| 2957 | // { |
| 2958 | // tANI_U16 length; |
| 2959 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 2960 | // } tSirRSNie, *tpSirRSNie; |
| 2961 | |
| 2962 | // So, we should be able to make the following two calls harmlessly, |
| 2963 | // since they do nothing if they don't find the given IE in the |
| 2964 | // bytestream with which they're provided. |
| 2965 | |
| 2966 | // The net effect of this will be to faithfully transmit whatever |
| 2967 | // security IE is in the join request. |
| 2968 | |
| 2969 | // *However*, if we're associating for the purpose of WPS |
| 2970 | // enrollment, and we've been configured to indicate that by |
| 2971 | // eliding the WPA or RSN IE, we just skip this: |
| 2972 | if( nAddIELen && pAddIE ) |
| 2973 | { |
| 2974 | wpsIe = limGetWscIEPtr(pMac, pAddIE, nAddIELen); |
| 2975 | } |
| 2976 | if ( NULL == wpsIe ) |
| 2977 | { |
| 2978 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2979 | &frm.RSNOpaque ); |
| 2980 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2981 | &frm.WPAOpaque ); |
| 2982 | #if defined(FEATURE_WLAN_WAPI) |
| 2983 | PopulateDot11fWAPIOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2984 | &frm.WAPIOpaque ); |
| 2985 | #endif // defined(FEATURE_WLAN_WAPI) |
| 2986 | } |
| 2987 | |
| 2988 | // include WME EDCA IE as well |
| 2989 | if ( fWmeEnabled ) |
| 2990 | { |
| 2991 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limReassocBssPropCap ) ) |
| 2992 | { |
| 2993 | PopulateDot11fWMMInfoStation( pMac, &frm.WMMInfoStation ); |
| 2994 | } |
| 2995 | |
| 2996 | if ( fWsmEnabled && |
| 2997 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limReassocBssPropCap ))) |
| 2998 | { |
| 2999 | PopulateDot11fWMMCaps( &frm.WMMCaps ); |
| 3000 | } |
| 3001 | } |
| 3002 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3003 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3004 | pMac->lim.htCapabilityPresentInBeacon) |
| 3005 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3006 | PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3007 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3008 | #ifdef WLAN_FEATURE_11AC |
| 3009 | if ( psessionEntry->vhtCapability && |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 3010 | psessionEntry->vhtCapabilityPresentInBeacon) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3011 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3012 | limLog( pMac, LOGW, FL("Populate VHT IEs in Re-Assoc Request")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3013 | PopulateDot11fVHTCaps( pMac, &frm.VHTCaps ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 3014 | PopulateDot11fExtCap( pMac, &frm.ExtCap); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3015 | } |
| 3016 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3017 | |
| 3018 | nStatus = dot11fGetPackedReAssocRequestSize( pMac, &frm, &nPayload ); |
| 3019 | if ( DOT11F_FAILED( nStatus ) ) |
| 3020 | { |
| 3021 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3022 | "or a Re-Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3023 | nStatus ); |
| 3024 | // We'll fall back on the worst case scenario: |
| 3025 | nPayload = sizeof( tDot11fReAssocRequest ); |
| 3026 | } |
| 3027 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3028 | { |
| 3029 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 3030 | "the packed size for a Re-Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3031 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3032 | } |
| 3033 | |
| 3034 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
| 3035 | |
| 3036 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3037 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 3038 | ( void** ) &pPacket ); |
| 3039 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3040 | { |
| 3041 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3042 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3043 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Re-As" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3044 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3045 | goto end; |
| 3046 | } |
| 3047 | |
| 3048 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3049 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3050 | |
| 3051 | // Next, we fill out the buffer descriptor: |
| 3052 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3053 | SIR_MAC_MGMT_REASSOC_REQ, |
| 3054 | psessionEntry->limReAssocbssId,psessionEntry->selfMacAddr); |
| 3055 | if ( eSIR_SUCCESS != nSirStatus ) |
| 3056 | { |
| 3057 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3058 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3059 | nSirStatus ); |
| 3060 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3061 | goto end; |
| 3062 | } |
| 3063 | |
| 3064 | |
| 3065 | // That done, pack the Probe Request: |
| 3066 | nStatus = dot11fPackReAssocRequest( pMac, &frm, pFrame + |
| 3067 | sizeof(tSirMacMgmtHdr), |
| 3068 | nPayload, &nPayload ); |
| 3069 | if ( DOT11F_FAILED( nStatus ) ) |
| 3070 | { |
| 3071 | limLog( pMac, LOGE, FL("Failed to pack a Re-Association Reque" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3072 | "st (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3073 | nStatus ); |
| 3074 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3075 | goto end; |
| 3076 | } |
| 3077 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3078 | { |
| 3079 | limLog( pMac, LOGW, FL("There were warnings while packing a R" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3080 | "e-Association Request (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3081 | } |
| 3082 | |
| 3083 | PELOG1(limLog( pMac, LOG1, FL("*** Sending Re-Association Request length %d" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3084 | "to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3085 | nBytes );) |
| 3086 | |
| 3087 | if( psessionEntry->assocReq != NULL ) |
| 3088 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3089 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3090 | psessionEntry->assocReq = NULL; |
| 3091 | } |
| 3092 | |
| 3093 | if( nAddIELen ) |
| 3094 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3095 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 3096 | pAddIE, |
| 3097 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3098 | nPayload += nAddIELen; |
| 3099 | } |
| 3100 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3101 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 3102 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3103 | { |
| 3104 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));) |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3105 | } |
| 3106 | else |
| 3107 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3108 | //Store the Assoc request. This is sent to csr/hdd in join cnf response. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3109 | vos_mem_copy(psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3110 | psessionEntry->assocReqLen = nPayload; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3111 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3112 | |
| 3113 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3114 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3115 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3116 | ) |
| 3117 | { |
| 3118 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3119 | } |
| 3120 | |
Gopichand Nakkala | d3918dd | 2012-12-31 16:27:55 -0800 | [diff] [blame] | 3121 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 3122 | { |
| 3123 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 3124 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3125 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3126 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 3127 | HAL_TXRX_FRM_802_11_MGMT, |
| 3128 | ANI_TXDIR_TODS, |
| 3129 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3130 | limTxComplete, pFrame, txFlag ); |
| 3131 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3132 | { |
| 3133 | limLog( pMac, LOGE, FL("Failed to send Re-Association Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3134 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3135 | nSirStatus ); |
| 3136 | //Pkt will be freed up by the callback |
| 3137 | goto end; |
| 3138 | } |
| 3139 | |
| 3140 | end: |
| 3141 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3142 | vos_mem_free( pMlmReassocReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3143 | psessionEntry->pLimMlmReassocReq = NULL; |
| 3144 | |
| 3145 | } // limSendReassocReqMgmtFrame |
| 3146 | |
| 3147 | /** |
| 3148 | * \brief Send an Authentication frame |
| 3149 | * |
| 3150 | * |
| 3151 | * \param pMac Pointer to Global MAC structure |
| 3152 | * |
| 3153 | * \param pAuthFrameBody Pointer to Authentication frame structure that need |
| 3154 | * to be sent |
| 3155 | * |
| 3156 | * \param peerMacAddr MAC address of the peer entity to which Authentication |
| 3157 | * frame is destined |
| 3158 | * |
| 3159 | * \param wepBit Indicates whether wep bit to be set in FC while sending |
| 3160 | * Authentication frame3 |
| 3161 | * |
| 3162 | * |
| 3163 | * This function is called by limProcessMlmMessages(). Authentication frame |
| 3164 | * is formatted and sent when this function is called. |
| 3165 | * |
| 3166 | * |
| 3167 | */ |
| 3168 | |
| 3169 | void |
| 3170 | limSendAuthMgmtFrame(tpAniSirGlobal pMac, |
| 3171 | tpSirMacAuthFrameBody pAuthFrameBody, |
| 3172 | tSirMacAddr peerMacAddr, |
| 3173 | tANI_U8 wepBit, |
| 3174 | tpPESession psessionEntry |
| 3175 | ) |
| 3176 | { |
| 3177 | tANI_U8 *pFrame, *pBody; |
| 3178 | tANI_U32 frameLen = 0, bodyLen = 0; |
| 3179 | tpSirMacMgmtHdr pMacHdr; |
| 3180 | tANI_U16 i; |
| 3181 | void *pPacket; |
| 3182 | eHalStatus halstatus; |
| 3183 | tANI_U8 txFlag = 0; |
| 3184 | |
| 3185 | if(NULL == psessionEntry) |
| 3186 | { |
| 3187 | return; |
| 3188 | } |
| 3189 | |
| 3190 | if (wepBit == LIM_WEP_IN_FC) |
| 3191 | { |
| 3192 | /// Auth frame3 to be sent with encrypted framebody |
| 3193 | /** |
| 3194 | * Allocate buffer for Authenticaton frame of size equal |
| 3195 | * to management frame header length plus 2 bytes each for |
| 3196 | * auth algorithm number, transaction number, status code, |
| 3197 | * 128 bytes for challenge text and 4 bytes each for |
| 3198 | * IV & ICV. |
| 3199 | */ |
| 3200 | |
| 3201 | frameLen = sizeof(tSirMacMgmtHdr) + LIM_ENCR_AUTH_BODY_LEN; |
| 3202 | |
| 3203 | bodyLen = LIM_ENCR_AUTH_BODY_LEN; |
| 3204 | } // if (wepBit == LIM_WEP_IN_FC) |
| 3205 | else |
| 3206 | { |
| 3207 | switch (pAuthFrameBody->authTransactionSeqNumber) |
| 3208 | { |
| 3209 | case SIR_MAC_AUTH_FRAME_1: |
| 3210 | /** |
| 3211 | * Allocate buffer for Authenticaton frame of size |
| 3212 | * equal to management frame header length plus 2 bytes |
| 3213 | * each for auth algorithm number, transaction number |
| 3214 | * and status code. |
| 3215 | */ |
| 3216 | |
| 3217 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3218 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3219 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3220 | |
| 3221 | #if defined WLAN_FEATURE_VOWIFI_11R |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3222 | if (pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) |
| 3223 | { |
| 3224 | if (0 != pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3225 | { |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3226 | frameLen += pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3227 | limLog(pMac, LOG3, FL("Auth frame, FTIES length added=%d"), |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3228 | pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3229 | } |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3230 | else |
| 3231 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3232 | limLog(pMac, LOG3, FL("Auth frame, Does not contain FTIES!!!")); |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3233 | frameLen += (2+SIR_MDIE_SIZE); |
| 3234 | } |
| 3235 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3236 | #endif |
| 3237 | break; |
| 3238 | |
| 3239 | case SIR_MAC_AUTH_FRAME_2: |
| 3240 | if ((pAuthFrameBody->authAlgoNumber == eSIR_OPEN_SYSTEM) || |
| 3241 | ((pAuthFrameBody->authAlgoNumber == eSIR_SHARED_KEY) && |
| 3242 | (pAuthFrameBody->authStatusCode != eSIR_MAC_SUCCESS_STATUS))) |
| 3243 | { |
| 3244 | /** |
| 3245 | * Allocate buffer for Authenticaton frame of size |
| 3246 | * equal to management frame header length plus |
| 3247 | * 2 bytes each for auth algorithm number, |
| 3248 | * transaction number and status code. |
| 3249 | */ |
| 3250 | |
| 3251 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3252 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3253 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3254 | } |
| 3255 | else |
| 3256 | { |
| 3257 | // Shared Key algorithm with challenge text |
| 3258 | // to be sent |
| 3259 | /** |
| 3260 | * Allocate buffer for Authenticaton frame of size |
| 3261 | * equal to management frame header length plus |
| 3262 | * 2 bytes each for auth algorithm number, |
| 3263 | * transaction number, status code and 128 bytes |
| 3264 | * for challenge text. |
| 3265 | */ |
| 3266 | |
| 3267 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3268 | sizeof(tSirMacAuthFrame); |
| 3269 | bodyLen = sizeof(tSirMacAuthFrameBody); |
| 3270 | } |
| 3271 | |
| 3272 | break; |
| 3273 | |
| 3274 | case SIR_MAC_AUTH_FRAME_3: |
| 3275 | /// Auth frame3 to be sent without encrypted framebody |
| 3276 | /** |
| 3277 | * Allocate buffer for Authenticaton frame of size equal |
| 3278 | * to management frame header length plus 2 bytes each |
| 3279 | * for auth algorithm number, transaction number and |
| 3280 | * status code. |
| 3281 | */ |
| 3282 | |
| 3283 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3284 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3285 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3286 | |
| 3287 | break; |
| 3288 | |
| 3289 | case SIR_MAC_AUTH_FRAME_4: |
| 3290 | /** |
| 3291 | * Allocate buffer for Authenticaton frame of size equal |
| 3292 | * to management frame header length plus 2 bytes each |
| 3293 | * for auth algorithm number, transaction number and |
| 3294 | * status code. |
| 3295 | */ |
| 3296 | |
| 3297 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3298 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3299 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3300 | |
| 3301 | break; |
| 3302 | } // switch (pAuthFrameBody->authTransactionSeqNumber) |
| 3303 | } // end if (wepBit == LIM_WEP_IN_FC) |
| 3304 | |
| 3305 | |
| 3306 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )frameLen, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 3307 | |
| 3308 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3309 | { |
| 3310 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3311 | limLog(pMac, LOGP, FL("call to bufAlloc failed for AUTH frame")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3312 | |
| 3313 | return; |
| 3314 | } |
| 3315 | |
| 3316 | for (i = 0; i < frameLen; i++) |
| 3317 | pFrame[i] = 0; |
| 3318 | |
| 3319 | // Prepare BD |
| 3320 | if (limPopulateMacHeader(pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3321 | SIR_MAC_MGMT_AUTH, peerMacAddr,psessionEntry->selfMacAddr) != eSIR_SUCCESS) |
| 3322 | { |
| 3323 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3324 | return; |
| 3325 | } |
| 3326 | |
| 3327 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 3328 | pMacHdr->fc.wep = wepBit; |
| 3329 | |
| 3330 | // Prepare BSSId |
| 3331 | if( (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 3332 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3333 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 3334 | (tANI_U8 *) psessionEntry->bssId, |
| 3335 | sizeof( tSirMacAddr )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3336 | } |
| 3337 | |
| 3338 | /// Prepare Authentication frame body |
| 3339 | pBody = pFrame + sizeof(tSirMacMgmtHdr); |
| 3340 | |
| 3341 | if (wepBit == LIM_WEP_IN_FC) |
| 3342 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3343 | vos_mem_copy(pBody, (tANI_U8 *) pAuthFrameBody, bodyLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3344 | |
| 3345 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3346 | FL("*** Sending Auth seq# 3 status %d (%d) to"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3347 | pAuthFrameBody->authStatusCode, |
| 3348 | (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS)); |
| 3349 | |
| 3350 | limPrintMacAddr(pMac, pMacHdr->da, LOG1);) |
| 3351 | } |
| 3352 | else |
| 3353 | { |
| 3354 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authAlgoNumber); |
| 3355 | pBody += sizeof(tANI_U16); |
| 3356 | bodyLen -= sizeof(tANI_U16); |
| 3357 | |
| 3358 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authTransactionSeqNumber); |
| 3359 | pBody += sizeof(tANI_U16); |
| 3360 | bodyLen -= sizeof(tANI_U16); |
| 3361 | |
| 3362 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authStatusCode); |
| 3363 | pBody += sizeof(tANI_U16); |
| 3364 | bodyLen -= sizeof(tANI_U16); |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 3365 | if ( bodyLen < sizeof (pAuthFrameBody->type) + sizeof (pAuthFrameBody->length) + sizeof (pAuthFrameBody->challengeText)) |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3366 | vos_mem_copy(pBody, (tANI_U8 *) &pAuthFrameBody->type, bodyLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3367 | |
| 3368 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 3369 | if ((pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) && |
| 3370 | (pAuthFrameBody->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_1)) |
| 3371 | { |
| 3372 | |
| 3373 | { |
| 3374 | int i = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3375 | if (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length) |
| 3376 | { |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3377 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3378 | PELOGE(limLog(pMac, LOGE, FL("Auth1 Frame FTIE is: ")); |
| 3379 | sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOGE, |
| 3380 | (tANI_U8 *)pBody, |
| 3381 | (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3382 | #endif |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3383 | for (i=0; i<pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length; i++) |
| 3384 | { |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3385 | *pBody = pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[i]; |
| 3386 | pBody++; |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3387 | } |
| 3388 | } |
| 3389 | else |
| 3390 | { |
| 3391 | /* MDID attr is 54*/ |
| 3392 | *pBody = 54; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3393 | pBody++; |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3394 | *pBody = SIR_MDIE_SIZE; |
| 3395 | pBody++; |
| 3396 | for(i=0;i<SIR_MDIE_SIZE;i++) |
| 3397 | { |
| 3398 | *pBody = pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription->mdie[i]; |
| 3399 | pBody++; |
| 3400 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3401 | } |
| 3402 | } |
| 3403 | } |
| 3404 | #endif |
| 3405 | |
| 3406 | PELOG1(limLog(pMac, LOG1, |
| 3407 | FL("*** Sending Auth seq# %d status %d (%d) to "), |
| 3408 | pAuthFrameBody->authTransactionSeqNumber, |
| 3409 | pAuthFrameBody->authStatusCode, |
| 3410 | (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS)); |
| 3411 | |
| 3412 | limPrintMacAddr(pMac, pMacHdr->da, LOG1);) |
| 3413 | } |
| 3414 | PELOG2(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, pFrame, frameLen);) |
| 3415 | |
| 3416 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3417 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3418 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3419 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 3420 | || ((NULL != pMac->ft.ftPEContext.pFTPreAuthReq) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3421 | && ( SIR_BAND_5_GHZ == limGetRFBand(pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum))) |
| 3422 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3423 | ) |
| 3424 | { |
| 3425 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3426 | } |
| 3427 | |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 3428 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) |
| 3429 | { |
| 3430 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 3431 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3432 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3433 | /// Queue Authentication frame in high priority WQ |
| 3434 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) frameLen, |
| 3435 | HAL_TXRX_FRM_802_11_MGMT, |
| 3436 | ANI_TXDIR_TODS, |
| 3437 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3438 | limTxComplete, pFrame, txFlag ); |
| 3439 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3440 | { |
| 3441 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3442 | FL("*** Could not send Auth frame, retCode=%X ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3443 | halstatus); |
| 3444 | |
| 3445 | //Pkt will be freed up by the callback |
| 3446 | } |
| 3447 | |
| 3448 | return; |
| 3449 | } /*** end limSendAuthMgmtFrame() ***/ |
| 3450 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3451 | eHalStatus limSendDeauthCnf(tpAniSirGlobal pMac) |
| 3452 | { |
| 3453 | tANI_U16 aid; |
| 3454 | tpDphHashNode pStaDs; |
| 3455 | tLimMlmDeauthReq *pMlmDeauthReq; |
| 3456 | tLimMlmDeauthCnf mlmDeauthCnf; |
| 3457 | tpPESession psessionEntry; |
| 3458 | |
| 3459 | pMlmDeauthReq = pMac->lim.limDisassocDeauthCnfReq.pMlmDeauthReq; |
| 3460 | if (pMlmDeauthReq) |
| 3461 | { |
| 3462 | if (tx_timer_running(&pMac->lim.limTimers.gLimDeauthAckTimer)) |
| 3463 | { |
| 3464 | limDeactivateAndChangeTimer(pMac, eLIM_DEAUTH_ACK_TIMER); |
| 3465 | } |
| 3466 | |
| 3467 | if((psessionEntry = peFindSessionBySessionId(pMac, pMlmDeauthReq->sessionId))== NULL) |
| 3468 | { |
| 3469 | |
| 3470 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3471 | FL("session does not exist for given sessionId"));) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3472 | mlmDeauthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 3473 | goto end; |
| 3474 | } |
| 3475 | |
| 3476 | pStaDs = dphLookupHashEntry(pMac, pMlmDeauthReq->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 3477 | if (pStaDs == NULL) |
| 3478 | { |
| 3479 | mlmDeauthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 3480 | goto end; |
| 3481 | } |
| 3482 | |
| 3483 | |
| 3484 | /// Receive path cleanup with dummy packet |
| 3485 | limCleanupRxPath(pMac, pStaDs,psessionEntry); |
| 3486 | /// Free up buffer allocated for mlmDeauthReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3487 | vos_mem_free(pMlmDeauthReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3488 | pMac->lim.limDisassocDeauthCnfReq.pMlmDeauthReq = NULL; |
| 3489 | } |
| 3490 | return eHAL_STATUS_SUCCESS; |
| 3491 | end: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3492 | vos_mem_copy( (tANI_U8 *) &mlmDeauthCnf.peerMacAddr, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3493 | (tANI_U8 *) pMlmDeauthReq->peerMacAddr, |
| 3494 | sizeof(tSirMacAddr)); |
| 3495 | mlmDeauthCnf.deauthTrigger = pMlmDeauthReq->deauthTrigger; |
| 3496 | mlmDeauthCnf.aid = pMlmDeauthReq->aid; |
| 3497 | mlmDeauthCnf.sessionId = pMlmDeauthReq->sessionId; |
| 3498 | |
| 3499 | // Free up buffer allocated |
| 3500 | // for mlmDeauthReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3501 | vos_mem_free(pMlmDeauthReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3502 | |
| 3503 | limPostSmeMessage(pMac, |
| 3504 | LIM_MLM_DEAUTH_CNF, |
| 3505 | (tANI_U32 *) &mlmDeauthCnf); |
| 3506 | return eHAL_STATUS_SUCCESS; |
| 3507 | } |
| 3508 | |
| 3509 | eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) |
| 3510 | { |
| 3511 | tANI_U16 aid; |
| 3512 | tpDphHashNode pStaDs; |
| 3513 | tLimMlmDisassocCnf mlmDisassocCnf; |
| 3514 | tpPESession psessionEntry; |
| 3515 | tLimMlmDisassocReq *pMlmDisassocReq; |
| 3516 | |
| 3517 | pMlmDisassocReq = pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq; |
| 3518 | if (pMlmDisassocReq) |
| 3519 | { |
| 3520 | if (tx_timer_running(&pMac->lim.limTimers.gLimDisassocAckTimer)) |
| 3521 | { |
| 3522 | limDeactivateAndChangeTimer(pMac, eLIM_DISASSOC_ACK_TIMER); |
| 3523 | } |
| 3524 | |
| 3525 | if((psessionEntry = peFindSessionBySessionId(pMac, pMlmDisassocReq->sessionId))== NULL) |
| 3526 | { |
| 3527 | |
| 3528 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3529 | FL("session does not exist for given sessionId"));) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3530 | mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 3531 | goto end; |
| 3532 | } |
| 3533 | |
| 3534 | pStaDs = dphLookupHashEntry(pMac, pMlmDisassocReq->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 3535 | if (pStaDs == NULL) |
| 3536 | { |
| 3537 | mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 3538 | goto end; |
| 3539 | } |
| 3540 | |
| 3541 | /// Receive path cleanup with dummy packet |
| 3542 | if(eSIR_SUCCESS != limCleanupRxPath(pMac, pStaDs, psessionEntry)) |
| 3543 | { |
| 3544 | mlmDisassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3545 | goto end; |
| 3546 | } |
| 3547 | |
| 3548 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 3549 | if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE ) && |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 3550 | ( |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3551 | #ifdef FEATURE_WLAN_CCX |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 3552 | (psessionEntry->isCCXconnection ) || |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 3553 | #endif |
| 3554 | #ifdef FEATURE_WLAN_LFR |
| 3555 | (psessionEntry->isFastRoamIniFeatureEnabled ) || |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3556 | #endif |
| 3557 | (psessionEntry->is11Rconnection )) && |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 3558 | (pMlmDisassocReq->reasonCode != |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 3559 | eSIR_MAC_DISASSOC_DUE_TO_FTHANDOFF_REASON)) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3560 | { |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 3561 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3562 | FL("FT Preauth Session (%p,%d) Cleanup"), |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 3563 | psessionEntry, psessionEntry->peSessionId);); |
| 3564 | limFTCleanup(pMac); |
| 3565 | } |
| 3566 | else |
| 3567 | { |
| 3568 | PELOGE(limLog(pMac, LOGE, |
| 3569 | FL("No FT Preauth Session Cleanup in role %d" |
| 3570 | #ifdef FEATURE_WLAN_CCX |
| 3571 | " isCCX %d" |
| 3572 | #endif |
| 3573 | #ifdef FEATURE_WLAN_LFR |
| 3574 | " isLFR %d" |
| 3575 | #endif |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3576 | " is11r %d reason %d"), |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 3577 | psessionEntry->limSystemRole, |
| 3578 | #ifdef FEATURE_WLAN_CCX |
| 3579 | psessionEntry->isCCXconnection, |
| 3580 | #endif |
| 3581 | #ifdef FEATURE_WLAN_LFR |
| 3582 | psessionEntry->isFastRoamIniFeatureEnabled, |
| 3583 | #endif |
| 3584 | psessionEntry->is11Rconnection, |
| 3585 | pMlmDisassocReq->reasonCode);); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3586 | } |
| 3587 | #endif |
| 3588 | |
| 3589 | /// Free up buffer allocated for mlmDisassocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3590 | vos_mem_free(pMlmDisassocReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3591 | pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL; |
| 3592 | return eHAL_STATUS_SUCCESS; |
| 3593 | } |
| 3594 | else |
| 3595 | { |
| 3596 | return eHAL_STATUS_SUCCESS; |
| 3597 | } |
| 3598 | end: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3599 | vos_mem_copy( (tANI_U8 *) &mlmDisassocCnf.peerMacAddr, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3600 | (tANI_U8 *) pMlmDisassocReq->peerMacAddr, |
| 3601 | sizeof(tSirMacAddr)); |
| 3602 | mlmDisassocCnf.aid = pMlmDisassocReq->aid; |
| 3603 | mlmDisassocCnf.disassocTrigger = pMlmDisassocReq->disassocTrigger; |
| 3604 | |
| 3605 | /* Update PE session ID*/ |
| 3606 | mlmDisassocCnf.sessionId = pMlmDisassocReq->sessionId; |
| 3607 | |
Madan Mohan Koyyalamudi | b7f5a67 | 2012-11-29 11:17:46 -0800 | [diff] [blame] | 3608 | if(pMlmDisassocReq != NULL) |
| 3609 | { |
| 3610 | /// Free up buffer allocated for mlmDisassocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3611 | vos_mem_free(pMlmDisassocReq); |
Madan Mohan Koyyalamudi | b7f5a67 | 2012-11-29 11:17:46 -0800 | [diff] [blame] | 3612 | pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL; |
| 3613 | } |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3614 | |
| 3615 | limPostSmeMessage(pMac, |
| 3616 | LIM_MLM_DISASSOC_CNF, |
| 3617 | (tANI_U32 *) &mlmDisassocCnf); |
| 3618 | return eHAL_STATUS_SUCCESS; |
| 3619 | } |
| 3620 | |
| 3621 | eHalStatus limDisassocTxCompleteCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess) |
| 3622 | { |
| 3623 | return limSendDisassocCnf(pMac); |
| 3624 | } |
| 3625 | |
| 3626 | eHalStatus limDeauthTxCompleteCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess) |
| 3627 | { |
| 3628 | return limSendDeauthCnf(pMac); |
| 3629 | } |
| 3630 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3631 | /** |
| 3632 | * \brief This function is called to send Disassociate frame. |
| 3633 | * |
| 3634 | * |
| 3635 | * \param pMac Pointer to Global MAC structure |
| 3636 | * |
| 3637 | * \param nReason Indicates the reason that need to be sent in |
| 3638 | * Disassociation frame |
| 3639 | * |
| 3640 | * \param peerMacAddr MAC address of the STA to which Disassociation frame is |
| 3641 | * sent |
| 3642 | * |
| 3643 | * |
| 3644 | */ |
| 3645 | |
| 3646 | void |
| 3647 | limSendDisassocMgmtFrame(tpAniSirGlobal pMac, |
| 3648 | tANI_U16 nReason, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3649 | tSirMacAddr peer, |
| 3650 | tpPESession psessionEntry, |
| 3651 | tANI_BOOLEAN waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3652 | { |
| 3653 | tDot11fDisassociation frm; |
| 3654 | tANI_U8 *pFrame; |
| 3655 | tSirRetStatus nSirStatus; |
| 3656 | tpSirMacMgmtHdr pMacHdr; |
| 3657 | tANI_U32 nBytes, nPayload, nStatus; |
| 3658 | void *pPacket; |
| 3659 | eHalStatus halstatus; |
| 3660 | tANI_U8 txFlag = 0; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3661 | tANI_U32 val = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3662 | if(NULL == psessionEntry) |
| 3663 | { |
| 3664 | return; |
| 3665 | } |
| 3666 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3667 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3668 | |
| 3669 | frm.Reason.code = nReason; |
| 3670 | |
| 3671 | nStatus = dot11fGetPackedDisassociationSize( pMac, &frm, &nPayload ); |
| 3672 | if ( DOT11F_FAILED( nStatus ) ) |
| 3673 | { |
| 3674 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3675 | "or a Disassociation (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3676 | nStatus ); |
| 3677 | // We'll fall back on the worst case scenario: |
| 3678 | nPayload = sizeof( tDot11fDisassociation ); |
| 3679 | } |
| 3680 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3681 | { |
| 3682 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 3683 | "the packed size for a Disassociation " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3684 | "(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3685 | } |
| 3686 | |
| 3687 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 3688 | |
| 3689 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3690 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 3691 | ( void** ) &pPacket ); |
| 3692 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3693 | { |
| 3694 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Dis" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3695 | "association."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3696 | return; |
| 3697 | } |
| 3698 | |
| 3699 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3700 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3701 | |
| 3702 | // Next, we fill out the buffer descriptor: |
| 3703 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3704 | SIR_MAC_MGMT_DISASSOC, peer,psessionEntry->selfMacAddr); |
| 3705 | if ( eSIR_SUCCESS != nSirStatus ) |
| 3706 | { |
| 3707 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3708 | "tor for a Disassociation (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3709 | nSirStatus ); |
| 3710 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3711 | ( void* ) pFrame, ( void* ) pPacket ); |
| 3712 | return; // just allocated... |
| 3713 | } |
| 3714 | |
| 3715 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 3716 | |
| 3717 | // Prepare the BSSID |
| 3718 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 3719 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3720 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 3721 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3722 | #endif |
| 3723 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3724 | nStatus = dot11fPackDisassociation( pMac, &frm, pFrame + |
| 3725 | sizeof(tSirMacMgmtHdr), |
| 3726 | nPayload, &nPayload ); |
| 3727 | if ( DOT11F_FAILED( nStatus ) ) |
| 3728 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3729 | limLog( pMac, LOGE, FL("Failed to pack a Disassociation (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3730 | nStatus ); |
| 3731 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3732 | ( void* ) pFrame, ( void* ) pPacket ); |
| 3733 | return; // allocated! |
| 3734 | } |
| 3735 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3736 | { |
| 3737 | limLog( pMac, LOGW, FL("There were warnings while packing a D" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3738 | "isassociation (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3739 | } |
| 3740 | |
| 3741 | PELOG1(limLog( pMac, LOG1, FL("*** Sending Disassociation frame with rea" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3742 | "son %d to"), nReason ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3743 | limPrintMacAddr( pMac, pMacHdr->da, LOG1 );) |
| 3744 | |
| 3745 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3746 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3747 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3748 | ) |
| 3749 | { |
| 3750 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3751 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3752 | |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 3753 | if((psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) || |
| 3754 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 3755 | { |
| 3756 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 3757 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3758 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3759 | if (waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3760 | { |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3761 | // Queue Disassociation frame in high priority WQ |
| 3762 | /* get the duration from the request */ |
| 3763 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 3764 | HAL_TXRX_FRM_802_11_MGMT, |
| 3765 | ANI_TXDIR_TODS, |
| 3766 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3767 | limTxComplete, pFrame, limDisassocTxCompleteCnf, |
| 3768 | txFlag ); |
| 3769 | val = SYS_MS_TO_TICKS(LIM_DISASSOC_DEAUTH_ACK_TIMEOUT); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3770 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3771 | if (tx_timer_change( |
| 3772 | &pMac->lim.limTimers.gLimDisassocAckTimer, val, 0) |
| 3773 | != TX_SUCCESS) |
| 3774 | { |
| 3775 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3776 | FL("Unable to change Disassoc ack Timer val")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3777 | return; |
| 3778 | } |
| 3779 | else if(TX_SUCCESS != tx_timer_activate( |
| 3780 | &pMac->lim.limTimers.gLimDisassocAckTimer)) |
| 3781 | { |
| 3782 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3783 | FL("Unable to activate Disassoc ack Timer")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3784 | limDeactivateAndChangeTimer(pMac, eLIM_DISASSOC_ACK_TIMER); |
| 3785 | return; |
| 3786 | } |
| 3787 | } |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 3788 | else |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3789 | { |
| 3790 | // Queue Disassociation frame in high priority WQ |
| 3791 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 3792 | HAL_TXRX_FRM_802_11_MGMT, |
| 3793 | ANI_TXDIR_TODS, |
| 3794 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3795 | limTxComplete, pFrame, txFlag ); |
| 3796 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3797 | { |
| 3798 | limLog( pMac, LOGE, FL("Failed to send Disassociation " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3799 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3800 | nSirStatus ); |
| 3801 | //Pkt will be freed up by the callback |
| 3802 | return; |
| 3803 | } |
| 3804 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3805 | } // End limSendDisassocMgmtFrame. |
| 3806 | |
| 3807 | /** |
| 3808 | * \brief This function is called to send a Deauthenticate frame |
| 3809 | * |
| 3810 | * |
| 3811 | * \param pMac Pointer to global MAC structure |
| 3812 | * |
| 3813 | * \param nReason Indicates the reason that need to be sent in the |
| 3814 | * Deauthenticate frame |
| 3815 | * |
| 3816 | * \param peeer address of the STA to which the frame is to be sent |
| 3817 | * |
| 3818 | * |
| 3819 | */ |
| 3820 | |
| 3821 | void |
| 3822 | limSendDeauthMgmtFrame(tpAniSirGlobal pMac, |
| 3823 | tANI_U16 nReason, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3824 | tSirMacAddr peer, |
| 3825 | tpPESession psessionEntry, |
| 3826 | tANI_BOOLEAN waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3827 | { |
| 3828 | tDot11fDeAuth frm; |
| 3829 | tANI_U8 *pFrame; |
| 3830 | tSirRetStatus nSirStatus; |
| 3831 | tpSirMacMgmtHdr pMacHdr; |
| 3832 | tANI_U32 nBytes, nPayload, nStatus; |
| 3833 | void *pPacket; |
| 3834 | eHalStatus halstatus; |
| 3835 | tANI_U8 txFlag = 0; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3836 | tANI_U32 val = 0; |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 3837 | #ifdef FEATURE_WLAN_TDLS |
| 3838 | tANI_U16 aid; |
| 3839 | tpDphHashNode pStaDs; |
| 3840 | #endif |
| 3841 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3842 | if(NULL == psessionEntry) |
| 3843 | { |
| 3844 | return; |
| 3845 | } |
| 3846 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3847 | vos_mem_set( ( tANI_U8* ) &frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3848 | |
| 3849 | frm.Reason.code = nReason; |
| 3850 | |
| 3851 | nStatus = dot11fGetPackedDeAuthSize( pMac, &frm, &nPayload ); |
| 3852 | if ( DOT11F_FAILED( nStatus ) ) |
| 3853 | { |
| 3854 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3855 | "or a De-Authentication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3856 | nStatus ); |
| 3857 | // We'll fall back on the worst case scenario: |
| 3858 | nPayload = sizeof( tDot11fDeAuth ); |
| 3859 | } |
| 3860 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3861 | { |
| 3862 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 3863 | "the packed size for a De-Authentication " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3864 | "(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3865 | } |
| 3866 | |
| 3867 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 3868 | |
| 3869 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3870 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 3871 | ( void** ) &pPacket ); |
| 3872 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3873 | { |
| 3874 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a De-" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3875 | "Authentication."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3876 | return; |
| 3877 | } |
| 3878 | |
| 3879 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 3880 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3881 | |
| 3882 | // Next, we fill out the buffer descriptor: |
| 3883 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3884 | SIR_MAC_MGMT_DEAUTH, peer,psessionEntry->selfMacAddr); |
| 3885 | if ( eSIR_SUCCESS != nSirStatus ) |
| 3886 | { |
| 3887 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3888 | "tor for a De-Authentication (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3889 | nSirStatus ); |
| 3890 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3891 | ( void* ) pFrame, ( void* ) pPacket ); |
| 3892 | return; // just allocated... |
| 3893 | } |
| 3894 | |
| 3895 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 3896 | |
| 3897 | // Prepare the BSSID |
| 3898 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 3899 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3900 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 3901 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3902 | #endif |
| 3903 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3904 | nStatus = dot11fPackDeAuth( pMac, &frm, pFrame + |
| 3905 | sizeof(tSirMacMgmtHdr), |
| 3906 | nPayload, &nPayload ); |
| 3907 | if ( DOT11F_FAILED( nStatus ) ) |
| 3908 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3909 | limLog( pMac, LOGE, FL("Failed to pack a DeAuthentication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3910 | nStatus ); |
| 3911 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3912 | ( void* ) pFrame, ( void* ) pPacket ); |
| 3913 | return; |
| 3914 | } |
| 3915 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3916 | { |
| 3917 | limLog( pMac, LOGW, FL("There were warnings while packing a D" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3918 | "e-Authentication (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3919 | } |
| 3920 | |
| 3921 | PELOG1(limLog( pMac, LOG1, FL("*** Sending De-Authentication frame with rea" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3922 | "son %d to"), nReason ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3923 | limPrintMacAddr( pMac, pMacHdr->da, LOG1 );) |
| 3924 | |
| 3925 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3926 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3927 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3928 | ) |
| 3929 | { |
| 3930 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3931 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3932 | |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 3933 | if((psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) || |
| 3934 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 3935 | { |
| 3936 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 3937 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3938 | |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 3939 | #ifdef FEATURE_WLAN_TDLS |
| 3940 | pStaDs = dphLookupHashEntry(pMac, peer, &aid, &psessionEntry->dph.dphHashTable); |
| 3941 | #endif |
| 3942 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3943 | if (waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3944 | { |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3945 | // Queue Disassociation frame in high priority WQ |
| 3946 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 3947 | HAL_TXRX_FRM_802_11_MGMT, |
| 3948 | ANI_TXDIR_TODS, |
| 3949 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3950 | limTxComplete, pFrame, limDeauthTxCompleteCnf, txFlag ); |
| 3951 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3952 | { |
| 3953 | limLog( pMac, LOGE, FL("Failed to send De-Authentication " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3954 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3955 | nSirStatus ); |
Gopichand Nakkala | 4261ea5 | 2012-12-31 16:43:00 -0800 | [diff] [blame] | 3956 | //Pkt will be freed up by the callback limTxComplete |
| 3957 | |
| 3958 | /*Call limProcessDeauthAckTimeout which will send |
| 3959 | * DeauthCnf for this frame |
| 3960 | */ |
| 3961 | limProcessDeauthAckTimeout(pMac); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3962 | return; |
| 3963 | } |
| 3964 | |
| 3965 | val = SYS_MS_TO_TICKS(LIM_DISASSOC_DEAUTH_ACK_TIMEOUT); |
| 3966 | |
| 3967 | if (tx_timer_change( |
| 3968 | &pMac->lim.limTimers.gLimDeauthAckTimer, val, 0) |
| 3969 | != TX_SUCCESS) |
| 3970 | { |
| 3971 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3972 | FL("Unable to change Deauth ack Timer val")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3973 | return; |
| 3974 | } |
| 3975 | else if(TX_SUCCESS != tx_timer_activate( |
| 3976 | &pMac->lim.limTimers.gLimDeauthAckTimer)) |
| 3977 | { |
| 3978 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3979 | FL("Unable to activate Deauth ack Timer")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3980 | limDeactivateAndChangeTimer(pMac, eLIM_DEAUTH_ACK_TIMER); |
| 3981 | return; |
| 3982 | } |
| 3983 | } |
| 3984 | else |
| 3985 | { |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 3986 | #ifdef FEATURE_WLAN_TDLS |
| 3987 | if ((NULL != pStaDs) && (STA_ENTRY_TDLS_PEER == pStaDs->staType)) |
| 3988 | { |
| 3989 | // Queue Disassociation frame in high priority WQ |
| 3990 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3991 | HAL_TXRX_FRM_802_11_MGMT, |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 3992 | ANI_TXDIR_IBSS, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 3993 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3994 | limTxComplete, pFrame, txFlag ); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 3995 | } |
| 3996 | else |
| 3997 | { |
| 3998 | #endif |
| 3999 | // Queue Disassociation frame in high priority WQ |
| 4000 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4001 | HAL_TXRX_FRM_802_11_MGMT, |
| 4002 | ANI_TXDIR_TODS, |
| 4003 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4004 | limTxComplete, pFrame, txFlag ); |
| 4005 | #ifdef FEATURE_WLAN_TDLS |
| 4006 | } |
| 4007 | #endif |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4008 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4009 | { |
| 4010 | limLog( pMac, LOGE, FL("Failed to send De-Authentication " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4011 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4012 | nSirStatus ); |
| 4013 | //Pkt will be freed up by the callback |
| 4014 | return; |
| 4015 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4016 | } |
| 4017 | |
| 4018 | } // End limSendDeauthMgmtFrame. |
| 4019 | |
| 4020 | |
| 4021 | #ifdef ANI_SUPPORT_11H |
| 4022 | /** |
| 4023 | * \brief Send a Measurement Report Action frame |
| 4024 | * |
| 4025 | * |
| 4026 | * \param pMac Pointer to the global MAC structure |
| 4027 | * |
| 4028 | * \param pMeasReqFrame Address of a tSirMacMeasReqActionFrame |
| 4029 | * |
| 4030 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 4031 | * |
| 4032 | * |
| 4033 | */ |
| 4034 | |
| 4035 | tSirRetStatus |
| 4036 | limSendMeasReportFrame(tpAniSirGlobal pMac, |
| 4037 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 4038 | tSirMacAddr peer) |
| 4039 | { |
| 4040 | tDot11fMeasurementReport frm; |
| 4041 | tANI_U8 *pFrame; |
| 4042 | tSirRetStatus nSirStatus; |
| 4043 | tpSirMacMgmtHdr pMacHdr; |
| 4044 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4045 | void *pPacket; |
| 4046 | eHalStatus halstatus; |
| 4047 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4048 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4049 | |
| 4050 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4051 | frm.Action.action = SIR_MAC_ACTION_MEASURE_REPORT_ID; |
| 4052 | frm.DialogToken.token = pMeasReqFrame->actionHeader.dialogToken; |
| 4053 | |
| 4054 | switch ( pMeasReqFrame->measReqIE.measType ) |
| 4055 | { |
| 4056 | case SIR_MAC_BASIC_MEASUREMENT_TYPE: |
| 4057 | nSirStatus = |
| 4058 | PopulateDot11fMeasurementReport0( pMac, pMeasReqFrame, |
| 4059 | &frm.MeasurementReport ); |
| 4060 | break; |
| 4061 | case SIR_MAC_CCA_MEASUREMENT_TYPE: |
| 4062 | nSirStatus = |
| 4063 | PopulateDot11fMeasurementReport1( pMac, pMeasReqFrame, |
| 4064 | &frm.MeasurementReport ); |
| 4065 | break; |
| 4066 | case SIR_MAC_RPI_MEASUREMENT_TYPE: |
| 4067 | nSirStatus = |
| 4068 | PopulateDot11fMeasurementReport2( pMac, pMeasReqFrame, |
| 4069 | &frm.MeasurementReport ); |
| 4070 | break; |
| 4071 | default: |
| 4072 | limLog( pMac, LOGE, FL("Unknown measurement type %d in limSen" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4073 | "dMeasReportFrame."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4074 | pMeasReqFrame->measReqIE.measType ); |
| 4075 | return eSIR_FAILURE; |
| 4076 | } |
| 4077 | |
| 4078 | if ( eSIR_SUCCESS != nSirStatus ) return eSIR_FAILURE; |
| 4079 | |
| 4080 | nStatus = dot11fGetPackedMeasurementReportSize( pMac, &frm, &nPayload ); |
| 4081 | if ( DOT11F_FAILED( nStatus ) ) |
| 4082 | { |
| 4083 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4084 | "or a Measurement Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4085 | nStatus ); |
| 4086 | // We'll fall back on the worst case scenario: |
| 4087 | nPayload = sizeof( tDot11fMeasurementReport ); |
| 4088 | } |
| 4089 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4090 | { |
| 4091 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 4092 | "the packed size for a Measurement Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4093 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4094 | } |
| 4095 | |
| 4096 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4097 | |
| 4098 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4099 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4100 | { |
| 4101 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a De-" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4102 | "Authentication."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4103 | return eSIR_FAILURE; |
| 4104 | } |
| 4105 | |
| 4106 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4107 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4108 | |
| 4109 | // Next, we fill out the buffer descriptor: |
| 4110 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4111 | SIR_MAC_MGMT_ACTION, peer); |
| 4112 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4113 | { |
| 4114 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4115 | "tor for a Measurement Report (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4116 | nSirStatus ); |
| 4117 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4118 | return eSIR_FAILURE; // just allocated... |
| 4119 | } |
| 4120 | |
| 4121 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4122 | |
| 4123 | nCfg = 6; |
| 4124 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 4125 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4126 | { |
| 4127 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4128 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4129 | nSirStatus ); |
| 4130 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4131 | return eSIR_FAILURE; // just allocated... |
| 4132 | } |
| 4133 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4134 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4135 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4136 | #endif |
| 4137 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4138 | nStatus = dot11fPackMeasurementReport( pMac, &frm, pFrame + |
| 4139 | sizeof(tSirMacMgmtHdr), |
| 4140 | nPayload, &nPayload ); |
| 4141 | if ( DOT11F_FAILED( nStatus ) ) |
| 4142 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4143 | limLog( pMac, LOGE, FL("Failed to pack a Measurement Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4144 | nStatus ); |
| 4145 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4146 | return eSIR_FAILURE; // allocated! |
| 4147 | } |
| 4148 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4149 | { |
| 4150 | limLog( pMac, LOGW, FL("There were warnings while packing a M" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4151 | "easurement Report (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4152 | } |
| 4153 | |
| 4154 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4155 | HAL_TXRX_FRM_802_11_MGMT, |
| 4156 | ANI_TXDIR_TODS, |
| 4157 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4158 | limTxComplete, pFrame, 0 ); |
| 4159 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4160 | { |
| 4161 | limLog( pMac, LOGE, FL("Failed to send a Measurement Report " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4162 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4163 | nSirStatus ); |
| 4164 | //Pkt will be freed up by the callback |
| 4165 | return eSIR_FAILURE; // just allocated... |
| 4166 | } |
| 4167 | |
| 4168 | return eSIR_SUCCESS; |
| 4169 | |
| 4170 | } // End limSendMeasReportFrame. |
| 4171 | |
| 4172 | |
| 4173 | /** |
| 4174 | * \brief Send a TPC Request Action frame |
| 4175 | * |
| 4176 | * |
| 4177 | * \param pMac Pointer to the global MAC datastructure |
| 4178 | * |
| 4179 | * \param peer MAC address to which the frame should be sent |
| 4180 | * |
| 4181 | * |
| 4182 | */ |
| 4183 | |
| 4184 | void |
| 4185 | limSendTpcRequestFrame(tpAniSirGlobal pMac, |
| 4186 | tSirMacAddr peer) |
| 4187 | { |
| 4188 | tDot11fTPCRequest frm; |
| 4189 | tANI_U8 *pFrame; |
| 4190 | tSirRetStatus nSirStatus; |
| 4191 | tpSirMacMgmtHdr pMacHdr; |
| 4192 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4193 | void *pPacket; |
| 4194 | eHalStatus halstatus; |
| 4195 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4196 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4197 | |
| 4198 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4199 | frm.Action.action = SIR_MAC_ACTION_TPC_REQUEST_ID; |
| 4200 | frm.DialogToken.token = 1; |
| 4201 | frm.TPCRequest.present = 1; |
| 4202 | |
| 4203 | nStatus = dot11fGetPackedTPCRequestSize( pMac, &frm, &nPayload ); |
| 4204 | if ( DOT11F_FAILED( nStatus ) ) |
| 4205 | { |
| 4206 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4207 | "or a TPC Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4208 | nStatus ); |
| 4209 | // We'll fall back on the worst case scenario: |
| 4210 | nPayload = sizeof( tDot11fTPCRequest ); |
| 4211 | } |
| 4212 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4213 | { |
| 4214 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 4215 | "the packed size for a TPC Request (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4216 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4217 | } |
| 4218 | |
| 4219 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4220 | |
| 4221 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4222 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4223 | { |
| 4224 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TPC" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4225 | " Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4226 | return; |
| 4227 | } |
| 4228 | |
| 4229 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4230 | vos_mem_set(pFrame, nBytes,0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4231 | |
| 4232 | // Next, we fill out the buffer descriptor: |
| 4233 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4234 | SIR_MAC_MGMT_ACTION, peer); |
| 4235 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4236 | { |
| 4237 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4238 | "tor for a TPC Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4239 | nSirStatus ); |
| 4240 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4241 | return; // just allocated... |
| 4242 | } |
| 4243 | |
| 4244 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4245 | |
| 4246 | nCfg = 6; |
| 4247 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 4248 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4249 | { |
| 4250 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4251 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4252 | nSirStatus ); |
| 4253 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4254 | return; // just allocated... |
| 4255 | } |
| 4256 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4257 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4258 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4259 | #endif |
| 4260 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4261 | nStatus = dot11fPackTPCRequest( pMac, &frm, pFrame + |
| 4262 | sizeof(tSirMacMgmtHdr), |
| 4263 | nPayload, &nPayload ); |
| 4264 | if ( DOT11F_FAILED( nStatus ) ) |
| 4265 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4266 | limLog( pMac, LOGE, FL("Failed to pack a TPC Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4267 | nStatus ); |
| 4268 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4269 | return; // allocated! |
| 4270 | } |
| 4271 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4272 | { |
| 4273 | limLog( pMac, LOGW, FL("There were warnings while packing a T" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4274 | "PC Request (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4275 | } |
| 4276 | |
| 4277 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4278 | HAL_TXRX_FRM_802_11_MGMT, |
| 4279 | ANI_TXDIR_TODS, |
| 4280 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4281 | limTxComplete, pFrame, 0 ); |
| 4282 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4283 | { |
| 4284 | limLog( pMac, LOGE, FL("Failed to send a TPC Request " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4285 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4286 | nSirStatus ); |
| 4287 | //Pkt will be freed up by the callback |
| 4288 | return; |
| 4289 | } |
| 4290 | |
| 4291 | } // End limSendTpcRequestFrame. |
| 4292 | |
| 4293 | |
| 4294 | /** |
| 4295 | * \brief Send a TPC Report Action frame |
| 4296 | * |
| 4297 | * |
| 4298 | * \param pMac Pointer to the global MAC datastructure |
| 4299 | * |
| 4300 | * \param pTpcReqFrame Pointer to the received TPC Request |
| 4301 | * |
| 4302 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 4303 | * |
| 4304 | * |
| 4305 | */ |
| 4306 | |
| 4307 | tSirRetStatus |
| 4308 | limSendTpcReportFrame(tpAniSirGlobal pMac, |
| 4309 | tpSirMacTpcReqActionFrame pTpcReqFrame, |
| 4310 | tSirMacAddr peer) |
| 4311 | { |
| 4312 | tDot11fTPCReport frm; |
| 4313 | tANI_U8 *pFrame; |
| 4314 | tSirRetStatus nSirStatus; |
| 4315 | tpSirMacMgmtHdr pMacHdr; |
| 4316 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4317 | void *pPacket; |
| 4318 | eHalStatus halstatus; |
| 4319 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4320 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4321 | |
| 4322 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4323 | frm.Action.action = SIR_MAC_ACTION_TPC_REPORT_ID; |
| 4324 | frm.DialogToken.token = pTpcReqFrame->actionHeader.dialogToken; |
| 4325 | |
| 4326 | // FramesToDo: On the Gen4_TVM branch, there was a comment: |
| 4327 | // "misplaced this function, need to replace: |
| 4328 | // txPower = halGetRateToPwrValue(pMac, staid, |
| 4329 | // pMac->lim.gLimCurrentChannelId, 0); |
| 4330 | frm.TPCReport.tx_power = 0; |
| 4331 | frm.TPCReport.link_margin = 0; |
| 4332 | frm.TPCReport.present = 1; |
| 4333 | |
| 4334 | nStatus = dot11fGetPackedTPCReportSize( pMac, &frm, &nPayload ); |
| 4335 | if ( DOT11F_FAILED( nStatus ) ) |
| 4336 | { |
| 4337 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4338 | "or a TPC Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4339 | nStatus ); |
| 4340 | // We'll fall back on the worst case scenario: |
| 4341 | nPayload = sizeof( tDot11fTPCReport ); |
| 4342 | } |
| 4343 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4344 | { |
| 4345 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 4346 | "the packed size for a TPC Report (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4347 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4348 | } |
| 4349 | |
| 4350 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4351 | |
| 4352 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4353 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4354 | { |
| 4355 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TPC" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4356 | " Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4357 | return eSIR_FAILURE; |
| 4358 | } |
| 4359 | |
| 4360 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4361 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4362 | |
| 4363 | // Next, we fill out the buffer descriptor: |
| 4364 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4365 | SIR_MAC_MGMT_ACTION, peer); |
| 4366 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4367 | { |
| 4368 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4369 | "tor for a TPC Report (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4370 | nSirStatus ); |
| 4371 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4372 | return eSIR_FAILURE; // just allocated... |
| 4373 | } |
| 4374 | |
| 4375 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4376 | |
| 4377 | nCfg = 6; |
| 4378 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 4379 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4380 | { |
| 4381 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4382 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4383 | nSirStatus ); |
| 4384 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4385 | return eSIR_FAILURE; // just allocated... |
| 4386 | } |
| 4387 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4388 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4389 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4390 | #endif |
| 4391 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4392 | nStatus = dot11fPackTPCReport( pMac, &frm, pFrame + |
| 4393 | sizeof(tSirMacMgmtHdr), |
| 4394 | nPayload, &nPayload ); |
| 4395 | if ( DOT11F_FAILED( nStatus ) ) |
| 4396 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4397 | limLog( pMac, LOGE, FL("Failed to pack a TPC Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4398 | nStatus ); |
| 4399 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4400 | return eSIR_FAILURE; // allocated! |
| 4401 | } |
| 4402 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4403 | { |
| 4404 | limLog( pMac, LOGW, FL("There were warnings while packing a T" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4405 | "PC Report (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4406 | } |
| 4407 | |
| 4408 | |
| 4409 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4410 | HAL_TXRX_FRM_802_11_MGMT, |
| 4411 | ANI_TXDIR_TODS, |
| 4412 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4413 | limTxComplete, pFrame, 0 ); |
| 4414 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4415 | { |
| 4416 | limLog( pMac, LOGE, FL("Failed to send a TPC Report " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4417 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4418 | nSirStatus ); |
| 4419 | //Pkt will be freed up by the callback |
| 4420 | return eSIR_FAILURE; // just allocated... |
| 4421 | } |
| 4422 | |
| 4423 | return eSIR_SUCCESS; |
| 4424 | |
| 4425 | } // End limSendTpcReportFrame. |
| 4426 | #endif //ANI_SUPPORT_11H |
| 4427 | |
| 4428 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4429 | /** |
| 4430 | * \brief Send a Channel Switch Announcement |
| 4431 | * |
| 4432 | * |
| 4433 | * \param pMac Pointer to the global MAC datastructure |
| 4434 | * |
| 4435 | * \param peer MAC address to which this frame will be sent |
| 4436 | * |
| 4437 | * \param nMode |
| 4438 | * |
| 4439 | * \param nNewChannel |
| 4440 | * |
| 4441 | * \param nCount |
| 4442 | * |
| 4443 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 4444 | * |
| 4445 | * |
| 4446 | */ |
| 4447 | |
| 4448 | tSirRetStatus |
| 4449 | limSendChannelSwitchMgmtFrame(tpAniSirGlobal pMac, |
| 4450 | tSirMacAddr peer, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4451 | tANI_U8 nMode, |
| 4452 | tANI_U8 nNewChannel, |
| 4453 | tANI_U8 nCount, |
| 4454 | tpPESession psessionEntry ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4455 | { |
| 4456 | tDot11fChannelSwitch frm; |
| 4457 | tANI_U8 *pFrame; |
| 4458 | tSirRetStatus nSirStatus; |
| 4459 | tpSirMacMgmtHdr pMacHdr; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4460 | tANI_U32 nBytes, nPayload, nStatus;//, nCfg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4461 | void *pPacket; |
| 4462 | eHalStatus halstatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4463 | tANI_U8 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4464 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4465 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4466 | |
| 4467 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4468 | frm.Action.action = SIR_MAC_ACTION_CHANNEL_SWITCH_ID; |
| 4469 | frm.ChanSwitchAnn.switchMode = nMode; |
| 4470 | frm.ChanSwitchAnn.newChannel = nNewChannel; |
| 4471 | frm.ChanSwitchAnn.switchCount = nCount; |
| 4472 | frm.ChanSwitchAnn.present = 1; |
| 4473 | |
| 4474 | nStatus = dot11fGetPackedChannelSwitchSize( pMac, &frm, &nPayload ); |
| 4475 | if ( DOT11F_FAILED( nStatus ) ) |
| 4476 | { |
| 4477 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4478 | "or a Channel Switch (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4479 | nStatus ); |
| 4480 | // We'll fall back on the worst case scenario: |
| 4481 | nPayload = sizeof( tDot11fChannelSwitch ); |
| 4482 | } |
| 4483 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4484 | { |
| 4485 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 4486 | "the packed size for a Channel Switch (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4487 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4488 | } |
| 4489 | |
| 4490 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4491 | |
| 4492 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4493 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4494 | { |
| 4495 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TPC" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4496 | " Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4497 | return eSIR_FAILURE; |
| 4498 | } |
| 4499 | |
| 4500 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4501 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4502 | |
| 4503 | // Next, we fill out the buffer descriptor: |
| 4504 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4505 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 4506 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4507 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 4508 | (tANI_U8 *) psessionEntry->bssId, |
| 4509 | sizeof( tSirMacAddr )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4510 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4511 | { |
| 4512 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4513 | "tor for a Channel Switch (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4514 | nSirStatus ); |
| 4515 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4516 | return eSIR_FAILURE; // just allocated... |
| 4517 | } |
| 4518 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4519 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4520 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4521 | |
| 4522 | nCfg = 6; |
| 4523 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 4524 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4525 | { |
| 4526 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4527 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4528 | nSirStatus ); |
| 4529 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4530 | return eSIR_FAILURE; // just allocated... |
| 4531 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4532 | #endif |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4533 | |
| 4534 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4535 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4536 | #endif |
| 4537 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4538 | nStatus = dot11fPackChannelSwitch( pMac, &frm, pFrame + |
| 4539 | sizeof(tSirMacMgmtHdr), |
| 4540 | nPayload, &nPayload ); |
| 4541 | if ( DOT11F_FAILED( nStatus ) ) |
| 4542 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4543 | limLog( pMac, LOGE, FL("Failed to pack a Channel Switch (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4544 | nStatus ); |
| 4545 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4546 | return eSIR_FAILURE; // allocated! |
| 4547 | } |
| 4548 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4549 | { |
| 4550 | limLog( pMac, LOGW, FL("There were warnings while packing a C" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4551 | "hannel Switch (0x%08x).") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4552 | } |
| 4553 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4554 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4555 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 4556 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4557 | ) |
| 4558 | { |
| 4559 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 4560 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4561 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4562 | HAL_TXRX_FRM_802_11_MGMT, |
| 4563 | ANI_TXDIR_TODS, |
| 4564 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4565 | limTxComplete, pFrame, txFlag ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4566 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4567 | { |
| 4568 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4569 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4570 | nSirStatus ); |
| 4571 | //Pkt will be freed up by the callback |
| 4572 | return eSIR_FAILURE; |
| 4573 | } |
| 4574 | |
| 4575 | return eSIR_SUCCESS; |
| 4576 | |
| 4577 | } // End limSendChannelSwitchMgmtFrame. |
| 4578 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4579 | |
| 4580 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4581 | #ifdef WLAN_FEATURE_11AC |
| 4582 | tSirRetStatus |
| 4583 | limSendVHTOpmodeNotificationFrame(tpAniSirGlobal pMac, |
| 4584 | tSirMacAddr peer, |
| 4585 | tANI_U8 nMode, |
| 4586 | tpPESession psessionEntry ) |
| 4587 | { |
| 4588 | tDot11fOperatingMode frm; |
| 4589 | tANI_U8 *pFrame; |
| 4590 | tSirRetStatus nSirStatus; |
| 4591 | tpSirMacMgmtHdr pMacHdr; |
| 4592 | tANI_U32 nBytes, nPayload = 0, nStatus;//, nCfg; |
| 4593 | void *pPacket; |
| 4594 | eHalStatus halstatus; |
| 4595 | tANI_U8 txFlag = 0; |
| 4596 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4597 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4598 | |
| 4599 | frm.Category.category = SIR_MAC_ACTION_VHT; |
| 4600 | frm.Action.action = SIR_MAC_VHT_OPMODE_NOTIFICATION; |
| 4601 | frm.OperatingMode.chanWidth = nMode; |
| 4602 | frm.OperatingMode.rxNSS = 0; |
| 4603 | frm.OperatingMode.rxNSSType = 0; |
| 4604 | |
| 4605 | nStatus = dot11fGetPackedOperatingModeSize( pMac, &frm, &nPayload ); |
| 4606 | if ( DOT11F_FAILED( nStatus ) ) |
| 4607 | { |
| 4608 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4609 | "or a Operating Mode (0x%08x)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4610 | nStatus ); |
| 4611 | // We'll fall back on the worst case scenario: |
| 4612 | nPayload = sizeof( tDot11fOperatingMode); |
| 4613 | } |
| 4614 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4615 | { |
| 4616 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 4617 | "the packed size for a Operating Mode (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4618 | "%08x)."), nStatus ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4619 | } |
| 4620 | |
| 4621 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4622 | |
| 4623 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4624 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4625 | { |
| 4626 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Operating Mode" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4627 | " Report."), nBytes ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4628 | return eSIR_FAILURE; |
| 4629 | } |
| 4630 | |
| 4631 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4632 | vos_mem_set( pFrame, nBytes, 0 ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4633 | |
| 4634 | |
| 4635 | // Next, we fill out the buffer descriptor: |
| 4636 | if(psessionEntry->pePersona == VOS_STA_SAP_MODE) { |
| 4637 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4638 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 4639 | } else |
| 4640 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4641 | SIR_MAC_MGMT_ACTION, psessionEntry->bssId, psessionEntry->selfMacAddr); |
| 4642 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4643 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 4644 | (tANI_U8 *) psessionEntry->bssId, |
| 4645 | sizeof( tSirMacAddr )); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4646 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4647 | { |
| 4648 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4649 | "tor for a Operating Mode (%d)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4650 | nSirStatus ); |
| 4651 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4652 | return eSIR_FAILURE; // just allocated... |
| 4653 | } |
| 4654 | nStatus = dot11fPackOperatingMode( pMac, &frm, pFrame + |
| 4655 | sizeof(tSirMacMgmtHdr), |
| 4656 | nPayload, &nPayload ); |
| 4657 | if ( DOT11F_FAILED( nStatus ) ) |
| 4658 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4659 | limLog( pMac, LOGE, FL("Failed to pack a Operating Mode (0x%08x)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4660 | nStatus ); |
| 4661 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4662 | return eSIR_FAILURE; // allocated! |
| 4663 | } |
| 4664 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4665 | { |
| 4666 | limLog( pMac, LOGW, FL("There were warnings while packing a Operating Mode" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4667 | " (0x%08x).") ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4668 | } |
| 4669 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4670 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 4671 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4672 | ) |
| 4673 | { |
| 4674 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 4675 | } |
| 4676 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4677 | HAL_TXRX_FRM_802_11_MGMT, |
| 4678 | ANI_TXDIR_TODS, |
| 4679 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4680 | limTxComplete, pFrame, txFlag ); |
| 4681 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4682 | { |
| 4683 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4684 | "(%X)!"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4685 | nSirStatus ); |
| 4686 | //Pkt will be freed up by the callback |
| 4687 | return eSIR_FAILURE; |
| 4688 | } |
| 4689 | |
| 4690 | return eSIR_SUCCESS; |
| 4691 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4692 | |
| 4693 | /** |
| 4694 | * \brief Send a VHT Channel Switch Announcement |
| 4695 | * |
| 4696 | * |
| 4697 | * \param pMac Pointer to the global MAC datastructure |
| 4698 | * |
| 4699 | * \param peer MAC address to which this frame will be sent |
| 4700 | * |
| 4701 | * \param nChanWidth |
| 4702 | * |
| 4703 | * \param nNewChannel |
| 4704 | * |
| 4705 | * |
| 4706 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 4707 | * |
| 4708 | * |
| 4709 | */ |
| 4710 | |
| 4711 | tSirRetStatus |
| 4712 | limSendVHTChannelSwitchMgmtFrame(tpAniSirGlobal pMac, |
| 4713 | tSirMacAddr peer, |
| 4714 | tANI_U8 nChanWidth, |
| 4715 | tANI_U8 nNewChannel, |
| 4716 | tANI_U8 ncbMode, |
| 4717 | tpPESession psessionEntry ) |
| 4718 | { |
| 4719 | tDot11fChannelSwitch frm; |
| 4720 | tANI_U8 *pFrame; |
| 4721 | tSirRetStatus nSirStatus; |
| 4722 | tpSirMacMgmtHdr pMacHdr; |
| 4723 | tANI_U32 nBytes, nPayload, nStatus;//, nCfg; |
| 4724 | void *pPacket; |
| 4725 | eHalStatus halstatus; |
| 4726 | tANI_U8 txFlag = 0; |
| 4727 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4728 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4729 | |
| 4730 | |
| 4731 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4732 | frm.Action.action = SIR_MAC_ACTION_CHANNEL_SWITCH_ID; |
| 4733 | frm.ChanSwitchAnn.switchMode = 1; |
| 4734 | frm.ChanSwitchAnn.newChannel = nNewChannel; |
| 4735 | frm.ChanSwitchAnn.switchCount = 1; |
| 4736 | frm.ExtChanSwitchAnn.secondaryChannelOffset = limGetHTCBState(ncbMode); |
| 4737 | frm.ExtChanSwitchAnn.present = 1; |
| 4738 | frm.WiderBWChanSwitchAnn.newChanWidth = nChanWidth; |
| 4739 | frm.WiderBWChanSwitchAnn.newCenterChanFreq0 = limGetCenterChannel(pMac,nNewChannel,ncbMode,nChanWidth); |
| 4740 | frm.WiderBWChanSwitchAnn.newCenterChanFreq1 = 0; |
| 4741 | frm.ChanSwitchAnn.present = 1; |
| 4742 | frm.WiderBWChanSwitchAnn.present = 1; |
| 4743 | |
| 4744 | nStatus = dot11fGetPackedChannelSwitchSize( pMac, &frm, &nPayload ); |
| 4745 | if ( DOT11F_FAILED( nStatus ) ) |
| 4746 | { |
| 4747 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4748 | "or a Channel Switch (0x%08x)."), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4749 | nStatus ); |
| 4750 | // We'll fall back on the worst case scenario: |
| 4751 | nPayload = sizeof( tDot11fChannelSwitch ); |
| 4752 | } |
| 4753 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4754 | { |
| 4755 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 4756 | "the packed size for a Channel Switch (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4757 | "%08x)."), nStatus ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4758 | } |
| 4759 | |
| 4760 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4761 | |
| 4762 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4763 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4764 | { |
| 4765 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TPC" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4766 | " Report."), nBytes ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4767 | return eSIR_FAILURE; |
| 4768 | } |
| 4769 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4770 | vos_mem_set( pFrame, nBytes, 0 ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4771 | |
| 4772 | // Next, we fill out the buffer descriptor: |
| 4773 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4774 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 4775 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4776 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 4777 | (tANI_U8 *) psessionEntry->bssId, |
| 4778 | sizeof( tSirMacAddr )); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4779 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4780 | { |
| 4781 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4782 | "tor for a Channel Switch (%d)."), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4783 | nSirStatus ); |
| 4784 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4785 | return eSIR_FAILURE; // just allocated... |
| 4786 | } |
| 4787 | nStatus = dot11fPackChannelSwitch( pMac, &frm, pFrame + |
| 4788 | sizeof(tSirMacMgmtHdr), |
| 4789 | nPayload, &nPayload ); |
| 4790 | if ( DOT11F_FAILED( nStatus ) ) |
| 4791 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4792 | limLog( pMac, LOGE, FL("Failed to pack a Channel Switch (0x%08x)."), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4793 | nStatus ); |
| 4794 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4795 | return eSIR_FAILURE; // allocated! |
| 4796 | } |
| 4797 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4798 | { |
| 4799 | limLog( pMac, LOGW, FL("There were warnings while packing a C" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4800 | "hannel Switch (0x%08x).") ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4801 | } |
| 4802 | |
| 4803 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4804 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 4805 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4806 | ) |
| 4807 | { |
| 4808 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 4809 | } |
| 4810 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4811 | HAL_TXRX_FRM_802_11_MGMT, |
| 4812 | ANI_TXDIR_TODS, |
| 4813 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4814 | limTxComplete, pFrame, txFlag ); |
| 4815 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4816 | { |
| 4817 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4818 | "(%X)!"), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 4819 | nSirStatus ); |
| 4820 | //Pkt will be freed up by the callback |
| 4821 | return eSIR_FAILURE; |
| 4822 | } |
| 4823 | |
| 4824 | return eSIR_SUCCESS; |
| 4825 | |
| 4826 | } // End limSendVHTChannelSwitchMgmtFrame. |
| 4827 | |
| 4828 | |
| 4829 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 4830 | #endif |
| 4831 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4832 | /** |
| 4833 | * \brief Send an ADDBA Req Action Frame to peer |
| 4834 | * |
| 4835 | * \sa limSendAddBAReq |
| 4836 | * |
| 4837 | * \param pMac The global tpAniSirGlobal object |
| 4838 | * |
| 4839 | * \param pMlmAddBAReq A pointer to tLimMlmAddBAReq. This contains |
| 4840 | * the necessary parameters reqd by PE send the ADDBA Req Action |
| 4841 | * Frame to the peer |
| 4842 | * |
| 4843 | * \return eSIR_SUCCESS if setup completes successfully |
| 4844 | * eSIR_FAILURE is some problem is encountered |
| 4845 | */ |
| 4846 | tSirRetStatus limSendAddBAReq( tpAniSirGlobal pMac, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4847 | tpLimMlmAddBAReq pMlmAddBAReq, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4848 | { |
| 4849 | tDot11fAddBAReq frmAddBAReq; |
| 4850 | tANI_U8 *pAddBAReqBuffer = NULL; |
| 4851 | tpSirMacMgmtHdr pMacHdr; |
| 4852 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 4853 | tSirRetStatus statusCode; |
| 4854 | eHalStatus halStatus; |
| 4855 | void *pPacket; |
| 4856 | tANI_U8 txFlag = 0; |
| 4857 | |
| 4858 | if(NULL == psessionEntry) |
| 4859 | { |
| 4860 | return eSIR_FAILURE; |
| 4861 | } |
| 4862 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4863 | vos_mem_set( (void *) &frmAddBAReq, sizeof( frmAddBAReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4864 | |
| 4865 | // Category - 3 (BA) |
| 4866 | frmAddBAReq.Category.category = SIR_MAC_ACTION_BLKACK; |
| 4867 | |
| 4868 | // Action - 0 (ADDBA Req) |
| 4869 | frmAddBAReq.Action.action = SIR_MAC_BLKACK_ADD_REQ; |
| 4870 | |
| 4871 | // FIXME - Dialog Token, generalize this... |
| 4872 | frmAddBAReq.DialogToken.token = pMlmAddBAReq->baDialogToken; |
| 4873 | |
| 4874 | // Fill the ADDBA Parameter Set |
| 4875 | frmAddBAReq.AddBAParameterSet.tid = pMlmAddBAReq->baTID; |
| 4876 | frmAddBAReq.AddBAParameterSet.policy = pMlmAddBAReq->baPolicy; |
| 4877 | frmAddBAReq.AddBAParameterSet.bufferSize = pMlmAddBAReq->baBufferSize; |
| 4878 | |
| 4879 | // BA timeout |
| 4880 | // 0 - indicates no BA timeout |
| 4881 | frmAddBAReq.BATimeout.timeout = pMlmAddBAReq->baTimeout; |
| 4882 | |
| 4883 | // BA Starting Sequence Number |
| 4884 | // Fragment number will always be zero |
| 4885 | if (pMlmAddBAReq->baSSN < LIM_TX_FRAMES_THRESHOLD_ON_CHIP) { |
| 4886 | pMlmAddBAReq->baSSN = LIM_TX_FRAMES_THRESHOLD_ON_CHIP; |
| 4887 | } |
| 4888 | |
| 4889 | frmAddBAReq.BAStartingSequenceControl.ssn = |
| 4890 | pMlmAddBAReq->baSSN - LIM_TX_FRAMES_THRESHOLD_ON_CHIP; |
| 4891 | |
| 4892 | nStatus = dot11fGetPackedAddBAReqSize( pMac, &frmAddBAReq, &nPayload ); |
| 4893 | |
| 4894 | if( DOT11F_FAILED( nStatus )) |
| 4895 | { |
| 4896 | limLog( pMac, LOGW, |
| 4897 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4898 | "an ADDBA Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4899 | nStatus ); |
| 4900 | |
| 4901 | // We'll fall back on the worst case scenario: |
| 4902 | nPayload = sizeof( tDot11fAddBAReq ); |
| 4903 | } |
| 4904 | else if( DOT11F_WARNED( nStatus )) |
| 4905 | { |
| 4906 | limLog( pMac, LOGW, |
| 4907 | FL( "There were warnings while calculating" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4908 | "the packed size for an ADDBA Req (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4909 | nStatus ); |
| 4910 | } |
| 4911 | |
| 4912 | // Add the MGMT header to frame length |
| 4913 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4914 | |
| 4915 | // Need to allocate a buffer for ADDBA AF |
| 4916 | if( eHAL_STATUS_SUCCESS != |
| 4917 | (halStatus = palPktAlloc( pMac->hHdd, |
| 4918 | HAL_TXRX_FRM_802_11_MGMT, |
| 4919 | (tANI_U16) frameLen, |
| 4920 | (void **) &pAddBAReqBuffer, |
| 4921 | (void **) &pPacket ))) |
| 4922 | { |
| 4923 | // Log error |
| 4924 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4925 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4926 | frameLen, |
| 4927 | halStatus ); |
| 4928 | |
| 4929 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 4930 | goto returnAfterError; |
| 4931 | } |
| 4932 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 4933 | vos_mem_set( (void *) pAddBAReqBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4934 | |
| 4935 | // Copy necessary info to BD |
| 4936 | if( eSIR_SUCCESS != |
| 4937 | (statusCode = limPopulateMacHeader( pMac, |
| 4938 | pAddBAReqBuffer, |
| 4939 | SIR_MAC_MGMT_FRAME, |
| 4940 | SIR_MAC_MGMT_ACTION, |
| 4941 | pMlmAddBAReq->peerMacAddr,psessionEntry->selfMacAddr))) |
| 4942 | goto returnAfterError; |
| 4943 | |
| 4944 | // Update A3 with the BSSID |
| 4945 | pMacHdr = ( tpSirMacMgmtHdr ) pAddBAReqBuffer; |
| 4946 | |
| 4947 | #if 0 |
| 4948 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 4949 | if( eSIR_SUCCESS != cfgGetStr( pMac, |
| 4950 | WNI_CFG_BSSID, |
| 4951 | (tANI_U8 *) pMacHdr->bssId, |
| 4952 | &cfgLen )) |
| 4953 | { |
| 4954 | limLog( pMac, LOGP, |
| 4955 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4956 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4957 | |
| 4958 | // FIXME - Need to convert to tSirRetStatus |
| 4959 | statusCode = eSIR_FAILURE; |
| 4960 | goto returnAfterError; |
| 4961 | } |
| 4962 | #endif//TO SUPPORT BT-AMP |
| 4963 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 4964 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4965 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4966 | limSetProtectedBit(pMac, psessionEntry, pMlmAddBAReq->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4967 | #endif |
| 4968 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4969 | // Now, we're ready to "pack" the frames |
| 4970 | nStatus = dot11fPackAddBAReq( pMac, |
| 4971 | &frmAddBAReq, |
| 4972 | pAddBAReqBuffer + sizeof( tSirMacMgmtHdr ), |
| 4973 | nPayload, |
| 4974 | &nPayload ); |
| 4975 | |
| 4976 | if( DOT11F_FAILED( nStatus )) |
| 4977 | { |
| 4978 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4979 | FL( "Failed to pack an ADDBA Req (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4980 | nStatus ); |
| 4981 | |
| 4982 | // FIXME - Need to convert to tSirRetStatus |
| 4983 | statusCode = eSIR_FAILURE; |
| 4984 | goto returnAfterError; |
| 4985 | } |
| 4986 | else if( DOT11F_WARNED( nStatus )) |
| 4987 | { |
| 4988 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4989 | FL( "There were warnings while packing an ADDBA Req (0x%08x)." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4990 | } |
| 4991 | |
| 4992 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4993 | FL( "Sending an ADDBA REQ to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4994 | limPrintMacAddr( pMac, pMlmAddBAReq->peerMacAddr, LOGW ); |
| 4995 | |
| 4996 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4997 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 4998 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4999 | ) |
| 5000 | { |
| 5001 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5002 | } |
| 5003 | |
| 5004 | if( eHAL_STATUS_SUCCESS != |
| 5005 | (halStatus = halTxFrame( pMac, |
| 5006 | pPacket, |
| 5007 | (tANI_U16) frameLen, |
| 5008 | HAL_TXRX_FRM_802_11_MGMT, |
| 5009 | ANI_TXDIR_TODS, |
| 5010 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5011 | limTxComplete, |
| 5012 | pAddBAReqBuffer, txFlag ))) |
| 5013 | { |
| 5014 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5015 | FL( "halTxFrame FAILED! Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5016 | halStatus ); |
| 5017 | |
| 5018 | // FIXME - Need to convert eHalStatus to tSirRetStatus |
| 5019 | statusCode = eSIR_FAILURE; |
| 5020 | //Pkt will be freed up by the callback |
| 5021 | return statusCode; |
| 5022 | } |
| 5023 | else |
| 5024 | return eSIR_SUCCESS; |
| 5025 | |
| 5026 | returnAfterError: |
| 5027 | |
| 5028 | // Release buffer, if allocated |
| 5029 | if( NULL != pAddBAReqBuffer ) |
| 5030 | palPktFree( pMac->hHdd, |
| 5031 | HAL_TXRX_FRM_802_11_MGMT, |
| 5032 | (void *) pAddBAReqBuffer, |
| 5033 | (void *) pPacket ); |
| 5034 | |
| 5035 | return statusCode; |
| 5036 | } |
| 5037 | |
| 5038 | /** |
| 5039 | * \brief Send an ADDBA Rsp Action Frame to peer |
| 5040 | * |
| 5041 | * \sa limSendAddBARsp |
| 5042 | * |
| 5043 | * \param pMac The global tpAniSirGlobal object |
| 5044 | * |
| 5045 | * \param pMlmAddBARsp A pointer to tLimMlmAddBARsp. This contains |
| 5046 | * the necessary parameters reqd by PE send the ADDBA Rsp Action |
| 5047 | * Frame to the peer |
| 5048 | * |
| 5049 | * \return eSIR_SUCCESS if setup completes successfully |
| 5050 | * eSIR_FAILURE is some problem is encountered |
| 5051 | */ |
| 5052 | tSirRetStatus limSendAddBARsp( tpAniSirGlobal pMac, |
| 5053 | tpLimMlmAddBARsp pMlmAddBARsp, |
| 5054 | tpPESession psessionEntry) |
| 5055 | { |
| 5056 | tDot11fAddBARsp frmAddBARsp; |
| 5057 | tANI_U8 *pAddBARspBuffer = NULL; |
| 5058 | tpSirMacMgmtHdr pMacHdr; |
| 5059 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 5060 | tSirRetStatus statusCode; |
| 5061 | eHalStatus halStatus; |
| 5062 | void *pPacket; |
| 5063 | tANI_U8 txFlag = 0; |
| 5064 | |
| 5065 | if(NULL == psessionEntry) |
| 5066 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5067 | PELOGE(limLog(pMac, LOGE, FL("Session entry is NULL!!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5068 | return eSIR_FAILURE; |
| 5069 | } |
| 5070 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5071 | vos_mem_set( (void *) &frmAddBARsp, sizeof( frmAddBARsp ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5072 | |
| 5073 | // Category - 3 (BA) |
| 5074 | frmAddBARsp.Category.category = SIR_MAC_ACTION_BLKACK; |
| 5075 | // Action - 1 (ADDBA Rsp) |
| 5076 | frmAddBARsp.Action.action = SIR_MAC_BLKACK_ADD_RSP; |
| 5077 | |
| 5078 | // Should be same as the one we received in the ADDBA Req |
| 5079 | frmAddBARsp.DialogToken.token = pMlmAddBARsp->baDialogToken; |
| 5080 | |
| 5081 | // ADDBA Req status |
| 5082 | frmAddBARsp.Status.status = pMlmAddBARsp->addBAResultCode; |
| 5083 | |
| 5084 | // Fill the ADDBA Parameter Set as provided by caller |
| 5085 | frmAddBARsp.AddBAParameterSet.tid = pMlmAddBARsp->baTID; |
| 5086 | frmAddBARsp.AddBAParameterSet.policy = pMlmAddBARsp->baPolicy; |
| 5087 | frmAddBARsp.AddBAParameterSet.bufferSize = pMlmAddBARsp->baBufferSize; |
Kiran Kumar Lokere | 2ac471f | 2013-05-30 16:08:48 -0700 | [diff] [blame] | 5088 | frmAddBARsp.AddBAParameterSet.amsduSupported = psessionEntry->amsduSupportedInBA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5089 | |
| 5090 | // BA timeout |
| 5091 | // 0 - indicates no BA timeout |
| 5092 | frmAddBARsp.BATimeout.timeout = pMlmAddBARsp->baTimeout; |
| 5093 | |
| 5094 | nStatus = dot11fGetPackedAddBARspSize( pMac, &frmAddBARsp, &nPayload ); |
| 5095 | |
| 5096 | if( DOT11F_FAILED( nStatus )) |
| 5097 | { |
| 5098 | limLog( pMac, LOGW, |
| 5099 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5100 | "an ADDBA Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5101 | nStatus ); |
| 5102 | |
| 5103 | // We'll fall back on the worst case scenario: |
| 5104 | nPayload = sizeof( tDot11fAddBARsp ); |
| 5105 | } |
| 5106 | else if( DOT11F_WARNED( nStatus )) |
| 5107 | { |
| 5108 | limLog( pMac, LOGW, |
| 5109 | FL( "There were warnings while calculating" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5110 | "the packed size for an ADDBA Rsp (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5111 | nStatus ); |
| 5112 | } |
| 5113 | |
| 5114 | // Need to allocate a buffer for ADDBA AF |
| 5115 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5116 | |
| 5117 | // Allocate shared memory |
| 5118 | if( eHAL_STATUS_SUCCESS != |
| 5119 | (halStatus = palPktAlloc( pMac->hHdd, |
| 5120 | HAL_TXRX_FRM_802_11_MGMT, |
| 5121 | (tANI_U16) frameLen, |
| 5122 | (void **) &pAddBARspBuffer, |
| 5123 | (void **) &pPacket ))) |
| 5124 | { |
| 5125 | // Log error |
| 5126 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5127 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5128 | frameLen, |
| 5129 | halStatus ); |
| 5130 | |
| 5131 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 5132 | goto returnAfterError; |
| 5133 | } |
| 5134 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5135 | vos_mem_set( (void *) pAddBARspBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5136 | |
| 5137 | // Copy necessary info to BD |
| 5138 | if( eSIR_SUCCESS != |
| 5139 | (statusCode = limPopulateMacHeader( pMac, |
| 5140 | pAddBARspBuffer, |
| 5141 | SIR_MAC_MGMT_FRAME, |
| 5142 | SIR_MAC_MGMT_ACTION, |
| 5143 | pMlmAddBARsp->peerMacAddr,psessionEntry->selfMacAddr))) |
| 5144 | goto returnAfterError; |
| 5145 | |
| 5146 | // Update A3 with the BSSID |
| 5147 | |
| 5148 | pMacHdr = ( tpSirMacMgmtHdr ) pAddBARspBuffer; |
| 5149 | |
| 5150 | #if 0 |
| 5151 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 5152 | if( eSIR_SUCCESS != wlan_cfgGetStr( pMac, |
| 5153 | WNI_CFG_BSSID, |
| 5154 | (tANI_U8 *) pMacHdr->bssId, |
| 5155 | &cfgLen )) |
| 5156 | { |
| 5157 | limLog( pMac, LOGP, |
| 5158 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5159 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5160 | |
| 5161 | // FIXME - Need to convert to tSirRetStatus |
| 5162 | statusCode = eSIR_FAILURE; |
| 5163 | goto returnAfterError; |
| 5164 | } |
| 5165 | #endif // TO SUPPORT BT-AMP |
| 5166 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 5167 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5168 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5169 | limSetProtectedBit(pMac, psessionEntry, pMlmAddBARsp->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5170 | #endif |
| 5171 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5172 | // Now, we're ready to "pack" the frames |
| 5173 | nStatus = dot11fPackAddBARsp( pMac, |
| 5174 | &frmAddBARsp, |
| 5175 | pAddBARspBuffer + sizeof( tSirMacMgmtHdr ), |
| 5176 | nPayload, |
| 5177 | &nPayload ); |
| 5178 | |
| 5179 | if( DOT11F_FAILED( nStatus )) |
| 5180 | { |
| 5181 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5182 | FL( "Failed to pack an ADDBA Rsp (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5183 | nStatus ); |
| 5184 | |
| 5185 | // FIXME - Need to convert to tSirRetStatus |
| 5186 | statusCode = eSIR_FAILURE; |
| 5187 | goto returnAfterError; |
| 5188 | } |
| 5189 | else if( DOT11F_WARNED( nStatus )) |
| 5190 | { |
| 5191 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5192 | FL( "There were warnings while packing an ADDBA Rsp (0x%08x)." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5193 | } |
| 5194 | |
| 5195 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5196 | FL( "Sending an ADDBA RSP to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5197 | limPrintMacAddr( pMac, pMlmAddBARsp->peerMacAddr, LOGW ); |
| 5198 | |
| 5199 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5200 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5201 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5202 | ) |
| 5203 | { |
| 5204 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5205 | } |
| 5206 | |
| 5207 | if( eHAL_STATUS_SUCCESS != |
| 5208 | (halStatus = halTxFrame( pMac, |
| 5209 | pPacket, |
| 5210 | (tANI_U16) frameLen, |
| 5211 | HAL_TXRX_FRM_802_11_MGMT, |
| 5212 | ANI_TXDIR_TODS, |
| 5213 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5214 | limTxComplete, |
| 5215 | pAddBARspBuffer, txFlag ))) |
| 5216 | { |
| 5217 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5218 | FL( "halTxFrame FAILED! Status [%d]" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5219 | halStatus ); |
| 5220 | |
| 5221 | // FIXME - HAL error codes are different from PE error |
| 5222 | // codes!! And, this routine is returning tSirRetStatus |
| 5223 | statusCode = eSIR_FAILURE; |
| 5224 | //Pkt will be freed up by the callback |
| 5225 | return statusCode; |
| 5226 | } |
| 5227 | else |
| 5228 | return eSIR_SUCCESS; |
| 5229 | |
| 5230 | returnAfterError: |
| 5231 | |
| 5232 | // Release buffer, if allocated |
| 5233 | if( NULL != pAddBARspBuffer ) |
| 5234 | palPktFree( pMac->hHdd, |
| 5235 | HAL_TXRX_FRM_802_11_MGMT, |
| 5236 | (void *) pAddBARspBuffer, |
| 5237 | (void *) pPacket ); |
| 5238 | |
| 5239 | return statusCode; |
| 5240 | } |
| 5241 | |
| 5242 | /** |
| 5243 | * \brief Send a DELBA Indication Action Frame to peer |
| 5244 | * |
| 5245 | * \sa limSendDelBAInd |
| 5246 | * |
| 5247 | * \param pMac The global tpAniSirGlobal object |
| 5248 | * |
| 5249 | * \param peerMacAddr MAC Address of peer |
| 5250 | * |
| 5251 | * \param reasonCode Reason for the DELBA notification |
| 5252 | * |
| 5253 | * \param pBAParameterSet The DELBA Parameter Set. |
| 5254 | * This identifies the TID for which the BA session is |
| 5255 | * being deleted. |
| 5256 | * |
| 5257 | * \return eSIR_SUCCESS if setup completes successfully |
| 5258 | * eSIR_FAILURE is some problem is encountered |
| 5259 | */ |
| 5260 | tSirRetStatus limSendDelBAInd( tpAniSirGlobal pMac, |
| 5261 | tpLimMlmDelBAReq pMlmDelBAReq,tpPESession psessionEntry) |
| 5262 | { |
| 5263 | tDot11fDelBAInd frmDelBAInd; |
| 5264 | tANI_U8 *pDelBAIndBuffer = NULL; |
| 5265 | //tANI_U32 val; |
| 5266 | tpSirMacMgmtHdr pMacHdr; |
| 5267 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 5268 | tSirRetStatus statusCode; |
| 5269 | eHalStatus halStatus; |
| 5270 | void *pPacket; |
| 5271 | tANI_U8 txFlag = 0; |
| 5272 | |
| 5273 | if(NULL == psessionEntry) |
| 5274 | { |
| 5275 | return eSIR_FAILURE; |
| 5276 | } |
| 5277 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5278 | vos_mem_set( (void *) &frmDelBAInd, sizeof( frmDelBAInd ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5279 | |
| 5280 | // Category - 3 (BA) |
| 5281 | frmDelBAInd.Category.category = SIR_MAC_ACTION_BLKACK; |
| 5282 | // Action - 2 (DELBA) |
| 5283 | frmDelBAInd.Action.action = SIR_MAC_BLKACK_DEL; |
| 5284 | |
| 5285 | // Fill the DELBA Parameter Set as provided by caller |
| 5286 | frmDelBAInd.DelBAParameterSet.tid = pMlmDelBAReq->baTID; |
| 5287 | frmDelBAInd.DelBAParameterSet.initiator = pMlmDelBAReq->baDirection; |
| 5288 | |
| 5289 | // BA Starting Sequence Number |
| 5290 | // Fragment number will always be zero |
| 5291 | frmDelBAInd.Reason.code = pMlmDelBAReq->delBAReasonCode; |
| 5292 | |
| 5293 | nStatus = dot11fGetPackedDelBAIndSize( pMac, &frmDelBAInd, &nPayload ); |
| 5294 | |
| 5295 | if( DOT11F_FAILED( nStatus )) |
| 5296 | { |
| 5297 | limLog( pMac, LOGW, |
| 5298 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5299 | "an DELBA Indication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5300 | nStatus ); |
| 5301 | |
| 5302 | // We'll fall back on the worst case scenario: |
| 5303 | nPayload = sizeof( tDot11fDelBAInd ); |
| 5304 | } |
| 5305 | else if( DOT11F_WARNED( nStatus )) |
| 5306 | { |
| 5307 | limLog( pMac, LOGW, |
| 5308 | FL( "There were warnings while calculating" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5309 | "the packed size for an DELBA Ind (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5310 | nStatus ); |
| 5311 | } |
| 5312 | |
| 5313 | // Add the MGMT header to frame length |
| 5314 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5315 | |
| 5316 | // Allocate shared memory |
| 5317 | if( eHAL_STATUS_SUCCESS != |
| 5318 | (halStatus = palPktAlloc( pMac->hHdd, |
| 5319 | HAL_TXRX_FRM_802_11_MGMT, |
| 5320 | (tANI_U16) frameLen, |
| 5321 | (void **) &pDelBAIndBuffer, |
| 5322 | (void **) &pPacket ))) |
| 5323 | { |
| 5324 | // Log error |
| 5325 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5326 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5327 | frameLen, |
| 5328 | halStatus ); |
| 5329 | |
| 5330 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 5331 | goto returnAfterError; |
| 5332 | } |
| 5333 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5334 | vos_mem_set( (void *) pDelBAIndBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5335 | |
| 5336 | // Copy necessary info to BD |
| 5337 | if( eSIR_SUCCESS != |
| 5338 | (statusCode = limPopulateMacHeader( pMac, |
| 5339 | pDelBAIndBuffer, |
| 5340 | SIR_MAC_MGMT_FRAME, |
| 5341 | SIR_MAC_MGMT_ACTION, |
| 5342 | pMlmDelBAReq->peerMacAddr,psessionEntry->selfMacAddr))) |
| 5343 | goto returnAfterError; |
| 5344 | |
| 5345 | // Update A3 with the BSSID |
| 5346 | pMacHdr = ( tpSirMacMgmtHdr ) pDelBAIndBuffer; |
| 5347 | |
| 5348 | #if 0 |
| 5349 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 5350 | if( eSIR_SUCCESS != cfgGetStr( pMac, |
| 5351 | WNI_CFG_BSSID, |
| 5352 | (tANI_U8 *) pMacHdr->bssId, |
| 5353 | &cfgLen )) |
| 5354 | { |
| 5355 | limLog( pMac, LOGP, |
| 5356 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5357 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5358 | |
| 5359 | // FIXME - Need to convert to tSirRetStatus |
| 5360 | statusCode = eSIR_FAILURE; |
| 5361 | goto returnAfterError; |
| 5362 | } |
| 5363 | #endif //TO SUPPORT BT-AMP |
| 5364 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 5365 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5366 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5367 | limSetProtectedBit(pMac, psessionEntry, pMlmDelBAReq->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5368 | #endif |
| 5369 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5370 | // Now, we're ready to "pack" the frames |
| 5371 | nStatus = dot11fPackDelBAInd( pMac, |
| 5372 | &frmDelBAInd, |
| 5373 | pDelBAIndBuffer + sizeof( tSirMacMgmtHdr ), |
| 5374 | nPayload, |
| 5375 | &nPayload ); |
| 5376 | |
| 5377 | if( DOT11F_FAILED( nStatus )) |
| 5378 | { |
| 5379 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5380 | FL( "Failed to pack an DELBA Ind (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5381 | nStatus ); |
| 5382 | |
| 5383 | // FIXME - Need to convert to tSirRetStatus |
| 5384 | statusCode = eSIR_FAILURE; |
| 5385 | goto returnAfterError; |
| 5386 | } |
| 5387 | else if( DOT11F_WARNED( nStatus )) |
| 5388 | { |
| 5389 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5390 | FL( "There were warnings while packing an DELBA Ind (0x%08x)." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5391 | } |
| 5392 | |
| 5393 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5394 | FL( "Sending a DELBA IND to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5395 | limPrintMacAddr( pMac, pMlmDelBAReq->peerMacAddr, LOGW ); |
| 5396 | |
| 5397 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5398 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5399 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5400 | ) |
| 5401 | { |
| 5402 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5403 | } |
| 5404 | |
| 5405 | if( eHAL_STATUS_SUCCESS != |
| 5406 | (halStatus = halTxFrame( pMac, |
| 5407 | pPacket, |
| 5408 | (tANI_U16) frameLen, |
| 5409 | HAL_TXRX_FRM_802_11_MGMT, |
| 5410 | ANI_TXDIR_TODS, |
| 5411 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5412 | limTxComplete, |
| 5413 | pDelBAIndBuffer, txFlag ))) |
| 5414 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5415 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halStatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5416 | statusCode = eSIR_FAILURE; |
| 5417 | //Pkt will be freed up by the callback |
| 5418 | return statusCode; |
| 5419 | } |
| 5420 | else |
| 5421 | return eSIR_SUCCESS; |
| 5422 | |
| 5423 | returnAfterError: |
| 5424 | |
| 5425 | // Release buffer, if allocated |
| 5426 | if( NULL != pDelBAIndBuffer ) |
| 5427 | palPktFree( pMac->hHdd, |
| 5428 | HAL_TXRX_FRM_802_11_MGMT, |
| 5429 | (void *) pDelBAIndBuffer, |
| 5430 | (void *) pPacket ); |
| 5431 | |
| 5432 | return statusCode; |
| 5433 | } |
| 5434 | |
| 5435 | #if defined WLAN_FEATURE_VOWIFI |
| 5436 | |
| 5437 | /** |
| 5438 | * \brief Send a Neighbor Report Request Action frame |
| 5439 | * |
| 5440 | * |
| 5441 | * \param pMac Pointer to the global MAC structure |
| 5442 | * |
| 5443 | * \param pNeighborReq Address of a tSirMacNeighborReportReq |
| 5444 | * |
| 5445 | * \param peer mac address of peer station. |
| 5446 | * |
| 5447 | * \param psessionEntry address of session entry. |
| 5448 | * |
| 5449 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 5450 | * |
| 5451 | * |
| 5452 | */ |
| 5453 | |
| 5454 | tSirRetStatus |
| 5455 | limSendNeighborReportRequestFrame(tpAniSirGlobal pMac, |
| 5456 | tpSirMacNeighborReportReq pNeighborReq, |
| 5457 | tSirMacAddr peer, |
| 5458 | tpPESession psessionEntry |
| 5459 | ) |
| 5460 | { |
| 5461 | tSirRetStatus statusCode = eSIR_SUCCESS; |
| 5462 | tDot11fNeighborReportRequest frm; |
| 5463 | tANI_U8 *pFrame; |
| 5464 | tpSirMacMgmtHdr pMacHdr; |
| 5465 | tANI_U32 nBytes, nPayload, nStatus; |
| 5466 | void *pPacket; |
| 5467 | eHalStatus halstatus; |
| 5468 | tANI_U8 txFlag = 0; |
| 5469 | |
| 5470 | if ( psessionEntry == NULL ) |
| 5471 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5472 | limLog( pMac, LOGE, FL("(psession == NULL) in Request to send Neighbor Report request action frame") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5473 | return eSIR_FAILURE; |
| 5474 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5475 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5476 | |
| 5477 | frm.Category.category = SIR_MAC_ACTION_RRM; |
| 5478 | frm.Action.action = SIR_MAC_RRM_NEIGHBOR_REQ; |
| 5479 | frm.DialogToken.token = pNeighborReq->dialogToken; |
| 5480 | |
| 5481 | |
| 5482 | if( pNeighborReq->ssid_present ) |
| 5483 | { |
| 5484 | PopulateDot11fSSID( pMac, &pNeighborReq->ssid, &frm.SSID ); |
| 5485 | } |
| 5486 | |
| 5487 | nStatus = dot11fGetPackedNeighborReportRequestSize( pMac, &frm, &nPayload ); |
| 5488 | if ( DOT11F_FAILED( nStatus ) ) |
| 5489 | { |
| 5490 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5491 | "or a Neighbor Report Request(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5492 | nStatus ); |
| 5493 | // We'll fall back on the worst case scenario: |
| 5494 | nPayload = sizeof( tDot11fNeighborReportRequest ); |
| 5495 | } |
| 5496 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5497 | { |
| 5498 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 5499 | "the packed size for a Neighbor Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5500 | "ort Request(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5501 | } |
| 5502 | |
| 5503 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5504 | |
| 5505 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5506 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5507 | { |
| 5508 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Neighbor " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5509 | "Report Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5510 | return eSIR_FAILURE; |
| 5511 | } |
| 5512 | |
| 5513 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5514 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5515 | |
| 5516 | // Copy necessary info to BD |
| 5517 | if( eSIR_SUCCESS != |
| 5518 | (statusCode = limPopulateMacHeader( pMac, |
| 5519 | pFrame, |
| 5520 | SIR_MAC_MGMT_FRAME, |
| 5521 | SIR_MAC_MGMT_ACTION, |
| 5522 | peer, psessionEntry->selfMacAddr))) |
| 5523 | goto returnAfterError; |
| 5524 | |
| 5525 | // Update A3 with the BSSID |
| 5526 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 5527 | |
| 5528 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 5529 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5530 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5531 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5532 | #endif |
| 5533 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5534 | // Now, we're ready to "pack" the frames |
| 5535 | nStatus = dot11fPackNeighborReportRequest( pMac, |
| 5536 | &frm, |
| 5537 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 5538 | nPayload, |
| 5539 | &nPayload ); |
| 5540 | |
| 5541 | if( DOT11F_FAILED( nStatus )) |
| 5542 | { |
| 5543 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5544 | FL( "Failed to pack an Neighbor Report Request (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5545 | nStatus ); |
| 5546 | |
| 5547 | // FIXME - Need to convert to tSirRetStatus |
| 5548 | statusCode = eSIR_FAILURE; |
| 5549 | goto returnAfterError; |
| 5550 | } |
| 5551 | else if( DOT11F_WARNED( nStatus )) |
| 5552 | { |
| 5553 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5554 | FL( "There were warnings while packing Neighbor Report Request (0x%08x)." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5555 | } |
| 5556 | |
| 5557 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5558 | FL( "Sending a Neighbor Report Request to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5559 | limPrintMacAddr( pMac, peer, LOGW ); |
| 5560 | |
| 5561 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5562 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5563 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5564 | ) |
| 5565 | { |
| 5566 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5567 | } |
| 5568 | |
| 5569 | if( eHAL_STATUS_SUCCESS != |
| 5570 | (halstatus = halTxFrame( pMac, |
| 5571 | pPacket, |
| 5572 | (tANI_U16) nBytes, |
| 5573 | HAL_TXRX_FRM_802_11_MGMT, |
| 5574 | ANI_TXDIR_TODS, |
| 5575 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5576 | limTxComplete, |
| 5577 | pFrame, txFlag ))) |
| 5578 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5579 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5580 | statusCode = eSIR_FAILURE; |
| 5581 | //Pkt will be freed up by the callback |
| 5582 | return statusCode; |
| 5583 | } |
| 5584 | else |
| 5585 | return eSIR_SUCCESS; |
| 5586 | |
| 5587 | returnAfterError: |
| 5588 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5589 | |
| 5590 | return statusCode; |
| 5591 | } // End limSendNeighborReportRequestFrame. |
| 5592 | |
| 5593 | /** |
| 5594 | * \brief Send a Link Report Action frame |
| 5595 | * |
| 5596 | * |
| 5597 | * \param pMac Pointer to the global MAC structure |
| 5598 | * |
| 5599 | * \param pLinkReport Address of a tSirMacLinkReport |
| 5600 | * |
| 5601 | * \param peer mac address of peer station. |
| 5602 | * |
| 5603 | * \param psessionEntry address of session entry. |
| 5604 | * |
| 5605 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 5606 | * |
| 5607 | * |
| 5608 | */ |
| 5609 | |
| 5610 | tSirRetStatus |
| 5611 | limSendLinkReportActionFrame(tpAniSirGlobal pMac, |
| 5612 | tpSirMacLinkReport pLinkReport, |
| 5613 | tSirMacAddr peer, |
| 5614 | tpPESession psessionEntry |
| 5615 | ) |
| 5616 | { |
| 5617 | tSirRetStatus statusCode = eSIR_SUCCESS; |
| 5618 | tDot11fLinkMeasurementReport frm; |
| 5619 | tANI_U8 *pFrame; |
| 5620 | tpSirMacMgmtHdr pMacHdr; |
| 5621 | tANI_U32 nBytes, nPayload, nStatus; |
| 5622 | void *pPacket; |
| 5623 | eHalStatus halstatus; |
| 5624 | tANI_U8 txFlag = 0; |
| 5625 | |
| 5626 | |
| 5627 | if ( psessionEntry == NULL ) |
| 5628 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5629 | limLog( pMac, LOGE, FL("(psession == NULL) in Request to send Link Report action frame") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5630 | return eSIR_FAILURE; |
| 5631 | } |
| 5632 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5633 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5634 | |
| 5635 | frm.Category.category = SIR_MAC_ACTION_RRM; |
| 5636 | frm.Action.action = SIR_MAC_RRM_LINK_MEASUREMENT_RPT; |
| 5637 | frm.DialogToken.token = pLinkReport->dialogToken; |
| 5638 | |
| 5639 | |
| 5640 | //IEEE Std. 802.11 7.3.2.18. for the report element. |
| 5641 | //Even though TPC report an IE, it is represented using fixed fields since it is positioned |
| 5642 | //in the middle of other fixed fields in the link report frame(IEEE Std. 802.11k section7.4.6.4 |
| 5643 | //and frame parser always expects IEs to come after all fixed fields. It is easier to handle |
| 5644 | //such case this way than changing the frame parser. |
| 5645 | frm.TPCEleID.TPCId = SIR_MAC_TPC_RPT_EID; |
| 5646 | frm.TPCEleLen.TPCLen = 2; |
| 5647 | frm.TxPower.txPower = pLinkReport->txPower; |
| 5648 | frm.LinkMargin.linkMargin = 0; |
| 5649 | |
| 5650 | frm.RxAntennaId.antennaId = pLinkReport->rxAntenna; |
| 5651 | frm.TxAntennaId.antennaId = pLinkReport->txAntenna; |
| 5652 | frm.RCPI.rcpi = pLinkReport->rcpi; |
| 5653 | frm.RSNI.rsni = pLinkReport->rsni; |
| 5654 | |
| 5655 | nStatus = dot11fGetPackedLinkMeasurementReportSize( pMac, &frm, &nPayload ); |
| 5656 | if ( DOT11F_FAILED( nStatus ) ) |
| 5657 | { |
| 5658 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5659 | "or a Link Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5660 | nStatus ); |
| 5661 | // We'll fall back on the worst case scenario: |
| 5662 | nPayload = sizeof( tDot11fLinkMeasurementReport ); |
| 5663 | } |
| 5664 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5665 | { |
| 5666 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 5667 | "the packed size for a Link Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5668 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5669 | } |
| 5670 | |
| 5671 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5672 | |
| 5673 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5674 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5675 | { |
| 5676 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Link " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5677 | "Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5678 | return eSIR_FAILURE; |
| 5679 | } |
| 5680 | |
| 5681 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5682 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5683 | |
| 5684 | // Copy necessary info to BD |
| 5685 | if( eSIR_SUCCESS != |
| 5686 | (statusCode = limPopulateMacHeader( pMac, |
| 5687 | pFrame, |
| 5688 | SIR_MAC_MGMT_FRAME, |
| 5689 | SIR_MAC_MGMT_ACTION, |
| 5690 | peer, psessionEntry->selfMacAddr))) |
| 5691 | goto returnAfterError; |
| 5692 | |
| 5693 | // Update A3 with the BSSID |
| 5694 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 5695 | |
| 5696 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 5697 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5698 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5699 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5700 | #endif |
| 5701 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5702 | // Now, we're ready to "pack" the frames |
| 5703 | nStatus = dot11fPackLinkMeasurementReport( pMac, |
| 5704 | &frm, |
| 5705 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 5706 | nPayload, |
| 5707 | &nPayload ); |
| 5708 | |
| 5709 | if( DOT11F_FAILED( nStatus )) |
| 5710 | { |
| 5711 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5712 | FL( "Failed to pack an Link Report (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5713 | nStatus ); |
| 5714 | |
| 5715 | // FIXME - Need to convert to tSirRetStatus |
| 5716 | statusCode = eSIR_FAILURE; |
| 5717 | goto returnAfterError; |
| 5718 | } |
| 5719 | else if( DOT11F_WARNED( nStatus )) |
| 5720 | { |
| 5721 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5722 | FL( "There were warnings while packing Link Report (0x%08x)." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5723 | } |
| 5724 | |
| 5725 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5726 | FL( "Sending a Link Report to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5727 | limPrintMacAddr( pMac, peer, LOGW ); |
| 5728 | |
| 5729 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5730 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5731 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5732 | ) |
| 5733 | { |
| 5734 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5735 | } |
| 5736 | |
| 5737 | if( eHAL_STATUS_SUCCESS != |
| 5738 | (halstatus = halTxFrame( pMac, |
| 5739 | pPacket, |
| 5740 | (tANI_U16) nBytes, |
| 5741 | HAL_TXRX_FRM_802_11_MGMT, |
| 5742 | ANI_TXDIR_TODS, |
| 5743 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5744 | limTxComplete, |
| 5745 | pFrame, txFlag ))) |
| 5746 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5747 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5748 | statusCode = eSIR_FAILURE; |
| 5749 | //Pkt will be freed up by the callback |
| 5750 | return statusCode; |
| 5751 | } |
| 5752 | else |
| 5753 | return eSIR_SUCCESS; |
| 5754 | |
| 5755 | returnAfterError: |
| 5756 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5757 | |
| 5758 | return statusCode; |
| 5759 | } // End limSendLinkReportActionFrame. |
| 5760 | |
| 5761 | /** |
| 5762 | * \brief Send a Beacon Report Action frame |
| 5763 | * |
| 5764 | * |
| 5765 | * \param pMac Pointer to the global MAC structure |
| 5766 | * |
| 5767 | * \param dialog_token dialog token to be used in the action frame. |
| 5768 | * |
| 5769 | * \param num_report number of reports in pRRMReport. |
| 5770 | * |
| 5771 | * \param pRRMReport Address of a tSirMacRadioMeasureReport. |
| 5772 | * |
| 5773 | * \param peer mac address of peer station. |
| 5774 | * |
| 5775 | * \param psessionEntry address of session entry. |
| 5776 | * |
| 5777 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 5778 | * |
| 5779 | * |
| 5780 | */ |
| 5781 | |
| 5782 | tSirRetStatus |
| 5783 | limSendRadioMeasureReportActionFrame(tpAniSirGlobal pMac, |
| 5784 | tANI_U8 dialog_token, |
| 5785 | tANI_U8 num_report, |
| 5786 | tpSirMacRadioMeasureReport pRRMReport, |
| 5787 | tSirMacAddr peer, |
| 5788 | tpPESession psessionEntry |
| 5789 | ) |
| 5790 | { |
| 5791 | tSirRetStatus statusCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5792 | tANI_U8 *pFrame; |
| 5793 | tpSirMacMgmtHdr pMacHdr; |
| 5794 | tANI_U32 nBytes, nPayload, nStatus; |
| 5795 | void *pPacket; |
| 5796 | eHalStatus halstatus; |
| 5797 | tANI_U8 i; |
| 5798 | tANI_U8 txFlag = 0; |
| 5799 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5800 | tDot11fRadioMeasurementReport *frm = |
| 5801 | vos_mem_malloc(sizeof(tDot11fRadioMeasurementReport)); |
| 5802 | if (!frm) { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5803 | limLog( pMac, LOGE, FL("Not enough memory to allocate tDot11fRadioMeasurementReport") ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5804 | return eSIR_FAILURE; |
| 5805 | } |
| 5806 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5807 | if ( psessionEntry == NULL ) |
| 5808 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5809 | limLog( pMac, LOGE, FL("(psession == NULL) in Request to send Beacon Report action frame") ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5810 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5811 | return eSIR_FAILURE; |
| 5812 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5813 | vos_mem_set( ( tANI_U8* )frm, sizeof( *frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5814 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5815 | frm->Category.category = SIR_MAC_ACTION_RRM; |
| 5816 | frm->Action.action = SIR_MAC_RRM_RADIO_MEASURE_RPT; |
| 5817 | frm->DialogToken.token = dialog_token; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5818 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5819 | frm->num_MeasurementReport = (num_report > RADIO_REPORTS_MAX_IN_A_FRAME ) ? RADIO_REPORTS_MAX_IN_A_FRAME : num_report; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5820 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5821 | for( i = 0 ; i < frm->num_MeasurementReport ; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5822 | { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5823 | frm->MeasurementReport[i].type = pRRMReport[i].type; |
| 5824 | frm->MeasurementReport[i].token = pRRMReport[i].token; |
| 5825 | frm->MeasurementReport[i].late = 0; //IEEE 802.11k section 7.3.22. (always zero in rrm) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5826 | switch( pRRMReport[i].type ) |
| 5827 | { |
| 5828 | case SIR_MAC_RRM_BEACON_TYPE: |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5829 | PopulateDot11fBeaconReport( pMac, &frm->MeasurementReport[i], &pRRMReport[i].report.beaconReport ); |
| 5830 | frm->MeasurementReport[i].incapable = pRRMReport[i].incapable; |
| 5831 | frm->MeasurementReport[i].refused = pRRMReport[i].refused; |
| 5832 | frm->MeasurementReport[i].present = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5833 | break; |
| 5834 | default: |
Gopichand Nakkala | 72717fd | 2013-02-08 12:23:45 +0530 | [diff] [blame] | 5835 | frm->MeasurementReport[i].incapable = pRRMReport[i].incapable; |
| 5836 | frm->MeasurementReport[i].refused = pRRMReport[i].refused; |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5837 | frm->MeasurementReport[i].present = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5838 | break; |
| 5839 | } |
| 5840 | } |
| 5841 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5842 | nStatus = dot11fGetPackedRadioMeasurementReportSize( pMac, frm, &nPayload ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5843 | if ( DOT11F_FAILED( nStatus ) ) |
| 5844 | { |
| 5845 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5846 | "or a Radio Measure Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5847 | nStatus ); |
| 5848 | // We'll fall back on the worst case scenario: |
| 5849 | nPayload = sizeof( tDot11fLinkMeasurementReport ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5850 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5851 | return eSIR_FAILURE; |
| 5852 | } |
| 5853 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5854 | { |
| 5855 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 5856 | "the packed size for a Radio Measure Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5857 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5858 | } |
| 5859 | |
| 5860 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5861 | |
| 5862 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5863 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5864 | { |
| 5865 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a Radio Measure " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5866 | "Report."), nBytes ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5867 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5868 | return eSIR_FAILURE; |
| 5869 | } |
| 5870 | |
| 5871 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5872 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5873 | |
| 5874 | // Copy necessary info to BD |
| 5875 | if( eSIR_SUCCESS != |
| 5876 | (statusCode = limPopulateMacHeader( pMac, |
| 5877 | pFrame, |
| 5878 | SIR_MAC_MGMT_FRAME, |
| 5879 | SIR_MAC_MGMT_ACTION, |
| 5880 | peer, psessionEntry->selfMacAddr))) |
| 5881 | goto returnAfterError; |
| 5882 | |
| 5883 | // Update A3 with the BSSID |
| 5884 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 5885 | |
| 5886 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 5887 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5888 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5889 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5890 | #endif |
| 5891 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5892 | // Now, we're ready to "pack" the frames |
| 5893 | nStatus = dot11fPackRadioMeasurementReport( pMac, |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5894 | frm, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5895 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 5896 | nPayload, |
| 5897 | &nPayload ); |
| 5898 | |
| 5899 | if( DOT11F_FAILED( nStatus )) |
| 5900 | { |
| 5901 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5902 | FL( "Failed to pack an Radio Measure Report (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5903 | nStatus ); |
| 5904 | |
| 5905 | // FIXME - Need to convert to tSirRetStatus |
| 5906 | statusCode = eSIR_FAILURE; |
| 5907 | goto returnAfterError; |
| 5908 | } |
| 5909 | else if( DOT11F_WARNED( nStatus )) |
| 5910 | { |
| 5911 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5912 | FL( "There were warnings while packing Radio Measure Report (0x%08x)." )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5913 | } |
| 5914 | |
| 5915 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5916 | FL( "Sending a Radio Measure Report to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5917 | limPrintMacAddr( pMac, peer, LOGW ); |
| 5918 | |
| 5919 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5920 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5921 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5922 | ) |
| 5923 | { |
| 5924 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5925 | } |
| 5926 | |
| 5927 | if( eHAL_STATUS_SUCCESS != |
| 5928 | (halstatus = halTxFrame( pMac, |
| 5929 | pPacket, |
| 5930 | (tANI_U16) nBytes, |
| 5931 | HAL_TXRX_FRM_802_11_MGMT, |
| 5932 | ANI_TXDIR_TODS, |
| 5933 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5934 | limTxComplete, |
| 5935 | pFrame, txFlag ))) |
| 5936 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5937 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5938 | statusCode = eSIR_FAILURE; |
| 5939 | //Pkt will be freed up by the callback |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5940 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5941 | return statusCode; |
| 5942 | } |
Madan Mohan Koyyalamudi | eeb56b1 | 2012-10-31 15:10:04 -0700 | [diff] [blame] | 5943 | else { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5944 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5945 | return eSIR_SUCCESS; |
Madan Mohan Koyyalamudi | eeb56b1 | 2012-10-31 15:10:04 -0700 | [diff] [blame] | 5946 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5947 | |
| 5948 | returnAfterError: |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5949 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5950 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5951 | return statusCode; |
| 5952 | } // End limSendBeaconReportActionFrame. |
| 5953 | |
| 5954 | #endif |
| 5955 | |
| 5956 | #ifdef WLAN_FEATURE_11W |
| 5957 | /** |
| 5958 | * \brief Send SA query response action frame to peer |
| 5959 | * |
| 5960 | * \sa limSendSaQueryResponseFrame |
| 5961 | * |
| 5962 | * |
| 5963 | * \param pMac The global tpAniSirGlobal object |
| 5964 | * |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5965 | * \param transId Transaction identifier received in SA query request action frame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5966 | * |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5967 | * \param peer The Mac address of the AP to which this action frame is addressed |
| 5968 | * |
| 5969 | * \param psessionEntry The PE session entry |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5970 | * |
| 5971 | * \return eSIR_SUCCESS if setup completes successfully |
| 5972 | * eSIR_FAILURE is some problem is encountered |
| 5973 | */ |
| 5974 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5975 | tSirRetStatus limSendSaQueryResponseFrame( tpAniSirGlobal pMac, tANI_U8 *transId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5976 | tSirMacAddr peer,tpPESession psessionEntry) |
| 5977 | { |
| 5978 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5979 | tDot11fSaQueryRsp frm; // SA query reponse action frame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5980 | tANI_U8 *pFrame; |
| 5981 | tSirRetStatus nSirStatus; |
| 5982 | tpSirMacMgmtHdr pMacHdr; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5983 | tANI_U32 nBytes, nPayload, nStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5984 | void *pPacket; |
| 5985 | eHalStatus halstatus; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5986 | tANI_U8 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5987 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 5988 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5989 | frm.Category.category = SIR_MAC_ACTION_SA_QUERY; |
| 5990 | /*11w action field is : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5991 | action: 0 --> SA query request action frame |
| 5992 | action: 1 --> SA query response action frame */ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5993 | frm.Action.action = SIR_MAC_SA_QUERY_RSP; |
| 5994 | /*11w SA query response transId is same as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5995 | SA query request transId*/ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5996 | vos_mem_copy( &frm.TransactionId.transId[0], &transId[0], 2 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5997 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5998 | nStatus = dot11fGetPackedSaQueryRspSize(pMac, &frm, &nPayload); |
| 5999 | if ( DOT11F_FAILED( nStatus ) ) |
| 6000 | { |
| 6001 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
| 6002 | "or a SA Query Response (0x%08x)."), |
| 6003 | nStatus ); |
| 6004 | // We'll fall back on the worst case scenario: |
| 6005 | nPayload = sizeof( tDot11fSaQueryRsp ); |
| 6006 | } |
| 6007 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6008 | { |
| 6009 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 6010 | "the packed size for an SA Query Response" |
| 6011 | " (0x%08x)."), nStatus ); |
| 6012 | } |
| 6013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6014 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6015 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6016 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6017 | { |
| 6018 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a SA query response" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6019 | " action frame"), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6020 | return eSIR_FAILURE; |
| 6021 | } |
| 6022 | |
| 6023 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame^] | 6024 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6025 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6026 | // Copy necessary info to BD |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6027 | nSirStatus = limPopulateMacHeader( pMac, |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6028 | pFrame, |
| 6029 | SIR_MAC_MGMT_FRAME, |
| 6030 | SIR_MAC_MGMT_ACTION, |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6031 | peer, psessionEntry->selfMacAddr ); |
| 6032 | if ( eSIR_SUCCESS != nSirStatus ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6033 | goto returnAfterError; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6034 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6035 | // Update A3 with the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6036 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6037 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6038 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6039 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6040 | // Since this is a SA Query Response, set the "protect" (aka WEP) bit |
| 6041 | // in the FC |
| 6042 | if ( psessionEntry->limRmfEnabled ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6043 | { |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6044 | pMacHdr->fc.wep = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6045 | } |
| 6046 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6047 | // Pack 11w SA query response frame |
| 6048 | nStatus = dot11fPackSaQueryRsp( pMac, |
| 6049 | &frm, |
| 6050 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6051 | nPayload, |
| 6052 | &nPayload ); |
| 6053 | |
| 6054 | if ( DOT11F_FAILED( nStatus )) |
| 6055 | { |
| 6056 | limLog( pMac, LOGE, |
| 6057 | FL( "Failed to pack an SA Query Response (0x%08x)." ), |
| 6058 | nStatus ); |
| 6059 | // FIXME - Need to convert to tSirRetStatus |
| 6060 | nSirStatus = eSIR_FAILURE; |
| 6061 | goto returnAfterError; |
| 6062 | } |
| 6063 | else if ( DOT11F_WARNED( nStatus )) |
| 6064 | { |
| 6065 | limLog( pMac, LOGW, |
| 6066 | FL( "There were warnings while packing SA Query Response (0x%08x)." ), |
| 6067 | nStatus); |
| 6068 | } |
| 6069 | |
| 6070 | limLog( pMac, LOG1, |
| 6071 | FL( "Sending a SA Query Response to " )); |
| 6072 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6073 | |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6074 | if ( ( SIR_BAND_5_GHZ == limGetRFBand( psessionEntry->currentOperChannel ) ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6075 | #ifdef WLAN_FEATURE_P2P |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6076 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6077 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6078 | #endif |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6079 | ) |
| 6080 | { |
| 6081 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6082 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6083 | |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6084 | halstatus = halTxFrame( pMac, |
| 6085 | pPacket, |
| 6086 | (tANI_U16) nBytes, |
| 6087 | HAL_TXRX_FRM_802_11_MGMT, |
| 6088 | ANI_TXDIR_TODS, |
| 6089 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6090 | limTxComplete, |
| 6091 | pFrame, txFlag ); |
| 6092 | if ( eHAL_STATUS_SUCCESS != halstatus ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6093 | { |
| 6094 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
| 6095 | nSirStatus = eSIR_FAILURE; |
| 6096 | //Pkt will be freed up by the callback |
| 6097 | return nSirStatus; |
| 6098 | } |
| 6099 | else { |
| 6100 | return eSIR_SUCCESS; |
| 6101 | } |
| 6102 | |
| 6103 | returnAfterError: |
| 6104 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 6105 | return nSirStatus; |
| 6106 | } // End limSendSaQueryResponseFrame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6107 | #endif |