Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Abhishek Singh | c601a47 | 2016-01-20 11:08:32 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 27 | |
| 28 | |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 29 | |
| 30 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 31 | /** |
| 32 | * \file limSendManagementFrames.c |
| 33 | * |
| 34 | * \brief Code for preparing and sending 802.11 Management frames |
| 35 | * |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 36 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 37 | * |
| 38 | */ |
| 39 | |
| 40 | #include "sirApi.h" |
| 41 | #include "aniGlobal.h" |
| 42 | #include "sirMacProtDef.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 43 | #include "cfgApi.h" |
| 44 | #include "utilsApi.h" |
| 45 | #include "limTypes.h" |
| 46 | #include "limUtils.h" |
| 47 | #include "limSecurityUtils.h" |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 48 | #include "limPropExtsUtils.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 49 | #include "dot11f.h" |
| 50 | #include "limStaHashApi.h" |
| 51 | #include "schApi.h" |
| 52 | #include "limSendMessages.h" |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 53 | #include "limAssocUtils.h" |
| 54 | #include "limFT.h" |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 55 | #ifdef WLAN_FEATURE_11W |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 56 | #include "wniCfg.h" |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 57 | #endif |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 58 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 59 | #if defined WLAN_FEATURE_VOWIFI |
| 60 | #include "rrmApi.h" |
| 61 | #endif |
| 62 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 63 | #include "wlan_qct_wda.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 64 | |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 65 | #define IS_BROADCAST_MAC(x) (((x[0] & x[1] & x[2] & x[3] & x[4] & x[5]) == 0xff) ? 1 : 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 66 | //////////////////////////////////////////////////////////////////////// |
| 67 | |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 68 | tSirRetStatus limStripOffExtCapIE(tpAniSirGlobal pMac, |
| 69 | tANI_U8 *addIE, |
| 70 | tANI_U16 *addnIELen, |
| 71 | tANI_U8 *pExtractedExtCapIEBuf ) |
| 72 | { |
| 73 | tANI_U8* tempbuf = NULL; |
| 74 | tANI_U16 tempLen = 0; |
| 75 | int left = *addnIELen; |
| 76 | tANI_U8 *ptr = addIE; |
| 77 | tANI_U8 elem_id, elem_len; |
| 78 | |
| 79 | if (NULL == addIE) |
| 80 | { |
| 81 | PELOGE(limLog(pMac, LOG1, FL("NULL addIE pointer"));) |
| 82 | return eSIR_IGNORE_IE ; |
| 83 | } |
| 84 | |
| 85 | tempbuf = vos_mem_malloc(left); |
| 86 | if ( NULL == tempbuf ) |
| 87 | { |
| 88 | PELOGE(limLog(pMac, LOGE, |
| 89 | FL("Unable to allocate memory to store addn IE"));) |
| 90 | return eSIR_MEM_ALLOC_FAILED; |
| 91 | } |
| 92 | |
| 93 | while(left >= 2) |
| 94 | { |
| 95 | elem_id = ptr[0]; |
| 96 | elem_len = ptr[1]; |
| 97 | left -= 2; |
| 98 | if (elem_len > left) |
| 99 | { |
| 100 | limLog( pMac, LOGE, |
| 101 | FL("Invalid IEs eid = %d elem_len=%d left=%d"), |
| 102 | elem_id,elem_len,left); |
| 103 | vos_mem_free(tempbuf); |
| 104 | return eSIR_FAILURE; |
| 105 | } |
| 106 | if ( !(DOT11F_EID_EXTCAP == elem_id) ) |
| 107 | { |
| 108 | vos_mem_copy (tempbuf + tempLen, &ptr[0], elem_len + 2); |
| 109 | tempLen += (elem_len + 2); |
| 110 | } |
| 111 | else |
| 112 | { /*Est Cap present size is 8 + 2 byte at present*/ |
| 113 | if ( NULL != pExtractedExtCapIEBuf ) |
| 114 | { |
| 115 | vos_mem_set(pExtractedExtCapIEBuf, |
| 116 | DOT11F_IE_EXTCAP_MAX_LEN + 2, 0); |
| 117 | if (elem_len <= DOT11F_IE_EXTCAP_MAX_LEN ) |
| 118 | { |
| 119 | vos_mem_copy (pExtractedExtCapIEBuf, &ptr[0], |
| 120 | elem_len + 2); |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | left -= elem_len; |
| 125 | ptr += (elem_len + 2); |
| 126 | } |
| 127 | vos_mem_copy (addIE, tempbuf, tempLen); |
| 128 | *addnIELen = tempLen; |
| 129 | vos_mem_free(tempbuf); |
| 130 | return eSIR_SUCCESS; |
| 131 | } |
| 132 | |
| 133 | void limUpdateExtCapIEtoStruct(tpAniSirGlobal pMac, |
| 134 | tANI_U8 *pBuf, |
| 135 | tDot11fIEExtCap *pDst) |
| 136 | { |
| 137 | tANI_U8 pOut[DOT11F_IE_EXTCAP_MAX_LEN]; |
| 138 | |
| 139 | if ( NULL == pBuf ) |
| 140 | { |
| 141 | limLog( pMac, LOGE, |
| 142 | FL("Invalid Buffer Address")); |
| 143 | return; |
| 144 | } |
| 145 | if(NULL == pDst) |
| 146 | { |
| 147 | PELOGE(limLog(pMac, LOGE, |
| 148 | FL("NULL pDst pointer"));) |
| 149 | return ; |
| 150 | } |
| 151 | |
| 152 | if ( DOT11F_EID_EXTCAP != pBuf[0] || |
| 153 | pBuf[1] > DOT11F_IE_EXTCAP_MAX_LEN ) |
| 154 | { |
Mahesh A Saptasagar | e00ff53 | 2014-10-17 19:05:14 +0530 | [diff] [blame] | 155 | limLog( pMac, LOG1, |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 156 | FL("Invalid IEs eid = %d elem_len=%d "), |
| 157 | pBuf[0],pBuf[1]); |
| 158 | return; |
| 159 | } |
| 160 | vos_mem_set(( tANI_U8* )&pOut[0], DOT11F_IE_EXTCAP_MAX_LEN, 0); |
| 161 | /* conversion should follow 4, 2, 2 byte order */ |
| 162 | limUtilsframeshtonl(pMac, &pOut[0],*((tANI_U32*)&pBuf[2]),0); |
| 163 | limUtilsframeshtons(pMac, &pOut[4],*((tANI_U16*)&pBuf[6]),0); |
| 164 | limUtilsframeshtons(pMac, &pOut[6],*((tANI_U16*)&pBuf[8]),0); |
| 165 | |
| 166 | if ( DOT11F_PARSE_SUCCESS != dot11fUnpackIeExtCap( pMac, |
| 167 | &pOut[0], DOT11F_IE_EXTCAP_MAX_LEN, pDst) ) |
| 168 | { |
| 169 | limLog( pMac, LOGE, |
| 170 | FL("dot11fUnpackIeExtCap Parse Error ")); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | tSirRetStatus limStripOffExtCapIEAndUpdateStruct(tpAniSirGlobal pMac, |
| 175 | tANI_U8* addIE, |
| 176 | tANI_U16 *addnIELen, |
| 177 | tDot11fIEExtCap * pDst ) |
| 178 | { |
| 179 | tANI_U8 pExtractedExtCapIEBuf[DOT11F_IE_EXTCAP_MAX_LEN + 2]; |
| 180 | tSirRetStatus nSirStatus; |
| 181 | |
| 182 | vos_mem_set(( tANI_U8* )&pExtractedExtCapIEBuf[0], |
| 183 | DOT11F_IE_EXTCAP_MAX_LEN + 2, 0); |
| 184 | nSirStatus = limStripOffExtCapIE(pMac, addIE, addnIELen, |
| 185 | pExtractedExtCapIEBuf); |
| 186 | if ( eSIR_SUCCESS != nSirStatus ) |
| 187 | { |
| 188 | limLog( pMac, LOG1, FL("Failed to strip off in" |
| 189 | "limStripOffExtCapIE status = (%d)."), |
| 190 | nSirStatus ); |
| 191 | return nSirStatus; |
| 192 | } |
| 193 | /* update the extracted ExtCap to struct*/ |
| 194 | limUpdateExtCapIEtoStruct(pMac, pExtractedExtCapIEBuf, pDst); |
| 195 | return nSirStatus; |
| 196 | } |
| 197 | |
| 198 | void limMergeExtCapIEStruct(tDot11fIEExtCap *pDst, |
| 199 | tDot11fIEExtCap *pSrc) |
| 200 | { |
| 201 | tANI_U8 *tempDst = (tANI_U8 *)pDst; |
| 202 | tANI_U8 *tempSrc = (tANI_U8 *)pSrc; |
| 203 | tANI_U8 structlen = sizeof(tDot11fIEExtCap); |
| 204 | |
| 205 | while(tempDst && tempSrc && structlen--) |
| 206 | { |
| 207 | *tempDst |= *tempSrc; |
| 208 | tempDst++; |
| 209 | tempSrc++; |
| 210 | } |
| 211 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 212 | |
| 213 | /** |
| 214 | * |
| 215 | * \brief This function is called by various LIM modules to prepare the |
| 216 | * 802.11 frame MAC header |
| 217 | * |
| 218 | * |
| 219 | * \param pMac Pointer to Global MAC structure |
| 220 | * |
| 221 | * \param pBD Pointer to the frame buffer that needs to be populate |
| 222 | * |
| 223 | * \param type Type of the frame |
| 224 | * |
| 225 | * \param subType Subtype of the frame |
| 226 | * |
| 227 | * \return eHalStatus |
| 228 | * |
| 229 | * |
| 230 | * The pFrameBuf argument points to the beginning of the frame buffer to |
| 231 | * which - a) The 802.11 MAC header is set b) Following this MAC header |
| 232 | * will be the MGMT frame payload The payload itself is populated by the |
| 233 | * caller API |
| 234 | * |
| 235 | * |
| 236 | */ |
| 237 | |
| 238 | tSirRetStatus limPopulateMacHeader( tpAniSirGlobal pMac, |
| 239 | tANI_U8* pBD, |
| 240 | tANI_U8 type, |
| 241 | tANI_U8 subType, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 242 | tSirMacAddr peerAddr, tSirMacAddr selfMacAddr) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 243 | { |
| 244 | tSirRetStatus statusCode = eSIR_SUCCESS; |
| 245 | tpSirMacMgmtHdr pMacHdr; |
| 246 | |
| 247 | /// Prepare MAC management header |
| 248 | pMacHdr = (tpSirMacMgmtHdr) (pBD); |
| 249 | |
| 250 | // Prepare FC |
| 251 | pMacHdr->fc.protVer = SIR_MAC_PROTOCOL_VERSION; |
| 252 | pMacHdr->fc.type = type; |
| 253 | pMacHdr->fc.subType = subType; |
| 254 | |
| 255 | // Prepare Address 1 |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 256 | vos_mem_copy( (tANI_U8 *) pMacHdr->da, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 257 | (tANI_U8 *) peerAddr, |
| 258 | sizeof( tSirMacAddr )); |
| 259 | |
| 260 | // Prepare Address 2 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 261 | sirCopyMacAddr(pMacHdr->sa,selfMacAddr); |
| 262 | |
| 263 | // Prepare Address 3 |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 264 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 265 | (tANI_U8 *) peerAddr, |
| 266 | sizeof( tSirMacAddr )); |
| 267 | return statusCode; |
| 268 | } /*** end limPopulateMacHeader() ***/ |
| 269 | |
| 270 | /** |
| 271 | * \brief limSendProbeReqMgmtFrame |
| 272 | * |
| 273 | * |
| 274 | * \param pMac Pointer to Global MAC structure |
| 275 | * |
| 276 | * \param pSsid SSID to be sent in Probe Request frame |
| 277 | * |
| 278 | * \param bssid BSSID to be sent in Probe Request frame |
| 279 | * |
| 280 | * \param nProbeDelay probe delay to be used before sending Probe Request |
| 281 | * frame |
| 282 | * |
| 283 | * \param nChannelNum Channel # on which the Probe Request is going out |
| 284 | * |
| 285 | * \param nAdditionalIELen if non-zero, include pAdditionalIE in the Probe Request frame |
| 286 | * |
| 287 | * \param pAdditionalIE if nAdditionalIELen is non zero, include this field in the Probe Request frame |
| 288 | * |
| 289 | * This function is called by various LIM modules to send Probe Request frame |
| 290 | * during active scan/learn phase. |
| 291 | * Probe request is sent out in the following scenarios: |
| 292 | * --heartbeat failure: session needed |
| 293 | * --join req: session needed |
| 294 | * --foreground scan: no session |
| 295 | * --background scan: no session |
| 296 | * --schBeaconProcessing: to get EDCA parameters: session needed |
| 297 | * |
| 298 | * |
| 299 | */ |
| 300 | tSirRetStatus |
| 301 | limSendProbeReqMgmtFrame(tpAniSirGlobal pMac, |
| 302 | tSirMacSSid *pSsid, |
| 303 | tSirMacAddr bssid, |
| 304 | tANI_U8 nChannelNum, |
| 305 | tSirMacAddr SelfMacAddr, |
| 306 | tANI_U32 dot11mode, |
| 307 | tANI_U32 nAdditionalIELen, |
| 308 | tANI_U8 *pAdditionalIE) |
| 309 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 310 | tDot11fProbeRequest pr; |
| 311 | tANI_U32 nStatus, nBytes, nPayload; |
| 312 | tSirRetStatus nSirStatus; |
| 313 | tANI_U8 *pFrame; |
| 314 | void *pPacket; |
| 315 | eHalStatus halstatus; |
| 316 | tpPESession psessionEntry; |
| 317 | tANI_U8 sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 318 | tANI_U8 *p2pIe = NULL; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 319 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 320 | |
| 321 | #ifndef GEN4_SCAN |
| 322 | return eSIR_FAILURE; |
| 323 | #endif |
| 324 | |
| 325 | #if defined ( ANI_DVT_DEBUG ) |
| 326 | return eSIR_FAILURE; |
| 327 | #endif |
| 328 | |
Abhishek Singh | 4beed42 | 2014-02-03 16:47:17 +0530 | [diff] [blame] | 329 | /* The probe req should not send 11ac capabilieties if band is 2.4GHz, |
| 330 | * unless enableVhtFor24GHz is enabled in INI. So if enableVhtFor24GHz |
| 331 | * is false and dot11mode is 11ac set it to 11n. |
| 332 | */ |
| 333 | if ( nChannelNum <= SIR_11B_CHANNEL_END && |
| 334 | ( FALSE == pMac->roam.configParam.enableVhtFor24GHz ) && |
| 335 | ( WNI_CFG_DOT11_MODE_11AC == dot11mode || |
| 336 | WNI_CFG_DOT11_MODE_11AC_ONLY == dot11mode ) ) |
| 337 | dot11mode = WNI_CFG_DOT11_MODE_11N; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 338 | /* |
| 339 | * session context may or may not be present, when probe request needs to be sent out. |
| 340 | * following cases exist: |
| 341 | * --heartbeat failure: session needed |
| 342 | * --join req: session needed |
| 343 | * --foreground scan: no session |
| 344 | * --background scan: no session |
| 345 | * --schBeaconProcessing: to get EDCA parameters: session needed |
| 346 | * If session context does not exist, some IEs will be populated from CFGs, |
| 347 | * e.g. Supported and Extended rate set IEs |
| 348 | */ |
| 349 | psessionEntry = peFindSessionByBssid(pMac,bssid,&sessionId); |
| 350 | |
| 351 | // The scheme here is to fill out a 'tDot11fProbeRequest' structure |
| 352 | // and then hand it off to 'dot11fPackProbeRequest' (for |
| 353 | // serialization). We start by zero-initializing the structure: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 354 | vos_mem_set(( tANI_U8* )&pr, sizeof( pr ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 355 | |
| 356 | // & delegating to assorted helpers: |
| 357 | PopulateDot11fSSID( pMac, pSsid, &pr.SSID ); |
| 358 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 359 | if( nAdditionalIELen && pAdditionalIE ) |
| 360 | { |
| 361 | p2pIe = limGetP2pIEPtr(pMac, pAdditionalIE, nAdditionalIELen); |
| 362 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 363 | /* Don't include 11b rate only when device is doing P2P Search */ |
| 364 | if( ( WNI_CFG_DOT11_MODE_11B != dot11mode ) && |
| 365 | ( p2pIe != NULL ) && |
| 366 | /* Don't include 11b rate if it is a P2P serach or probe request is sent by P2P Client */ |
| 367 | ( ( ( pMac->lim.gpLimMlmScanReq != NULL ) && |
| 368 | pMac->lim.gpLimMlmScanReq->p2pSearch ) || |
| 369 | ( ( psessionEntry != NULL ) && |
| 370 | ( VOS_P2P_CLIENT_MODE == psessionEntry->pePersona ) ) |
| 371 | ) |
| 372 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 373 | { |
| 374 | /* In the below API pass channel number > 14, do that it fills only |
| 375 | * 11a rates in supported rates */ |
| 376 | PopulateDot11fSuppRates( pMac, 15, &pr.SuppRates,psessionEntry); |
| 377 | } |
| 378 | else |
| 379 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 380 | PopulateDot11fSuppRates( pMac, nChannelNum, |
| 381 | &pr.SuppRates,psessionEntry); |
| 382 | |
| 383 | if ( WNI_CFG_DOT11_MODE_11B != dot11mode ) |
| 384 | { |
| 385 | PopulateDot11fExtSuppRates1( pMac, nChannelNum, &pr.ExtSuppRates ); |
| 386 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 387 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 388 | |
| 389 | #if defined WLAN_FEATURE_VOWIFI |
| 390 | //Table 7-14 in IEEE Std. 802.11k-2008 says |
| 391 | //DS params "can" be present in RRM is disabled and "is" present if |
| 392 | //RRM is enabled. It should be ok even if we add it into probe req when |
| 393 | //RRM is not enabled. |
| 394 | PopulateDot11fDSParams( pMac, &pr.DSParams, nChannelNum, psessionEntry ); |
| 395 | //Call RRM module to get the tx power for management used. |
| 396 | { |
| 397 | tANI_U8 txPower = (tANI_U8) rrmGetMgmtTxPower( pMac, psessionEntry ); |
| 398 | PopulateDot11fWFATPC( pMac, &pr.WFATPC, txPower, 0 ); |
| 399 | } |
| 400 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 401 | |
| 402 | if (psessionEntry != NULL ) { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 403 | psessionEntry->htCapability = IS_DOT11_MODE_HT(dot11mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 404 | //Include HT Capability IE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 405 | if (psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 406 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 407 | PopulateDot11fHTCaps( pMac, psessionEntry, &pr.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 408 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 409 | } else { //psessionEntry == NULL |
| 410 | if (IS_DOT11_MODE_HT(dot11mode)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 411 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 412 | PopulateDot11fHTCaps( pMac, psessionEntry, &pr.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 413 | } |
| 414 | } |
Gopichand Nakkala | 40bc650 | 2012-12-20 16:55:36 -0800 | [diff] [blame] | 415 | |
Hardik Kantilal Patel | bca5b00 | 2015-01-19 15:30:18 +0530 | [diff] [blame] | 416 | if((nChannelNum <= SIR_11B_CHANNEL_END) |
| 417 | && (!IS_HT40_OBSS_SCAN_FEATURE_ENABLE) |
| 418 | && (!pMac->roam.configParam.channelBondingMode24GHz)) |
Gopichand Nakkala | 40bc650 | 2012-12-20 16:55:36 -0800 | [diff] [blame] | 419 | { |
| 420 | pr.HTCaps.supportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; |
| 421 | pr.HTCaps.shortGI40MHz = 0; |
| 422 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 423 | #ifdef WLAN_FEATURE_11AC |
| 424 | if (psessionEntry != NULL ) { |
| 425 | psessionEntry->vhtCapability = IS_DOT11_MODE_VHT(dot11mode); |
| 426 | //Include HT Capability IE |
| 427 | if (psessionEntry->vhtCapability) |
| 428 | { |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 429 | PopulateDot11fVHTCaps( pMac, &pr.VHTCaps, |
| 430 | psessionEntry->currentOperChannel , eSIR_FALSE ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 431 | } |
| 432 | } else { |
| 433 | if (IS_DOT11_MODE_VHT(dot11mode)) |
| 434 | { |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 435 | PopulateDot11fVHTCaps( pMac, &pr.VHTCaps, nChannelNum, eSIR_FALSE ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 436 | } |
| 437 | } |
| 438 | #endif |
| 439 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 440 | |
| 441 | // That's it-- now we pack it. First, how much space are we going to |
| 442 | // need? |
| 443 | nStatus = dot11fGetPackedProbeRequestSize( pMac, &pr, &nPayload ); |
| 444 | if ( DOT11F_FAILED( nStatus ) ) |
| 445 | { |
| 446 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 447 | "or a Probe Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 448 | // We'll fall back on the worst case scenario: |
| 449 | nPayload = sizeof( tDot11fProbeRequest ); |
| 450 | } |
| 451 | else if ( DOT11F_WARNED( nStatus ) ) |
| 452 | { |
| 453 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 454 | "the packed size for a Probe Request (" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 455 | "0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAdditionalIELen; |
| 459 | |
| 460 | // Ok-- try to allocate some memory: |
| 461 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 462 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 463 | ( void** ) &pPacket ); |
| 464 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 465 | { |
| 466 | 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] | 467 | "be Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 468 | return eSIR_MEM_ALLOC_FAILED; |
| 469 | } |
| 470 | |
| 471 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 472 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | |
| 474 | // Next, we fill out the buffer descriptor: |
| 475 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 476 | SIR_MAC_MGMT_PROBE_REQ, bssid, SelfMacAddr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 477 | if ( eSIR_SUCCESS != nSirStatus ) |
| 478 | { |
| 479 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 480 | "tor for a Probe Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 481 | nSirStatus ); |
| 482 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 483 | ( void* ) pFrame, ( void* ) pPacket ); |
| 484 | return nSirStatus; // allocated! |
| 485 | } |
| 486 | |
| 487 | // That done, pack the Probe Request: |
| 488 | nStatus = dot11fPackProbeRequest( pMac, &pr, pFrame + |
| 489 | sizeof( tSirMacMgmtHdr ), |
| 490 | nPayload, &nPayload ); |
| 491 | if ( DOT11F_FAILED( nStatus ) ) |
| 492 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 493 | limLog( pMac, LOGE, FL("Failed to pack a Probe Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 494 | nStatus ); |
| 495 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 496 | return eSIR_FAILURE; // allocated! |
| 497 | } |
| 498 | else if ( DOT11F_WARNED( nStatus ) ) |
| 499 | { |
| 500 | limLog( pMac, LOGW, FL("There were warnings while packing a P" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 501 | "robe Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | // Append any AddIE if present. |
| 505 | if( nAdditionalIELen ) |
| 506 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 507 | vos_mem_copy( pFrame+sizeof(tSirMacMgmtHdr)+nPayload, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 508 | pAdditionalIE, nAdditionalIELen ); |
| 509 | nPayload += nAdditionalIELen; |
| 510 | } |
| 511 | |
| 512 | /* If this probe request is sent during P2P Search State, then we need |
| 513 | * to send it at OFDM rate. |
| 514 | */ |
| 515 | if( ( SIR_BAND_5_GHZ == limGetRFBand(nChannelNum)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 516 | || (( pMac->lim.gpLimMlmScanReq != NULL) && |
| 517 | pMac->lim.gpLimMlmScanReq->p2pSearch ) |
Gopichand Nakkala | 6796721 | 2013-02-15 17:31:15 +0530 | [diff] [blame] | 518 | /* For unicast probe req mgmt from Join function |
| 519 | we don't set above variables. So we need to add |
| 520 | one more check whether it is pePersona is P2P_CLIENT or not */ |
| 521 | || ( ( psessionEntry != NULL ) && |
| 522 | ( VOS_P2P_CLIENT_MODE == psessionEntry->pePersona ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 523 | ) |
| 524 | { |
| 525 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 526 | } |
| 527 | |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 528 | if( ( psessionEntry != NULL ) && ( psessionEntry->is11Gonly == true ) && |
| 529 | ( !IS_BROADCAST_MAC(bssid) ) ){ |
| 530 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 531 | } |
| 532 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 533 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) sizeof(tSirMacMgmtHdr) + nPayload, |
| 534 | HAL_TXRX_FRM_802_11_MGMT, |
| 535 | ANI_TXDIR_TODS, |
| 536 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 537 | limTxComplete, pFrame, txFlag ); |
| 538 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 539 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 540 | limLog( pMac, LOGE, FL("could not send Probe Request frame!" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 541 | //Pkt will be freed up by the callback |
| 542 | return eSIR_FAILURE; |
| 543 | } |
| 544 | |
| 545 | return eSIR_SUCCESS; |
| 546 | } // End limSendProbeReqMgmtFrame. |
| 547 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 548 | tSirRetStatus limGetAddnIeForProbeResp(tpAniSirGlobal pMac, |
| 549 | tANI_U8* addIE, tANI_U16 *addnIELen, |
| 550 | tANI_U8 probeReqP2pIe) |
| 551 | { |
| 552 | /* If Probe request doesn't have P2P IE, then take out P2P IE |
| 553 | from additional IE */ |
| 554 | if(!probeReqP2pIe) |
| 555 | { |
| 556 | tANI_U8* tempbuf = NULL; |
| 557 | tANI_U16 tempLen = 0; |
| 558 | int left = *addnIELen; |
| 559 | v_U8_t *ptr = addIE; |
| 560 | v_U8_t elem_id, elem_len; |
| 561 | |
| 562 | if(NULL == addIE) |
| 563 | { |
| 564 | PELOGE(limLog(pMac, LOGE, |
| 565 | FL(" NULL addIE pointer"));) |
| 566 | return eSIR_FAILURE; |
| 567 | } |
| 568 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 569 | tempbuf = vos_mem_malloc(left); |
| 570 | if ( NULL == tempbuf ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 571 | { |
| 572 | PELOGE(limLog(pMac, LOGE, |
| 573 | FL("Unable to allocate memory to store addn IE"));) |
| 574 | return eSIR_MEM_ALLOC_FAILED; |
| 575 | } |
| 576 | |
| 577 | while(left >= 2) |
| 578 | { |
| 579 | elem_id = ptr[0]; |
| 580 | elem_len = ptr[1]; |
| 581 | left -= 2; |
| 582 | if(elem_len > left) |
| 583 | { |
| 584 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 585 | FL("****Invalid IEs eid = %d elem_len=%d left=%d*****"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 586 | elem_id,elem_len,left); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 587 | vos_mem_free(tempbuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 588 | return eSIR_FAILURE; |
| 589 | } |
| 590 | if ( !( (SIR_MAC_EID_VENDOR == elem_id) && |
| 591 | (memcmp(&ptr[2], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE)==0) ) ) |
| 592 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 593 | vos_mem_copy (tempbuf + tempLen, &ptr[0], elem_len + 2); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 594 | tempLen += (elem_len + 2); |
| 595 | } |
| 596 | left -= elem_len; |
| 597 | ptr += (elem_len + 2); |
| 598 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 599 | vos_mem_copy (addIE, tempbuf, tempLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 600 | *addnIELen = tempLen; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 601 | vos_mem_free(tempbuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 602 | } |
| 603 | return eSIR_SUCCESS; |
| 604 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 605 | |
| 606 | void |
| 607 | limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, |
| 608 | tSirMacAddr peerMacAddr, |
| 609 | tpAniSSID pSsid, |
| 610 | short nStaId, |
| 611 | tANI_U8 nKeepAlive, |
| 612 | tpPESession psessionEntry, |
| 613 | tANI_U8 probeReqP2pIe) |
| 614 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 615 | tDot11fProbeResponse *pFrm; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 616 | tSirRetStatus nSirStatus; |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 617 | tANI_U32 cfg, nPayload, nStatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 618 | tpSirMacMgmtHdr pMacHdr; |
| 619 | tANI_U8 *pFrame; |
| 620 | void *pPacket; |
| 621 | eHalStatus halstatus; |
| 622 | tANI_U32 addnIEPresent; |
| 623 | tANI_U32 addnIE1Len=0; |
| 624 | tANI_U32 addnIE2Len=0; |
| 625 | tANI_U32 addnIE3Len=0; |
| 626 | tANI_U16 totalAddnIeLen = 0; |
| 627 | tANI_U32 wpsApEnable=0, tmp; |
| 628 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 629 | tANI_U8 *addIE = NULL; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 630 | tANI_U8 *pP2pIe = NULL; |
| 631 | tANI_U8 noaLen = 0; |
| 632 | tANI_U8 total_noaLen = 0; |
| 633 | tANI_U8 noaStream[SIR_MAX_NOA_ATTR_LEN |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 634 | + SIR_P2P_IE_HEADER_LEN]; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 635 | tANI_U8 noaIe[SIR_MAX_NOA_ATTR_LEN + SIR_P2P_IE_HEADER_LEN]; |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 636 | tDot11fIEExtCap extractedExtCap; |
| 637 | tANI_BOOLEAN extractedExtCapFlag = eANI_BOOLEAN_TRUE; |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 638 | tANI_U32 nBytes = 0; |
| 639 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 640 | if(pMac->gDriverType == eDRIVER_TYPE_MFG) // We don't answer requests |
| 641 | { |
| 642 | return; // in this case. |
| 643 | } |
| 644 | |
| 645 | if(NULL == psessionEntry) |
| 646 | { |
| 647 | return; |
| 648 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 649 | |
| 650 | pFrm = vos_mem_malloc(sizeof(tDot11fProbeResponse)); |
| 651 | if ( NULL == pFrm ) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 652 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 653 | limLog(pMac, LOGE, FL("Unable to allocate memory in limSendProbeRspMgmtFrame") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 654 | return; |
| 655 | } |
| 656 | |
Girish Gowli | 0e82679 | 2014-05-17 17:56:44 +0530 | [diff] [blame] | 657 | vos_mem_set(( tANI_U8* )&extractedExtCap, sizeof( tDot11fIEExtCap ), 0); |
| 658 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 659 | // Fill out 'frm', after which we'll just hand the struct off to |
| 660 | // 'dot11fPackProbeResponse'. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 661 | vos_mem_set(( tANI_U8* )pFrm, sizeof( tDot11fProbeResponse ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 662 | |
| 663 | // Timestamp to be updated by TFP, below. |
| 664 | |
| 665 | // Beacon Interval: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 666 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 667 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 668 | pFrm->BeaconInterval.interval = pMac->sch.schObject.gSchBeaconInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 669 | } |
| 670 | else |
| 671 | { |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 672 | nSirStatus = wlan_cfgGetInt( pMac, WNI_CFG_BEACON_INTERVAL, &cfg); |
| 673 | if (eSIR_SUCCESS != nSirStatus) |
| 674 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 675 | 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] | 676 | nSirStatus ); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 677 | vos_mem_free(pFrm); |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 678 | return; |
| 679 | } |
| 680 | pFrm->BeaconInterval.interval = ( tANI_U16 ) cfg; |
Madan Mohan Koyyalamudi | c0d1b3f | 2012-11-13 10:41:07 -0800 | [diff] [blame] | 681 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 682 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 683 | PopulateDot11fCapabilities( pMac, &pFrm->Capabilities, psessionEntry ); |
| 684 | PopulateDot11fSSID( pMac, ( tSirMacSSid* )pSsid, &pFrm->SSID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 685 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 686 | &pFrm->SuppRates,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 687 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 688 | PopulateDot11fDSParams( pMac, &pFrm->DSParams, psessionEntry->currentOperChannel,psessionEntry); |
| 689 | PopulateDot11fIBSSParams( pMac, &pFrm->IBSSParams, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 690 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 691 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 692 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 693 | { |
| 694 | if(psessionEntry->wps_state != SAP_WPS_DISABLED) |
| 695 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 696 | PopulateDot11fProbeResWPSIEs(pMac, &pFrm->WscProbeRes, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 697 | } |
| 698 | } |
| 699 | else |
| 700 | { |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 701 | 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] | 702 | 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] | 703 | |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 704 | wpsApEnable = tmp & WNI_CFG_WPS_ENABLE_AP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 705 | |
Jeff Johnson | 3c3e178 | 2013-02-27 10:48:42 -0800 | [diff] [blame] | 706 | if (wpsApEnable) |
| 707 | { |
| 708 | PopulateDot11fWscInProbeRes(pMac, &pFrm->WscProbeRes); |
| 709 | } |
| 710 | |
| 711 | if (pMac->lim.wscIeInfo.probeRespWscEnrollmentState == eLIM_WSC_ENROLL_BEGIN) |
| 712 | { |
| 713 | PopulateDot11fWscRegistrarInfoInProbeRes(pMac, &pFrm->WscProbeRes); |
| 714 | pMac->lim.wscIeInfo.probeRespWscEnrollmentState = eLIM_WSC_ENROLL_IN_PROGRESS; |
| 715 | } |
| 716 | |
| 717 | if (pMac->lim.wscIeInfo.wscEnrollmentState == eLIM_WSC_ENROLL_END) |
| 718 | { |
| 719 | DePopulateDot11fWscRegistrarInfoInProbeRes(pMac, &pFrm->WscProbeRes); |
| 720 | pMac->lim.wscIeInfo.probeRespWscEnrollmentState = eLIM_WSC_ENROLL_NOOP; |
| 721 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 722 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 723 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 724 | PopulateDot11fCountry( pMac, &pFrm->Country, psessionEntry); |
| 725 | PopulateDot11fEDCAParamSet( pMac, &pFrm->EDCAParamSet, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 726 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 727 | |
| 728 | if (psessionEntry->dot11mode != WNI_CFG_DOT11_MODE_11B) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 729 | PopulateDot11fERPInfo( pMac, &pFrm->ERPInfo, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 730 | |
| 731 | |
| 732 | // N.B. In earlier implementations, the RSN IE would be placed in |
| 733 | // the frame here, before the WPA IE, if 'RSN_BEFORE_WPA' was defined. |
| 734 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 735 | &pFrm->ExtSuppRates, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 736 | |
| 737 | //Populate HT IEs, when operating in 11n or Taurus modes. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 738 | if ( psessionEntry->htCapability ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 739 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 740 | PopulateDot11fHTCaps( pMac, psessionEntry, &pFrm->HTCaps ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 741 | PopulateDot11fHTInfo( pMac, &pFrm->HTInfo, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 742 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 743 | |
| 744 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 745 | /* Populate Overlapping BSS Scan Parameters IEs, |
| 746 | * when operating in HT40 in 2.4GHz. |
| 747 | */ |
Hardik Kantilal Patel | 3c23524 | 2015-01-02 17:56:18 +0530 | [diff] [blame] | 748 | if ((pMac->roam.configParam.apHT40_24GEnabled) |
| 749 | && (IS_DOT11_MODE_HT(psessionEntry->dot11mode))) |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 750 | { |
| 751 | PopulateDot11fOBSSScanParameters( pMac, &pFrm->OBSSScanParameters, |
| 752 | psessionEntry); |
Hardik Kantilal Patel | ee5874c | 2015-01-14 15:23:28 +0530 | [diff] [blame] | 753 | /* 10.15.8 Support of DSSS/CCK in 40 MHz, An associated HT STA in |
| 754 | * a 20/40 MHz BSS may generate DSSS/CCK transmissions.Set DSSS/CCK |
| 755 | * Mode in 40 MHz bit in HT capablity. |
| 756 | */ |
| 757 | pFrm->HTCaps.dsssCckMode40MHz = 1; |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 758 | } |
| 759 | #endif |
| 760 | |
| 761 | PopulateDot11fExtCap( pMac, &pFrm->ExtCap, psessionEntry); |
| 762 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 763 | #ifdef WLAN_FEATURE_11AC |
| 764 | if(psessionEntry->vhtCapability) |
| 765 | { |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 766 | limLog( pMac, LOG1, FL("Populate VHT IE in Probe Response")); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 767 | PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps, |
| 768 | psessionEntry->currentOperChannel, eSIR_TRUE ); |
| 769 | PopulateDot11fVHTOperation( pMac, &pFrm->VHTOperation , |
| 770 | psessionEntry->currentOperChannel); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 771 | // we do not support multi users yet |
| 772 | //PopulateDot11fVHTExtBssLoad( pMac, &frm.VHTExtBssLoad ); |
| 773 | } |
| 774 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 775 | |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 776 | |
Hardik Kantilal Patel | ee5874c | 2015-01-14 15:23:28 +0530 | [diff] [blame] | 777 | if ( psessionEntry->pLimStartBssReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 778 | { |
| 779 | PopulateDot11fWPA( pMac, &( psessionEntry->pLimStartBssReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 780 | &pFrm->WPA ); |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 781 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimStartBssReq->rsnIE ), |
| 782 | &pFrm->RSNOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 783 | } |
| 784 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 785 | PopulateDot11fWMM( pMac, &pFrm->WMMInfoAp, &pFrm->WMMParams, &pFrm->WMMCaps, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 786 | |
| 787 | #if defined(FEATURE_WLAN_WAPI) |
| 788 | if( psessionEntry->pLimStartBssReq ) |
| 789 | { |
| 790 | PopulateDot11fWAPI( pMac, &( psessionEntry->pLimStartBssReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 791 | &pFrm->WAPI ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 792 | } |
| 793 | |
| 794 | #endif // defined(FEATURE_WLAN_WAPI) |
| 795 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 796 | addnIEPresent = false; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 797 | if( pMac->lim.gpLimRemainOnChanReq ) |
| 798 | { |
| 799 | nBytes += (pMac->lim.gpLimRemainOnChanReq->length - sizeof( tSirRemainOnChnReq ) ); |
| 800 | } |
| 801 | //Only use CFG for non-listen mode. This CFG is not working for concurrency |
| 802 | //In listening mode, probe rsp IEs is passed in the message from SME to PE |
| 803 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 804 | { |
| 805 | |
| 806 | if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_RSP_ADDNIE_FLAG, |
| 807 | &addnIEPresent) != eSIR_SUCCESS) |
| 808 | { |
| 809 | 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] | 810 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 811 | return; |
| 812 | } |
| 813 | } |
| 814 | |
| 815 | if (addnIEPresent) |
| 816 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 817 | |
| 818 | addIE = vos_mem_malloc(WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN*3); |
| 819 | if ( NULL == addIE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 820 | { |
| 821 | PELOGE(limLog(pMac, LOGE, |
| 822 | FL("Unable to allocate memory to store addn IE"));) |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 823 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 824 | return; |
| 825 | } |
| 826 | |
| 827 | //Probe rsp IE available |
| 828 | if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, |
| 829 | WNI_CFG_PROBE_RSP_ADDNIE_DATA1, &addnIE1Len) ) |
| 830 | { |
| 831 | 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] | 832 | vos_mem_free(addIE); |
| 833 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 834 | return; |
| 835 | } |
| 836 | if (addnIE1Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN && addnIE1Len && |
| 837 | (nBytes + addnIE1Len) <= SIR_MAX_PACKET_SIZE) |
| 838 | { |
| 839 | if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, |
| 840 | WNI_CFG_PROBE_RSP_ADDNIE_DATA1, &addIE[0], |
| 841 | &addnIE1Len) ) |
| 842 | { |
| 843 | limLog(pMac, LOGP, |
| 844 | FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 String")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 845 | vos_mem_free(addIE); |
| 846 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 847 | return; |
| 848 | } |
| 849 | } |
| 850 | |
| 851 | //Probe rsp IE available |
| 852 | if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, |
| 853 | WNI_CFG_PROBE_RSP_ADDNIE_DATA2, &addnIE2Len) ) |
| 854 | { |
| 855 | 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] | 856 | vos_mem_free(addIE); |
| 857 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 858 | return; |
| 859 | } |
| 860 | if (addnIE2Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA2_LEN && addnIE2Len && |
| 861 | (nBytes + addnIE2Len) <= SIR_MAX_PACKET_SIZE) |
| 862 | { |
| 863 | if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, |
| 864 | WNI_CFG_PROBE_RSP_ADDNIE_DATA2, &addIE[addnIE1Len], |
| 865 | &addnIE2Len) ) |
| 866 | { |
| 867 | limLog(pMac, LOGP, |
| 868 | FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA2 String")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 869 | vos_mem_free(addIE); |
| 870 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 871 | return; |
| 872 | } |
| 873 | } |
| 874 | |
| 875 | //Probe rsp IE available |
| 876 | if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, |
| 877 | WNI_CFG_PROBE_RSP_ADDNIE_DATA3, &addnIE3Len) ) |
| 878 | { |
| 879 | 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] | 880 | vos_mem_free(addIE); |
| 881 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 882 | return; |
| 883 | } |
| 884 | if (addnIE3Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA3_LEN && addnIE3Len && |
| 885 | (nBytes + addnIE3Len) <= SIR_MAX_PACKET_SIZE) |
| 886 | { |
| 887 | if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, |
| 888 | WNI_CFG_PROBE_RSP_ADDNIE_DATA3, |
| 889 | &addIE[addnIE1Len + addnIE2Len], |
| 890 | &addnIE3Len) ) |
| 891 | { |
| 892 | limLog(pMac, LOGP, |
| 893 | FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA3 String")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 894 | vos_mem_free(addIE); |
| 895 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 896 | return; |
| 897 | } |
| 898 | } |
| 899 | totalAddnIeLen = addnIE1Len + addnIE2Len + addnIE3Len; |
| 900 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 901 | if(eSIR_SUCCESS != limGetAddnIeForProbeResp(pMac, addIE, &totalAddnIeLen, probeReqP2pIe)) |
| 902 | { |
| 903 | limLog(pMac, LOGP, |
| 904 | FL("Unable to get final Additional IE for Probe Req")); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 905 | vos_mem_free(addIE); |
| 906 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 907 | return; |
| 908 | } |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 909 | |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 910 | nSirStatus = limStripOffExtCapIEAndUpdateStruct(pMac, |
| 911 | addIE, |
| 912 | &totalAddnIeLen, |
| 913 | &extractedExtCap ); |
| 914 | if(eSIR_SUCCESS != nSirStatus ) |
| 915 | { |
| 916 | extractedExtCapFlag = eANI_BOOLEAN_FALSE; |
| 917 | limLog(pMac, LOG1, |
| 918 | FL("Unable to Stripoff ExtCap IE from Probe Rsp")); |
| 919 | } |
| 920 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 921 | nBytes = nBytes + totalAddnIeLen; |
Kaushik, Sushant | a5ee77a | 2014-07-30 19:35:25 +0530 | [diff] [blame] | 922 | limLog(pMac, LOG1, |
| 923 | FL("probe rsp packet size is %d "), nBytes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 924 | if (probeReqP2pIe) |
| 925 | { |
| 926 | pP2pIe = limGetP2pIEPtr(pMac, &addIE[0], totalAddnIeLen); |
| 927 | if (pP2pIe != NULL) |
| 928 | { |
| 929 | //get NoA attribute stream P2P IE |
| 930 | noaLen = limGetNoaAttrStream(pMac, noaStream, psessionEntry); |
| 931 | if (noaLen != 0) |
| 932 | { |
| 933 | total_noaLen = limBuildP2pIe(pMac, &noaIe[0], |
| 934 | &noaStream[0], noaLen); |
| 935 | nBytes = nBytes + total_noaLen; |
Kaushik, Sushant | a5ee77a | 2014-07-30 19:35:25 +0530 | [diff] [blame] | 936 | limLog(pMac, LOG1, |
| 937 | FL("p2p probe rsp packet size is %d, noalength is %d"), |
| 938 | nBytes, total_noaLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 939 | } |
| 940 | } |
| 941 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 942 | } |
| 943 | |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 944 | /*merge ExtCap IE*/ |
| 945 | if (extractedExtCapFlag && extractedExtCap.present) |
| 946 | { |
| 947 | limMergeExtCapIEStruct(&pFrm->ExtCap, &extractedExtCap); |
| 948 | } |
| 949 | |
| 950 | nStatus = dot11fGetPackedProbeResponseSize( pMac, pFrm, &nPayload ); |
| 951 | if ( DOT11F_FAILED( nStatus ) ) |
| 952 | { |
| 953 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
| 954 | "or a Probe Response (0x%08x)."), |
| 955 | nStatus ); |
| 956 | // We'll fall back on the worst case scenario: |
| 957 | nPayload = sizeof( tDot11fProbeResponse ); |
| 958 | } |
| 959 | else if ( DOT11F_WARNED( nStatus ) ) |
| 960 | { |
| 961 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 962 | "the packed size for a Probe Response " |
| 963 | "(0x%08x)."), nStatus ); |
| 964 | } |
| 965 | |
| 966 | nBytes += nPayload + sizeof( tSirMacMgmtHdr ); |
| 967 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 968 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 969 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 970 | ( void** ) &pPacket ); |
| 971 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 972 | { |
| 973 | 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] | 974 | "be Response."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 975 | if ( addIE != NULL ) |
| 976 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 977 | vos_mem_free(addIE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 978 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 979 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 980 | return; |
| 981 | } |
| 982 | |
| 983 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 984 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 985 | |
| 986 | // Next, we fill out the buffer descriptor: |
| 987 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 988 | SIR_MAC_MGMT_PROBE_RSP, peerMacAddr,psessionEntry->selfMacAddr); |
| 989 | if ( eSIR_SUCCESS != nSirStatus ) |
| 990 | { |
| 991 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 992 | "tor for a Probe Response (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 993 | nSirStatus ); |
| 994 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 995 | ( void* ) pFrame, ( void* ) pPacket ); |
| 996 | if ( addIE != NULL ) |
| 997 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 998 | vos_mem_free(addIE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 999 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1000 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1001 | return; |
| 1002 | } |
| 1003 | |
| 1004 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 1005 | |
| 1006 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 1007 | |
| 1008 | // That done, pack the Probe Response: |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1009 | nStatus = dot11fPackProbeResponse( pMac, pFrm, pFrame + sizeof(tSirMacMgmtHdr), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1010 | nPayload, &nPayload ); |
| 1011 | if ( DOT11F_FAILED( nStatus ) ) |
| 1012 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1013 | limLog( pMac, LOGE, FL("Failed to pack a Probe Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1014 | nStatus ); |
| 1015 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1016 | if ( addIE != NULL ) |
| 1017 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1018 | vos_mem_free(addIE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1019 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1020 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1021 | return; // allocated! |
| 1022 | } |
| 1023 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1024 | { |
| 1025 | limLog( pMac, LOGW, FL("There were warnings while packing a P" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1026 | "robe Response (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1027 | } |
| 1028 | |
| 1029 | PELOG3(limLog( pMac, LOG3, FL("Sending Probe Response frame to ") ); |
| 1030 | limPrintMacAddr( pMac, peerMacAddr, LOG3 );) |
| 1031 | |
| 1032 | pMac->sys.probeRespond++; |
| 1033 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1034 | if( pMac->lim.gpLimRemainOnChanReq ) |
| 1035 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1036 | vos_mem_copy ( pFrame+sizeof(tSirMacMgmtHdr)+nPayload, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1037 | pMac->lim.gpLimRemainOnChanReq->probeRspIe, (pMac->lim.gpLimRemainOnChanReq->length - sizeof( tSirRemainOnChnReq )) ); |
| 1038 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1039 | |
| 1040 | if ( addnIEPresent ) |
| 1041 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1042 | vos_mem_copy(pFrame+sizeof(tSirMacMgmtHdr)+nPayload, &addIE[0], totalAddnIeLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1043 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1044 | if (noaLen != 0) |
| 1045 | { |
Krunal Soni | 81b2426 | 2013-05-15 17:46:41 -0700 | [diff] [blame] | 1046 | 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] | 1047 | { |
| 1048 | limLog(pMac, LOGE, |
Kaushik, Sushant | 96ac9d7 | 2013-12-11 19:28:10 +0530 | [diff] [blame] | 1049 | FL("Not able to insert NoA because of length constraint." |
| 1050 | "Total Length is :%d"),total_noaLen); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1051 | vos_mem_free(addIE); |
| 1052 | vos_mem_free(pFrm); |
Krunal Soni | 81b2426 | 2013-05-15 17:46:41 -0700 | [diff] [blame] | 1053 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1054 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1055 | return; |
| 1056 | } |
| 1057 | else |
| 1058 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1059 | vos_mem_copy( &pFrame[nBytes - (total_noaLen)], |
Krunal Soni | 81b2426 | 2013-05-15 17:46:41 -0700 | [diff] [blame] | 1060 | &noaIe[0], total_noaLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1061 | } |
| 1062 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1063 | |
| 1064 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1065 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 1066 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1067 | ) |
| 1068 | { |
| 1069 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 1070 | } |
| 1071 | |
| 1072 | // Queue Probe Response frame in high priority WQ |
| 1073 | halstatus = halTxFrame( ( tHalHandle ) pMac, pPacket, |
| 1074 | ( tANI_U16 ) nBytes, |
| 1075 | HAL_TXRX_FRM_802_11_MGMT, |
| 1076 | ANI_TXDIR_TODS, |
| 1077 | 7,//SMAC_SWBD_TX_TID_MGMT_LOW, |
| 1078 | limTxComplete, pFrame, txFlag ); |
| 1079 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1080 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1081 | limLog( pMac, LOGE, FL("Could not send Probe Response.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1082 | //Pkt will be freed up by the callback |
| 1083 | } |
| 1084 | |
| 1085 | if ( addIE != NULL ) |
| 1086 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1087 | vos_mem_free(addIE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1088 | } |
| 1089 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1090 | vos_mem_free(pFrm); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1091 | return; |
| 1092 | |
| 1093 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1094 | } // End limSendProbeRspMgmtFrame. |
| 1095 | |
| 1096 | void |
| 1097 | limSendAddtsReqActionFrame(tpAniSirGlobal pMac, |
| 1098 | tSirMacAddr peerMacAddr, |
| 1099 | tSirAddtsReqInfo *pAddTS, |
| 1100 | tpPESession psessionEntry) |
| 1101 | { |
| 1102 | tANI_U16 i; |
| 1103 | tANI_U8 *pFrame; |
| 1104 | tSirRetStatus nSirStatus; |
| 1105 | tDot11fAddTSRequest AddTSReq; |
| 1106 | tDot11fWMMAddTSRequest WMMAddTSReq; |
| 1107 | tANI_U32 nPayload, nBytes, nStatus; |
| 1108 | tpSirMacMgmtHdr pMacHdr; |
| 1109 | void *pPacket; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1110 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1111 | tANI_U32 phyMode; |
| 1112 | #endif |
| 1113 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 1114 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1115 | |
| 1116 | if(NULL == psessionEntry) |
| 1117 | { |
| 1118 | return; |
| 1119 | } |
| 1120 | |
| 1121 | if ( ! pAddTS->wmeTspecPresent ) |
| 1122 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1123 | vos_mem_set(( tANI_U8* )&AddTSReq, sizeof( AddTSReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1124 | |
| 1125 | AddTSReq.Action.action = SIR_MAC_QOS_ADD_TS_REQ; |
| 1126 | AddTSReq.DialogToken.token = pAddTS->dialogToken; |
| 1127 | AddTSReq.Category.category = SIR_MAC_ACTION_QOS_MGMT; |
| 1128 | if ( pAddTS->lleTspecPresent ) |
| 1129 | { |
| 1130 | PopulateDot11fTSPEC( &pAddTS->tspec, &AddTSReq.TSPEC ); |
| 1131 | } |
| 1132 | else |
| 1133 | { |
| 1134 | PopulateDot11fWMMTSPEC( &pAddTS->tspec, &AddTSReq.WMMTSPEC ); |
| 1135 | } |
| 1136 | |
| 1137 | if ( pAddTS->lleTspecPresent ) |
| 1138 | { |
| 1139 | AddTSReq.num_WMMTCLAS = 0; |
| 1140 | AddTSReq.num_TCLAS = pAddTS->numTclas; |
| 1141 | for ( i = 0; i < pAddTS->numTclas; ++i) |
| 1142 | { |
| 1143 | PopulateDot11fTCLAS( pMac, &pAddTS->tclasInfo[i], |
| 1144 | &AddTSReq.TCLAS[i] ); |
| 1145 | } |
| 1146 | } |
| 1147 | else |
| 1148 | { |
| 1149 | AddTSReq.num_TCLAS = 0; |
| 1150 | AddTSReq.num_WMMTCLAS = pAddTS->numTclas; |
| 1151 | for ( i = 0; i < pAddTS->numTclas; ++i) |
| 1152 | { |
| 1153 | PopulateDot11fWMMTCLAS( pMac, &pAddTS->tclasInfo[i], |
| 1154 | &AddTSReq.WMMTCLAS[i] ); |
| 1155 | } |
| 1156 | } |
| 1157 | |
| 1158 | if ( pAddTS->tclasProcPresent ) |
| 1159 | { |
| 1160 | if ( pAddTS->lleTspecPresent ) |
| 1161 | { |
| 1162 | AddTSReq.TCLASSPROC.processing = pAddTS->tclasProc; |
| 1163 | AddTSReq.TCLASSPROC.present = 1; |
| 1164 | } |
| 1165 | else |
| 1166 | { |
| 1167 | AddTSReq.WMMTCLASPROC.version = 1; |
| 1168 | AddTSReq.WMMTCLASPROC.processing = pAddTS->tclasProc; |
| 1169 | AddTSReq.WMMTCLASPROC.present = 1; |
| 1170 | } |
| 1171 | } |
| 1172 | |
| 1173 | nStatus = dot11fGetPackedAddTSRequestSize( pMac, &AddTSReq, &nPayload ); |
| 1174 | if ( DOT11F_FAILED( nStatus ) ) |
| 1175 | { |
| 1176 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1177 | "or an Add TS Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1178 | nStatus ); |
| 1179 | // We'll fall back on the worst case scenario: |
| 1180 | nPayload = sizeof( tDot11fAddTSRequest ); |
| 1181 | } |
| 1182 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1183 | { |
| 1184 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 1185 | "the packed size for an Add TS Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1186 | " (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1187 | } |
| 1188 | } |
| 1189 | else |
| 1190 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1191 | vos_mem_set(( tANI_U8* )&WMMAddTSReq, sizeof( WMMAddTSReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1192 | |
| 1193 | WMMAddTSReq.Action.action = SIR_MAC_QOS_ADD_TS_REQ; |
| 1194 | WMMAddTSReq.DialogToken.token = pAddTS->dialogToken; |
| 1195 | WMMAddTSReq.Category.category = SIR_MAC_ACTION_WME; |
| 1196 | |
| 1197 | // WMM spec 2.2.10 - status code is only filled in for ADDTS response |
| 1198 | WMMAddTSReq.StatusCode.statusCode = 0; |
| 1199 | |
| 1200 | PopulateDot11fWMMTSPEC( &pAddTS->tspec, &WMMAddTSReq.WMMTSPEC ); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1201 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1202 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 1203 | |
| 1204 | if( phyMode == WNI_CFG_PHY_MODE_11G || phyMode == WNI_CFG_PHY_MODE_11A) |
| 1205 | { |
| 1206 | pAddTS->tsrsIE.rates[0] = TSRS_11AG_RATE_6MBPS; |
| 1207 | } |
| 1208 | else |
| 1209 | { |
| 1210 | pAddTS->tsrsIE.rates[0] = TSRS_11B_RATE_5_5MBPS; |
| 1211 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1212 | PopulateDot11TSRSIE(pMac,&pAddTS->tsrsIE, &WMMAddTSReq.ESETrafStrmRateSet,sizeof(tANI_U8)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1213 | #endif |
| 1214 | // fillWmeTspecIE |
| 1215 | |
| 1216 | nStatus = dot11fGetPackedWMMAddTSRequestSize( pMac, &WMMAddTSReq, &nPayload ); |
| 1217 | if ( DOT11F_FAILED( nStatus ) ) |
| 1218 | { |
| 1219 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1220 | "or a WMM Add TS Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1221 | nStatus ); |
| 1222 | // We'll fall back on the worst case scenario: |
| 1223 | nPayload = sizeof( tDot11fAddTSRequest ); |
| 1224 | } |
| 1225 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1226 | { |
| 1227 | limLog( pMac, LOGW, FL("There were warnings while calculating" |
| 1228 | "the packed size for a WMM Add TS Requ" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1229 | "est (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1230 | } |
| 1231 | } |
| 1232 | |
| 1233 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 1234 | |
| 1235 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1236 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 1237 | ( void** ) &pPacket ); |
| 1238 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1239 | { |
| 1240 | 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] | 1241 | "d TS Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1242 | return; |
| 1243 | } |
| 1244 | |
| 1245 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1246 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1247 | |
| 1248 | // Next, we fill out the buffer descriptor: |
| 1249 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 1250 | SIR_MAC_MGMT_ACTION, peerMacAddr,psessionEntry->selfMacAddr); |
| 1251 | if ( eSIR_SUCCESS != nSirStatus ) |
| 1252 | { |
| 1253 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1254 | "tor for an Add TS Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1255 | nSirStatus ); |
| 1256 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1257 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1258 | return; |
| 1259 | } |
| 1260 | |
| 1261 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 1262 | |
| 1263 | #if 0 |
| 1264 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 1265 | if ( eSIR_SUCCESS != wlan_cfgGetStr( pMac, WNI_CFG_BSSID, |
| 1266 | ( tANI_U8* )pMacHdr->bssId, &cfgLen ) ) |
| 1267 | { |
| 1268 | limLog( pMac, LOGP, FL("Failed to retrieve WNI_CFG_BSSID whil" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1269 | "e sending an Add TS Request.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1270 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1271 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1272 | return; |
| 1273 | } |
| 1274 | #endif //TO SUPPORT BT-AMP |
| 1275 | |
| 1276 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 1277 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1278 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 1279 | limSetProtectedBit(pMac, psessionEntry, peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1280 | #endif |
| 1281 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1282 | // That done, pack the struct: |
| 1283 | if ( ! pAddTS->wmeTspecPresent ) |
| 1284 | { |
| 1285 | nStatus = dot11fPackAddTSRequest( pMac, &AddTSReq, |
| 1286 | pFrame + sizeof(tSirMacMgmtHdr), |
| 1287 | nPayload, &nPayload ); |
| 1288 | if ( DOT11F_FAILED( nStatus ) ) |
| 1289 | { |
| 1290 | limLog( pMac, LOGE, FL("Failed to pack an Add TS Request " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1291 | "(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1292 | nStatus ); |
| 1293 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1294 | return; // allocated! |
| 1295 | } |
| 1296 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1297 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1298 | limLog( pMac, LOGW, FL("There were warnings while packing " |
| 1299 | "an Add TS Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1300 | } |
| 1301 | } |
| 1302 | else |
| 1303 | { |
| 1304 | nStatus = dot11fPackWMMAddTSRequest( pMac, &WMMAddTSReq, |
| 1305 | pFrame + sizeof(tSirMacMgmtHdr), |
| 1306 | nPayload, &nPayload ); |
| 1307 | if ( DOT11F_FAILED( nStatus ) ) |
| 1308 | { |
| 1309 | 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] | 1310 | "st (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1311 | nStatus ); |
| 1312 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1313 | return; // allocated! |
| 1314 | } |
| 1315 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1316 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1317 | limLog( pMac, LOGW, FL("There were warnings while packing " |
| 1318 | "a WMM Add TS Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1319 | } |
| 1320 | } |
| 1321 | |
Abhishek Singh | 127a844 | 2014-12-15 17:31:27 +0530 | [diff] [blame] | 1322 | limLog( pMac, LOG1, FL("Sending an Add TS Request frame to ") ); |
| 1323 | limPrintMacAddr( pMac, peerMacAddr, LOG1 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1324 | |
| 1325 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1326 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 1327 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1328 | ) |
| 1329 | { |
| 1330 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 1331 | } |
| 1332 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 1333 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 1334 | psessionEntry->peSessionId, |
| 1335 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1336 | // Queue Addts Response frame in high priority WQ |
| 1337 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 1338 | HAL_TXRX_FRM_802_11_MGMT, |
| 1339 | ANI_TXDIR_TODS, |
| 1340 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 1341 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 1342 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 1343 | psessionEntry->peSessionId, |
| 1344 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1345 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1346 | { |
| 1347 | limLog( pMac, LOGE, FL( "*** Could not send an Add TS Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1348 | " (%X) ***" ), halstatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1349 | //Pkt will be freed up by the callback |
| 1350 | } |
| 1351 | |
| 1352 | } // End limSendAddtsReqActionFrame. |
| 1353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1354 | |
| 1355 | |
| 1356 | void |
| 1357 | limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, |
| 1358 | tANI_U16 statusCode, |
| 1359 | tANI_U16 aid, |
| 1360 | tSirMacAddr peerMacAddr, |
| 1361 | tANI_U8 subType, |
| 1362 | tpDphHashNode pSta,tpPESession psessionEntry) |
| 1363 | { |
| 1364 | static tDot11fAssocResponse frm; |
| 1365 | tANI_U8 *pFrame, *macAddr; |
| 1366 | tpSirMacMgmtHdr pMacHdr; |
| 1367 | tSirRetStatus nSirStatus; |
| 1368 | tANI_U8 lleMode = 0, fAddTS, edcaInclude = 0; |
| 1369 | tHalBitVal qosMode, wmeMode; |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 1370 | tANI_U32 nPayload, nStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1371 | void *pPacket; |
| 1372 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 1373 | tUpdateBeaconParams beaconParams; |
| 1374 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1375 | tANI_U32 addnIEPresent = false; |
| 1376 | tANI_U32 addnIELen=0; |
| 1377 | tANI_U8 addIE[WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN]; |
| 1378 | tpSirAssocReq pAssocReq = NULL; |
Mahesh A Saptasagar | 38c177e | 2014-10-17 18:55:48 +0530 | [diff] [blame] | 1379 | tANI_U16 addStripoffIELen = 0; |
| 1380 | tDot11fIEExtCap extractedExtCap; |
| 1381 | tANI_BOOLEAN extractedExtCapFlag = eANI_BOOLEAN_FALSE; |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 1382 | tANI_U32 nBytes = 0; |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 1383 | |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 1384 | #ifdef WLAN_FEATURE_11W |
| 1385 | tANI_U32 retryInterval; |
| 1386 | tANI_U32 maxRetries; |
| 1387 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1388 | |
| 1389 | if(NULL == psessionEntry) |
| 1390 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1391 | limLog( pMac, LOGE, FL("psessionEntry is NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1392 | return; |
| 1393 | } |
| 1394 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1395 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1396 | |
| 1397 | limGetQosMode(psessionEntry, &qosMode); |
| 1398 | limGetWmeMode(psessionEntry, &wmeMode); |
| 1399 | |
| 1400 | // An Add TS IE is added only if the AP supports it and the requesting |
| 1401 | // STA sent a traffic spec. |
| 1402 | fAddTS = ( qosMode && pSta && pSta->qos.addtsPresent ) ? 1 : 0; |
| 1403 | |
| 1404 | PopulateDot11fCapabilities( pMac, &frm.Capabilities, psessionEntry ); |
| 1405 | |
| 1406 | frm.Status.status = statusCode; |
| 1407 | |
| 1408 | frm.AID.associd = aid | LIM_AID_MASK; |
| 1409 | |
| 1410 | if ( NULL == pSta ) |
| 1411 | { |
| 1412 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, &frm.SuppRates,psessionEntry); |
| 1413 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, &frm.ExtSuppRates, psessionEntry ); |
| 1414 | } |
| 1415 | else |
| 1416 | { |
| 1417 | PopulateDot11fAssocRspRates( pMac, &frm.SuppRates, &frm.ExtSuppRates, |
| 1418 | pSta->supportedRates.llbRates, pSta->supportedRates.llaRates ); |
| 1419 | } |
| 1420 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1421 | if(psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 1422 | { |
| 1423 | if( pSta != NULL && eSIR_SUCCESS == statusCode ) |
| 1424 | { |
| 1425 | pAssocReq = |
| 1426 | (tpSirAssocReq) psessionEntry->parsedAssocReq[pSta->assocId]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1427 | /* populate P2P IE in AssocRsp when assocReq from the peer includes P2P IE */ |
| 1428 | if( pAssocReq != NULL && pAssocReq->addIEPresent ) { |
| 1429 | PopulateDot11AssocResP2PIE(pMac, &frm.P2PAssocRes, pAssocReq); |
| 1430 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1431 | } |
| 1432 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1433 | |
| 1434 | if ( NULL != pSta ) |
| 1435 | { |
| 1436 | if ( eHAL_SET == qosMode ) |
| 1437 | { |
| 1438 | if ( pSta->lleEnabled ) |
| 1439 | { |
| 1440 | lleMode = 1; |
| 1441 | if ( ( ! pSta->aniPeer ) || ( ! PROP_CAPABILITY_GET( 11EQOS, pSta->propCapability ) ) ) |
| 1442 | { |
| 1443 | PopulateDot11fEDCAParamSet( pMac, &frm.EDCAParamSet, psessionEntry); |
| 1444 | |
| 1445 | // FramesToDo:... |
| 1446 | // if ( fAddTS ) |
| 1447 | // { |
| 1448 | // tANI_U8 *pAf = pBody; |
| 1449 | // *pAf++ = SIR_MAC_QOS_ACTION_EID; |
| 1450 | // tANI_U32 tlen; |
| 1451 | // status = sirAddtsRspFill(pMac, pAf, statusCode, &pSta->qos.addts, NULL, |
| 1452 | // &tlen, bufLen - frameLen); |
| 1453 | // } // End if on Add TS. |
| 1454 | } |
| 1455 | } // End if on .11e enabled in 'pSta'. |
| 1456 | } // End if on QOS Mode on. |
| 1457 | |
| 1458 | if ( ( ! lleMode ) && ( eHAL_SET == wmeMode ) && pSta->wmeEnabled ) |
| 1459 | { |
| 1460 | if ( ( ! pSta->aniPeer ) || ( ! PROP_CAPABILITY_GET( WME, pSta->propCapability ) ) ) |
| 1461 | { |
| 1462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1463 | PopulateDot11fWMMParams( pMac, &frm.WMMParams, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1464 | |
| 1465 | if ( pSta->wsmEnabled ) |
| 1466 | { |
| 1467 | PopulateDot11fWMMCaps(&frm.WMMCaps ); |
| 1468 | } |
| 1469 | } |
| 1470 | } |
| 1471 | |
| 1472 | if ( pSta->aniPeer ) |
| 1473 | { |
| 1474 | if ( ( lleMode && PROP_CAPABILITY_GET( 11EQOS, pSta->propCapability ) ) || |
| 1475 | ( pSta->wmeEnabled && PROP_CAPABILITY_GET( WME, pSta->propCapability ) ) ) |
| 1476 | { |
| 1477 | edcaInclude = 1; |
| 1478 | } |
| 1479 | |
| 1480 | } // End if on Airgo peer. |
| 1481 | |
| 1482 | if ( pSta->mlmStaContext.htCapability && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1483 | psessionEntry->htCapability ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1484 | { |
Krishna Kumaar Natarajan | 025a860 | 2015-08-04 16:31:36 +0530 | [diff] [blame] | 1485 | limLog(pMac, LOG1, FL("Populate HT IEs in Assoc Response")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1486 | PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); |
Sachin Ahuja | c3a2623 | 2014-09-23 22:27:30 +0530 | [diff] [blame] | 1487 | /* |
| 1488 | *Check the STA capability and update the HTCaps accordingly |
| 1489 | */ |
| 1490 | frm.HTCaps.supportedChannelWidthSet = |
| 1491 | (pSta->htSupportedChannelWidthSet < psessionEntry->htSupportedChannelWidthSet) ? |
| 1492 | pSta->htSupportedChannelWidthSet : psessionEntry->htSupportedChannelWidthSet ; |
| 1493 | |
| 1494 | if (!frm.HTCaps.supportedChannelWidthSet) |
| 1495 | frm.HTCaps.shortGI40MHz = 0; |
| 1496 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1497 | PopulateDot11fHTInfo( pMac, &frm.HTInfo, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1498 | } |
Agrawal Ashish | b10d039 | 2015-08-06 16:18:20 +0530 | [diff] [blame] | 1499 | limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," |
| 1500 | "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), |
| 1501 | frm.HTCaps.supportedChannelWidthSet, frm.HTCaps.mimoPowerSave, |
| 1502 | frm.HTCaps.greenField, frm.HTCaps.shortGI20MHz, frm.HTCaps.shortGI40MHz, |
| 1503 | frm.HTCaps.dsssCckMode40MHz, frm.HTCaps.maxRxAMPDUFactor); |
| 1504 | |
| 1505 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1506 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 1507 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 1508 | /* Populate Overlapping BSS Scan Parameters IEs, |
| 1509 | * when operating in HT40 in 2.4GHz. |
| 1510 | */ |
Hardik Kantilal Patel | 3c23524 | 2015-01-02 17:56:18 +0530 | [diff] [blame] | 1511 | if ((pMac->roam.configParam.apHT40_24GEnabled) |
| 1512 | && (IS_DOT11_MODE_HT(psessionEntry->dot11mode))) |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 1513 | { |
| 1514 | PopulateDot11fOBSSScanParameters( pMac, &frm.OBSSScanParameters, |
| 1515 | psessionEntry); |
Hardik Kantilal Patel | ee5874c | 2015-01-14 15:23:28 +0530 | [diff] [blame] | 1516 | /* 10.15.8 Support of DSSS/CCK in 40 MHz, An associated HT STA in |
| 1517 | * a 20/40 MHz BSS may generate DSSS/CCK transmissions.Set DSSS/CCK |
| 1518 | * Mode in 40 MHz bit in HT capablity. |
| 1519 | */ |
| 1520 | frm.HTCaps.dsssCckMode40MHz = 1; |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 1521 | } |
| 1522 | #endif |
| 1523 | |
| 1524 | PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1525 | #ifdef WLAN_FEATURE_11AC |
| 1526 | if( pSta->mlmStaContext.vhtCapability && |
| 1527 | psessionEntry->vhtCapability ) |
| 1528 | { |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 1529 | limLog( pMac, LOG1, FL("Populate VHT IEs in Assoc Response")); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 1530 | PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, |
| 1531 | psessionEntry->currentOperChannel, eSIR_TRUE ); |
| 1532 | PopulateDot11fVHTOperation( pMac, &frm.VHTOperation, |
| 1533 | psessionEntry->currentOperChannel); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1534 | } |
| 1535 | #endif |
| 1536 | |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 1537 | #ifdef WLAN_FEATURE_11W |
Dino Mycle | a7f1845 | 2014-04-24 08:55:31 +0530 | [diff] [blame] | 1538 | if( eSIR_MAC_TRY_AGAIN_LATER == statusCode ) |
| 1539 | { |
Chet Lanctot | fadc8e3 | 2014-04-24 14:50:52 -0700 | [diff] [blame] | 1540 | if ( wlan_cfgGetInt(pMac, WNI_CFG_PMF_SA_QUERY_MAX_RETRIES, |
| 1541 | &maxRetries ) != eSIR_SUCCESS ) |
| 1542 | limLog( pMac, LOGE, |
| 1543 | FL("Could not retrieve PMF SA Query maximum retries value") ); |
| 1544 | else |
| 1545 | if ( wlan_cfgGetInt(pMac, WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL, |
| 1546 | &retryInterval ) != eSIR_SUCCESS) |
| 1547 | limLog( pMac, LOGE, |
| 1548 | FL("Could not retrieve PMF SA Query timer interval value") ); |
Dino Mycle | a7f1845 | 2014-04-24 08:55:31 +0530 | [diff] [blame] | 1549 | else |
Chet Lanctot | fadc8e3 | 2014-04-24 14:50:52 -0700 | [diff] [blame] | 1550 | PopulateDot11fTimeoutInterval( |
| 1551 | pMac, &frm.TimeoutInterval, SIR_MAC_TI_TYPE_ASSOC_COMEBACK, |
| 1552 | (maxRetries - pSta->pmfSaQueryRetryCount) * retryInterval ); |
Dino Mycle | a7f1845 | 2014-04-24 08:55:31 +0530 | [diff] [blame] | 1553 | } |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 1554 | #endif |
Dino Mycle | a7f1845 | 2014-04-24 08:55:31 +0530 | [diff] [blame] | 1555 | } // End if on non-NULL 'pSta'. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1556 | |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 1557 | vos_mem_set(( tANI_U8* )&beaconParams, sizeof( tUpdateBeaconParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1558 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1559 | if( psessionEntry->limSystemRole == eLIM_AP_ROLE ){ |
| 1560 | if(psessionEntry->gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
| 1561 | limDecideApProtection(pMac, peerMacAddr, &beaconParams,psessionEntry); |
| 1562 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1563 | |
| 1564 | limUpdateShortPreamble(pMac, peerMacAddr, &beaconParams, psessionEntry); |
| 1565 | limUpdateShortSlotTime(pMac, peerMacAddr, &beaconParams, psessionEntry); |
| 1566 | |
| 1567 | beaconParams.bssIdx = psessionEntry->bssIdx; |
| 1568 | |
| 1569 | //Send message to HAL about beacon parameter change. |
| 1570 | if(beaconParams.paramChangeBitmap) |
| 1571 | { |
| 1572 | schSetFixedBeaconFields(pMac,psessionEntry); |
| 1573 | limSendBeaconParams(pMac, &beaconParams, psessionEntry ); |
| 1574 | } |
| 1575 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1576 | if ( pAssocReq != NULL ) |
| 1577 | { |
| 1578 | if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOC_RSP_ADDNIE_FLAG, |
| 1579 | &addnIEPresent) != eSIR_SUCCESS) |
| 1580 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1581 | limLog(pMac, LOGP, FL("Unable to get " |
| 1582 | "WNI_CFG_ASSOC_RSP_ADDNIE_FLAG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1583 | return; |
| 1584 | } |
| 1585 | |
| 1586 | if (addnIEPresent) |
| 1587 | { |
| 1588 | //Assoc rsp IE available |
| 1589 | if (wlan_cfgGetStrLen(pMac, WNI_CFG_ASSOC_RSP_ADDNIE_DATA, |
| 1590 | &addnIELen) != eSIR_SUCCESS) |
| 1591 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1592 | limLog(pMac, LOGP, FL("Unable to get " |
| 1593 | "WNI_CFG_ASSOC_RSP_ADDNIE_DATA length")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1594 | return; |
| 1595 | } |
| 1596 | |
| 1597 | if (addnIELen <= WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN && addnIELen && |
| 1598 | (nBytes + addnIELen) <= SIR_MAX_PACKET_SIZE) |
| 1599 | { |
| 1600 | if (wlan_cfgGetStr(pMac, WNI_CFG_ASSOC_RSP_ADDNIE_DATA, |
| 1601 | &addIE[0], &addnIELen) == eSIR_SUCCESS) |
| 1602 | { |
Mahesh A Saptasagar | 38c177e | 2014-10-17 18:55:48 +0530 | [diff] [blame] | 1603 | |
| 1604 | vos_mem_set(( tANI_U8* )&extractedExtCap, |
| 1605 | sizeof( tDot11fIEExtCap ), 0); |
Mahesh A Saptasagar | e00ff53 | 2014-10-17 19:05:14 +0530 | [diff] [blame] | 1606 | addStripoffIELen = addnIELen; |
Mahesh A Saptasagar | 38c177e | 2014-10-17 18:55:48 +0530 | [diff] [blame] | 1607 | nSirStatus = limStripOffExtCapIEAndUpdateStruct(pMac, |
| 1608 | &addIE[0], |
| 1609 | &addStripoffIELen, |
| 1610 | &extractedExtCap ); |
| 1611 | if(eSIR_SUCCESS != nSirStatus) |
| 1612 | { |
| 1613 | limLog(pMac, LOG1, |
| 1614 | FL("Unable to Stripoff ExtCap IE from Assoc Rsp")); |
| 1615 | } |
| 1616 | else |
| 1617 | { |
| 1618 | addnIELen = addStripoffIELen; |
| 1619 | extractedExtCapFlag = eANI_BOOLEAN_TRUE; |
| 1620 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1621 | nBytes = nBytes + addnIELen; |
| 1622 | } |
| 1623 | } |
| 1624 | } |
| 1625 | } |
| 1626 | |
Mahesh A Saptasagar | 38c177e | 2014-10-17 18:55:48 +0530 | [diff] [blame] | 1627 | /* merge the ExtCap struct*/ |
| 1628 | if (extractedExtCapFlag && extractedExtCap.present) |
| 1629 | { |
| 1630 | limMergeExtCapIEStruct(&(frm.ExtCap), &extractedExtCap); |
| 1631 | } |
| 1632 | |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 1633 | nStatus = dot11fGetPackedAssocResponseSize( pMac, &frm, &nPayload ); |
| 1634 | if ( DOT11F_FAILED( nStatus ) ) |
| 1635 | { |
| 1636 | limLog( pMac, LOGE, FL("Failed to calculate the packed size f" |
| 1637 | "or an Association Response (0x%08x)."), |
| 1638 | nStatus ); |
| 1639 | return; |
| 1640 | } |
| 1641 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1642 | { |
| 1643 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
| 1644 | "the packed size for an Association Re" |
| 1645 | "sponse (0x%08x)."), nStatus ); |
| 1646 | } |
| 1647 | |
| 1648 | nBytes += sizeof( tSirMacMgmtHdr ) + nPayload; |
| 1649 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1650 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1651 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 1652 | ( void** ) &pPacket ); |
| 1653 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1654 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1655 | limLog(pMac, LOGP, FL("Call to bufAlloc failed for RE/ASSOC RSP.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1656 | return; |
| 1657 | } |
| 1658 | |
| 1659 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1660 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1661 | |
| 1662 | // Next, we fill out the buffer descriptor: |
| 1663 | nSirStatus = limPopulateMacHeader( pMac, |
| 1664 | pFrame, |
| 1665 | SIR_MAC_MGMT_FRAME, |
| 1666 | ( LIM_ASSOC == subType ) ? |
| 1667 | SIR_MAC_MGMT_ASSOC_RSP : |
| 1668 | SIR_MAC_MGMT_REASSOC_RSP, |
| 1669 | peerMacAddr,psessionEntry->selfMacAddr); |
| 1670 | if ( eSIR_SUCCESS != nSirStatus ) |
| 1671 | { |
| 1672 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1673 | "tor for an Association Response (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1674 | nSirStatus ); |
| 1675 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1676 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1677 | return; |
| 1678 | } |
| 1679 | |
| 1680 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 1681 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1682 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 1683 | |
| 1684 | nStatus = dot11fPackAssocResponse( pMac, &frm, |
| 1685 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 1686 | nPayload, &nPayload ); |
| 1687 | if ( DOT11F_FAILED( nStatus ) ) |
| 1688 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 1689 | limLog( pMac, LOGE, FL("Failed to pack an Association Response" |
| 1690 | " (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1691 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 1692 | ( void* ) pFrame, ( void* ) pPacket ); |
| 1693 | return; // allocated! |
| 1694 | } |
| 1695 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1696 | { |
| 1697 | limLog( pMac, LOGW, FL("There were warnings while packing an " |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1698 | "Association Response (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1699 | } |
| 1700 | |
| 1701 | macAddr = pMacHdr->da; |
| 1702 | |
| 1703 | if (subType == LIM_ASSOC) |
| 1704 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1705 | limLog(pMac, LOG1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1706 | FL("*** Sending Assoc Resp status %d aid %d to "), |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1707 | statusCode, aid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1708 | } |
| 1709 | else{ |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1710 | limLog(pMac, LOG1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1711 | FL("*** Sending ReAssoc Resp status %d aid %d to "), |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1712 | statusCode, aid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1713 | } |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1714 | limPrintMacAddr(pMac, pMacHdr->da, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1715 | |
| 1716 | if ( addnIEPresent ) |
| 1717 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1718 | vos_mem_copy ( pFrame+sizeof(tSirMacMgmtHdr)+nPayload, &addIE[0], addnIELen ) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1719 | } |
| 1720 | |
| 1721 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1722 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 1723 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1724 | ) |
| 1725 | { |
| 1726 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 1727 | } |
| 1728 | |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 1729 | limLog( pMac, LOG1, FL("Sending Assoc resp over WQ5 to "MAC_ADDRESS_STR |
| 1730 | " From " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMacHdr->da), |
| 1731 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
| 1732 | |
| 1733 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 1734 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 1735 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 1736 | psessionEntry->peSessionId, |
| 1737 | pMacHdr->fc.subType)); |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 1738 | |
| 1739 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 1740 | { |
| 1741 | limLog(pMac, LOG1, FL("Re/AssocRsp - txBdToken %u"), pMac->lim.txBdToken); |
| 1742 | /// Queue Association Response frame in high priority WQ |
| 1743 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 1744 | HAL_TXRX_FRM_802_11_MGMT, |
| 1745 | ANI_TXDIR_TODS, |
| 1746 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 1747 | limTxComplete, pFrame, limTxBdComplete, |
| 1748 | txFlag, pMac->lim.txBdToken ); |
| 1749 | pMac->lim.txBdToken++; |
| 1750 | } |
| 1751 | else |
| 1752 | { |
| 1753 | /// Queue Association Response frame in high priority WQ |
| 1754 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 1755 | HAL_TXRX_FRM_802_11_MGMT, |
| 1756 | ANI_TXDIR_TODS, |
| 1757 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 1758 | limTxComplete, pFrame, txFlag ); |
| 1759 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 1760 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 1761 | psessionEntry->peSessionId, |
| 1762 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1763 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1764 | { |
| 1765 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1766 | FL("*** Could not Send Re/AssocRsp, retCode=%X ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1767 | nSirStatus); |
| 1768 | |
| 1769 | //Pkt will be freed up by the callback |
| 1770 | } |
| 1771 | |
| 1772 | // update the ANI peer station count |
| 1773 | //FIXME_PROTECTION : take care of different type of station |
| 1774 | // counter inside this function. |
| 1775 | limUtilCountStaAdd(pMac, pSta, psessionEntry); |
| 1776 | |
| 1777 | } // End limSendAssocRspMgmtFrame. |
| 1778 | |
| 1779 | |
| 1780 | |
| 1781 | void |
| 1782 | limSendAddtsRspActionFrame(tpAniSirGlobal pMac, |
| 1783 | tSirMacAddr peer, |
| 1784 | tANI_U16 nStatusCode, |
| 1785 | tSirAddtsReqInfo *pAddTS, |
| 1786 | tSirMacScheduleIE *pSchedule, |
| 1787 | tpPESession psessionEntry) |
| 1788 | { |
| 1789 | tANI_U8 *pFrame; |
| 1790 | tpSirMacMgmtHdr pMacHdr; |
| 1791 | tDot11fAddTSResponse AddTSRsp; |
| 1792 | tDot11fWMMAddTSResponse WMMAddTSRsp; |
| 1793 | tSirRetStatus nSirStatus; |
| 1794 | tANI_U32 i, nBytes, nPayload, nStatus; |
| 1795 | void *pPacket; |
| 1796 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 1797 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1798 | |
| 1799 | if(NULL == psessionEntry) |
| 1800 | { |
| 1801 | return; |
| 1802 | } |
| 1803 | |
| 1804 | if ( ! pAddTS->wmeTspecPresent ) |
| 1805 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1806 | vos_mem_set( ( tANI_U8* )&AddTSRsp, sizeof( AddTSRsp ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1807 | |
| 1808 | AddTSRsp.Category.category = SIR_MAC_ACTION_QOS_MGMT; |
| 1809 | AddTSRsp.Action.action = SIR_MAC_QOS_ADD_TS_RSP; |
| 1810 | AddTSRsp.DialogToken.token = pAddTS->dialogToken; |
| 1811 | AddTSRsp.Status.status = nStatusCode; |
| 1812 | |
| 1813 | // The TsDelay information element is only filled in for a specific |
| 1814 | // status code: |
| 1815 | if ( eSIR_MAC_TS_NOT_CREATED_STATUS == nStatusCode ) |
| 1816 | { |
| 1817 | if ( pAddTS->wsmTspecPresent ) |
| 1818 | { |
| 1819 | AddTSRsp.WMMTSDelay.version = 1; |
| 1820 | AddTSRsp.WMMTSDelay.delay = 10; |
| 1821 | AddTSRsp.WMMTSDelay.present = 1; |
| 1822 | } |
| 1823 | else |
| 1824 | { |
| 1825 | AddTSRsp.TSDelay.delay = 10; |
| 1826 | AddTSRsp.TSDelay.present = 1; |
| 1827 | } |
| 1828 | } |
| 1829 | |
| 1830 | if ( pAddTS->wsmTspecPresent ) |
| 1831 | { |
| 1832 | PopulateDot11fWMMTSPEC( &pAddTS->tspec, &AddTSRsp.WMMTSPEC ); |
| 1833 | } |
| 1834 | else |
| 1835 | { |
| 1836 | PopulateDot11fTSPEC( &pAddTS->tspec, &AddTSRsp.TSPEC ); |
| 1837 | } |
| 1838 | |
| 1839 | if ( pAddTS->wsmTspecPresent ) |
| 1840 | { |
| 1841 | AddTSRsp.num_WMMTCLAS = 0; |
| 1842 | AddTSRsp.num_TCLAS = pAddTS->numTclas; |
| 1843 | for ( i = 0; i < AddTSRsp.num_TCLAS; ++i) |
| 1844 | { |
| 1845 | PopulateDot11fTCLAS( pMac, &pAddTS->tclasInfo[i], |
| 1846 | &AddTSRsp.TCLAS[i] ); |
| 1847 | } |
| 1848 | } |
| 1849 | else |
| 1850 | { |
| 1851 | AddTSRsp.num_TCLAS = 0; |
| 1852 | AddTSRsp.num_WMMTCLAS = pAddTS->numTclas; |
| 1853 | for ( i = 0; i < AddTSRsp.num_WMMTCLAS; ++i) |
| 1854 | { |
| 1855 | PopulateDot11fWMMTCLAS( pMac, &pAddTS->tclasInfo[i], |
| 1856 | &AddTSRsp.WMMTCLAS[i] ); |
| 1857 | } |
| 1858 | } |
| 1859 | |
| 1860 | if ( pAddTS->tclasProcPresent ) |
| 1861 | { |
| 1862 | if ( pAddTS->wsmTspecPresent ) |
| 1863 | { |
| 1864 | AddTSRsp.WMMTCLASPROC.version = 1; |
| 1865 | AddTSRsp.WMMTCLASPROC.processing = pAddTS->tclasProc; |
| 1866 | AddTSRsp.WMMTCLASPROC.present = 1; |
| 1867 | } |
| 1868 | else |
| 1869 | { |
| 1870 | AddTSRsp.TCLASSPROC.processing = pAddTS->tclasProc; |
| 1871 | AddTSRsp.TCLASSPROC.present = 1; |
| 1872 | } |
| 1873 | } |
| 1874 | |
| 1875 | // schedule element is included only if requested in the tspec and we are |
| 1876 | // using hcca (or both edca and hcca) |
| 1877 | // 11e-D8.0 is inconsistent on whether the schedule element is included |
| 1878 | // based on tspec schedule bit or not. Sec 7.4.2.2. says one thing but |
| 1879 | // pg 46, line 17-18 says something else. So just include it and let the |
| 1880 | // sta figure it out |
| 1881 | if ((pSchedule != NULL) && |
| 1882 | ((pAddTS->tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) || |
| 1883 | (pAddTS->tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH))) |
| 1884 | { |
| 1885 | if ( pAddTS->wsmTspecPresent ) |
| 1886 | { |
| 1887 | PopulateDot11fWMMSchedule( pSchedule, &AddTSRsp.WMMSchedule ); |
| 1888 | } |
| 1889 | else |
| 1890 | { |
| 1891 | PopulateDot11fSchedule( pSchedule, &AddTSRsp.Schedule ); |
| 1892 | } |
| 1893 | } |
| 1894 | |
| 1895 | nStatus = dot11fGetPackedAddTSResponseSize( pMac, &AddTSRsp, &nPayload ); |
| 1896 | if ( DOT11F_FAILED( nStatus ) ) |
| 1897 | { |
| 1898 | limLog( pMac, LOGP, FL("Failed to calculate the packed si" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1899 | "ze for an Add TS Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1900 | nStatus ); |
| 1901 | // We'll fall back on the worst case scenario: |
| 1902 | nPayload = sizeof( tDot11fAddTSResponse ); |
| 1903 | } |
| 1904 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1905 | { |
| 1906 | limLog( pMac, LOGW, FL("There were warnings while calcula" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1907 | "ting the packed size for an Add TS" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1908 | " Response (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1909 | } |
| 1910 | } |
| 1911 | else |
| 1912 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1913 | vos_mem_set( ( tANI_U8* )&WMMAddTSRsp, sizeof( WMMAddTSRsp ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1914 | |
| 1915 | WMMAddTSRsp.Category.category = SIR_MAC_ACTION_WME; |
| 1916 | WMMAddTSRsp.Action.action = SIR_MAC_QOS_ADD_TS_RSP; |
| 1917 | WMMAddTSRsp.DialogToken.token = pAddTS->dialogToken; |
| 1918 | WMMAddTSRsp.StatusCode.statusCode = (tANI_U8)nStatusCode; |
| 1919 | |
| 1920 | PopulateDot11fWMMTSPEC( &pAddTS->tspec, &WMMAddTSRsp.WMMTSPEC ); |
| 1921 | |
| 1922 | nStatus = dot11fGetPackedWMMAddTSResponseSize( pMac, &WMMAddTSRsp, &nPayload ); |
| 1923 | if ( DOT11F_FAILED( nStatus ) ) |
| 1924 | { |
| 1925 | limLog( pMac, LOGP, FL("Failed to calculate the packed si" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1926 | "ze for a WMM Add TS Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1927 | nStatus ); |
| 1928 | // We'll fall back on the worst case scenario: |
| 1929 | nPayload = sizeof( tDot11fWMMAddTSResponse ); |
| 1930 | } |
| 1931 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1932 | { |
| 1933 | limLog( pMac, LOGW, FL("There were warnings while calcula" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1934 | "ting the packed size for a WMM Add" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1935 | "TS Response (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1936 | } |
| 1937 | } |
| 1938 | |
| 1939 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 1940 | |
| 1941 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 1942 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 1943 | { |
| 1944 | 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] | 1945 | "d TS Response."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1946 | return; |
| 1947 | } |
| 1948 | |
| 1949 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1950 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1951 | |
| 1952 | // Next, we fill out the buffer descriptor: |
| 1953 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 1954 | SIR_MAC_MGMT_ACTION, peer,psessionEntry->selfMacAddr); |
| 1955 | if ( eSIR_SUCCESS != nSirStatus ) |
| 1956 | { |
| 1957 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1958 | "tor for an Add TS Response (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1959 | nSirStatus ); |
| 1960 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1961 | return; // allocated! |
| 1962 | } |
| 1963 | |
| 1964 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 1965 | |
| 1966 | |
| 1967 | #if 0 |
| 1968 | if ( eSIR_SUCCESS != wlan_cfgGetStr( pMac, WNI_CFG_BSSID, |
| 1969 | ( tANI_U8* )pMacHdr->bssId, &cfgLen ) ) |
| 1970 | { |
| 1971 | limLog( pMac, LOGP, FL("Failed to retrieve WNI_CFG_BSSID whil" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1972 | "e sending an Add TS Response.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1973 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1974 | return; // allocated! |
| 1975 | } |
| 1976 | #endif //TO SUPPORT BT-AMP |
| 1977 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 1978 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1979 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 1980 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1981 | #endif |
| 1982 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1983 | // That done, pack the struct: |
| 1984 | if ( ! pAddTS->wmeTspecPresent ) |
| 1985 | { |
| 1986 | nStatus = dot11fPackAddTSResponse( pMac, &AddTSRsp, |
| 1987 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 1988 | nPayload, &nPayload ); |
| 1989 | if ( DOT11F_FAILED( nStatus ) ) |
| 1990 | { |
| 1991 | limLog( pMac, LOGE, FL("Failed to pack an Add TS Response " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1992 | "(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1993 | nStatus ); |
| 1994 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 1995 | return; |
| 1996 | } |
| 1997 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1998 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1999 | limLog( pMac, LOGW, FL("There were warnings while packing " |
| 2000 | "an Add TS Response (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2001 | } |
| 2002 | } |
| 2003 | else |
| 2004 | { |
| 2005 | nStatus = dot11fPackWMMAddTSResponse( pMac, &WMMAddTSRsp, |
| 2006 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 2007 | nPayload, &nPayload ); |
| 2008 | if ( DOT11F_FAILED( nStatus ) ) |
| 2009 | { |
| 2010 | 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] | 2011 | "(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2012 | nStatus ); |
| 2013 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 2014 | return; |
| 2015 | } |
| 2016 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2017 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 2018 | limLog( pMac, LOGW, FL("There were warnings while packing " |
| 2019 | "a WMM Add TS Response (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2020 | } |
| 2021 | } |
| 2022 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2023 | limLog( pMac, LOG1, FL("Sending an Add TS Response (status %d) to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2024 | nStatusCode ); |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2025 | limPrintMacAddr( pMac, pMacHdr->da, LOG1 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2026 | |
| 2027 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2028 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 2029 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2030 | ) |
| 2031 | { |
| 2032 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 2033 | } |
| 2034 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2035 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 2036 | psessionEntry->peSessionId, |
| 2037 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | // Queue the frame in high priority WQ: |
| 2039 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 2040 | HAL_TXRX_FRM_802_11_MGMT, |
| 2041 | ANI_TXDIR_TODS, |
| 2042 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 2043 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2044 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 2045 | psessionEntry->peSessionId, |
| 2046 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2047 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2048 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2049 | limLog( pMac, LOGE, FL("Failed to send Add TS Response (%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2050 | nSirStatus ); |
| 2051 | //Pkt will be freed up by the callback |
| 2052 | } |
| 2053 | |
| 2054 | } // End limSendAddtsRspActionFrame. |
| 2055 | |
| 2056 | void |
| 2057 | limSendDeltsReqActionFrame(tpAniSirGlobal pMac, |
| 2058 | tSirMacAddr peer, |
| 2059 | tANI_U8 wmmTspecPresent, |
| 2060 | tSirMacTSInfo *pTsinfo, |
| 2061 | tSirMacTspecIE *pTspecIe, |
| 2062 | tpPESession psessionEntry) |
| 2063 | { |
| 2064 | tANI_U8 *pFrame; |
| 2065 | tpSirMacMgmtHdr pMacHdr; |
| 2066 | tDot11fDelTS DelTS; |
| 2067 | tDot11fWMMDelTS WMMDelTS; |
| 2068 | tSirRetStatus nSirStatus; |
| 2069 | tANI_U32 nBytes, nPayload, nStatus; |
| 2070 | void *pPacket; |
| 2071 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 2072 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2073 | |
| 2074 | if(NULL == psessionEntry) |
| 2075 | { |
| 2076 | return; |
| 2077 | } |
| 2078 | |
| 2079 | if ( ! wmmTspecPresent ) |
| 2080 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2081 | vos_mem_set( ( tANI_U8* )&DelTS, sizeof( DelTS ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2082 | |
| 2083 | DelTS.Category.category = SIR_MAC_ACTION_QOS_MGMT; |
| 2084 | DelTS.Action.action = SIR_MAC_QOS_DEL_TS_REQ; |
| 2085 | PopulateDot11fTSInfo( pTsinfo, &DelTS.TSInfo ); |
| 2086 | |
| 2087 | nStatus = dot11fGetPackedDelTSSize( pMac, &DelTS, &nPayload ); |
| 2088 | if ( DOT11F_FAILED( nStatus ) ) |
| 2089 | { |
| 2090 | limLog( pMac, LOGP, FL("Failed to calculate the packed si" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2091 | "ze for a Del TS (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2092 | nStatus ); |
| 2093 | // We'll fall back on the worst case scenario: |
| 2094 | nPayload = sizeof( tDot11fDelTS ); |
| 2095 | } |
| 2096 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2097 | { |
| 2098 | limLog( pMac, LOGW, FL("There were warnings while calcula" |
| 2099 | "ting the packed size for a Del TS" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2100 | " (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2101 | } |
| 2102 | } |
| 2103 | else |
| 2104 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2105 | vos_mem_set( ( tANI_U8* )&WMMDelTS, sizeof( WMMDelTS ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2106 | |
| 2107 | WMMDelTS.Category.category = SIR_MAC_ACTION_WME; |
| 2108 | WMMDelTS.Action.action = SIR_MAC_QOS_DEL_TS_REQ; |
| 2109 | WMMDelTS.DialogToken.token = 0; |
| 2110 | WMMDelTS.StatusCode.statusCode = 0; |
| 2111 | PopulateDot11fWMMTSPEC( pTspecIe, &WMMDelTS.WMMTSPEC ); |
| 2112 | nStatus = dot11fGetPackedWMMDelTSSize( pMac, &WMMDelTS, &nPayload ); |
| 2113 | if ( DOT11F_FAILED( nStatus ) ) |
| 2114 | { |
| 2115 | limLog( pMac, LOGP, FL("Failed to calculate the packed si" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2116 | "ze for a WMM Del TS (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2117 | nStatus ); |
| 2118 | // We'll fall back on the worst case scenario: |
| 2119 | nPayload = sizeof( tDot11fDelTS ); |
| 2120 | } |
| 2121 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2122 | { |
| 2123 | limLog( pMac, LOGW, FL("There were warnings while calcula" |
| 2124 | "ting the packed size for a WMM De" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2125 | "l TS (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2126 | } |
| 2127 | } |
| 2128 | |
| 2129 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 2130 | |
| 2131 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 2132 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2133 | { |
| 2134 | 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] | 2135 | "d TS Response."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2136 | return; |
| 2137 | } |
| 2138 | |
| 2139 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2140 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2141 | |
| 2142 | // Next, we fill out the buffer descriptor: |
| 2143 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 2144 | SIR_MAC_MGMT_ACTION, peer, |
| 2145 | psessionEntry->selfMacAddr); |
| 2146 | if ( eSIR_SUCCESS != nSirStatus ) |
| 2147 | { |
| 2148 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2149 | "tor for an Add TS Response (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2150 | nSirStatus ); |
| 2151 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 2152 | return; // allocated! |
| 2153 | } |
| 2154 | |
| 2155 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 2156 | |
| 2157 | #if 0 |
| 2158 | |
| 2159 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 2160 | if ( eSIR_SUCCESS != wlan_cfgGetStr( pMac, WNI_CFG_BSSID, |
| 2161 | ( tANI_U8* )pMacHdr->bssId, &cfgLen ) ) |
| 2162 | { |
| 2163 | limLog( pMac, LOGP, FL("Failed to retrieve WNI_CFG_BSSID whil" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2164 | "e sending an Add TS Response.") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2165 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 2166 | return; // allocated! |
| 2167 | } |
| 2168 | #endif //TO SUPPORT BT-AMP |
| 2169 | sirCopyMacAddr(pMacHdr->bssId, psessionEntry->bssId); |
| 2170 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2171 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 2172 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2173 | #endif |
| 2174 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2175 | // That done, pack the struct: |
| 2176 | if ( !wmmTspecPresent ) |
| 2177 | { |
| 2178 | nStatus = dot11fPackDelTS( pMac, &DelTS, |
| 2179 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 2180 | nPayload, &nPayload ); |
| 2181 | if ( DOT11F_FAILED( nStatus ) ) |
| 2182 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2183 | 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] | 2184 | nStatus ); |
| 2185 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 2186 | return; // allocated! |
| 2187 | } |
| 2188 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2189 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 2190 | limLog( pMac, LOGW, FL("There were warnings while packing " |
| 2191 | "a Del TS frame (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2192 | } |
| 2193 | } |
| 2194 | else |
| 2195 | { |
| 2196 | nStatus = dot11fPackWMMDelTS( pMac, &WMMDelTS, |
| 2197 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 2198 | nPayload, &nPayload ); |
| 2199 | if ( DOT11F_FAILED( nStatus ) ) |
| 2200 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2201 | 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] | 2202 | nStatus ); |
| 2203 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 2204 | return; // allocated! |
| 2205 | } |
| 2206 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2207 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 2208 | limLog( pMac, LOGW, FL("There were warnings while packing " |
| 2209 | "a WMM Del TS frame (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2210 | } |
| 2211 | } |
| 2212 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2213 | limLog(pMac, LOG1, FL("Sending DELTS REQ (size %d) to "), nBytes); |
| 2214 | limPrintMacAddr(pMac, pMacHdr->da, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2215 | |
| 2216 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2217 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 2218 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2219 | ) |
| 2220 | { |
| 2221 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 2222 | } |
| 2223 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2224 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 2225 | psessionEntry->peSessionId, |
| 2226 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2227 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 2228 | HAL_TXRX_FRM_802_11_MGMT, |
| 2229 | ANI_TXDIR_TODS, |
| 2230 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 2231 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2232 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 2233 | psessionEntry->peSessionId, |
| 2234 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2235 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2236 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2237 | limLog( pMac, LOGE, FL("Failed to send Del TS (%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2238 | nSirStatus ); |
| 2239 | //Pkt will be freed up by the callback |
| 2240 | } |
| 2241 | |
| 2242 | } // End limSendDeltsReqActionFrame. |
| 2243 | |
| 2244 | void |
| 2245 | limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, |
| 2246 | tLimMlmAssocReq *pMlmAssocReq, |
| 2247 | tpPESession psessionEntry) |
| 2248 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2249 | tDot11fAssocRequest *pFrm; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2250 | tANI_U16 caps; |
| 2251 | tANI_U8 *pFrame; |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 2252 | tSirRetStatus nSirStatus = eSIR_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2253 | tLimMlmAssocCnf mlmAssocCnf; |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 2254 | tANI_U32 nPayload, nStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2255 | tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; |
| 2256 | void *pPacket; |
| 2257 | eHalStatus halstatus; |
| 2258 | tANI_U16 nAddIELen; |
| 2259 | tANI_U8 *pAddIE; |
| 2260 | tANI_U8 *wpsIe = NULL; |
| 2261 | #if defined WLAN_FEATURE_VOWIFI |
| 2262 | tANI_U8 PowerCapsPopulated = FALSE; |
| 2263 | #endif |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 2264 | tANI_U32 txFlag = 0; |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2265 | tpSirMacMgmtHdr pMacHdr; |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 2266 | tDot11fIEExtCap extractedExtCap; |
| 2267 | tANI_BOOLEAN extractedExtCapFlag = eANI_BOOLEAN_TRUE; |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 2268 | tANI_U32 nBytes = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2269 | |
| 2270 | if(NULL == psessionEntry) |
| 2271 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2272 | limLog(pMac, LOGE, FL("psessionEntry is NULL") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2273 | return; |
| 2274 | } |
| 2275 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2276 | /* check this early to avoid unncessary operation */ |
| 2277 | if(NULL == psessionEntry->pLimJoinReq) |
| 2278 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2279 | limLog(pMac, LOGE, FL("psessionEntry->pLimJoinReq is NULL") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2280 | return; |
| 2281 | } |
| 2282 | nAddIELen = psessionEntry->pLimJoinReq->addIEAssoc.length; |
| 2283 | pAddIE = psessionEntry->pLimJoinReq->addIEAssoc.addIEdata; |
| 2284 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2285 | pFrm = vos_mem_malloc(sizeof(tDot11fAssocRequest)); |
| 2286 | if ( NULL == pFrm ) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2287 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2288 | limLog(pMac, LOGE, FL("Unable to allocate memory") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2289 | return; |
| 2290 | } |
| 2291 | |
| 2292 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2293 | vos_mem_set( ( tANI_U8* )pFrm, sizeof( tDot11fAssocRequest ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2294 | |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 2295 | vos_mem_set(( tANI_U8* )&extractedExtCap, sizeof( tDot11fIEExtCap ), 0); |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 2296 | if (psessionEntry->is_ext_caps_present) |
| 2297 | { |
| 2298 | nSirStatus = limStripOffExtCapIEAndUpdateStruct(pMac, pAddIE, |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 2299 | &nAddIELen, |
| 2300 | &extractedExtCap ); |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 2301 | } |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 2302 | if(eSIR_SUCCESS != nSirStatus ) |
| 2303 | { |
| 2304 | extractedExtCapFlag = eANI_BOOLEAN_FALSE; |
| 2305 | limLog(pMac, LOG1, |
| 2306 | FL("Unable to Stripoff ExtCap IE from Assoc Req")); |
| 2307 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 2f9b571 | 2014-05-06 00:09:42 -0700 | [diff] [blame] | 2308 | /* TODO:remove this code once driver provides the call back function |
| 2309 | * to supplicant for set_qos_map |
| 2310 | */ |
| 2311 | else |
| 2312 | { |
Abhishek Singh | c601a47 | 2016-01-20 11:08:32 +0530 | [diff] [blame] | 2313 | if (extractedExtCap.interworkingService || |
| 2314 | extractedExtCap.bssTransition) |
Leela Venkata Kiran Kumar Reddy Chirala | 2f9b571 | 2014-05-06 00:09:42 -0700 | [diff] [blame] | 2315 | { |
| 2316 | extractedExtCap.qosMap = 1; |
| 2317 | } |
Abhishek Singh | 15d9560 | 2015-03-24 15:52:57 +0530 | [diff] [blame] | 2318 | /* No need to merge the EXT Cap from Supplicant |
Abhishek Singh | c601a47 | 2016-01-20 11:08:32 +0530 | [diff] [blame] | 2319 | * if interworkingService or bsstransition is not set, |
| 2320 | * as currently driver is only interested in interworkingService |
| 2321 | * and bsstransition capability from supplicant. if in |
Abhishek Singh | 15d9560 | 2015-03-24 15:52:57 +0530 | [diff] [blame] | 2322 | * future any other EXT Cap info is required from |
| 2323 | * supplicant it needs to be handled here. |
| 2324 | */ |
| 2325 | else |
| 2326 | { |
| 2327 | extractedExtCapFlag = eANI_BOOLEAN_FALSE; |
| 2328 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 2f9b571 | 2014-05-06 00:09:42 -0700 | [diff] [blame] | 2329 | } |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 2330 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2331 | caps = pMlmAssocReq->capabilityInfo; |
| 2332 | if ( PROP_CAPABILITY_GET( 11EQOS, psessionEntry->limCurrentBssPropCap ) ) |
| 2333 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 2334 | #if defined(FEATURE_WLAN_WAPI) |
| 2335 | /* CR: 262463 : |
| 2336 | According to WAPI standard: |
| 2337 | 7.3.1.4 Capability Information field |
| 2338 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 2339 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 2340 | Reassociation management frames. */ |
| 2341 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 2342 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 2343 | #endif |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2344 | swapBitField16(caps, ( tANI_U16* )&pFrm->Capabilities ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2345 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2346 | pFrm->ListenInterval.interval = pMlmAssocReq->listenInterval; |
| 2347 | PopulateDot11fSSID2( pMac, &pFrm->SSID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2348 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2349 | &pFrm->SuppRates,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2350 | |
| 2351 | fQosEnabled = ( psessionEntry->limQosEnabled) && |
| 2352 | SIR_MAC_GET_QOS( psessionEntry->limCurrentBssCaps ); |
| 2353 | |
| 2354 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 2355 | LIM_BSS_CAPS_GET( WME, psessionEntry->limCurrentBssQosCaps ); |
| 2356 | |
| 2357 | // We prefer .11e asociations: |
| 2358 | if ( fQosEnabled ) fWmeEnabled = false; |
| 2359 | |
| 2360 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 2361 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limCurrentBssQosCaps ); |
| 2362 | |
| 2363 | if ( psessionEntry->lim11hEnable && |
| 2364 | psessionEntry->pLimJoinReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 2365 | { |
| 2366 | #if defined WLAN_FEATURE_VOWIFI |
| 2367 | PowerCapsPopulated = TRUE; |
| 2368 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2369 | PopulateDot11fPowerCaps( pMac, &pFrm->PowerCaps, LIM_ASSOC,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2370 | #endif |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2371 | PopulateDot11fSuppChannels( pMac, &pFrm->SuppChannels, LIM_ASSOC,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2372 | |
| 2373 | } |
| 2374 | |
| 2375 | #if defined WLAN_FEATURE_VOWIFI |
| 2376 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2377 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2378 | { |
| 2379 | if (PowerCapsPopulated == FALSE) |
| 2380 | { |
| 2381 | PowerCapsPopulated = TRUE; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2382 | PopulateDot11fPowerCaps(pMac, &pFrm->PowerCaps, LIM_ASSOC, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2383 | } |
| 2384 | } |
| 2385 | #endif |
| 2386 | |
| 2387 | if ( fQosEnabled && |
| 2388 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limCurrentBssPropCap))) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2389 | PopulateDot11fQOSCapsStation( pMac, &pFrm->QOSCapsStation ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2390 | |
| 2391 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2392 | &pFrm->ExtSuppRates, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2393 | |
| 2394 | #if defined WLAN_FEATURE_VOWIFI |
| 2395 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2396 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2397 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2398 | PopulateDot11fRRMIe( pMac, &pFrm->RRMEnabledCap, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2399 | } |
| 2400 | #endif |
| 2401 | // The join request *should* contain zero or one of the WPA and RSN |
| 2402 | // IEs. The payload send along with the request is a |
| 2403 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 2404 | |
| 2405 | // typedef struct sSirRSNie |
| 2406 | // { |
| 2407 | // tANI_U16 length; |
| 2408 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 2409 | // } tSirRSNie, *tpSirRSNie; |
| 2410 | |
| 2411 | // So, we should be able to make the following two calls harmlessly, |
| 2412 | // since they do nothing if they don't find the given IE in the |
| 2413 | // bytestream with which they're provided. |
| 2414 | |
| 2415 | // The net effect of this will be to faithfully transmit whatever |
| 2416 | // security IE is in the join request. |
| 2417 | |
| 2418 | // *However*, if we're associating for the purpose of WPS |
| 2419 | // enrollment, and we've been configured to indicate that by |
| 2420 | // eliding the WPA or RSN IE, we just skip this: |
| 2421 | if( nAddIELen && pAddIE ) |
| 2422 | { |
| 2423 | wpsIe = limGetWscIEPtr (pMac, pAddIE, nAddIELen); |
| 2424 | } |
| 2425 | if ( NULL == wpsIe ) |
| 2426 | { |
| 2427 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2428 | &pFrm->RSNOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2429 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2430 | &pFrm->WPAOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2431 | #if defined(FEATURE_WLAN_WAPI) |
| 2432 | PopulateDot11fWAPIOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2433 | &pFrm->WAPIOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2434 | #endif // defined(FEATURE_WLAN_WAPI) |
| 2435 | } |
| 2436 | |
| 2437 | // include WME EDCA IE as well |
| 2438 | if ( fWmeEnabled ) |
| 2439 | { |
| 2440 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limCurrentBssPropCap ) ) |
| 2441 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2442 | PopulateDot11fWMMInfoStation( pMac, &pFrm->WMMInfoStation ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2443 | } |
| 2444 | |
| 2445 | if ( fWsmEnabled && |
| 2446 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limCurrentBssPropCap ))) |
| 2447 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2448 | PopulateDot11fWMMCaps( &pFrm->WMMCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2449 | } |
| 2450 | } |
| 2451 | |
| 2452 | //Populate HT IEs, when operating in 11n or Taurus modes AND |
| 2453 | //when AP is also operating in 11n mode. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2454 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2455 | pMac->lim.htCapabilityPresentInBeacon) |
| 2456 | { |
Krishna Kumaar Natarajan | 025a860 | 2015-08-04 16:31:36 +0530 | [diff] [blame] | 2457 | limLog(pMac, LOG1, FL("Populate HT IEs in Assoc Request")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2458 | PopulateDot11fHTCaps( pMac, psessionEntry, &pFrm->HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2459 | #ifdef DISABLE_GF_FOR_INTEROP |
| 2460 | |
| 2461 | /* |
| 2462 | * To resolve the interop problem with Broadcom AP, |
| 2463 | * where TQ STA could not pass traffic with GF enabled, |
| 2464 | * TQ STA will do Greenfield only with TQ AP, for |
| 2465 | * everybody else it will be turned off. |
| 2466 | */ |
| 2467 | |
| 2468 | if( (psessionEntry->pLimJoinReq != NULL) && (!psessionEntry->pLimJoinReq->bssDescription.aniIndicator)) |
| 2469 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2470 | limLog( pMac, LOG1, FL("Sending Assoc Req to Non-TQ AP," |
| 2471 | " Turning off Greenfield")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2472 | pFrm->HTCaps.greenField = WNI_CFG_GREENFIELD_CAPABILITY_DISABLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2473 | } |
| 2474 | #endif |
| 2475 | |
| 2476 | } |
Agrawal Ashish | b10d039 | 2015-08-06 16:18:20 +0530 | [diff] [blame] | 2477 | |
| 2478 | limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," |
| 2479 | "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), |
| 2480 | pFrm->HTCaps.supportedChannelWidthSet, pFrm->HTCaps.mimoPowerSave, |
| 2481 | pFrm->HTCaps.greenField, pFrm->HTCaps.shortGI20MHz, pFrm->HTCaps.shortGI40MHz, |
| 2482 | pFrm->HTCaps.dsssCckMode40MHz, pFrm->HTCaps.maxRxAMPDUFactor); |
| 2483 | |
| 2484 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2485 | #ifdef WLAN_FEATURE_11AC |
| 2486 | if ( psessionEntry->vhtCapability && |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2487 | psessionEntry->vhtCapabilityPresentInBeacon) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2488 | { |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 2489 | limLog( pMac, LOG1, FL("Populate VHT IEs in Assoc Request")); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 2490 | PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps, |
| 2491 | psessionEntry->currentOperChannel, eSIR_FALSE ); |
Abhishek Singh | e038dc6 | 2015-05-22 11:36:45 +0530 | [diff] [blame] | 2492 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2493 | } |
| 2494 | #endif |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 2495 | if (psessionEntry->is_ext_caps_present) |
| 2496 | PopulateDot11fExtCap( pMac, &pFrm->ExtCap, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2497 | |
| 2498 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2499 | if (psessionEntry->pLimJoinReq->is11Rconnection) |
| 2500 | { |
| 2501 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2502 | limLog( pMac, LOG1, FL("mdie = %02x %02x %02x"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2503 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[0], |
| 2504 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[1], |
| 2505 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[2]); |
| 2506 | #endif |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2507 | PopulateMDIE( pMac, &pFrm->MobilityDomain, |
| 2508 | psessionEntry->pLimJoinReq->bssDescription.mdie); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2509 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2510 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2511 | { |
| 2512 | // No 11r IEs dont send any MDIE |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2513 | limLog( pMac, LOG1, FL("MDIE not present")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2514 | } |
| 2515 | #endif |
| 2516 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2517 | #ifdef FEATURE_WLAN_ESE |
| 2518 | /* For ESE Associations fill the ESE IEs */ |
| 2519 | if (psessionEntry->isESEconnection && |
| 2520 | psessionEntry->pLimJoinReq->isESEFeatureIniEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2521 | { |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2522 | #ifndef FEATURE_DISABLE_RM |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2523 | PopulateDot11fESERadMgmtCap(&pFrm->ESERadMgmtCap); |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2524 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2525 | PopulateDot11fESEVersion(&pFrm->ESEVersion); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2526 | } |
| 2527 | #endif |
| 2528 | |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 2529 | /* merge the ExtCap struct*/ |
| 2530 | if (extractedExtCapFlag && extractedExtCap.present) |
| 2531 | { |
| 2532 | limMergeExtCapIEStruct(&pFrm->ExtCap, &extractedExtCap); |
| 2533 | } |
| 2534 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2535 | nStatus = dot11fGetPackedAssocRequestSize( pMac, pFrm, &nPayload ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2536 | if ( DOT11F_FAILED( nStatus ) ) |
| 2537 | { |
| 2538 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2539 | "or an Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2540 | nStatus ); |
| 2541 | // We'll fall back on the worst case scenario: |
| 2542 | nPayload = sizeof( tDot11fAssocRequest ); |
| 2543 | } |
| 2544 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2545 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 2546 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2547 | "the packed size for an Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2548 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2549 | } |
| 2550 | |
| 2551 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
| 2552 | |
| 2553 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2554 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 2555 | ( void** ) &pPacket ); |
| 2556 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2557 | { |
| 2558 | 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] | 2559 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2560 | |
| 2561 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2562 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2563 | |
| 2564 | |
| 2565 | /* Update PE session id*/ |
| 2566 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 2567 | |
| 2568 | mlmAssocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 2569 | |
| 2570 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2571 | ( void* ) pFrame, ( void* ) pPacket ); |
| 2572 | |
| 2573 | limPostSmeMessage( pMac, LIM_MLM_ASSOC_CNF, |
| 2574 | ( tANI_U32* ) &mlmAssocCnf); |
| 2575 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2576 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2577 | return; |
| 2578 | } |
| 2579 | |
| 2580 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2581 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2582 | |
| 2583 | // Next, we fill out the buffer descriptor: |
| 2584 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 2585 | SIR_MAC_MGMT_ASSOC_REQ, psessionEntry->bssId,psessionEntry->selfMacAddr); |
| 2586 | if ( eSIR_SUCCESS != nSirStatus ) |
| 2587 | { |
| 2588 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2589 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2590 | nSirStatus ); |
| 2591 | 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] | 2592 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2593 | return; |
| 2594 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2595 | |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2596 | // That done, pack the Assoc Request: |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2597 | nStatus = dot11fPackAssocRequest( pMac, pFrm, pFrame + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2598 | sizeof(tSirMacMgmtHdr), |
| 2599 | nPayload, &nPayload ); |
| 2600 | if ( DOT11F_FAILED( nStatus ) ) |
| 2601 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2602 | limLog( pMac, LOGE, FL("Failed to pack a Assoc Request (0x%0" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2603 | "8x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2604 | nStatus ); |
| 2605 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2606 | ( void* ) pFrame, ( void* ) pPacket ); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2607 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2608 | return; |
| 2609 | } |
| 2610 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2611 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2612 | limLog( pMac, LOGW, FL("There were warnings while packing a Assoc" |
| 2613 | "Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2614 | } |
| 2615 | |
| 2616 | PELOG1(limLog( pMac, LOG1, FL("*** Sending Association Request length %d" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2617 | "to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2618 | nBytes );) |
| 2619 | // limPrintMacAddr( pMac, bssid, LOG1 ); |
| 2620 | |
| 2621 | if( psessionEntry->assocReq != NULL ) |
| 2622 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2623 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2624 | psessionEntry->assocReq = NULL; |
| 2625 | } |
| 2626 | |
| 2627 | if( nAddIELen ) |
| 2628 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2629 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 2630 | pAddIE, |
| 2631 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2632 | nPayload += nAddIELen; |
| 2633 | } |
| 2634 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2635 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 2636 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2637 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2638 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store " |
| 2639 | "assoc request"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2640 | } |
| 2641 | else |
| 2642 | { |
| 2643 | //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] | 2644 | vos_mem_copy( psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2645 | psessionEntry->assocReqLen = nPayload; |
| 2646 | } |
| 2647 | |
| 2648 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2649 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 2650 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2651 | ) |
| 2652 | { |
| 2653 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 2654 | } |
| 2655 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 2656 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || |
| 2657 | psessionEntry->pePersona == VOS_STA_MODE) |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 2658 | { |
| 2659 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 2660 | } |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame] | 2661 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 2662 | limDiagEventReport(pMac, WLAN_PE_DIAG_ASSOC_START_EVENT, psessionEntry, |
| 2663 | eSIR_SUCCESS, eSIR_SUCCESS); |
| 2664 | #endif |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2665 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 2666 | limLog( pMac, LOG1, FL("Sending Assoc req over WQ5 to "MAC_ADDRESS_STR |
| 2667 | " From " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMacHdr->da), |
| 2668 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
| 2669 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 2670 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2671 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 2672 | psessionEntry->peSessionId, |
| 2673 | pMacHdr->fc.subType)); |
Katya Nigam | 6390293 | 2014-06-26 19:04:23 +0530 | [diff] [blame] | 2674 | |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 2675 | if( ( psessionEntry->is11Gonly == true ) && |
| 2676 | ( !IS_BROADCAST_MAC(pMlmAssocReq->peerMacAddr) ) ){ |
| 2677 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 2678 | } |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 2679 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 2680 | { |
| 2681 | limLog(pMac, LOG1, FL("Assoc Req - txBdToken %u"), pMac->lim.txBdToken); |
| 2682 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, |
| 2683 | ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 2684 | HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, |
| 2685 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 2686 | limTxComplete, pFrame, limTxBdComplete, txFlag, |
| 2687 | pMac->lim.txBdToken); |
| 2688 | pMac->lim.txBdToken++; |
| 2689 | } |
| 2690 | else |
| 2691 | { |
| 2692 | halstatus = halTxFrame( pMac, pPacket, |
| 2693 | ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 2694 | HAL_TXRX_FRM_802_11_MGMT, |
| 2695 | ANI_TXDIR_TODS, |
| 2696 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 2697 | limTxComplete, pFrame, txFlag ); |
| 2698 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2699 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 2700 | psessionEntry->peSessionId, |
| 2701 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2702 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2703 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2704 | limLog( pMac, LOGE, FL("Failed to send Association Request (%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2705 | halstatus ); |
| 2706 | //Pkt will be freed up by the callback |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2707 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2708 | return; |
| 2709 | } |
| 2710 | |
Katya Nigam | ccaeda7 | 2015-04-20 18:51:22 +0530 | [diff] [blame] | 2711 | //Enable caching only if Assoc Request is successfully submitted to the h/w |
| 2712 | WLANTL_EnableCaching(psessionEntry->staId); |
| 2713 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2714 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2715 | vos_mem_free(pMlmAssocReq); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2716 | pMlmAssocReq = NULL; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2717 | vos_mem_free(pFrm); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2718 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2719 | } // End limSendAssocReqMgmtFrame |
| 2720 | |
| 2721 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2722 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2723 | /*------------------------------------------------------------------------------------ |
| 2724 | * |
| 2725 | * Send Reassoc Req with FTIEs. |
| 2726 | * |
| 2727 | *----------------------------------------------------------------------------------- |
| 2728 | */ |
| 2729 | void |
| 2730 | limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, |
| 2731 | tLimMlmReassocReq *pMlmReassocReq,tpPESession psessionEntry) |
| 2732 | { |
| 2733 | static tDot11fReAssocRequest frm; |
| 2734 | tANI_U16 caps; |
| 2735 | tANI_U8 *pFrame; |
| 2736 | tSirRetStatus nSirStatus; |
| 2737 | tANI_U32 nBytes, nPayload, nStatus; |
| 2738 | tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; |
| 2739 | void *pPacket; |
| 2740 | eHalStatus halstatus; |
| 2741 | #if defined WLAN_FEATURE_VOWIFI |
| 2742 | tANI_U8 PowerCapsPopulated = FALSE; |
| 2743 | #endif |
| 2744 | tANI_U16 ft_ies_length = 0; |
| 2745 | tANI_U8 *pBody; |
| 2746 | tANI_U16 nAddIELen; |
| 2747 | tANI_U8 *pAddIE; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2748 | #if defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2749 | tANI_U8 *wpsIe = NULL; |
| 2750 | #endif |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 2751 | tANI_U32 txFlag = 0; |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2752 | tpSirMacMgmtHdr pMacHdr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2753 | |
| 2754 | if (NULL == psessionEntry) |
| 2755 | { |
| 2756 | return; |
| 2757 | } |
| 2758 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2759 | /* check this early to avoid unncessary operation */ |
| 2760 | if(NULL == psessionEntry->pLimReAssocReq) |
| 2761 | { |
| 2762 | return; |
| 2763 | } |
| 2764 | nAddIELen = psessionEntry->pLimReAssocReq->addIEAssoc.length; |
| 2765 | pAddIE = psessionEntry->pLimReAssocReq->addIEAssoc.addIEdata; |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 2766 | limLog( pMac, LOG1, FL("limSendReassocReqWithFTIEsMgmtFrame received in " |
| 2767 | "state (%d)."), psessionEntry->limMlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2768 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2769 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2770 | |
| 2771 | caps = pMlmReassocReq->capabilityInfo; |
| 2772 | if (PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap)) |
| 2773 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 2774 | #if defined(FEATURE_WLAN_WAPI) |
| 2775 | /* CR: 262463 : |
| 2776 | According to WAPI standard: |
| 2777 | 7.3.1.4 Capability Information field |
| 2778 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 2779 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 2780 | Reassociation management frames. */ |
| 2781 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 2782 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 2783 | #endif |
| 2784 | swapBitField16(caps, ( tANI_U16* )&frm.Capabilities ); |
| 2785 | |
| 2786 | frm.ListenInterval.interval = pMlmReassocReq->listenInterval; |
| 2787 | |
| 2788 | // Get the old bssid of the older AP. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2789 | vos_mem_copy( ( tANI_U8* )frm.CurrentAPAddress.mac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2790 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, 6); |
| 2791 | |
| 2792 | PopulateDot11fSSID2( pMac, &frm.SSID ); |
| 2793 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 2794 | &frm.SuppRates,psessionEntry); |
| 2795 | |
| 2796 | fQosEnabled = ( psessionEntry->limQosEnabled) && |
| 2797 | SIR_MAC_GET_QOS( psessionEntry->limReassocBssCaps ); |
| 2798 | |
| 2799 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 2800 | LIM_BSS_CAPS_GET( WME, psessionEntry->limReassocBssQosCaps ); |
| 2801 | |
| 2802 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 2803 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limReassocBssQosCaps ); |
| 2804 | |
| 2805 | if ( psessionEntry->lim11hEnable && |
| 2806 | psessionEntry->pLimReAssocReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 2807 | { |
| 2808 | #if defined WLAN_FEATURE_VOWIFI |
| 2809 | PowerCapsPopulated = TRUE; |
| 2810 | |
| 2811 | PopulateDot11fPowerCaps( pMac, &frm.PowerCaps, LIM_REASSOC,psessionEntry); |
| 2812 | PopulateDot11fSuppChannels( pMac, &frm.SuppChannels, LIM_REASSOC,psessionEntry); |
| 2813 | #endif |
| 2814 | } |
| 2815 | |
| 2816 | #if defined WLAN_FEATURE_VOWIFI |
| 2817 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2818 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2819 | { |
| 2820 | if (PowerCapsPopulated == FALSE) |
| 2821 | { |
| 2822 | PowerCapsPopulated = TRUE; |
| 2823 | PopulateDot11fPowerCaps(pMac, &frm.PowerCaps, LIM_REASSOC, psessionEntry); |
| 2824 | } |
| 2825 | } |
| 2826 | #endif |
| 2827 | |
| 2828 | if ( fQosEnabled && |
| 2829 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap ) )) |
| 2830 | { |
| 2831 | PopulateDot11fQOSCapsStation( pMac, &frm.QOSCapsStation ); |
| 2832 | } |
| 2833 | |
| 2834 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 2835 | &frm.ExtSuppRates, psessionEntry ); |
| 2836 | |
| 2837 | #if defined WLAN_FEATURE_VOWIFI |
| 2838 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2839 | SIR_MAC_GET_RRM( psessionEntry->limReassocBssCaps ) ) |
| 2840 | { |
| 2841 | PopulateDot11fRRMIe( pMac, &frm.RRMEnabledCap, psessionEntry ); |
| 2842 | } |
| 2843 | #endif |
| 2844 | |
| 2845 | // Ideally this should be enabled for 11r also. But 11r does |
| 2846 | // not follow the usual norm of using the Opaque object |
| 2847 | // for rsnie and fties. Instead we just add |
| 2848 | // the rsnie and fties at the end of the pack routine for 11r. |
| 2849 | // This should ideally! be fixed. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2850 | #if defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2851 | // |
| 2852 | // The join request *should* contain zero or one of the WPA and RSN |
| 2853 | // IEs. The payload send along with the request is a |
| 2854 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 2855 | |
| 2856 | // typedef struct sSirRSNie |
| 2857 | // { |
| 2858 | // tANI_U16 length; |
| 2859 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 2860 | // } tSirRSNie, *tpSirRSNie; |
| 2861 | |
| 2862 | // So, we should be able to make the following two calls harmlessly, |
| 2863 | // since they do nothing if they don't find the given IE in the |
| 2864 | // bytestream with which they're provided. |
| 2865 | |
| 2866 | // The net effect of this will be to faithfully transmit whatever |
| 2867 | // security IE is in the join request. |
| 2868 | |
| 2869 | // *However*, if we're associating for the purpose of WPS |
| 2870 | // enrollment, and we've been configured to indicate that by |
| 2871 | // eliding the WPA or RSN IE, we just skip this: |
| 2872 | if (!psessionEntry->is11Rconnection) |
| 2873 | { |
| 2874 | if( nAddIELen && pAddIE ) |
| 2875 | { |
| 2876 | wpsIe = limGetWscIEPtr(pMac, pAddIE, nAddIELen); |
| 2877 | } |
| 2878 | if ( NULL == wpsIe ) |
| 2879 | { |
| 2880 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2881 | &frm.RSNOpaque ); |
| 2882 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2883 | &frm.WPAOpaque ); |
| 2884 | } |
| 2885 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2886 | #ifdef FEATURE_WLAN_ESE |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2887 | if (psessionEntry->pLimReAssocReq->cckmIE.length) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2888 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2889 | PopulateDot11fESECckmOpaque( pMac, &( psessionEntry->pLimReAssocReq->cckmIE ), |
| 2890 | &frm.ESECckmOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2891 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2892 | #endif //FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2893 | } |
| 2894 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2895 | #ifdef FEATURE_WLAN_ESE |
| 2896 | // For ESE Associations fill the ESE IEs |
| 2897 | if (psessionEntry->isESEconnection && |
| 2898 | psessionEntry->pLimReAssocReq->isESEFeatureIniEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2899 | { |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2900 | #ifndef FEATURE_DISABLE_RM |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2901 | PopulateDot11fESERadMgmtCap(&frm.ESERadMgmtCap); |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2902 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2903 | PopulateDot11fESEVersion(&frm.ESEVersion); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2904 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2905 | #endif //FEATURE_WLAN_ESE |
| 2906 | #endif //FEATURE_WLAN_ESE || FEATURE_WLAN_LFR |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2907 | |
| 2908 | // include WME EDCA IE as well |
| 2909 | if ( fWmeEnabled ) |
| 2910 | { |
| 2911 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limReassocBssPropCap ) ) |
| 2912 | { |
| 2913 | PopulateDot11fWMMInfoStation( pMac, &frm.WMMInfoStation ); |
| 2914 | } |
| 2915 | |
| 2916 | if ( fWsmEnabled && |
| 2917 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limReassocBssPropCap ))) |
| 2918 | { |
| 2919 | PopulateDot11fWMMCaps( &frm.WMMCaps ); |
| 2920 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2921 | #ifdef FEATURE_WLAN_ESE |
| 2922 | if (psessionEntry->isESEconnection) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2923 | { |
| 2924 | PopulateDot11fReAssocTspec(pMac, &frm, psessionEntry); |
| 2925 | |
| 2926 | // Populate the TSRS IE if TSPEC is included in the reassoc request |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2927 | if (psessionEntry->pLimReAssocReq->eseTspecInfo.numTspecs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2928 | { |
| 2929 | tANI_U32 phyMode; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2930 | tSirMacESETSRSIE tsrsIE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2931 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2932 | |
| 2933 | tsrsIE.tsid = 0; |
| 2934 | if( phyMode == WNI_CFG_PHY_MODE_11G || phyMode == WNI_CFG_PHY_MODE_11A) |
| 2935 | { |
| 2936 | tsrsIE.rates[0] = TSRS_11AG_RATE_6MBPS; |
| 2937 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2938 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2939 | { |
| 2940 | tsrsIE.rates[0] = TSRS_11B_RATE_5_5MBPS; |
| 2941 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2942 | PopulateDot11TSRSIE(pMac,&tsrsIE, &frm.ESETrafStrmRateSet, sizeof(tANI_U8)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2943 | } |
| 2944 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2945 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2946 | } |
| 2947 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2948 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2949 | pMac->lim.htCapabilityPresentInBeacon) |
| 2950 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2951 | PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2952 | } |
Agrawal Ashish | b10d039 | 2015-08-06 16:18:20 +0530 | [diff] [blame] | 2953 | limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," |
| 2954 | "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), |
| 2955 | frm.HTCaps.supportedChannelWidthSet, frm.HTCaps.mimoPowerSave, |
| 2956 | frm.HTCaps.greenField, frm.HTCaps.shortGI20MHz, frm.HTCaps.shortGI40MHz, |
| 2957 | frm.HTCaps.dsssCckMode40MHz, frm.HTCaps.maxRxAMPDUFactor); |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 2958 | #if defined WLAN_FEATURE_VOWIFI_11R |
Kanchanapally, Vidyullatha | 4f84f68 | 2014-04-29 20:40:34 +0530 | [diff] [blame] | 2959 | if ( psessionEntry->pLimReAssocReq->bssDescription.mdiePresent && |
| 2960 | (pMac->ft.ftSmeContext.addMDIE == TRUE) |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2961 | #if defined FEATURE_WLAN_ESE |
| 2962 | && !psessionEntry->isESEconnection |
Gopichand Nakkala | 0ac5506 | 2013-04-08 14:43:07 +0530 | [diff] [blame] | 2963 | #endif |
| 2964 | ) |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 2965 | { |
| 2966 | PopulateMDIE( pMac, &frm.MobilityDomain, psessionEntry->pLimReAssocReq->bssDescription.mdie); |
| 2967 | } |
| 2968 | #endif |
| 2969 | |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 2970 | #ifdef WLAN_FEATURE_11AC |
| 2971 | if ( psessionEntry->vhtCapability && |
| 2972 | psessionEntry->vhtCapabilityPresentInBeacon) |
| 2973 | { |
| 2974 | limLog( pMac, LOG1, FL("Populate VHT IEs in Re-Assoc Request")); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 2975 | PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, |
| 2976 | psessionEntry->currentOperChannel, eSIR_FALSE ); |
Abhishek Singh | e038dc6 | 2015-05-22 11:36:45 +0530 | [diff] [blame] | 2977 | |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 2978 | } |
| 2979 | #endif |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 2980 | if (psessionEntry->is_ext_caps_present) |
| 2981 | PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 2982 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2983 | nStatus = dot11fGetPackedReAssocRequestSize( pMac, &frm, &nPayload ); |
| 2984 | if ( DOT11F_FAILED( nStatus ) ) |
| 2985 | { |
| 2986 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2987 | "or a Re-Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2988 | nStatus ); |
| 2989 | // We'll fall back on the worst case scenario: |
| 2990 | nPayload = sizeof( tDot11fReAssocRequest ); |
| 2991 | } |
| 2992 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2993 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 2994 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2995 | "the packed size for a Re-Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2996 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2997 | } |
| 2998 | |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 2999 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3000 | |
| 3001 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 3002 | limLog( pMac, LOG1, FL("FT IE Reassoc Req (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3003 | pMac->ft.ftSmeContext.reassoc_ft_ies_length); |
| 3004 | #endif |
| 3005 | |
| 3006 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 3007 | if (psessionEntry->is11Rconnection) |
| 3008 | { |
| 3009 | ft_ies_length = pMac->ft.ftSmeContext.reassoc_ft_ies_length; |
| 3010 | } |
| 3011 | #endif |
| 3012 | |
| 3013 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3014 | ( tANI_U16 )nBytes+ft_ies_length, ( void** ) &pFrame, |
| 3015 | ( void** ) &pPacket ); |
| 3016 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3017 | { |
| 3018 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3019 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3020 | 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] | 3021 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3022 | goto end; |
| 3023 | } |
| 3024 | |
| 3025 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3026 | vos_mem_set( pFrame, nBytes + ft_ies_length, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3027 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3028 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 3029 | limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3030 | #endif |
| 3031 | // Next, we fill out the buffer descriptor: |
| 3032 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3033 | SIR_MAC_MGMT_REASSOC_REQ, |
| 3034 | psessionEntry->limReAssocbssId,psessionEntry->selfMacAddr); |
| 3035 | if ( eSIR_SUCCESS != nSirStatus ) |
| 3036 | { |
| 3037 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3038 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3039 | nSirStatus ); |
| 3040 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3041 | goto end; |
| 3042 | } |
| 3043 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3044 | pMacHdr = (tpSirMacMgmtHdr) pFrame; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3045 | // That done, pack the ReAssoc Request: |
| 3046 | nStatus = dot11fPackReAssocRequest( pMac, &frm, pFrame + |
| 3047 | sizeof(tSirMacMgmtHdr), |
| 3048 | nPayload, &nPayload ); |
| 3049 | if ( DOT11F_FAILED( nStatus ) ) |
| 3050 | { |
| 3051 | limLog( pMac, LOGE, FL("Failed to pack a Re-Association Reque" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3052 | "st (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3053 | nStatus ); |
| 3054 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3055 | goto end; |
| 3056 | } |
| 3057 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3058 | { |
| 3059 | limLog( pMac, LOGW, FL("There were warnings while packing a R" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 3060 | "e-Association Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3061 | } |
| 3062 | |
| 3063 | PELOG3(limLog( pMac, LOG3, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3064 | FL("*** Sending Re-Association Request length %d %d to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3065 | nBytes, nPayload );) |
| 3066 | if( psessionEntry->assocReq != NULL ) |
| 3067 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3068 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3069 | psessionEntry->assocReq = NULL; |
| 3070 | } |
| 3071 | |
| 3072 | if( nAddIELen ) |
| 3073 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3074 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 3075 | pAddIE, |
| 3076 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3077 | nPayload += nAddIELen; |
| 3078 | } |
| 3079 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3080 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 3081 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3082 | { |
| 3083 | 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] | 3084 | } |
| 3085 | else |
| 3086 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3087 | //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] | 3088 | vos_mem_copy( psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3089 | psessionEntry->assocReqLen = nPayload; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3090 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3091 | |
| 3092 | if (psessionEntry->is11Rconnection) |
| 3093 | { |
| 3094 | { |
| 3095 | int i = 0; |
| 3096 | |
| 3097 | pBody = pFrame + nBytes; |
| 3098 | for (i=0; i<ft_ies_length; i++) |
| 3099 | { |
| 3100 | *pBody = pMac->ft.ftSmeContext.reassoc_ft_ies[i]; |
| 3101 | pBody++; |
| 3102 | } |
| 3103 | } |
| 3104 | } |
| 3105 | |
| 3106 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3107 | PELOGE(limLog(pMac, LOG1, FL("Re-assoc Req Frame is: ")); |
| 3108 | sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3109 | (tANI_U8 *)pFrame, |
| 3110 | (nBytes + ft_ies_length));) |
| 3111 | #endif |
| 3112 | |
| 3113 | |
| 3114 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3115 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3116 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3117 | ) |
| 3118 | { |
| 3119 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3120 | } |
| 3121 | |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3122 | if( NULL != psessionEntry->assocReq ) |
| 3123 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3124 | vos_mem_free(psessionEntry->assocReq); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3125 | psessionEntry->assocReq = NULL; |
| 3126 | } |
Agrawal Ashish | ad64dc2 | 2016-02-04 11:32:15 +0530 | [diff] [blame] | 3127 | if (ft_ies_length) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3128 | { |
Agrawal Ashish | ad64dc2 | 2016-02-04 11:32:15 +0530 | [diff] [blame] | 3129 | psessionEntry->assocReq = vos_mem_malloc(ft_ies_length); |
| 3130 | if (NULL == psessionEntry->assocReq) |
| 3131 | { |
| 3132 | limLog(pMac, LOGE, |
| 3133 | FL("Unable to allocate memory for FT IEs")); |
| 3134 | psessionEntry->assocReqLen = 0; |
| 3135 | } |
| 3136 | else |
| 3137 | { |
| 3138 | /* Store the FT IEs. This is sent to csr/hdd in join cnf response.*/ |
| 3139 | vos_mem_copy(psessionEntry->assocReq, |
| 3140 | pMac->ft.ftSmeContext.reassoc_ft_ies, |
| 3141 | (ft_ies_length)); |
| 3142 | psessionEntry->assocReqLen = ft_ies_length; |
| 3143 | } |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3144 | } |
| 3145 | else |
| 3146 | { |
Agrawal Ashish | ad64dc2 | 2016-02-04 11:32:15 +0530 | [diff] [blame] | 3147 | limLog(pMac, LOG1, FL("FT IEs not present")); |
| 3148 | psessionEntry->assocReqLen = 0; |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3149 | } |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame] | 3150 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 3151 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_START_EVENT, psessionEntry, |
| 3152 | eSIR_SUCCESS, eSIR_SUCCESS); |
| 3153 | #endif |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3154 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 3155 | psessionEntry->peSessionId, |
| 3156 | pMacHdr->fc.subType)); |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3157 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 3158 | { |
| 3159 | limLog( pMac, LOG1, FL("Reassoc req - txBdToken %u"), pMac->lim.txBdToken); |
| 3160 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, |
| 3161 | ( tANI_U16 ) (nBytes + ft_ies_length), |
| 3162 | HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, |
| 3163 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3164 | limTxComplete, pFrame, limTxBdComplete, txFlag, |
| 3165 | pMac->lim.txBdToken); |
| 3166 | pMac->lim.txBdToken++; |
| 3167 | } |
| 3168 | else |
| 3169 | { |
| 3170 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (nBytes + ft_ies_length), |
| 3171 | HAL_TXRX_FRM_802_11_MGMT, |
| 3172 | ANI_TXDIR_TODS, |
| 3173 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3174 | limTxComplete, pFrame, txFlag ); |
| 3175 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3176 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 3177 | psessionEntry->peSessionId, |
| 3178 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3179 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3180 | { |
| 3181 | limLog( pMac, LOGE, FL("Failed to send Re-Association Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3182 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3183 | nSirStatus ); |
| 3184 | //Pkt will be freed up by the callback |
| 3185 | goto end; |
| 3186 | } |
| 3187 | |
Katya Nigam | ccaeda7 | 2015-04-20 18:51:22 +0530 | [diff] [blame] | 3188 | // Enable TL cahching in case of roaming |
| 3189 | WLANTL_EnableCaching(psessionEntry->staId); |
| 3190 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3191 | end: |
| 3192 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3193 | vos_mem_free( pMlmReassocReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3194 | psessionEntry->pLimMlmReassocReq = NULL; |
| 3195 | |
| 3196 | } |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3197 | |
| 3198 | void limSendRetryReassocReqFrame(tpAniSirGlobal pMac, |
| 3199 | tLimMlmReassocReq *pMlmReassocReq, |
| 3200 | tpPESession psessionEntry) |
| 3201 | { |
| 3202 | tLimMlmReassocCnf mlmReassocCnf; // keep sme |
| 3203 | tLimMlmReassocReq *pTmpMlmReassocReq = NULL; |
Sachin Ahuja | 07a4301 | 2015-01-30 17:04:38 +0530 | [diff] [blame] | 3204 | #ifdef FEATURE_WLAN_ESE |
| 3205 | tANI_U32 val=0; |
| 3206 | #endif |
| 3207 | if (pMlmReassocReq == NULL) |
| 3208 | { |
| 3209 | limLog(pMac, LOGE, |
| 3210 | FL("Invalid pMlmReassocReq")); |
| 3211 | goto end; |
| 3212 | } |
Hema Aparna Medicharla | 43d0f7b | 2015-02-12 17:07:59 +0530 | [diff] [blame] | 3213 | |
| 3214 | pTmpMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); |
| 3215 | if ( NULL == pTmpMlmReassocReq ) goto end; |
| 3216 | vos_mem_set( pTmpMlmReassocReq, sizeof(tLimMlmReassocReq), 0); |
| 3217 | vos_mem_copy( pTmpMlmReassocReq, pMlmReassocReq, sizeof(tLimMlmReassocReq)); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3218 | |
| 3219 | // Prepare and send Reassociation request frame |
| 3220 | // start reassoc timer. |
Sachin Ahuja | 07a4301 | 2015-01-30 17:04:38 +0530 | [diff] [blame] | 3221 | #ifdef FEATURE_WLAN_ESE |
| 3222 | /* |
| 3223 | * In case of Ese Reassociation, change the reassoc timer |
| 3224 | * value. |
| 3225 | */ |
| 3226 | val = pMlmReassocReq->reassocFailureTimeout; |
| 3227 | if (psessionEntry->isESEconnection) |
| 3228 | { |
| 3229 | val = val/LIM_MAX_REASSOC_RETRY_LIMIT; |
| 3230 | } |
| 3231 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != |
| 3232 | TX_SUCCESS) |
| 3233 | { |
| 3234 | limLog(pMac, LOGP, |
| 3235 | FL("unable to deactivate Reassoc failure timer")); |
| 3236 | } |
| 3237 | val = SYS_MS_TO_TICKS(val); |
| 3238 | if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, |
| 3239 | val, 0) != TX_SUCCESS) |
| 3240 | { |
| 3241 | limLog(pMac, LOGP, |
| 3242 | FL("unable to change Reassociation failure timer")); |
| 3243 | } |
| 3244 | #endif |
| 3245 | |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3246 | pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; |
| 3247 | // Start reassociation failure timer |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 3248 | 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] | 3249 | if (tx_timer_activate(&pMac->lim.limTimers.gLimReassocFailureTimer) |
| 3250 | != TX_SUCCESS) |
| 3251 | { |
| 3252 | // Could not start reassoc failure timer. |
| 3253 | // Log error |
| 3254 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3255 | FL("could not start Reassociation failure timer")); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3256 | // Return Reassoc confirm with |
| 3257 | // Resources Unavailable |
| 3258 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3259 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 3260 | goto end; |
| 3261 | } |
| 3262 | |
| 3263 | limSendReassocReqWithFTIEsMgmtFrame(pMac, pTmpMlmReassocReq, psessionEntry); |
| 3264 | return; |
| 3265 | |
| 3266 | end: |
| 3267 | // Free up buffer allocated for reassocReq |
| 3268 | if (pMlmReassocReq != NULL) |
| 3269 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3270 | vos_mem_free(pMlmReassocReq); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3271 | pMlmReassocReq = NULL; |
| 3272 | } |
| 3273 | if (pTmpMlmReassocReq != NULL) |
| 3274 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3275 | vos_mem_free(pTmpMlmReassocReq); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3276 | pTmpMlmReassocReq = NULL; |
| 3277 | } |
| 3278 | mlmReassocCnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; |
| 3279 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 3280 | /* Update PE sessio Id*/ |
| 3281 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 3282 | |
| 3283 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 3284 | } |
| 3285 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3286 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 3287 | |
| 3288 | |
| 3289 | void |
| 3290 | limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, |
| 3291 | tLimMlmReassocReq *pMlmReassocReq,tpPESession psessionEntry) |
| 3292 | { |
| 3293 | static tDot11fReAssocRequest frm; |
| 3294 | tANI_U16 caps; |
| 3295 | tANI_U8 *pFrame; |
| 3296 | tSirRetStatus nSirStatus; |
| 3297 | tANI_U32 nBytes, nPayload, nStatus; |
| 3298 | tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; |
| 3299 | void *pPacket; |
| 3300 | eHalStatus halstatus; |
| 3301 | tANI_U16 nAddIELen; |
| 3302 | tANI_U8 *pAddIE; |
| 3303 | tANI_U8 *wpsIe = NULL; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 3304 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3305 | #if defined WLAN_FEATURE_VOWIFI |
| 3306 | tANI_U8 PowerCapsPopulated = FALSE; |
| 3307 | #endif |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3308 | tpSirMacMgmtHdr pMacHdr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3309 | |
| 3310 | if(NULL == psessionEntry) |
| 3311 | { |
| 3312 | return; |
| 3313 | } |
| 3314 | |
| 3315 | /* check this early to avoid unncessary operation */ |
| 3316 | if(NULL == psessionEntry->pLimReAssocReq) |
| 3317 | { |
| 3318 | return; |
| 3319 | } |
| 3320 | nAddIELen = psessionEntry->pLimReAssocReq->addIEAssoc.length; |
| 3321 | pAddIE = psessionEntry->pLimReAssocReq->addIEAssoc.addIEdata; |
| 3322 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3323 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3324 | |
| 3325 | caps = pMlmReassocReq->capabilityInfo; |
| 3326 | if (PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap)) |
| 3327 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 3328 | #if defined(FEATURE_WLAN_WAPI) |
| 3329 | /* CR: 262463 : |
| 3330 | According to WAPI standard: |
| 3331 | 7.3.1.4 Capability Information field |
| 3332 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 3333 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 3334 | Reassociation management frames. */ |
| 3335 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 3336 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 3337 | #endif |
| 3338 | swapBitField16(caps, ( tANI_U16* )&frm.Capabilities ); |
| 3339 | |
| 3340 | frm.ListenInterval.interval = pMlmReassocReq->listenInterval; |
| 3341 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3342 | vos_mem_copy(( tANI_U8* )frm.CurrentAPAddress.mac, |
| 3343 | ( tANI_U8* )psessionEntry->bssId, 6 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3344 | |
| 3345 | PopulateDot11fSSID2( pMac, &frm.SSID ); |
| 3346 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 3347 | &frm.SuppRates,psessionEntry); |
| 3348 | |
| 3349 | fQosEnabled = ( psessionEntry->limQosEnabled ) && |
| 3350 | SIR_MAC_GET_QOS( psessionEntry->limReassocBssCaps ); |
| 3351 | |
| 3352 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 3353 | LIM_BSS_CAPS_GET( WME, psessionEntry->limReassocBssQosCaps ); |
| 3354 | |
| 3355 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 3356 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limReassocBssQosCaps ); |
| 3357 | |
| 3358 | |
| 3359 | if ( psessionEntry->lim11hEnable && |
| 3360 | psessionEntry->pLimReAssocReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 3361 | { |
| 3362 | #if defined WLAN_FEATURE_VOWIFI |
| 3363 | PowerCapsPopulated = TRUE; |
| 3364 | PopulateDot11fPowerCaps( pMac, &frm.PowerCaps, LIM_REASSOC,psessionEntry); |
| 3365 | PopulateDot11fSuppChannels( pMac, &frm.SuppChannels, LIM_REASSOC,psessionEntry); |
| 3366 | #endif |
| 3367 | } |
| 3368 | |
| 3369 | #if defined WLAN_FEATURE_VOWIFI |
| 3370 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 3371 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 3372 | { |
| 3373 | if (PowerCapsPopulated == FALSE) |
| 3374 | { |
| 3375 | PowerCapsPopulated = TRUE; |
| 3376 | PopulateDot11fPowerCaps(pMac, &frm.PowerCaps, LIM_REASSOC, psessionEntry); |
| 3377 | } |
| 3378 | } |
| 3379 | #endif |
| 3380 | |
| 3381 | if ( fQosEnabled && |
| 3382 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap ) )) |
| 3383 | { |
| 3384 | PopulateDot11fQOSCapsStation( pMac, &frm.QOSCapsStation ); |
| 3385 | } |
| 3386 | |
| 3387 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 3388 | &frm.ExtSuppRates, psessionEntry ); |
| 3389 | |
| 3390 | #if defined WLAN_FEATURE_VOWIFI |
| 3391 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 3392 | SIR_MAC_GET_RRM( psessionEntry->limReassocBssCaps ) ) |
| 3393 | { |
| 3394 | PopulateDot11fRRMIe( pMac, &frm.RRMEnabledCap, psessionEntry ); |
| 3395 | } |
| 3396 | #endif |
| 3397 | // The join request *should* contain zero or one of the WPA and RSN |
| 3398 | // IEs. The payload send along with the request is a |
| 3399 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 3400 | |
| 3401 | // typedef struct sSirRSNie |
| 3402 | // { |
| 3403 | // tANI_U16 length; |
| 3404 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 3405 | // } tSirRSNie, *tpSirRSNie; |
| 3406 | |
| 3407 | // So, we should be able to make the following two calls harmlessly, |
| 3408 | // since they do nothing if they don't find the given IE in the |
| 3409 | // bytestream with which they're provided. |
| 3410 | |
| 3411 | // The net effect of this will be to faithfully transmit whatever |
| 3412 | // security IE is in the join request. |
| 3413 | |
| 3414 | // *However*, if we're associating for the purpose of WPS |
| 3415 | // enrollment, and we've been configured to indicate that by |
| 3416 | // eliding the WPA or RSN IE, we just skip this: |
| 3417 | if( nAddIELen && pAddIE ) |
| 3418 | { |
| 3419 | wpsIe = limGetWscIEPtr(pMac, pAddIE, nAddIELen); |
| 3420 | } |
| 3421 | if ( NULL == wpsIe ) |
| 3422 | { |
| 3423 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 3424 | &frm.RSNOpaque ); |
| 3425 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 3426 | &frm.WPAOpaque ); |
| 3427 | #if defined(FEATURE_WLAN_WAPI) |
| 3428 | PopulateDot11fWAPIOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 3429 | &frm.WAPIOpaque ); |
| 3430 | #endif // defined(FEATURE_WLAN_WAPI) |
| 3431 | } |
| 3432 | |
| 3433 | // include WME EDCA IE as well |
| 3434 | if ( fWmeEnabled ) |
| 3435 | { |
| 3436 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limReassocBssPropCap ) ) |
| 3437 | { |
| 3438 | PopulateDot11fWMMInfoStation( pMac, &frm.WMMInfoStation ); |
| 3439 | } |
| 3440 | |
| 3441 | if ( fWsmEnabled && |
| 3442 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limReassocBssPropCap ))) |
| 3443 | { |
| 3444 | PopulateDot11fWMMCaps( &frm.WMMCaps ); |
| 3445 | } |
| 3446 | } |
| 3447 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3448 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3449 | pMac->lim.htCapabilityPresentInBeacon) |
| 3450 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3451 | PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3452 | } |
Agrawal Ashish | b10d039 | 2015-08-06 16:18:20 +0530 | [diff] [blame] | 3453 | limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," |
| 3454 | "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), |
| 3455 | frm.HTCaps.supportedChannelWidthSet, frm.HTCaps.mimoPowerSave, |
| 3456 | frm.HTCaps.greenField, frm.HTCaps.shortGI20MHz, frm.HTCaps.shortGI40MHz, |
| 3457 | frm.HTCaps.dsssCckMode40MHz, frm.HTCaps.maxRxAMPDUFactor); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3458 | #ifdef WLAN_FEATURE_11AC |
| 3459 | if ( psessionEntry->vhtCapability && |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 3460 | psessionEntry->vhtCapabilityPresentInBeacon) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3461 | { |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 3462 | limLog( pMac, LOG1, FL("Populate VHT IEs in Re-Assoc Request")); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 3463 | PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, |
| 3464 | psessionEntry->currentOperChannel, eSIR_FALSE ); |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 3465 | if (psessionEntry->is_ext_caps_present) |
| 3466 | PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3467 | } |
| 3468 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3469 | |
| 3470 | nStatus = dot11fGetPackedReAssocRequestSize( pMac, &frm, &nPayload ); |
| 3471 | if ( DOT11F_FAILED( nStatus ) ) |
| 3472 | { |
| 3473 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3474 | "or a Re-Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3475 | nStatus ); |
| 3476 | // We'll fall back on the worst case scenario: |
| 3477 | nPayload = sizeof( tDot11fReAssocRequest ); |
| 3478 | } |
| 3479 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3480 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 3481 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3482 | "the packed size for a Re-Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3483 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3484 | } |
| 3485 | |
| 3486 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
| 3487 | |
| 3488 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3489 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 3490 | ( void** ) &pPacket ); |
| 3491 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3492 | { |
| 3493 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3494 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3495 | 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] | 3496 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3497 | goto end; |
| 3498 | } |
| 3499 | |
| 3500 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3501 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3502 | |
| 3503 | // Next, we fill out the buffer descriptor: |
| 3504 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3505 | SIR_MAC_MGMT_REASSOC_REQ, |
| 3506 | psessionEntry->limReAssocbssId,psessionEntry->selfMacAddr); |
| 3507 | if ( eSIR_SUCCESS != nSirStatus ) |
| 3508 | { |
| 3509 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3510 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3511 | nSirStatus ); |
| 3512 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3513 | goto end; |
| 3514 | } |
| 3515 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3516 | pMacHdr = (tpSirMacMgmtHdr) pFrame; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3517 | // That done, pack the Probe Request: |
| 3518 | nStatus = dot11fPackReAssocRequest( pMac, &frm, pFrame + |
| 3519 | sizeof(tSirMacMgmtHdr), |
| 3520 | nPayload, &nPayload ); |
| 3521 | if ( DOT11F_FAILED( nStatus ) ) |
| 3522 | { |
| 3523 | limLog( pMac, LOGE, FL("Failed to pack a Re-Association Reque" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3524 | "st (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3525 | nStatus ); |
| 3526 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3527 | goto end; |
| 3528 | } |
| 3529 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3530 | { |
| 3531 | limLog( pMac, LOGW, FL("There were warnings while packing a R" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 3532 | "e-Association Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3533 | } |
| 3534 | |
| 3535 | PELOG1(limLog( pMac, LOG1, FL("*** Sending Re-Association Request length %d" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3536 | "to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3537 | nBytes );) |
| 3538 | |
| 3539 | if( psessionEntry->assocReq != NULL ) |
| 3540 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3541 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3542 | psessionEntry->assocReq = NULL; |
| 3543 | } |
| 3544 | |
| 3545 | if( nAddIELen ) |
| 3546 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3547 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 3548 | pAddIE, |
| 3549 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3550 | nPayload += nAddIELen; |
| 3551 | } |
| 3552 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3553 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 3554 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3555 | { |
| 3556 | 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] | 3557 | } |
| 3558 | else |
| 3559 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3560 | //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] | 3561 | vos_mem_copy(psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3562 | psessionEntry->assocReqLen = nPayload; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3563 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3564 | |
| 3565 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3566 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3567 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3568 | ) |
| 3569 | { |
| 3570 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3571 | } |
| 3572 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 3573 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || |
| 3574 | psessionEntry->pePersona == VOS_STA_MODE) |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 3575 | { |
| 3576 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 3577 | } |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame] | 3578 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 3579 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_START_EVENT, psessionEntry, |
| 3580 | eSIR_SUCCESS, eSIR_SUCCESS); |
| 3581 | #endif |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3582 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3583 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 3584 | psessionEntry->peSessionId, |
| 3585 | pMacHdr->fc.subType)); |
Katya Nigam | 6390293 | 2014-06-26 19:04:23 +0530 | [diff] [blame] | 3586 | |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3587 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 3588 | { |
| 3589 | limLog(pMac, LOG1, FL("Reassoc req - txBdToken %u"), pMac->lim.txBdToken); |
| 3590 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, |
| 3591 | ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 3592 | HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, |
| 3593 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3594 | limTxComplete, pFrame, limTxBdComplete, |
| 3595 | txFlag, pMac->lim.txBdToken ); |
| 3596 | pMac->lim.txBdToken++; |
| 3597 | } |
| 3598 | else |
| 3599 | { |
| 3600 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 3601 | HAL_TXRX_FRM_802_11_MGMT, |
| 3602 | ANI_TXDIR_TODS, |
| 3603 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3604 | limTxComplete, pFrame, txFlag ); |
| 3605 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3606 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 3607 | psessionEntry->peSessionId, |
| 3608 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3609 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3610 | { |
| 3611 | limLog( pMac, LOGE, FL("Failed to send Re-Association Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3612 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3613 | nSirStatus ); |
| 3614 | //Pkt will be freed up by the callback |
| 3615 | goto end; |
| 3616 | } |
| 3617 | |
Katya Nigam | ccaeda7 | 2015-04-20 18:51:22 +0530 | [diff] [blame] | 3618 | // enable caching |
| 3619 | WLANTL_EnableCaching(psessionEntry->staId); |
| 3620 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3621 | end: |
| 3622 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3623 | vos_mem_free( pMlmReassocReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3624 | psessionEntry->pLimMlmReassocReq = NULL; |
| 3625 | |
| 3626 | } // limSendReassocReqMgmtFrame |
| 3627 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3628 | eHalStatus limAuthTxCompleteCnf(tpAniSirGlobal pMac, void *pData) |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3629 | { |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3630 | tANI_U32 txCompleteSuccess; |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3631 | tpSirTxBdStatus pTxBdStatus; |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3632 | |
| 3633 | if (!pData) |
| 3634 | { |
| 3635 | limLog(pMac, LOG1, |
| 3636 | FL(" pData is NULL")); |
| 3637 | return eHAL_STATUS_FAILURE; |
| 3638 | } |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3639 | |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3640 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 3641 | { |
| 3642 | pTxBdStatus = (tpSirTxBdStatus) pData; |
| 3643 | txCompleteSuccess = pTxBdStatus->txCompleteStatus; |
| 3644 | limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), |
| 3645 | pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); |
| 3646 | } |
| 3647 | else |
| 3648 | { |
| 3649 | txCompleteSuccess = *((tANI_U32*) pData); |
| 3650 | limLog(pMac, LOG1, |
| 3651 | FL("txCompleteSuccess= %d"), txCompleteSuccess); |
| 3652 | } |
| 3653 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3654 | if(txCompleteSuccess) |
| 3655 | { |
| 3656 | pMac->authAckStatus = LIM_AUTH_ACK_RCD_SUCCESS; |
| 3657 | // 'Change' timer for future activations |
| 3658 | limDeactivateAndChangeTimer(pMac, eLIM_AUTH_RETRY_TIMER); |
| 3659 | } |
| 3660 | else |
| 3661 | pMac->authAckStatus = LIM_AUTH_ACK_RCD_FAILURE; |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 3662 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame] | 3663 | limDiagEventReport(pMac, WLAN_PE_DIAG_AUTH_START_EVENT, NULL, |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 3664 | pMac->authAckStatus, eSIR_SUCCESS); |
| 3665 | #endif |
| 3666 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3667 | return eHAL_STATUS_SUCCESS; |
| 3668 | } |
| 3669 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3670 | /** |
| 3671 | * \brief Send an Authentication frame |
| 3672 | * |
| 3673 | * |
| 3674 | * \param pMac Pointer to Global MAC structure |
| 3675 | * |
| 3676 | * \param pAuthFrameBody Pointer to Authentication frame structure that need |
| 3677 | * to be sent |
| 3678 | * |
| 3679 | * \param peerMacAddr MAC address of the peer entity to which Authentication |
| 3680 | * frame is destined |
| 3681 | * |
| 3682 | * \param wepBit Indicates whether wep bit to be set in FC while sending |
| 3683 | * Authentication frame3 |
| 3684 | * |
| 3685 | * |
| 3686 | * This function is called by limProcessMlmMessages(). Authentication frame |
| 3687 | * is formatted and sent when this function is called. |
| 3688 | * |
| 3689 | * |
| 3690 | */ |
| 3691 | |
| 3692 | void |
| 3693 | limSendAuthMgmtFrame(tpAniSirGlobal pMac, |
| 3694 | tpSirMacAuthFrameBody pAuthFrameBody, |
| 3695 | tSirMacAddr peerMacAddr, |
| 3696 | tANI_U8 wepBit, |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3697 | tpPESession psessionEntry, |
| 3698 | tAniBool waitForAck |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3699 | ) |
| 3700 | { |
| 3701 | tANI_U8 *pFrame, *pBody; |
| 3702 | tANI_U32 frameLen = 0, bodyLen = 0; |
| 3703 | tpSirMacMgmtHdr pMacHdr; |
| 3704 | tANI_U16 i; |
| 3705 | void *pPacket; |
| 3706 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 3707 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3708 | |
| 3709 | if(NULL == psessionEntry) |
| 3710 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3711 | limLog(pMac, LOGE, FL("Error: psession Entry is NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3712 | return; |
| 3713 | } |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3714 | |
| 3715 | limLog(pMac, LOG1, |
| 3716 | FL("Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), |
| 3717 | pAuthFrameBody->authTransactionSeqNumber, |
| 3718 | pAuthFrameBody->authStatusCode, |
| 3719 | (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), |
| 3720 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3721 | if (wepBit == LIM_WEP_IN_FC) |
| 3722 | { |
| 3723 | /// Auth frame3 to be sent with encrypted framebody |
| 3724 | /** |
| 3725 | * Allocate buffer for Authenticaton frame of size equal |
| 3726 | * to management frame header length plus 2 bytes each for |
| 3727 | * auth algorithm number, transaction number, status code, |
| 3728 | * 128 bytes for challenge text and 4 bytes each for |
| 3729 | * IV & ICV. |
| 3730 | */ |
| 3731 | |
| 3732 | frameLen = sizeof(tSirMacMgmtHdr) + LIM_ENCR_AUTH_BODY_LEN; |
| 3733 | |
| 3734 | bodyLen = LIM_ENCR_AUTH_BODY_LEN; |
| 3735 | } // if (wepBit == LIM_WEP_IN_FC) |
| 3736 | else |
| 3737 | { |
| 3738 | switch (pAuthFrameBody->authTransactionSeqNumber) |
| 3739 | { |
| 3740 | case SIR_MAC_AUTH_FRAME_1: |
| 3741 | /** |
| 3742 | * Allocate buffer for Authenticaton frame of size |
| 3743 | * equal to management frame header length plus 2 bytes |
| 3744 | * each for auth algorithm number, transaction number |
| 3745 | * and status code. |
| 3746 | */ |
| 3747 | |
| 3748 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3749 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3750 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3751 | |
| 3752 | #if defined WLAN_FEATURE_VOWIFI_11R |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3753 | if (pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) |
| 3754 | { |
| 3755 | if (0 != pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3756 | { |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3757 | frameLen += pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3758 | limLog(pMac, LOG3, FL("Auth frame, FTIES length added=%d"), |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3759 | pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3760 | } |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3761 | else |
| 3762 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3763 | limLog(pMac, LOG3, FL("Auth frame, Does not contain " |
| 3764 | "FTIES!!!")); |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3765 | frameLen += (2+SIR_MDIE_SIZE); |
| 3766 | } |
| 3767 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3768 | #endif |
| 3769 | break; |
| 3770 | |
| 3771 | case SIR_MAC_AUTH_FRAME_2: |
| 3772 | if ((pAuthFrameBody->authAlgoNumber == eSIR_OPEN_SYSTEM) || |
| 3773 | ((pAuthFrameBody->authAlgoNumber == eSIR_SHARED_KEY) && |
| 3774 | (pAuthFrameBody->authStatusCode != eSIR_MAC_SUCCESS_STATUS))) |
| 3775 | { |
| 3776 | /** |
| 3777 | * Allocate buffer for Authenticaton frame of size |
| 3778 | * equal to management frame header length plus |
| 3779 | * 2 bytes each for auth algorithm number, |
| 3780 | * transaction number and status code. |
| 3781 | */ |
| 3782 | |
| 3783 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3784 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3785 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3786 | } |
| 3787 | else |
| 3788 | { |
| 3789 | // Shared Key algorithm with challenge text |
| 3790 | // to be sent |
| 3791 | /** |
| 3792 | * Allocate buffer for Authenticaton frame of size |
| 3793 | * equal to management frame header length plus |
| 3794 | * 2 bytes each for auth algorithm number, |
| 3795 | * transaction number, status code and 128 bytes |
| 3796 | * for challenge text. |
| 3797 | */ |
| 3798 | |
| 3799 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3800 | sizeof(tSirMacAuthFrame); |
| 3801 | bodyLen = sizeof(tSirMacAuthFrameBody); |
| 3802 | } |
| 3803 | |
| 3804 | break; |
| 3805 | |
| 3806 | case SIR_MAC_AUTH_FRAME_3: |
| 3807 | /// Auth frame3 to be sent without encrypted framebody |
| 3808 | /** |
| 3809 | * Allocate buffer for Authenticaton frame of size equal |
| 3810 | * to management frame header length plus 2 bytes each |
| 3811 | * for auth algorithm number, transaction number and |
| 3812 | * status code. |
| 3813 | */ |
| 3814 | |
| 3815 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3816 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3817 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3818 | |
| 3819 | break; |
| 3820 | |
| 3821 | case SIR_MAC_AUTH_FRAME_4: |
| 3822 | /** |
| 3823 | * Allocate buffer for Authenticaton frame of size equal |
| 3824 | * to management frame header length plus 2 bytes each |
| 3825 | * for auth algorithm number, transaction number and |
| 3826 | * status code. |
| 3827 | */ |
| 3828 | |
| 3829 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3830 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3831 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3832 | |
| 3833 | break; |
| 3834 | } // switch (pAuthFrameBody->authTransactionSeqNumber) |
| 3835 | } // end if (wepBit == LIM_WEP_IN_FC) |
| 3836 | |
| 3837 | |
| 3838 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )frameLen, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 3839 | |
| 3840 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3841 | { |
| 3842 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3843 | limLog(pMac, LOGP, FL("call to bufAlloc failed for AUTH frame")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3844 | |
| 3845 | return; |
| 3846 | } |
| 3847 | |
| 3848 | for (i = 0; i < frameLen; i++) |
| 3849 | pFrame[i] = 0; |
| 3850 | |
| 3851 | // Prepare BD |
| 3852 | if (limPopulateMacHeader(pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3853 | SIR_MAC_MGMT_AUTH, peerMacAddr,psessionEntry->selfMacAddr) != eSIR_SUCCESS) |
| 3854 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3855 | limLog(pMac, LOGE, FL("call to limPopulateMacHeader failed for " |
| 3856 | "AUTH frame")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3857 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3858 | return; |
| 3859 | } |
| 3860 | |
| 3861 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 3862 | pMacHdr->fc.wep = wepBit; |
| 3863 | |
| 3864 | // Prepare BSSId |
| 3865 | if( (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 3866 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3867 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 3868 | (tANI_U8 *) psessionEntry->bssId, |
| 3869 | sizeof( tSirMacAddr )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3870 | } |
| 3871 | |
| 3872 | /// Prepare Authentication frame body |
| 3873 | pBody = pFrame + sizeof(tSirMacMgmtHdr); |
| 3874 | |
| 3875 | if (wepBit == LIM_WEP_IN_FC) |
| 3876 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3877 | vos_mem_copy(pBody, (tANI_U8 *) pAuthFrameBody, bodyLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3878 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3879 | limLog(pMac, LOG1, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3880 | FL("*** Sending Auth seq# 3 status %d (%d) to"MAC_ADDRESS_STR), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3881 | pAuthFrameBody->authStatusCode, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3882 | (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3883 | MAC_ADDR_ARRAY(pMacHdr->da)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3884 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3885 | } |
| 3886 | else |
| 3887 | { |
| 3888 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authAlgoNumber); |
| 3889 | pBody += sizeof(tANI_U16); |
| 3890 | bodyLen -= sizeof(tANI_U16); |
| 3891 | |
| 3892 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authTransactionSeqNumber); |
| 3893 | pBody += sizeof(tANI_U16); |
| 3894 | bodyLen -= sizeof(tANI_U16); |
| 3895 | |
| 3896 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authStatusCode); |
| 3897 | pBody += sizeof(tANI_U16); |
| 3898 | bodyLen -= sizeof(tANI_U16); |
Leela Venkata Kiran Kumar Reddy Chirala | 7d3fa55 | 2013-08-28 10:52:21 -0700 | [diff] [blame] | 3899 | if ( bodyLen <= (sizeof (pAuthFrameBody->type) + |
| 3900 | sizeof (pAuthFrameBody->length) + |
| 3901 | sizeof (pAuthFrameBody->challengeText))) |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3902 | vos_mem_copy(pBody, (tANI_U8 *) &pAuthFrameBody->type, bodyLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3903 | |
| 3904 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 3905 | if ((pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) && |
| 3906 | (pAuthFrameBody->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_1)) |
| 3907 | { |
| 3908 | |
| 3909 | { |
| 3910 | int i = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3911 | if (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length) |
| 3912 | { |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3913 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Srinivas Girigowda | d63eb49 | 2014-02-06 12:21:47 -0800 | [diff] [blame] | 3914 | PELOG2(limLog(pMac, LOG2, FL("Auth1 Frame FTIE is: ")); |
| 3915 | sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3916 | (tANI_U8 *)pBody, |
| 3917 | (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3918 | #endif |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3919 | for (i=0; i<pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length; i++) |
| 3920 | { |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3921 | *pBody = pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[i]; |
| 3922 | pBody++; |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3923 | } |
| 3924 | } |
| 3925 | else |
| 3926 | { |
| 3927 | /* MDID attr is 54*/ |
| 3928 | *pBody = 54; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3929 | pBody++; |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3930 | *pBody = SIR_MDIE_SIZE; |
| 3931 | pBody++; |
| 3932 | for(i=0;i<SIR_MDIE_SIZE;i++) |
| 3933 | { |
| 3934 | *pBody = pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription->mdie[i]; |
| 3935 | pBody++; |
| 3936 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3937 | } |
| 3938 | } |
| 3939 | } |
| 3940 | #endif |
| 3941 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3942 | limLog(pMac, LOG1, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3943 | FL("*** Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3944 | pAuthFrameBody->authTransactionSeqNumber, |
| 3945 | pAuthFrameBody->authStatusCode, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3946 | (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3947 | MAC_ADDR_ARRAY(pMacHdr->da)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3948 | } |
| 3949 | PELOG2(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, pFrame, frameLen);) |
| 3950 | |
| 3951 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3952 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3953 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3954 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 3955 | || ((NULL != pMac->ft.ftPEContext.pFTPreAuthReq) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3956 | && ( SIR_BAND_5_GHZ == limGetRFBand(pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum))) |
| 3957 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3958 | ) |
| 3959 | { |
| 3960 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3961 | } |
| 3962 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 3963 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || |
| 3964 | psessionEntry->pePersona == VOS_STA_MODE) |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 3965 | { |
| 3966 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 3967 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3968 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3969 | limLog( pMac, LOG1, |
| 3970 | FL("Sending Auth Frame over WQ5 with waitForAck %d to "MAC_ADDRESS_STR |
| 3971 | " From " MAC_ADDRESS_STR), waitForAck, MAC_ADDR_ARRAY(pMacHdr->da), |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 3972 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
| 3973 | |
| 3974 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 3975 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3976 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 3977 | psessionEntry->peSessionId, |
| 3978 | pMacHdr->fc.subType)); |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 3979 | |
| 3980 | if( ( psessionEntry->is11Gonly == true ) && |
| 3981 | ( !IS_BROADCAST_MAC(peerMacAddr) ) ){ |
| 3982 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3983 | } |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3984 | if(eSIR_TRUE == waitForAck) |
| 3985 | { |
| 3986 | pMac->authAckStatus = LIM_AUTH_ACK_NOT_RCD; |
Sushant Kaushik | 0b34342 | 2015-05-25 17:15:55 +0530 | [diff] [blame] | 3987 | limLog(pMac, LOG1, FL("Auth frame - txBdToken %u"), |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3988 | pMac->lim.txBdToken); |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3989 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, |
| 3990 | ( tANI_U16 ) frameLen, |
| 3991 | HAL_TXRX_FRM_802_11_MGMT, |
| 3992 | ANI_TXDIR_TODS, |
| 3993 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3994 | limTxComplete, pFrame, limAuthTxCompleteCnf, txFlag, |
| 3995 | pMac->lim.txBdToken); |
| 3996 | pMac->lim.txBdToken++; |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3997 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 3998 | psessionEntry->peSessionId, |
| 3999 | halstatus)); |
| 4000 | if (!HAL_STATUS_SUCCESS(halstatus)) |
| 4001 | { |
| 4002 | limLog( pMac, LOGE, |
| 4003 | FL("Could not send Auth frame, retCode=%X "), |
| 4004 | halstatus ); |
| 4005 | pMac->authAckStatus = LIM_AUTH_ACK_RCD_FAILURE; |
| 4006 | //Pkt will be freed up by the callback |
| 4007 | } |
| 4008 | } |
| 4009 | else |
| 4010 | { |
| 4011 | /// Queue Authentication frame in high priority WQ |
| 4012 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) frameLen, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4013 | HAL_TXRX_FRM_802_11_MGMT, |
| 4014 | ANI_TXDIR_TODS, |
| 4015 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4016 | limTxComplete, pFrame, txFlag ); |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 4017 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4018 | psessionEntry->peSessionId, |
| 4019 | halstatus)); |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 4020 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4021 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4022 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4023 | FL("*** Could not send Auth frame, retCode=%X ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4024 | halstatus); |
| 4025 | |
| 4026 | //Pkt will be freed up by the callback |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 4027 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4028 | } |
| 4029 | |
| 4030 | return; |
| 4031 | } /*** end limSendAuthMgmtFrame() ***/ |
| 4032 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4033 | eHalStatus limSendDeauthCnf(tpAniSirGlobal pMac) |
| 4034 | { |
| 4035 | tANI_U16 aid; |
| 4036 | tpDphHashNode pStaDs; |
| 4037 | tLimMlmDeauthReq *pMlmDeauthReq; |
| 4038 | tLimMlmDeauthCnf mlmDeauthCnf; |
| 4039 | tpPESession psessionEntry; |
| 4040 | |
| 4041 | pMlmDeauthReq = pMac->lim.limDisassocDeauthCnfReq.pMlmDeauthReq; |
| 4042 | if (pMlmDeauthReq) |
| 4043 | { |
| 4044 | if (tx_timer_running(&pMac->lim.limTimers.gLimDeauthAckTimer)) |
| 4045 | { |
| 4046 | limDeactivateAndChangeTimer(pMac, eLIM_DEAUTH_ACK_TIMER); |
| 4047 | } |
| 4048 | |
| 4049 | if((psessionEntry = peFindSessionBySessionId(pMac, pMlmDeauthReq->sessionId))== NULL) |
| 4050 | { |
| 4051 | |
| 4052 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4053 | FL("session does not exist for given sessionId"));) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4054 | mlmDeauthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 4055 | goto end; |
| 4056 | } |
| 4057 | |
| 4058 | pStaDs = dphLookupHashEntry(pMac, pMlmDeauthReq->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 4059 | if (pStaDs == NULL) |
| 4060 | { |
| 4061 | mlmDeauthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 4062 | goto end; |
| 4063 | } |
| 4064 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4065 | /// Receive path cleanup with dummy packet |
| 4066 | limCleanupRxPath(pMac, pStaDs,psessionEntry); |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4067 | |
| 4068 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4069 | if ( psessionEntry->limSystemRole == eLIM_STA_ROLE ) |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4070 | { |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4071 | PELOGE(limLog(pMac, LOG1, |
| 4072 | FL("FT Preauth SessionId %d Cleanup" |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4073 | #ifdef FEATURE_WLAN_ESE |
| 4074 | " isESE %d" |
| 4075 | #endif |
| 4076 | #ifdef FEATURE_WLAN_LFR |
| 4077 | " isLFR %d" |
| 4078 | #endif |
| 4079 | " is11r %d, Deauth reason %d Trigger = %d"), |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4080 | psessionEntry->peSessionId, |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4081 | #ifdef FEATURE_WLAN_ESE |
| 4082 | psessionEntry->isESEconnection, |
| 4083 | #endif |
| 4084 | #ifdef FEATURE_WLAN_LFR |
| 4085 | psessionEntry->isFastRoamIniFeatureEnabled, |
| 4086 | #endif |
| 4087 | psessionEntry->is11Rconnection, |
| 4088 | pMlmDeauthReq->reasonCode, |
| 4089 | pMlmDeauthReq->deauthTrigger);); |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4090 | |
| 4091 | limFTCleanup(pMac); |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4092 | } |
| 4093 | #endif |
| 4094 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4095 | /// Free up buffer allocated for mlmDeauthReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4096 | vos_mem_free(pMlmDeauthReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4097 | pMac->lim.limDisassocDeauthCnfReq.pMlmDeauthReq = NULL; |
| 4098 | } |
| 4099 | return eHAL_STATUS_SUCCESS; |
| 4100 | end: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4101 | vos_mem_copy( (tANI_U8 *) &mlmDeauthCnf.peerMacAddr, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4102 | (tANI_U8 *) pMlmDeauthReq->peerMacAddr, |
| 4103 | sizeof(tSirMacAddr)); |
| 4104 | mlmDeauthCnf.deauthTrigger = pMlmDeauthReq->deauthTrigger; |
| 4105 | mlmDeauthCnf.aid = pMlmDeauthReq->aid; |
| 4106 | mlmDeauthCnf.sessionId = pMlmDeauthReq->sessionId; |
| 4107 | |
| 4108 | // Free up buffer allocated |
| 4109 | // for mlmDeauthReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4110 | vos_mem_free(pMlmDeauthReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4111 | |
| 4112 | limPostSmeMessage(pMac, |
| 4113 | LIM_MLM_DEAUTH_CNF, |
| 4114 | (tANI_U32 *) &mlmDeauthCnf); |
| 4115 | return eHAL_STATUS_SUCCESS; |
| 4116 | } |
| 4117 | |
| 4118 | eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) |
| 4119 | { |
| 4120 | tANI_U16 aid; |
| 4121 | tpDphHashNode pStaDs; |
| 4122 | tLimMlmDisassocCnf mlmDisassocCnf; |
| 4123 | tpPESession psessionEntry; |
| 4124 | tLimMlmDisassocReq *pMlmDisassocReq; |
| 4125 | |
| 4126 | pMlmDisassocReq = pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq; |
| 4127 | if (pMlmDisassocReq) |
| 4128 | { |
| 4129 | if (tx_timer_running(&pMac->lim.limTimers.gLimDisassocAckTimer)) |
| 4130 | { |
| 4131 | limDeactivateAndChangeTimer(pMac, eLIM_DISASSOC_ACK_TIMER); |
| 4132 | } |
| 4133 | |
| 4134 | if((psessionEntry = peFindSessionBySessionId(pMac, pMlmDisassocReq->sessionId))== NULL) |
| 4135 | { |
| 4136 | |
| 4137 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4138 | FL("session does not exist for given sessionId"));) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4139 | mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 4140 | goto end; |
| 4141 | } |
| 4142 | |
| 4143 | pStaDs = dphLookupHashEntry(pMac, pMlmDisassocReq->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 4144 | if (pStaDs == NULL) |
| 4145 | { |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 4146 | limLog(pMac, LOGE, |
| 4147 | FL("StaDs Null")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4148 | mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 4149 | goto end; |
| 4150 | } |
| 4151 | |
| 4152 | /// Receive path cleanup with dummy packet |
| 4153 | if(eSIR_SUCCESS != limCleanupRxPath(pMac, pStaDs, psessionEntry)) |
| 4154 | { |
| 4155 | mlmDisassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 4156 | limLog(pMac, LOGE, |
| 4157 | FL("CleanupRxPath error")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4158 | goto end; |
| 4159 | } |
| 4160 | |
| 4161 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4162 | if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE ) && |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 4163 | (pMlmDisassocReq->reasonCode != |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4164 | eSIR_MAC_DISASSOC_DUE_TO_FTHANDOFF_REASON)) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4165 | { |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4166 | PELOGE(limLog(pMac, LOG1, |
| 4167 | FL("FT Preauth SessionId %d Cleanup" |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4168 | #ifdef FEATURE_WLAN_ESE |
| 4169 | " isESE %d" |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4170 | #endif |
| 4171 | #ifdef FEATURE_WLAN_LFR |
| 4172 | " isLFR %d" |
| 4173 | #endif |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4174 | " is11r %d reason %d"), |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4175 | psessionEntry->peSessionId, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4176 | #ifdef FEATURE_WLAN_ESE |
| 4177 | psessionEntry->isESEconnection, |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4178 | #endif |
| 4179 | #ifdef FEATURE_WLAN_LFR |
| 4180 | psessionEntry->isFastRoamIniFeatureEnabled, |
| 4181 | #endif |
| 4182 | psessionEntry->is11Rconnection, |
| 4183 | pMlmDisassocReq->reasonCode);); |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4184 | limFTCleanup(pMac); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4185 | } |
| 4186 | #endif |
| 4187 | |
| 4188 | /// Free up buffer allocated for mlmDisassocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4189 | vos_mem_free(pMlmDisassocReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4190 | pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL; |
| 4191 | return eHAL_STATUS_SUCCESS; |
| 4192 | } |
| 4193 | else |
| 4194 | { |
| 4195 | return eHAL_STATUS_SUCCESS; |
| 4196 | } |
| 4197 | end: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4198 | vos_mem_copy( (tANI_U8 *) &mlmDisassocCnf.peerMacAddr, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4199 | (tANI_U8 *) pMlmDisassocReq->peerMacAddr, |
| 4200 | sizeof(tSirMacAddr)); |
| 4201 | mlmDisassocCnf.aid = pMlmDisassocReq->aid; |
| 4202 | mlmDisassocCnf.disassocTrigger = pMlmDisassocReq->disassocTrigger; |
| 4203 | |
| 4204 | /* Update PE session ID*/ |
| 4205 | mlmDisassocCnf.sessionId = pMlmDisassocReq->sessionId; |
| 4206 | |
Madan Mohan Koyyalamudi | b7f5a67 | 2012-11-29 11:17:46 -0800 | [diff] [blame] | 4207 | if(pMlmDisassocReq != NULL) |
| 4208 | { |
| 4209 | /// Free up buffer allocated for mlmDisassocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4210 | vos_mem_free(pMlmDisassocReq); |
Madan Mohan Koyyalamudi | b7f5a67 | 2012-11-29 11:17:46 -0800 | [diff] [blame] | 4211 | pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL; |
| 4212 | } |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4213 | |
| 4214 | limPostSmeMessage(pMac, |
| 4215 | LIM_MLM_DISASSOC_CNF, |
| 4216 | (tANI_U32 *) &mlmDisassocCnf); |
| 4217 | return eHAL_STATUS_SUCCESS; |
| 4218 | } |
| 4219 | |
Ganesh Kondabattini | 358fc9b | 2015-03-11 16:14:25 +0530 | [diff] [blame] | 4220 | eHalStatus limDisassocTxCompleteCnf(tpAniSirGlobal pMac, void *pData) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4221 | { |
Ganesh Kondabattini | b18b329 | 2015-03-16 16:59:26 +0530 | [diff] [blame] | 4222 | if (pData && IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 4223 | { |
| 4224 | tpSirTxBdStatus pTxBdStatus; |
| 4225 | pTxBdStatus = (tpSirTxBdStatus) pData; |
| 4226 | limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), |
| 4227 | pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); |
| 4228 | } |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4229 | return limSendDisassocCnf(pMac); |
| 4230 | } |
| 4231 | |
Ganesh Kondabattini | 358fc9b | 2015-03-11 16:14:25 +0530 | [diff] [blame] | 4232 | eHalStatus limDeauthTxCompleteCnf(tpAniSirGlobal pMac, void *pData) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4233 | { |
Ganesh Kondabattini | b18b329 | 2015-03-16 16:59:26 +0530 | [diff] [blame] | 4234 | if (pData && IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 4235 | { |
| 4236 | tpSirTxBdStatus pTxBdStatus; |
| 4237 | pTxBdStatus = (tpSirTxBdStatus) pData; |
| 4238 | limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), |
| 4239 | pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); |
| 4240 | } |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4241 | return limSendDeauthCnf(pMac); |
| 4242 | } |
| 4243 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4244 | /** |
| 4245 | * \brief This function is called to send Disassociate frame. |
| 4246 | * |
| 4247 | * |
| 4248 | * \param pMac Pointer to Global MAC structure |
| 4249 | * |
| 4250 | * \param nReason Indicates the reason that need to be sent in |
| 4251 | * Disassociation frame |
| 4252 | * |
| 4253 | * \param peerMacAddr MAC address of the STA to which Disassociation frame is |
| 4254 | * sent |
| 4255 | * |
| 4256 | * |
| 4257 | */ |
| 4258 | |
| 4259 | void |
| 4260 | limSendDisassocMgmtFrame(tpAniSirGlobal pMac, |
| 4261 | tANI_U16 nReason, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4262 | tSirMacAddr peer, |
| 4263 | tpPESession psessionEntry, |
| 4264 | tANI_BOOLEAN waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4265 | { |
| 4266 | tDot11fDisassociation frm; |
| 4267 | tANI_U8 *pFrame; |
| 4268 | tSirRetStatus nSirStatus; |
| 4269 | tpSirMacMgmtHdr pMacHdr; |
| 4270 | tANI_U32 nBytes, nPayload, nStatus; |
| 4271 | void *pPacket; |
| 4272 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4273 | tANI_U32 txFlag = 0; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4274 | tANI_U32 val = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4275 | if(NULL == psessionEntry) |
| 4276 | { |
| 4277 | return; |
| 4278 | } |
| 4279 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4280 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4281 | |
| 4282 | frm.Reason.code = nReason; |
| 4283 | |
| 4284 | nStatus = dot11fGetPackedDisassociationSize( pMac, &frm, &nPayload ); |
| 4285 | if ( DOT11F_FAILED( nStatus ) ) |
| 4286 | { |
| 4287 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4288 | "or a Disassociation (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4289 | nStatus ); |
| 4290 | // We'll fall back on the worst case scenario: |
| 4291 | nPayload = sizeof( tDot11fDisassociation ); |
| 4292 | } |
| 4293 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4294 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4295 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4296 | "the packed size for a Disassociation " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4297 | "(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4298 | } |
| 4299 | |
| 4300 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4301 | |
| 4302 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4303 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 4304 | ( void** ) &pPacket ); |
| 4305 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4306 | { |
| 4307 | 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] | 4308 | "association."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4309 | return; |
| 4310 | } |
| 4311 | |
| 4312 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4313 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4314 | |
| 4315 | // Next, we fill out the buffer descriptor: |
| 4316 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4317 | SIR_MAC_MGMT_DISASSOC, peer,psessionEntry->selfMacAddr); |
| 4318 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4319 | { |
| 4320 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4321 | "tor for a Disassociation (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4322 | nSirStatus ); |
| 4323 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4324 | ( void* ) pFrame, ( void* ) pPacket ); |
| 4325 | return; // just allocated... |
| 4326 | } |
| 4327 | |
| 4328 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4329 | |
| 4330 | // Prepare the BSSID |
| 4331 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 4332 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4333 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4334 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4335 | #endif |
| 4336 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4337 | nStatus = dot11fPackDisassociation( pMac, &frm, pFrame + |
| 4338 | sizeof(tSirMacMgmtHdr), |
| 4339 | nPayload, &nPayload ); |
| 4340 | if ( DOT11F_FAILED( nStatus ) ) |
| 4341 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4342 | limLog( pMac, LOGE, FL("Failed to pack a Disassociation (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4343 | nStatus ); |
| 4344 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4345 | ( void* ) pFrame, ( void* ) pPacket ); |
| 4346 | return; // allocated! |
| 4347 | } |
| 4348 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4349 | { |
| 4350 | limLog( pMac, LOGW, FL("There were warnings while packing a D" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4351 | "isassociation (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4352 | } |
| 4353 | |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 4354 | limLog( pMac, LOG1, FL("***Sessionid %d Sending Disassociation frame with " |
| 4355 | "reason %u and waitForAck %d to "MAC_ADDRESS_STR" ,From " |
| 4356 | MAC_ADDRESS_STR), psessionEntry->peSessionId, nReason, waitForAck, |
| 4357 | MAC_ADDR_ARRAY(pMacHdr->da), |
| 4358 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4359 | |
| 4360 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4361 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 4362 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4363 | ) |
| 4364 | { |
| 4365 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 4366 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 4367 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 4368 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 4369 | |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4370 | if( IS_FW_IN_TX_PATH_FEATURE_ENABLE ) |
| 4371 | { |
| 4372 | /* This frame will be sent on air by firmware, |
| 4373 | which will ensure that this frame goes out |
| 4374 | even though DEL_STA is sent immediately */ |
| 4375 | /* Without this for DEL_STA command there is |
| 4376 | risk of flushing frame in BTQM queue without |
| 4377 | sending on air */ |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 4378 | limLog( pMac, LOG1, FL("Sending Disassoc Frame over WQ5 to "MAC_ADDRESS_STR |
| 4379 | " From " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMacHdr->da), |
| 4380 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4381 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 4382 | } |
| 4383 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4384 | if (waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4385 | { |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4386 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4387 | psessionEntry->peSessionId, |
| 4388 | pMacHdr->fc.subType)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4389 | // Queue Disassociation frame in high priority WQ |
| 4390 | /* get the duration from the request */ |
| 4391 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4392 | HAL_TXRX_FRM_802_11_MGMT, |
| 4393 | ANI_TXDIR_TODS, |
| 4394 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4395 | limTxComplete, pFrame, limDisassocTxCompleteCnf, |
Ganesh Kondabattini | 10e6735 | 2015-03-16 17:41:57 +0530 | [diff] [blame] | 4396 | txFlag, |
| 4397 | pMac->lim.txBdToken++); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4398 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4399 | psessionEntry->peSessionId, |
| 4400 | halstatus)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4401 | val = SYS_MS_TO_TICKS(LIM_DISASSOC_DEAUTH_ACK_TIMEOUT); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4402 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4403 | if (tx_timer_change( |
| 4404 | &pMac->lim.limTimers.gLimDisassocAckTimer, val, 0) |
| 4405 | != TX_SUCCESS) |
| 4406 | { |
| 4407 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4408 | FL("Unable to change Disassoc ack Timer val")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4409 | return; |
| 4410 | } |
| 4411 | else if(TX_SUCCESS != tx_timer_activate( |
| 4412 | &pMac->lim.limTimers.gLimDisassocAckTimer)) |
| 4413 | { |
| 4414 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4415 | FL("Unable to activate Disassoc ack Timer")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4416 | limDeactivateAndChangeTimer(pMac, eLIM_DISASSOC_ACK_TIMER); |
| 4417 | return; |
| 4418 | } |
| 4419 | } |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4420 | else |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4421 | { |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4422 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4423 | psessionEntry->peSessionId, |
| 4424 | pMacHdr->fc.subType)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4425 | // Queue Disassociation frame in high priority WQ |
| 4426 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4427 | HAL_TXRX_FRM_802_11_MGMT, |
| 4428 | ANI_TXDIR_TODS, |
| 4429 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4430 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4431 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4432 | psessionEntry->peSessionId, |
| 4433 | halstatus)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4434 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4435 | { |
| 4436 | limLog( pMac, LOGE, FL("Failed to send Disassociation " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4437 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4438 | nSirStatus ); |
| 4439 | //Pkt will be freed up by the callback |
| 4440 | return; |
| 4441 | } |
| 4442 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4443 | } // End limSendDisassocMgmtFrame. |
| 4444 | |
| 4445 | /** |
| 4446 | * \brief This function is called to send a Deauthenticate frame |
| 4447 | * |
| 4448 | * |
| 4449 | * \param pMac Pointer to global MAC structure |
| 4450 | * |
| 4451 | * \param nReason Indicates the reason that need to be sent in the |
| 4452 | * Deauthenticate frame |
| 4453 | * |
| 4454 | * \param peeer address of the STA to which the frame is to be sent |
| 4455 | * |
| 4456 | * |
| 4457 | */ |
| 4458 | |
| 4459 | void |
| 4460 | limSendDeauthMgmtFrame(tpAniSirGlobal pMac, |
| 4461 | tANI_U16 nReason, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4462 | tSirMacAddr peer, |
| 4463 | tpPESession psessionEntry, |
| 4464 | tANI_BOOLEAN waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4465 | { |
| 4466 | tDot11fDeAuth frm; |
| 4467 | tANI_U8 *pFrame; |
| 4468 | tSirRetStatus nSirStatus; |
| 4469 | tpSirMacMgmtHdr pMacHdr; |
| 4470 | tANI_U32 nBytes, nPayload, nStatus; |
| 4471 | void *pPacket; |
| 4472 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4473 | tANI_U32 txFlag = 0; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4474 | tANI_U32 val = 0; |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4475 | #ifdef FEATURE_WLAN_TDLS |
| 4476 | tANI_U16 aid; |
| 4477 | tpDphHashNode pStaDs; |
| 4478 | #endif |
| 4479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4480 | if(NULL == psessionEntry) |
| 4481 | { |
| 4482 | return; |
| 4483 | } |
| 4484 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4485 | vos_mem_set( ( tANI_U8* ) &frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4486 | |
| 4487 | frm.Reason.code = nReason; |
| 4488 | |
| 4489 | nStatus = dot11fGetPackedDeAuthSize( pMac, &frm, &nPayload ); |
| 4490 | if ( DOT11F_FAILED( nStatus ) ) |
| 4491 | { |
| 4492 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4493 | "or a De-Authentication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4494 | nStatus ); |
| 4495 | // We'll fall back on the worst case scenario: |
| 4496 | nPayload = sizeof( tDot11fDeAuth ); |
| 4497 | } |
| 4498 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4499 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4500 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4501 | "the packed size for a De-Authentication " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4502 | "(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4503 | } |
| 4504 | |
| 4505 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4506 | |
| 4507 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4508 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 4509 | ( void** ) &pPacket ); |
| 4510 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4511 | { |
| 4512 | 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] | 4513 | "Authentication."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4514 | return; |
| 4515 | } |
| 4516 | |
| 4517 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4518 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4519 | |
| 4520 | // Next, we fill out the buffer descriptor: |
| 4521 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4522 | SIR_MAC_MGMT_DEAUTH, peer,psessionEntry->selfMacAddr); |
| 4523 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4524 | { |
| 4525 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4526 | "tor for a De-Authentication (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4527 | nSirStatus ); |
| 4528 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4529 | ( void* ) pFrame, ( void* ) pPacket ); |
| 4530 | return; // just allocated... |
| 4531 | } |
| 4532 | |
| 4533 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4534 | |
| 4535 | // Prepare the BSSID |
| 4536 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 4537 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4538 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4539 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4540 | #endif |
| 4541 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4542 | nStatus = dot11fPackDeAuth( pMac, &frm, pFrame + |
| 4543 | sizeof(tSirMacMgmtHdr), |
| 4544 | nPayload, &nPayload ); |
| 4545 | if ( DOT11F_FAILED( nStatus ) ) |
| 4546 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4547 | limLog( pMac, LOGE, FL("Failed to pack a DeAuthentication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4548 | nStatus ); |
| 4549 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4550 | ( void* ) pFrame, ( void* ) pPacket ); |
| 4551 | return; |
| 4552 | } |
| 4553 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4554 | { |
| 4555 | limLog( pMac, LOGW, FL("There were warnings while packing a D" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4556 | "e-Authentication (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4557 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 4558 | limLog( pMac, LOG1, FL("***Sessionid %d Sending Deauth frame with " |
| 4559 | "reason %u and waitForAck %d to "MAC_ADDRESS_STR" ,From " |
| 4560 | MAC_ADDRESS_STR), psessionEntry->peSessionId, nReason, waitForAck, |
| 4561 | MAC_ADDR_ARRAY(pMacHdr->da), |
| 4562 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4563 | |
| 4564 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4565 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 4566 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4567 | ) |
| 4568 | { |
| 4569 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 4570 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 4571 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 4572 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 4573 | |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4574 | if( IS_FW_IN_TX_PATH_FEATURE_ENABLE ) |
| 4575 | { |
| 4576 | /* This frame will be sent on air by firmware, |
| 4577 | which will ensure that this frame goes out |
| 4578 | even though DEL_STA is sent immediately */ |
| 4579 | /* Without this for DEL_STA command there is |
| 4580 | risk of flushing frame in BTQM queue without |
| 4581 | sending on air */ |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 4582 | limLog( pMac, LOG1, FL("Sending Deauth Frame over WQ5 to "MAC_ADDRESS_STR |
| 4583 | " From " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMacHdr->da), |
| 4584 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4585 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 4586 | } |
| 4587 | |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4588 | #ifdef FEATURE_WLAN_TDLS |
| 4589 | pStaDs = dphLookupHashEntry(pMac, peer, &aid, &psessionEntry->dph.dphHashTable); |
| 4590 | #endif |
| 4591 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4592 | if (waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4593 | { |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4594 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4595 | psessionEntry->peSessionId, |
| 4596 | pMacHdr->fc.subType)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4597 | // Queue Disassociation frame in high priority WQ |
| 4598 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4599 | HAL_TXRX_FRM_802_11_MGMT, |
| 4600 | ANI_TXDIR_TODS, |
| 4601 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
Ganesh Kondabattini | 10e6735 | 2015-03-16 17:41:57 +0530 | [diff] [blame] | 4602 | limTxComplete, pFrame, limDeauthTxCompleteCnf, txFlag, |
| 4603 | pMac->lim.txBdToken++); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4604 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4605 | psessionEntry->peSessionId, |
| 4606 | halstatus)); |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4607 | if (!HAL_STATUS_SUCCESS(halstatus)) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4608 | { |
| 4609 | limLog( pMac, LOGE, FL("Failed to send De-Authentication " |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4610 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4611 | nSirStatus ); |
Gopichand Nakkala | 4261ea5 | 2012-12-31 16:43:00 -0800 | [diff] [blame] | 4612 | //Pkt will be freed up by the callback limTxComplete |
| 4613 | |
| 4614 | /*Call limProcessDeauthAckTimeout which will send |
| 4615 | * DeauthCnf for this frame |
| 4616 | */ |
| 4617 | limProcessDeauthAckTimeout(pMac); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4618 | return; |
| 4619 | } |
| 4620 | |
| 4621 | val = SYS_MS_TO_TICKS(LIM_DISASSOC_DEAUTH_ACK_TIMEOUT); |
| 4622 | |
| 4623 | if (tx_timer_change( |
| 4624 | &pMac->lim.limTimers.gLimDeauthAckTimer, val, 0) |
| 4625 | != TX_SUCCESS) |
| 4626 | { |
| 4627 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4628 | FL("Unable to change Deauth ack Timer val")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4629 | return; |
| 4630 | } |
| 4631 | else if(TX_SUCCESS != tx_timer_activate( |
| 4632 | &pMac->lim.limTimers.gLimDeauthAckTimer)) |
| 4633 | { |
| 4634 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4635 | FL("Unable to activate Deauth ack Timer")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4636 | limDeactivateAndChangeTimer(pMac, eLIM_DEAUTH_ACK_TIMER); |
| 4637 | return; |
| 4638 | } |
| 4639 | } |
| 4640 | else |
| 4641 | { |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4642 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4643 | psessionEntry->peSessionId, |
| 4644 | pMacHdr->fc.subType)); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4645 | #ifdef FEATURE_WLAN_TDLS |
| 4646 | if ((NULL != pStaDs) && (STA_ENTRY_TDLS_PEER == pStaDs->staType)) |
| 4647 | { |
| 4648 | // Queue Disassociation frame in high priority WQ |
| 4649 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4650 | HAL_TXRX_FRM_802_11_MGMT, |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4651 | ANI_TXDIR_IBSS, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4652 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4653 | limTxComplete, pFrame, txFlag ); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4654 | } |
| 4655 | else |
| 4656 | { |
| 4657 | #endif |
| 4658 | // Queue Disassociation frame in high priority WQ |
| 4659 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4660 | HAL_TXRX_FRM_802_11_MGMT, |
| 4661 | ANI_TXDIR_TODS, |
| 4662 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4663 | limTxComplete, pFrame, txFlag ); |
| 4664 | #ifdef FEATURE_WLAN_TDLS |
| 4665 | } |
| 4666 | #endif |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4667 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4668 | psessionEntry->peSessionId, |
| 4669 | halstatus)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4670 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4671 | { |
| 4672 | limLog( pMac, LOGE, FL("Failed to send De-Authentication " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4673 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4674 | nSirStatus ); |
| 4675 | //Pkt will be freed up by the callback |
| 4676 | return; |
| 4677 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4678 | } |
| 4679 | |
| 4680 | } // End limSendDeauthMgmtFrame. |
| 4681 | |
| 4682 | |
| 4683 | #ifdef ANI_SUPPORT_11H |
| 4684 | /** |
| 4685 | * \brief Send a Measurement Report Action frame |
| 4686 | * |
| 4687 | * |
| 4688 | * \param pMac Pointer to the global MAC structure |
| 4689 | * |
| 4690 | * \param pMeasReqFrame Address of a tSirMacMeasReqActionFrame |
| 4691 | * |
| 4692 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 4693 | * |
| 4694 | * |
| 4695 | */ |
| 4696 | |
| 4697 | tSirRetStatus |
| 4698 | limSendMeasReportFrame(tpAniSirGlobal pMac, |
| 4699 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 4700 | tSirMacAddr peer) |
| 4701 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4702 | tDot11fMeasurementReport frm; |
| 4703 | tANI_U8 *pFrame; |
| 4704 | tSirRetStatus nSirStatus; |
| 4705 | tpSirMacMgmtHdr pMacHdr; |
| 4706 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4707 | void *pPacket; |
| 4708 | eHalStatus halstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4709 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4710 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4711 | |
| 4712 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4713 | frm.Action.action = SIR_MAC_ACTION_MEASURE_REPORT_ID; |
| 4714 | frm.DialogToken.token = pMeasReqFrame->actionHeader.dialogToken; |
| 4715 | |
| 4716 | switch ( pMeasReqFrame->measReqIE.measType ) |
| 4717 | { |
| 4718 | case SIR_MAC_BASIC_MEASUREMENT_TYPE: |
| 4719 | nSirStatus = |
| 4720 | PopulateDot11fMeasurementReport0( pMac, pMeasReqFrame, |
| 4721 | &frm.MeasurementReport ); |
| 4722 | break; |
| 4723 | case SIR_MAC_CCA_MEASUREMENT_TYPE: |
| 4724 | nSirStatus = |
| 4725 | PopulateDot11fMeasurementReport1( pMac, pMeasReqFrame, |
| 4726 | &frm.MeasurementReport ); |
| 4727 | break; |
| 4728 | case SIR_MAC_RPI_MEASUREMENT_TYPE: |
| 4729 | nSirStatus = |
| 4730 | PopulateDot11fMeasurementReport2( pMac, pMeasReqFrame, |
| 4731 | &frm.MeasurementReport ); |
| 4732 | break; |
| 4733 | default: |
| 4734 | limLog( pMac, LOGE, FL("Unknown measurement type %d in limSen" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4735 | "dMeasReportFrame."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4736 | pMeasReqFrame->measReqIE.measType ); |
| 4737 | return eSIR_FAILURE; |
| 4738 | } |
| 4739 | |
| 4740 | if ( eSIR_SUCCESS != nSirStatus ) return eSIR_FAILURE; |
| 4741 | |
| 4742 | nStatus = dot11fGetPackedMeasurementReportSize( pMac, &frm, &nPayload ); |
| 4743 | if ( DOT11F_FAILED( nStatus ) ) |
| 4744 | { |
| 4745 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4746 | "or a Measurement Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4747 | nStatus ); |
| 4748 | // We'll fall back on the worst case scenario: |
| 4749 | nPayload = sizeof( tDot11fMeasurementReport ); |
| 4750 | } |
| 4751 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4752 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4753 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4754 | "the packed size for a Measurement Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4755 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4756 | } |
| 4757 | |
| 4758 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4759 | |
| 4760 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4761 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4762 | { |
| 4763 | 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] | 4764 | "Authentication."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4765 | return eSIR_FAILURE; |
| 4766 | } |
| 4767 | |
| 4768 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4769 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4770 | |
| 4771 | // Next, we fill out the buffer descriptor: |
| 4772 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4773 | SIR_MAC_MGMT_ACTION, peer); |
| 4774 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4775 | { |
| 4776 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4777 | "tor for a Measurement Report (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4778 | nSirStatus ); |
| 4779 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4780 | return eSIR_FAILURE; // just allocated... |
| 4781 | } |
| 4782 | |
| 4783 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4784 | |
| 4785 | nCfg = 6; |
| 4786 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 4787 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4788 | { |
| 4789 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4790 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4791 | nSirStatus ); |
| 4792 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4793 | return eSIR_FAILURE; // just allocated... |
| 4794 | } |
| 4795 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4796 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4797 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4798 | #endif |
| 4799 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4800 | nStatus = dot11fPackMeasurementReport( pMac, &frm, pFrame + |
| 4801 | sizeof(tSirMacMgmtHdr), |
| 4802 | nPayload, &nPayload ); |
| 4803 | if ( DOT11F_FAILED( nStatus ) ) |
| 4804 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4805 | limLog( pMac, LOGE, FL("Failed to pack a Measurement Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4806 | nStatus ); |
| 4807 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4808 | return eSIR_FAILURE; // allocated! |
| 4809 | } |
| 4810 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4811 | { |
| 4812 | limLog( pMac, LOGW, FL("There were warnings while packing a M" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4813 | "easurement Report (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4814 | } |
| 4815 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4816 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4817 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 4818 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4819 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4820 | HAL_TXRX_FRM_802_11_MGMT, |
| 4821 | ANI_TXDIR_TODS, |
| 4822 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4823 | limTxComplete, pFrame, 0 ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4824 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4825 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 4826 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4827 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4828 | { |
| 4829 | limLog( pMac, LOGE, FL("Failed to send a Measurement Report " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4830 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4831 | nSirStatus ); |
| 4832 | //Pkt will be freed up by the callback |
| 4833 | return eSIR_FAILURE; // just allocated... |
| 4834 | } |
| 4835 | |
| 4836 | return eSIR_SUCCESS; |
| 4837 | |
| 4838 | } // End limSendMeasReportFrame. |
| 4839 | |
| 4840 | |
| 4841 | /** |
| 4842 | * \brief Send a TPC Request Action frame |
| 4843 | * |
| 4844 | * |
| 4845 | * \param pMac Pointer to the global MAC datastructure |
| 4846 | * |
| 4847 | * \param peer MAC address to which the frame should be sent |
| 4848 | * |
| 4849 | * |
| 4850 | */ |
| 4851 | |
| 4852 | void |
| 4853 | limSendTpcRequestFrame(tpAniSirGlobal pMac, |
| 4854 | tSirMacAddr peer) |
| 4855 | { |
| 4856 | tDot11fTPCRequest frm; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4857 | tANI_U8 *pFrame; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4858 | tSirRetStatus nSirStatus; |
| 4859 | tpSirMacMgmtHdr pMacHdr; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4860 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4861 | void *pPacket; |
| 4862 | eHalStatus halstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4863 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4864 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4865 | |
| 4866 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4867 | frm.Action.action = SIR_MAC_ACTION_TPC_REQUEST_ID; |
| 4868 | frm.DialogToken.token = 1; |
| 4869 | frm.TPCRequest.present = 1; |
| 4870 | |
| 4871 | nStatus = dot11fGetPackedTPCRequestSize( pMac, &frm, &nPayload ); |
| 4872 | if ( DOT11F_FAILED( nStatus ) ) |
| 4873 | { |
| 4874 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4875 | "or a TPC Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4876 | nStatus ); |
| 4877 | // We'll fall back on the worst case scenario: |
| 4878 | nPayload = sizeof( tDot11fTPCRequest ); |
| 4879 | } |
| 4880 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4881 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4882 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4883 | "the packed size for a TPC Request (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4884 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4885 | } |
| 4886 | |
| 4887 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4888 | |
| 4889 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4890 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4891 | { |
| 4892 | 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] | 4893 | " Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4894 | return; |
| 4895 | } |
| 4896 | |
| 4897 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4898 | vos_mem_set(pFrame, nBytes,0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4899 | |
| 4900 | // Next, we fill out the buffer descriptor: |
| 4901 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4902 | SIR_MAC_MGMT_ACTION, peer); |
| 4903 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4904 | { |
| 4905 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4906 | "tor for a TPC Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4907 | nSirStatus ); |
| 4908 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4909 | return; // just allocated... |
| 4910 | } |
| 4911 | |
| 4912 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4913 | |
| 4914 | nCfg = 6; |
| 4915 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 4916 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4917 | { |
| 4918 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4919 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4920 | nSirStatus ); |
| 4921 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4922 | return; // just allocated... |
| 4923 | } |
| 4924 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4925 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4926 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4927 | #endif |
| 4928 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4929 | nStatus = dot11fPackTPCRequest( pMac, &frm, pFrame + |
| 4930 | sizeof(tSirMacMgmtHdr), |
| 4931 | nPayload, &nPayload ); |
| 4932 | if ( DOT11F_FAILED( nStatus ) ) |
| 4933 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4934 | limLog( pMac, LOGE, FL("Failed to pack a TPC Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4935 | nStatus ); |
| 4936 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4937 | return; // allocated! |
| 4938 | } |
| 4939 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4940 | { |
| 4941 | limLog( pMac, LOGW, FL("There were warnings while packing a T" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4942 | "PC Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4943 | } |
| 4944 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4945 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4946 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 4947 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4948 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4949 | HAL_TXRX_FRM_802_11_MGMT, |
| 4950 | ANI_TXDIR_TODS, |
| 4951 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4952 | limTxComplete, pFrame, 0 ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4953 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4954 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 4955 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4956 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4957 | { |
| 4958 | limLog( pMac, LOGE, FL("Failed to send a TPC Request " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4959 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4960 | nSirStatus ); |
| 4961 | //Pkt will be freed up by the callback |
| 4962 | return; |
| 4963 | } |
| 4964 | |
| 4965 | } // End limSendTpcRequestFrame. |
| 4966 | |
| 4967 | |
| 4968 | /** |
| 4969 | * \brief Send a TPC Report Action frame |
| 4970 | * |
| 4971 | * |
| 4972 | * \param pMac Pointer to the global MAC datastructure |
| 4973 | * |
| 4974 | * \param pTpcReqFrame Pointer to the received TPC Request |
| 4975 | * |
| 4976 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 4977 | * |
| 4978 | * |
| 4979 | */ |
| 4980 | |
| 4981 | tSirRetStatus |
| 4982 | limSendTpcReportFrame(tpAniSirGlobal pMac, |
| 4983 | tpSirMacTpcReqActionFrame pTpcReqFrame, |
| 4984 | tSirMacAddr peer) |
| 4985 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4986 | tDot11fTPCReport frm; |
| 4987 | tANI_U8 *pFrame; |
| 4988 | tSirRetStatus nSirStatus; |
| 4989 | tpSirMacMgmtHdr pMacHdr; |
| 4990 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4991 | void *pPacket; |
| 4992 | eHalStatus halstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4993 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4994 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4995 | |
| 4996 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4997 | frm.Action.action = SIR_MAC_ACTION_TPC_REPORT_ID; |
| 4998 | frm.DialogToken.token = pTpcReqFrame->actionHeader.dialogToken; |
| 4999 | |
| 5000 | // FramesToDo: On the Gen4_TVM branch, there was a comment: |
| 5001 | // "misplaced this function, need to replace: |
| 5002 | // txPower = halGetRateToPwrValue(pMac, staid, |
| 5003 | // pMac->lim.gLimCurrentChannelId, 0); |
| 5004 | frm.TPCReport.tx_power = 0; |
| 5005 | frm.TPCReport.link_margin = 0; |
| 5006 | frm.TPCReport.present = 1; |
| 5007 | |
| 5008 | nStatus = dot11fGetPackedTPCReportSize( pMac, &frm, &nPayload ); |
| 5009 | if ( DOT11F_FAILED( nStatus ) ) |
| 5010 | { |
| 5011 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5012 | "or a TPC Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5013 | nStatus ); |
| 5014 | // We'll fall back on the worst case scenario: |
| 5015 | nPayload = sizeof( tDot11fTPCReport ); |
| 5016 | } |
| 5017 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5018 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5019 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5020 | "the packed size for a TPC Report (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5021 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5022 | } |
| 5023 | |
| 5024 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5025 | |
| 5026 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5027 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5028 | { |
| 5029 | 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] | 5030 | " Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5031 | return eSIR_FAILURE; |
| 5032 | } |
| 5033 | |
| 5034 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5035 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5036 | |
| 5037 | // Next, we fill out the buffer descriptor: |
| 5038 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 5039 | SIR_MAC_MGMT_ACTION, peer); |
| 5040 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5041 | { |
| 5042 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5043 | "tor for a TPC Report (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5044 | nSirStatus ); |
| 5045 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5046 | return eSIR_FAILURE; // just allocated... |
| 5047 | } |
| 5048 | |
| 5049 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 5050 | |
| 5051 | nCfg = 6; |
| 5052 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 5053 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5054 | { |
| 5055 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5056 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5057 | nSirStatus ); |
| 5058 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5059 | return eSIR_FAILURE; // just allocated... |
| 5060 | } |
| 5061 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5062 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5063 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5064 | #endif |
| 5065 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5066 | nStatus = dot11fPackTPCReport( pMac, &frm, pFrame + |
| 5067 | sizeof(tSirMacMgmtHdr), |
| 5068 | nPayload, &nPayload ); |
| 5069 | if ( DOT11F_FAILED( nStatus ) ) |
| 5070 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5071 | limLog( pMac, LOGE, FL("Failed to pack a TPC Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5072 | nStatus ); |
| 5073 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5074 | return eSIR_FAILURE; // allocated! |
| 5075 | } |
| 5076 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5077 | { |
| 5078 | limLog( pMac, LOGW, FL("There were warnings while packing a T" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5079 | "PC Report (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5080 | } |
| 5081 | |
| 5082 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5083 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5084 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 5085 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5086 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 5087 | HAL_TXRX_FRM_802_11_MGMT, |
| 5088 | ANI_TXDIR_TODS, |
| 5089 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5090 | limTxComplete, pFrame, 0 ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5091 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5092 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 5093 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5094 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5095 | { |
| 5096 | limLog( pMac, LOGE, FL("Failed to send a TPC Report " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5097 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5098 | nSirStatus ); |
| 5099 | //Pkt will be freed up by the callback |
| 5100 | return eSIR_FAILURE; // just allocated... |
| 5101 | } |
| 5102 | |
| 5103 | return eSIR_SUCCESS; |
| 5104 | |
| 5105 | } // End limSendTpcReportFrame. |
| 5106 | #endif //ANI_SUPPORT_11H |
| 5107 | |
| 5108 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5109 | /** |
| 5110 | * \brief Send a Channel Switch Announcement |
| 5111 | * |
| 5112 | * |
| 5113 | * \param pMac Pointer to the global MAC datastructure |
| 5114 | * |
| 5115 | * \param peer MAC address to which this frame will be sent |
| 5116 | * |
| 5117 | * \param nMode |
| 5118 | * |
| 5119 | * \param nNewChannel |
| 5120 | * |
| 5121 | * \param nCount |
| 5122 | * |
| 5123 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 5124 | * |
| 5125 | * |
| 5126 | */ |
| 5127 | |
| 5128 | tSirRetStatus |
| 5129 | limSendChannelSwitchMgmtFrame(tpAniSirGlobal pMac, |
| 5130 | tSirMacAddr peer, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5131 | tANI_U8 nMode, |
| 5132 | tANI_U8 nNewChannel, |
| 5133 | tANI_U8 nCount, |
| 5134 | tpPESession psessionEntry ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5135 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5136 | tDot11fChannelSwitch frm; |
| 5137 | tANI_U8 *pFrame; |
| 5138 | tSirRetStatus nSirStatus; |
| 5139 | tpSirMacMgmtHdr pMacHdr; |
| 5140 | tANI_U32 nBytes, nPayload, nStatus;//, nCfg; |
| 5141 | void *pPacket; |
| 5142 | eHalStatus halstatus; |
| 5143 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5144 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5145 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5146 | |
| 5147 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 5148 | frm.Action.action = SIR_MAC_ACTION_CHANNEL_SWITCH_ID; |
| 5149 | frm.ChanSwitchAnn.switchMode = nMode; |
| 5150 | frm.ChanSwitchAnn.newChannel = nNewChannel; |
| 5151 | frm.ChanSwitchAnn.switchCount = nCount; |
| 5152 | frm.ChanSwitchAnn.present = 1; |
| 5153 | |
| 5154 | nStatus = dot11fGetPackedChannelSwitchSize( pMac, &frm, &nPayload ); |
| 5155 | if ( DOT11F_FAILED( nStatus ) ) |
| 5156 | { |
| 5157 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5158 | "or a Channel Switch (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5159 | nStatus ); |
| 5160 | // We'll fall back on the worst case scenario: |
| 5161 | nPayload = sizeof( tDot11fChannelSwitch ); |
| 5162 | } |
| 5163 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5164 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5165 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5166 | "the packed size for a Channel Switch (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5167 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5168 | } |
| 5169 | |
| 5170 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5171 | |
| 5172 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5173 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5174 | { |
| 5175 | 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] | 5176 | " Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5177 | return eSIR_FAILURE; |
| 5178 | } |
| 5179 | |
| 5180 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5181 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5182 | |
| 5183 | // Next, we fill out the buffer descriptor: |
| 5184 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5185 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 5186 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5187 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 5188 | (tANI_U8 *) psessionEntry->bssId, |
| 5189 | sizeof( tSirMacAddr )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5190 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5191 | { |
| 5192 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5193 | "tor for a Channel Switch (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5194 | nSirStatus ); |
| 5195 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5196 | return eSIR_FAILURE; // just allocated... |
| 5197 | } |
| 5198 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5199 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5200 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 5201 | |
| 5202 | nCfg = 6; |
| 5203 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 5204 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5205 | { |
| 5206 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5207 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5208 | nSirStatus ); |
| 5209 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5210 | return eSIR_FAILURE; // just allocated... |
| 5211 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5212 | #endif |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5213 | |
| 5214 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5215 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5216 | #endif |
| 5217 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5218 | nStatus = dot11fPackChannelSwitch( pMac, &frm, pFrame + |
| 5219 | sizeof(tSirMacMgmtHdr), |
| 5220 | nPayload, &nPayload ); |
| 5221 | if ( DOT11F_FAILED( nStatus ) ) |
| 5222 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5223 | limLog( pMac, LOGE, FL("Failed to pack a Channel Switch (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5224 | nStatus ); |
| 5225 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5226 | return eSIR_FAILURE; // allocated! |
| 5227 | } |
| 5228 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5229 | { |
| 5230 | limLog( pMac, LOGW, FL("There were warnings while packing a C" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5231 | "hannel Switch (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5232 | } |
| 5233 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5234 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5235 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5236 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5237 | ) |
| 5238 | { |
| 5239 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5240 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5241 | |
| 5242 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5243 | psessionEntry->peSessionId, |
| 5244 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5245 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 5246 | HAL_TXRX_FRM_802_11_MGMT, |
| 5247 | ANI_TXDIR_TODS, |
| 5248 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5249 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5250 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5251 | psessionEntry->peSessionId, |
| 5252 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5253 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5254 | { |
| 5255 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5256 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5257 | nSirStatus ); |
| 5258 | //Pkt will be freed up by the callback |
| 5259 | return eSIR_FAILURE; |
| 5260 | } |
| 5261 | |
| 5262 | return eSIR_SUCCESS; |
| 5263 | |
| 5264 | } // End limSendChannelSwitchMgmtFrame. |
| 5265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5266 | |
| 5267 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5268 | #ifdef WLAN_FEATURE_11AC |
| 5269 | tSirRetStatus |
| 5270 | limSendVHTOpmodeNotificationFrame(tpAniSirGlobal pMac, |
| 5271 | tSirMacAddr peer, |
| 5272 | tANI_U8 nMode, |
| 5273 | tpPESession psessionEntry ) |
| 5274 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5275 | tDot11fOperatingMode frm; |
| 5276 | tANI_U8 *pFrame; |
| 5277 | tSirRetStatus nSirStatus; |
| 5278 | tpSirMacMgmtHdr pMacHdr; |
| 5279 | tANI_U32 nBytes, nPayload = 0, nStatus;//, nCfg; |
| 5280 | void *pPacket; |
| 5281 | eHalStatus halstatus; |
| 5282 | tANI_U32 txFlag = 0; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5283 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5284 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5285 | |
| 5286 | frm.Category.category = SIR_MAC_ACTION_VHT; |
| 5287 | frm.Action.action = SIR_MAC_VHT_OPMODE_NOTIFICATION; |
| 5288 | frm.OperatingMode.chanWidth = nMode; |
| 5289 | frm.OperatingMode.rxNSS = 0; |
| 5290 | frm.OperatingMode.rxNSSType = 0; |
| 5291 | |
| 5292 | nStatus = dot11fGetPackedOperatingModeSize( pMac, &frm, &nPayload ); |
| 5293 | if ( DOT11F_FAILED( nStatus ) ) |
| 5294 | { |
| 5295 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5296 | "or a Operating Mode (0x%08x)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5297 | nStatus ); |
| 5298 | // We'll fall back on the worst case scenario: |
| 5299 | nPayload = sizeof( tDot11fOperatingMode); |
| 5300 | } |
| 5301 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5302 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5303 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5304 | "the packed size for a Operating Mode (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5305 | "%08x)."), nStatus ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5306 | } |
| 5307 | |
| 5308 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5309 | |
| 5310 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5311 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5312 | { |
| 5313 | 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] | 5314 | " Report."), nBytes ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5315 | return eSIR_FAILURE; |
| 5316 | } |
| 5317 | |
| 5318 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5319 | vos_mem_set( pFrame, nBytes, 0 ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5320 | |
| 5321 | |
| 5322 | // Next, we fill out the buffer descriptor: |
| 5323 | if(psessionEntry->pePersona == VOS_STA_SAP_MODE) { |
| 5324 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 5325 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 5326 | } else |
| 5327 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 5328 | SIR_MAC_MGMT_ACTION, psessionEntry->bssId, psessionEntry->selfMacAddr); |
| 5329 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5330 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 5331 | (tANI_U8 *) psessionEntry->bssId, |
| 5332 | sizeof( tSirMacAddr )); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5333 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5334 | { |
| 5335 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5336 | "tor for a Operating Mode (%d)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5337 | nSirStatus ); |
| 5338 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5339 | return eSIR_FAILURE; // just allocated... |
| 5340 | } |
| 5341 | nStatus = dot11fPackOperatingMode( pMac, &frm, pFrame + |
| 5342 | sizeof(tSirMacMgmtHdr), |
| 5343 | nPayload, &nPayload ); |
| 5344 | if ( DOT11F_FAILED( nStatus ) ) |
| 5345 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5346 | limLog( pMac, LOGE, FL("Failed to pack a Operating Mode (0x%08x)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5347 | nStatus ); |
| 5348 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5349 | return eSIR_FAILURE; // allocated! |
| 5350 | } |
| 5351 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5352 | { |
| 5353 | limLog( pMac, LOGW, FL("There were warnings while packing a Operating Mode" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5354 | " (0x%08x)."), nStatus ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5355 | } |
| 5356 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5357 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5358 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5359 | ) |
| 5360 | { |
| 5361 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5362 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5363 | |
| 5364 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5365 | psessionEntry->peSessionId, |
| 5366 | pMacHdr->fc.subType)); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5367 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 5368 | HAL_TXRX_FRM_802_11_MGMT, |
| 5369 | ANI_TXDIR_TODS, |
| 5370 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5371 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5372 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5373 | psessionEntry->peSessionId, |
| 5374 | halstatus)); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5375 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5376 | { |
| 5377 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5378 | "(%X)!"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5379 | nSirStatus ); |
| 5380 | //Pkt will be freed up by the callback |
| 5381 | return eSIR_FAILURE; |
| 5382 | } |
| 5383 | |
| 5384 | return eSIR_SUCCESS; |
| 5385 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5386 | |
| 5387 | /** |
| 5388 | * \brief Send a VHT Channel Switch Announcement |
| 5389 | * |
| 5390 | * |
| 5391 | * \param pMac Pointer to the global MAC datastructure |
| 5392 | * |
| 5393 | * \param peer MAC address to which this frame will be sent |
| 5394 | * |
| 5395 | * \param nChanWidth |
| 5396 | * |
| 5397 | * \param nNewChannel |
| 5398 | * |
| 5399 | * |
| 5400 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 5401 | * |
| 5402 | * |
| 5403 | */ |
| 5404 | |
| 5405 | tSirRetStatus |
| 5406 | limSendVHTChannelSwitchMgmtFrame(tpAniSirGlobal pMac, |
| 5407 | tSirMacAddr peer, |
| 5408 | tANI_U8 nChanWidth, |
| 5409 | tANI_U8 nNewChannel, |
| 5410 | tANI_U8 ncbMode, |
| 5411 | tpPESession psessionEntry ) |
| 5412 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5413 | tDot11fChannelSwitch frm; |
| 5414 | tANI_U8 *pFrame; |
| 5415 | tSirRetStatus nSirStatus; |
| 5416 | tpSirMacMgmtHdr pMacHdr; |
| 5417 | tANI_U32 nBytes, nPayload, nStatus;//, nCfg; |
| 5418 | void *pPacket; |
| 5419 | eHalStatus halstatus; |
| 5420 | tANI_U32 txFlag = 0; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5421 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5422 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5423 | |
| 5424 | |
| 5425 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 5426 | frm.Action.action = SIR_MAC_ACTION_CHANNEL_SWITCH_ID; |
| 5427 | frm.ChanSwitchAnn.switchMode = 1; |
| 5428 | frm.ChanSwitchAnn.newChannel = nNewChannel; |
| 5429 | frm.ChanSwitchAnn.switchCount = 1; |
| 5430 | frm.ExtChanSwitchAnn.secondaryChannelOffset = limGetHTCBState(ncbMode); |
| 5431 | frm.ExtChanSwitchAnn.present = 1; |
| 5432 | frm.WiderBWChanSwitchAnn.newChanWidth = nChanWidth; |
| 5433 | frm.WiderBWChanSwitchAnn.newCenterChanFreq0 = limGetCenterChannel(pMac,nNewChannel,ncbMode,nChanWidth); |
| 5434 | frm.WiderBWChanSwitchAnn.newCenterChanFreq1 = 0; |
| 5435 | frm.ChanSwitchAnn.present = 1; |
| 5436 | frm.WiderBWChanSwitchAnn.present = 1; |
| 5437 | |
| 5438 | nStatus = dot11fGetPackedChannelSwitchSize( pMac, &frm, &nPayload ); |
| 5439 | if ( DOT11F_FAILED( nStatus ) ) |
| 5440 | { |
| 5441 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5442 | "or a Channel Switch (0x%08x)."), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5443 | nStatus ); |
| 5444 | // We'll fall back on the worst case scenario: |
| 5445 | nPayload = sizeof( tDot11fChannelSwitch ); |
| 5446 | } |
| 5447 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5448 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5449 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5450 | "the packed size for a Channel Switch (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5451 | "%08x)."), nStatus ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5452 | } |
| 5453 | |
| 5454 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5455 | |
| 5456 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5457 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5458 | { |
| 5459 | 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] | 5460 | " Report."), nBytes ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5461 | return eSIR_FAILURE; |
| 5462 | } |
| 5463 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5464 | vos_mem_set( pFrame, nBytes, 0 ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5465 | |
| 5466 | // Next, we fill out the buffer descriptor: |
| 5467 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 5468 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 5469 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5470 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 5471 | (tANI_U8 *) psessionEntry->bssId, |
| 5472 | sizeof( tSirMacAddr )); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5473 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5474 | { |
| 5475 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5476 | "tor for a Channel Switch (%d)."), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5477 | nSirStatus ); |
| 5478 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5479 | return eSIR_FAILURE; // just allocated... |
| 5480 | } |
| 5481 | nStatus = dot11fPackChannelSwitch( pMac, &frm, pFrame + |
| 5482 | sizeof(tSirMacMgmtHdr), |
| 5483 | nPayload, &nPayload ); |
| 5484 | if ( DOT11F_FAILED( nStatus ) ) |
| 5485 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5486 | 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] | 5487 | nStatus ); |
| 5488 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5489 | return eSIR_FAILURE; // allocated! |
| 5490 | } |
| 5491 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5492 | { |
| 5493 | limLog( pMac, LOGW, FL("There were warnings while packing a C" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5494 | "hannel Switch (0x%08x)."), nStatus ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5495 | } |
| 5496 | |
| 5497 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5498 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5499 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5500 | ) |
| 5501 | { |
| 5502 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5503 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5504 | |
| 5505 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5506 | psessionEntry->peSessionId, |
| 5507 | pMacHdr->fc.subType)); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5508 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 5509 | HAL_TXRX_FRM_802_11_MGMT, |
| 5510 | ANI_TXDIR_TODS, |
| 5511 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5512 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5513 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5514 | psessionEntry->peSessionId, |
| 5515 | halstatus)); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5516 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5517 | { |
| 5518 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5519 | "(%X)!"), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5520 | nSirStatus ); |
| 5521 | //Pkt will be freed up by the callback |
| 5522 | return eSIR_FAILURE; |
| 5523 | } |
| 5524 | |
| 5525 | return eSIR_SUCCESS; |
| 5526 | |
| 5527 | } // End limSendVHTChannelSwitchMgmtFrame. |
| 5528 | |
| 5529 | |
| 5530 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5531 | #endif |
| 5532 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5533 | /** |
| 5534 | * \brief Send an ADDBA Req Action Frame to peer |
| 5535 | * |
| 5536 | * \sa limSendAddBAReq |
| 5537 | * |
| 5538 | * \param pMac The global tpAniSirGlobal object |
| 5539 | * |
| 5540 | * \param pMlmAddBAReq A pointer to tLimMlmAddBAReq. This contains |
| 5541 | * the necessary parameters reqd by PE send the ADDBA Req Action |
| 5542 | * Frame to the peer |
| 5543 | * |
| 5544 | * \return eSIR_SUCCESS if setup completes successfully |
| 5545 | * eSIR_FAILURE is some problem is encountered |
| 5546 | */ |
| 5547 | tSirRetStatus limSendAddBAReq( tpAniSirGlobal pMac, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5548 | tpLimMlmAddBAReq pMlmAddBAReq, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5549 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5550 | tDot11fAddBAReq frmAddBAReq; |
| 5551 | tANI_U8 *pAddBAReqBuffer = NULL; |
| 5552 | tpSirMacMgmtHdr pMacHdr; |
| 5553 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 5554 | tSirRetStatus statusCode; |
| 5555 | eHalStatus halStatus; |
| 5556 | void *pPacket; |
| 5557 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5558 | |
| 5559 | if(NULL == psessionEntry) |
| 5560 | { |
| 5561 | return eSIR_FAILURE; |
| 5562 | } |
| 5563 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5564 | vos_mem_set( (void *) &frmAddBAReq, sizeof( frmAddBAReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5565 | |
| 5566 | // Category - 3 (BA) |
| 5567 | frmAddBAReq.Category.category = SIR_MAC_ACTION_BLKACK; |
| 5568 | |
| 5569 | // Action - 0 (ADDBA Req) |
| 5570 | frmAddBAReq.Action.action = SIR_MAC_BLKACK_ADD_REQ; |
| 5571 | |
| 5572 | // FIXME - Dialog Token, generalize this... |
| 5573 | frmAddBAReq.DialogToken.token = pMlmAddBAReq->baDialogToken; |
| 5574 | |
| 5575 | // Fill the ADDBA Parameter Set |
| 5576 | frmAddBAReq.AddBAParameterSet.tid = pMlmAddBAReq->baTID; |
| 5577 | frmAddBAReq.AddBAParameterSet.policy = pMlmAddBAReq->baPolicy; |
| 5578 | frmAddBAReq.AddBAParameterSet.bufferSize = pMlmAddBAReq->baBufferSize; |
| 5579 | |
| 5580 | // BA timeout |
| 5581 | // 0 - indicates no BA timeout |
| 5582 | frmAddBAReq.BATimeout.timeout = pMlmAddBAReq->baTimeout; |
| 5583 | |
Abhishek Singh | 1f6e653 | 2014-06-05 17:35:08 +0530 | [diff] [blame] | 5584 | /* Send SSN whatever we get from FW. |
| 5585 | */ |
| 5586 | frmAddBAReq.BAStartingSequenceControl.ssn = pMlmAddBAReq->baSSN; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5587 | |
| 5588 | nStatus = dot11fGetPackedAddBAReqSize( pMac, &frmAddBAReq, &nPayload ); |
| 5589 | |
| 5590 | if( DOT11F_FAILED( nStatus )) |
| 5591 | { |
| 5592 | limLog( pMac, LOGW, |
| 5593 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5594 | "an ADDBA Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5595 | nStatus ); |
| 5596 | |
| 5597 | // We'll fall back on the worst case scenario: |
| 5598 | nPayload = sizeof( tDot11fAddBAReq ); |
| 5599 | } |
| 5600 | else if( DOT11F_WARNED( nStatus )) |
| 5601 | { |
| 5602 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5603 | FL( "There were warnings while calculating " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5604 | "the packed size for an ADDBA Req (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5605 | nStatus ); |
| 5606 | } |
| 5607 | |
| 5608 | // Add the MGMT header to frame length |
| 5609 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5610 | |
| 5611 | // Need to allocate a buffer for ADDBA AF |
| 5612 | if( eHAL_STATUS_SUCCESS != |
| 5613 | (halStatus = palPktAlloc( pMac->hHdd, |
| 5614 | HAL_TXRX_FRM_802_11_MGMT, |
| 5615 | (tANI_U16) frameLen, |
| 5616 | (void **) &pAddBAReqBuffer, |
| 5617 | (void **) &pPacket ))) |
| 5618 | { |
| 5619 | // Log error |
| 5620 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5621 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5622 | frameLen, |
| 5623 | halStatus ); |
| 5624 | |
| 5625 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 5626 | goto returnAfterError; |
| 5627 | } |
| 5628 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5629 | vos_mem_set( (void *) pAddBAReqBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5630 | |
| 5631 | // Copy necessary info to BD |
| 5632 | if( eSIR_SUCCESS != |
| 5633 | (statusCode = limPopulateMacHeader( pMac, |
| 5634 | pAddBAReqBuffer, |
| 5635 | SIR_MAC_MGMT_FRAME, |
| 5636 | SIR_MAC_MGMT_ACTION, |
| 5637 | pMlmAddBAReq->peerMacAddr,psessionEntry->selfMacAddr))) |
| 5638 | goto returnAfterError; |
| 5639 | |
| 5640 | // Update A3 with the BSSID |
| 5641 | pMacHdr = ( tpSirMacMgmtHdr ) pAddBAReqBuffer; |
| 5642 | |
| 5643 | #if 0 |
| 5644 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 5645 | if( eSIR_SUCCESS != cfgGetStr( pMac, |
| 5646 | WNI_CFG_BSSID, |
| 5647 | (tANI_U8 *) pMacHdr->bssId, |
| 5648 | &cfgLen )) |
| 5649 | { |
| 5650 | limLog( pMac, LOGP, |
| 5651 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5652 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5653 | |
| 5654 | // FIXME - Need to convert to tSirRetStatus |
| 5655 | statusCode = eSIR_FAILURE; |
| 5656 | goto returnAfterError; |
| 5657 | } |
| 5658 | #endif//TO SUPPORT BT-AMP |
| 5659 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 5660 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5661 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5662 | limSetProtectedBit(pMac, psessionEntry, pMlmAddBAReq->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5663 | #endif |
| 5664 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5665 | // Now, we're ready to "pack" the frames |
| 5666 | nStatus = dot11fPackAddBAReq( pMac, |
| 5667 | &frmAddBAReq, |
| 5668 | pAddBAReqBuffer + sizeof( tSirMacMgmtHdr ), |
| 5669 | nPayload, |
| 5670 | &nPayload ); |
| 5671 | |
| 5672 | if( DOT11F_FAILED( nStatus )) |
| 5673 | { |
| 5674 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5675 | FL( "Failed to pack an ADDBA Req (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5676 | nStatus ); |
| 5677 | |
| 5678 | // FIXME - Need to convert to tSirRetStatus |
| 5679 | statusCode = eSIR_FAILURE; |
| 5680 | goto returnAfterError; |
| 5681 | } |
| 5682 | else if( DOT11F_WARNED( nStatus )) |
| 5683 | { |
| 5684 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5685 | FL( "There were warnings while packing an ADDBA Req (0x%08x)."), |
| 5686 | nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5687 | } |
| 5688 | |
Abhishek Singh | 02d9f6c | 2014-05-12 14:07:53 +0530 | [diff] [blame] | 5689 | limLog( pMac, LOG1, FL( "Sending an ADDBA REQ to "MAC_ADDRESS_STR " with" |
| 5690 | " tid = %d policy = %d buffsize = %d " |
| 5691 | " amsduSupported = %d"), |
| 5692 | MAC_ADDR_ARRAY(pMlmAddBAReq->peerMacAddr), |
| 5693 | frmAddBAReq.AddBAParameterSet.tid, |
| 5694 | frmAddBAReq.AddBAParameterSet.policy, |
| 5695 | frmAddBAReq.AddBAParameterSet.bufferSize, |
| 5696 | frmAddBAReq.AddBAParameterSet.amsduSupported); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5697 | |
Abhishek Singh | 1f6e653 | 2014-06-05 17:35:08 +0530 | [diff] [blame] | 5698 | limLog( pMac, LOG1, FL( "ssn = %d fragNum = %d" ), |
| 5699 | frmAddBAReq.BAStartingSequenceControl.ssn, |
| 5700 | frmAddBAReq.BAStartingSequenceControl.fragNumber); |
| 5701 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5702 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5703 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5704 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5705 | ) |
| 5706 | { |
| 5707 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5708 | } |
| 5709 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5710 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5711 | psessionEntry->peSessionId, |
| 5712 | pMacHdr->fc.subType)); |
| 5713 | halStatus = halTxFrame( pMac, |
| 5714 | pPacket, |
| 5715 | (tANI_U16) frameLen, |
| 5716 | HAL_TXRX_FRM_802_11_MGMT, |
| 5717 | ANI_TXDIR_TODS, |
| 5718 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5719 | limTxComplete, |
| 5720 | pAddBAReqBuffer, txFlag ); |
| 5721 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5722 | psessionEntry->peSessionId, |
| 5723 | halStatus)); |
| 5724 | if( eHAL_STATUS_SUCCESS != halStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5725 | { |
| 5726 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5727 | FL( "halTxFrame FAILED! Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5728 | halStatus ); |
| 5729 | |
| 5730 | // FIXME - Need to convert eHalStatus to tSirRetStatus |
| 5731 | statusCode = eSIR_FAILURE; |
| 5732 | //Pkt will be freed up by the callback |
| 5733 | return statusCode; |
| 5734 | } |
| 5735 | else |
| 5736 | return eSIR_SUCCESS; |
| 5737 | |
| 5738 | returnAfterError: |
| 5739 | |
| 5740 | // Release buffer, if allocated |
| 5741 | if( NULL != pAddBAReqBuffer ) |
| 5742 | palPktFree( pMac->hHdd, |
| 5743 | HAL_TXRX_FRM_802_11_MGMT, |
| 5744 | (void *) pAddBAReqBuffer, |
| 5745 | (void *) pPacket ); |
| 5746 | |
| 5747 | return statusCode; |
| 5748 | } |
| 5749 | |
| 5750 | /** |
| 5751 | * \brief Send an ADDBA Rsp Action Frame to peer |
| 5752 | * |
| 5753 | * \sa limSendAddBARsp |
| 5754 | * |
| 5755 | * \param pMac The global tpAniSirGlobal object |
| 5756 | * |
| 5757 | * \param pMlmAddBARsp A pointer to tLimMlmAddBARsp. This contains |
| 5758 | * the necessary parameters reqd by PE send the ADDBA Rsp Action |
| 5759 | * Frame to the peer |
| 5760 | * |
| 5761 | * \return eSIR_SUCCESS if setup completes successfully |
| 5762 | * eSIR_FAILURE is some problem is encountered |
| 5763 | */ |
| 5764 | tSirRetStatus limSendAddBARsp( tpAniSirGlobal pMac, |
| 5765 | tpLimMlmAddBARsp pMlmAddBARsp, |
| 5766 | tpPESession psessionEntry) |
| 5767 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5768 | tDot11fAddBARsp frmAddBARsp; |
| 5769 | tANI_U8 *pAddBARspBuffer = NULL; |
| 5770 | tpSirMacMgmtHdr pMacHdr; |
| 5771 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 5772 | tSirRetStatus statusCode; |
| 5773 | eHalStatus halStatus; |
| 5774 | void *pPacket; |
| 5775 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5776 | |
| 5777 | if(NULL == psessionEntry) |
| 5778 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5779 | PELOGE(limLog(pMac, LOGE, FL("Session entry is NULL!!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5780 | return eSIR_FAILURE; |
| 5781 | } |
| 5782 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5783 | vos_mem_set( (void *) &frmAddBARsp, sizeof( frmAddBARsp ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5784 | |
| 5785 | // Category - 3 (BA) |
| 5786 | frmAddBARsp.Category.category = SIR_MAC_ACTION_BLKACK; |
| 5787 | // Action - 1 (ADDBA Rsp) |
| 5788 | frmAddBARsp.Action.action = SIR_MAC_BLKACK_ADD_RSP; |
| 5789 | |
| 5790 | // Should be same as the one we received in the ADDBA Req |
| 5791 | frmAddBARsp.DialogToken.token = pMlmAddBARsp->baDialogToken; |
| 5792 | |
| 5793 | // ADDBA Req status |
| 5794 | frmAddBARsp.Status.status = pMlmAddBARsp->addBAResultCode; |
| 5795 | |
| 5796 | // Fill the ADDBA Parameter Set as provided by caller |
| 5797 | frmAddBARsp.AddBAParameterSet.tid = pMlmAddBARsp->baTID; |
| 5798 | frmAddBARsp.AddBAParameterSet.policy = pMlmAddBARsp->baPolicy; |
| 5799 | frmAddBARsp.AddBAParameterSet.bufferSize = pMlmAddBARsp->baBufferSize; |
krunal soni | 5afa96c | 2013-09-06 22:19:02 -0700 | [diff] [blame] | 5800 | |
| 5801 | if(psessionEntry->isAmsduSupportInAMPDU) |
| 5802 | { |
| 5803 | frmAddBARsp.AddBAParameterSet.amsduSupported = |
| 5804 | psessionEntry->amsduSupportedInBA; |
| 5805 | } |
| 5806 | else |
| 5807 | { |
| 5808 | frmAddBARsp.AddBAParameterSet.amsduSupported = 0; |
| 5809 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5810 | |
| 5811 | // BA timeout |
| 5812 | // 0 - indicates no BA timeout |
| 5813 | frmAddBARsp.BATimeout.timeout = pMlmAddBARsp->baTimeout; |
| 5814 | |
| 5815 | nStatus = dot11fGetPackedAddBARspSize( pMac, &frmAddBARsp, &nPayload ); |
| 5816 | |
| 5817 | if( DOT11F_FAILED( nStatus )) |
| 5818 | { |
| 5819 | limLog( pMac, LOGW, |
| 5820 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5821 | "an ADDBA Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5822 | nStatus ); |
| 5823 | |
| 5824 | // We'll fall back on the worst case scenario: |
| 5825 | nPayload = sizeof( tDot11fAddBARsp ); |
| 5826 | } |
| 5827 | else if( DOT11F_WARNED( nStatus )) |
| 5828 | { |
| 5829 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5830 | FL( "There were warnings while calculating " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5831 | "the packed size for an ADDBA Rsp (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5832 | nStatus ); |
| 5833 | } |
| 5834 | |
| 5835 | // Need to allocate a buffer for ADDBA AF |
| 5836 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5837 | |
| 5838 | // Allocate shared memory |
| 5839 | if( eHAL_STATUS_SUCCESS != |
| 5840 | (halStatus = palPktAlloc( pMac->hHdd, |
| 5841 | HAL_TXRX_FRM_802_11_MGMT, |
| 5842 | (tANI_U16) frameLen, |
| 5843 | (void **) &pAddBARspBuffer, |
| 5844 | (void **) &pPacket ))) |
| 5845 | { |
| 5846 | // Log error |
| 5847 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5848 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5849 | frameLen, |
| 5850 | halStatus ); |
| 5851 | |
| 5852 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 5853 | goto returnAfterError; |
| 5854 | } |
| 5855 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5856 | vos_mem_set( (void *) pAddBARspBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5857 | |
| 5858 | // Copy necessary info to BD |
| 5859 | if( eSIR_SUCCESS != |
| 5860 | (statusCode = limPopulateMacHeader( pMac, |
| 5861 | pAddBARspBuffer, |
| 5862 | SIR_MAC_MGMT_FRAME, |
| 5863 | SIR_MAC_MGMT_ACTION, |
| 5864 | pMlmAddBARsp->peerMacAddr,psessionEntry->selfMacAddr))) |
| 5865 | goto returnAfterError; |
| 5866 | |
| 5867 | // Update A3 with the BSSID |
| 5868 | |
| 5869 | pMacHdr = ( tpSirMacMgmtHdr ) pAddBARspBuffer; |
| 5870 | |
| 5871 | #if 0 |
| 5872 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 5873 | if( eSIR_SUCCESS != wlan_cfgGetStr( pMac, |
| 5874 | WNI_CFG_BSSID, |
| 5875 | (tANI_U8 *) pMacHdr->bssId, |
| 5876 | &cfgLen )) |
| 5877 | { |
| 5878 | limLog( pMac, LOGP, |
| 5879 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5880 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5881 | |
| 5882 | // FIXME - Need to convert to tSirRetStatus |
| 5883 | statusCode = eSIR_FAILURE; |
| 5884 | goto returnAfterError; |
| 5885 | } |
| 5886 | #endif // TO SUPPORT BT-AMP |
| 5887 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 5888 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5889 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5890 | limSetProtectedBit(pMac, psessionEntry, pMlmAddBARsp->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5891 | #endif |
| 5892 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5893 | // Now, we're ready to "pack" the frames |
| 5894 | nStatus = dot11fPackAddBARsp( pMac, |
| 5895 | &frmAddBARsp, |
| 5896 | pAddBARspBuffer + sizeof( tSirMacMgmtHdr ), |
| 5897 | nPayload, |
| 5898 | &nPayload ); |
| 5899 | |
| 5900 | if( DOT11F_FAILED( nStatus )) |
| 5901 | { |
| 5902 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5903 | FL( "Failed to pack an ADDBA Rsp (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5904 | nStatus ); |
| 5905 | |
| 5906 | // FIXME - Need to convert to tSirRetStatus |
| 5907 | statusCode = eSIR_FAILURE; |
| 5908 | goto returnAfterError; |
| 5909 | } |
| 5910 | else if( DOT11F_WARNED( nStatus )) |
| 5911 | { |
| 5912 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5913 | FL( "There were warnings while packing an ADDBA Rsp (0x%08x)." ), |
| 5914 | nStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5915 | } |
| 5916 | |
Abhishek Singh | 02d9f6c | 2014-05-12 14:07:53 +0530 | [diff] [blame] | 5917 | limLog( pMac, LOG1, FL( "Sending an ADDBA RSP to "MAC_ADDRESS_STR " with" |
| 5918 | " tid = %d policy = %d buffsize = %d" |
| 5919 | " amsduSupported = %d status %d"), |
| 5920 | MAC_ADDR_ARRAY(pMlmAddBARsp->peerMacAddr), |
| 5921 | frmAddBARsp.AddBAParameterSet.tid, |
| 5922 | frmAddBARsp.AddBAParameterSet.policy, |
| 5923 | frmAddBARsp.AddBAParameterSet.bufferSize, |
| 5924 | frmAddBARsp.AddBAParameterSet.amsduSupported, |
| 5925 | frmAddBARsp.Status.status); |
| 5926 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5927 | |
| 5928 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5929 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5930 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5931 | ) |
| 5932 | { |
| 5933 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5934 | } |
| 5935 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5936 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5937 | psessionEntry->peSessionId, |
| 5938 | pMacHdr->fc.subType)); |
| 5939 | halStatus = halTxFrame( pMac, |
| 5940 | pPacket, |
| 5941 | (tANI_U16) frameLen, |
| 5942 | HAL_TXRX_FRM_802_11_MGMT, |
| 5943 | ANI_TXDIR_TODS, |
| 5944 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5945 | limTxComplete, |
| 5946 | pAddBARspBuffer, txFlag ); |
| 5947 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5948 | psessionEntry->peSessionId, |
| 5949 | halStatus)); |
| 5950 | if( eHAL_STATUS_SUCCESS != halStatus ) |
| 5951 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5952 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5953 | FL( "halTxFrame FAILED! Status [%d]" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5954 | halStatus ); |
| 5955 | |
| 5956 | // FIXME - HAL error codes are different from PE error |
| 5957 | // codes!! And, this routine is returning tSirRetStatus |
| 5958 | statusCode = eSIR_FAILURE; |
| 5959 | //Pkt will be freed up by the callback |
| 5960 | return statusCode; |
| 5961 | } |
| 5962 | else |
| 5963 | return eSIR_SUCCESS; |
| 5964 | |
| 5965 | returnAfterError: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5966 | // Release buffer, if allocated |
| 5967 | if( NULL != pAddBARspBuffer ) |
| 5968 | palPktFree( pMac->hHdd, |
| 5969 | HAL_TXRX_FRM_802_11_MGMT, |
| 5970 | (void *) pAddBARspBuffer, |
| 5971 | (void *) pPacket ); |
| 5972 | |
| 5973 | return statusCode; |
| 5974 | } |
| 5975 | |
| 5976 | /** |
| 5977 | * \brief Send a DELBA Indication Action Frame to peer |
| 5978 | * |
| 5979 | * \sa limSendDelBAInd |
| 5980 | * |
| 5981 | * \param pMac The global tpAniSirGlobal object |
| 5982 | * |
| 5983 | * \param peerMacAddr MAC Address of peer |
| 5984 | * |
| 5985 | * \param reasonCode Reason for the DELBA notification |
| 5986 | * |
| 5987 | * \param pBAParameterSet The DELBA Parameter Set. |
| 5988 | * This identifies the TID for which the BA session is |
| 5989 | * being deleted. |
| 5990 | * |
| 5991 | * \return eSIR_SUCCESS if setup completes successfully |
| 5992 | * eSIR_FAILURE is some problem is encountered |
| 5993 | */ |
| 5994 | tSirRetStatus limSendDelBAInd( tpAniSirGlobal pMac, |
| 5995 | tpLimMlmDelBAReq pMlmDelBAReq,tpPESession psessionEntry) |
| 5996 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5997 | tDot11fDelBAInd frmDelBAInd; |
| 5998 | tANI_U8 *pDelBAIndBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5999 | //tANI_U32 val; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6000 | tpSirMacMgmtHdr pMacHdr; |
| 6001 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 6002 | tSirRetStatus statusCode; |
| 6003 | eHalStatus halStatus; |
| 6004 | void *pPacket; |
| 6005 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6006 | |
| 6007 | if(NULL == psessionEntry) |
| 6008 | { |
| 6009 | return eSIR_FAILURE; |
| 6010 | } |
| 6011 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6012 | vos_mem_set( (void *) &frmDelBAInd, sizeof( frmDelBAInd ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6013 | |
| 6014 | // Category - 3 (BA) |
| 6015 | frmDelBAInd.Category.category = SIR_MAC_ACTION_BLKACK; |
| 6016 | // Action - 2 (DELBA) |
| 6017 | frmDelBAInd.Action.action = SIR_MAC_BLKACK_DEL; |
| 6018 | |
| 6019 | // Fill the DELBA Parameter Set as provided by caller |
| 6020 | frmDelBAInd.DelBAParameterSet.tid = pMlmDelBAReq->baTID; |
| 6021 | frmDelBAInd.DelBAParameterSet.initiator = pMlmDelBAReq->baDirection; |
| 6022 | |
| 6023 | // BA Starting Sequence Number |
| 6024 | // Fragment number will always be zero |
| 6025 | frmDelBAInd.Reason.code = pMlmDelBAReq->delBAReasonCode; |
| 6026 | |
| 6027 | nStatus = dot11fGetPackedDelBAIndSize( pMac, &frmDelBAInd, &nPayload ); |
| 6028 | |
| 6029 | if( DOT11F_FAILED( nStatus )) |
| 6030 | { |
| 6031 | limLog( pMac, LOGW, |
| 6032 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6033 | "an DELBA Indication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6034 | nStatus ); |
| 6035 | |
| 6036 | // We'll fall back on the worst case scenario: |
| 6037 | nPayload = sizeof( tDot11fDelBAInd ); |
| 6038 | } |
| 6039 | else if( DOT11F_WARNED( nStatus )) |
| 6040 | { |
| 6041 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6042 | FL( "There were warnings while calculating " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6043 | "the packed size for an DELBA Ind (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6044 | nStatus ); |
| 6045 | } |
| 6046 | |
| 6047 | // Add the MGMT header to frame length |
| 6048 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6049 | |
| 6050 | // Allocate shared memory |
| 6051 | if( eHAL_STATUS_SUCCESS != |
| 6052 | (halStatus = palPktAlloc( pMac->hHdd, |
| 6053 | HAL_TXRX_FRM_802_11_MGMT, |
| 6054 | (tANI_U16) frameLen, |
| 6055 | (void **) &pDelBAIndBuffer, |
| 6056 | (void **) &pPacket ))) |
| 6057 | { |
| 6058 | // Log error |
| 6059 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6060 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6061 | frameLen, |
| 6062 | halStatus ); |
| 6063 | |
| 6064 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 6065 | goto returnAfterError; |
| 6066 | } |
| 6067 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6068 | vos_mem_set( (void *) pDelBAIndBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6069 | |
| 6070 | // Copy necessary info to BD |
| 6071 | if( eSIR_SUCCESS != |
| 6072 | (statusCode = limPopulateMacHeader( pMac, |
| 6073 | pDelBAIndBuffer, |
| 6074 | SIR_MAC_MGMT_FRAME, |
| 6075 | SIR_MAC_MGMT_ACTION, |
| 6076 | pMlmDelBAReq->peerMacAddr,psessionEntry->selfMacAddr))) |
| 6077 | goto returnAfterError; |
| 6078 | |
| 6079 | // Update A3 with the BSSID |
| 6080 | pMacHdr = ( tpSirMacMgmtHdr ) pDelBAIndBuffer; |
| 6081 | |
| 6082 | #if 0 |
| 6083 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 6084 | if( eSIR_SUCCESS != cfgGetStr( pMac, |
| 6085 | WNI_CFG_BSSID, |
| 6086 | (tANI_U8 *) pMacHdr->bssId, |
| 6087 | &cfgLen )) |
| 6088 | { |
| 6089 | limLog( pMac, LOGP, |
| 6090 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6091 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6092 | |
| 6093 | // FIXME - Need to convert to tSirRetStatus |
| 6094 | statusCode = eSIR_FAILURE; |
| 6095 | goto returnAfterError; |
| 6096 | } |
| 6097 | #endif //TO SUPPORT BT-AMP |
| 6098 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 6099 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6100 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 6101 | limSetProtectedBit(pMac, psessionEntry, pMlmDelBAReq->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6102 | #endif |
| 6103 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6104 | // Now, we're ready to "pack" the frames |
| 6105 | nStatus = dot11fPackDelBAInd( pMac, |
| 6106 | &frmDelBAInd, |
| 6107 | pDelBAIndBuffer + sizeof( tSirMacMgmtHdr ), |
| 6108 | nPayload, |
| 6109 | &nPayload ); |
| 6110 | |
| 6111 | if( DOT11F_FAILED( nStatus )) |
| 6112 | { |
| 6113 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6114 | FL( "Failed to pack an DELBA Ind (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6115 | nStatus ); |
| 6116 | |
| 6117 | // FIXME - Need to convert to tSirRetStatus |
| 6118 | statusCode = eSIR_FAILURE; |
| 6119 | goto returnAfterError; |
| 6120 | } |
| 6121 | else if( DOT11F_WARNED( nStatus )) |
| 6122 | { |
| 6123 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6124 | FL( "There were warnings while packing an DELBA Ind (0x%08x)." ), |
| 6125 | nStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6126 | } |
| 6127 | |
Abhishek Singh | 1f6e653 | 2014-06-05 17:35:08 +0530 | [diff] [blame] | 6128 | limLog( pMac, LOG1, |
| 6129 | FL( "Sending a DELBA IND to: "MAC_ADDRESS_STR" with Tid = %d" |
| 6130 | " initiator = %d reason = %d" ), |
| 6131 | MAC_ADDR_ARRAY(pMlmDelBAReq->peerMacAddr), |
| 6132 | frmDelBAInd.DelBAParameterSet.tid, |
| 6133 | frmDelBAInd.DelBAParameterSet.initiator, |
| 6134 | frmDelBAInd.Reason.code); |
| 6135 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6136 | |
| 6137 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6138 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6139 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6140 | ) |
| 6141 | { |
| 6142 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6143 | } |
| 6144 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6145 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6146 | psessionEntry->peSessionId, |
| 6147 | pMacHdr->fc.subType)); |
| 6148 | halStatus = halTxFrame( pMac, |
| 6149 | pPacket, |
| 6150 | (tANI_U16) frameLen, |
| 6151 | HAL_TXRX_FRM_802_11_MGMT, |
| 6152 | ANI_TXDIR_TODS, |
| 6153 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6154 | limTxComplete, |
| 6155 | pDelBAIndBuffer, txFlag ); |
| 6156 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 6157 | psessionEntry->peSessionId, |
| 6158 | halStatus)); |
| 6159 | if( eHAL_STATUS_SUCCESS != halStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6160 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6161 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halStatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6162 | statusCode = eSIR_FAILURE; |
| 6163 | //Pkt will be freed up by the callback |
| 6164 | return statusCode; |
| 6165 | } |
| 6166 | else |
| 6167 | return eSIR_SUCCESS; |
| 6168 | |
| 6169 | returnAfterError: |
| 6170 | |
| 6171 | // Release buffer, if allocated |
| 6172 | if( NULL != pDelBAIndBuffer ) |
| 6173 | palPktFree( pMac->hHdd, |
| 6174 | HAL_TXRX_FRM_802_11_MGMT, |
| 6175 | (void *) pDelBAIndBuffer, |
| 6176 | (void *) pPacket ); |
| 6177 | |
| 6178 | return statusCode; |
| 6179 | } |
| 6180 | |
| 6181 | #if defined WLAN_FEATURE_VOWIFI |
| 6182 | |
| 6183 | /** |
| 6184 | * \brief Send a Neighbor Report Request Action frame |
| 6185 | * |
| 6186 | * |
| 6187 | * \param pMac Pointer to the global MAC structure |
| 6188 | * |
| 6189 | * \param pNeighborReq Address of a tSirMacNeighborReportReq |
| 6190 | * |
| 6191 | * \param peer mac address of peer station. |
| 6192 | * |
| 6193 | * \param psessionEntry address of session entry. |
| 6194 | * |
| 6195 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 6196 | * |
| 6197 | * |
| 6198 | */ |
| 6199 | |
| 6200 | tSirRetStatus |
| 6201 | limSendNeighborReportRequestFrame(tpAniSirGlobal pMac, |
| 6202 | tpSirMacNeighborReportReq pNeighborReq, |
| 6203 | tSirMacAddr peer, |
| 6204 | tpPESession psessionEntry |
| 6205 | ) |
| 6206 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6207 | tSirRetStatus statusCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6208 | tDot11fNeighborReportRequest frm; |
| 6209 | tANI_U8 *pFrame; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6210 | tpSirMacMgmtHdr pMacHdr; |
| 6211 | tANI_U32 nBytes, nPayload, nStatus; |
| 6212 | void *pPacket; |
| 6213 | eHalStatus halstatus; |
| 6214 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6215 | |
| 6216 | if ( psessionEntry == NULL ) |
| 6217 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6218 | 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] | 6219 | return eSIR_FAILURE; |
| 6220 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6221 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6222 | |
| 6223 | frm.Category.category = SIR_MAC_ACTION_RRM; |
| 6224 | frm.Action.action = SIR_MAC_RRM_NEIGHBOR_REQ; |
| 6225 | frm.DialogToken.token = pNeighborReq->dialogToken; |
| 6226 | |
| 6227 | |
| 6228 | if( pNeighborReq->ssid_present ) |
| 6229 | { |
| 6230 | PopulateDot11fSSID( pMac, &pNeighborReq->ssid, &frm.SSID ); |
| 6231 | } |
| 6232 | |
| 6233 | nStatus = dot11fGetPackedNeighborReportRequestSize( pMac, &frm, &nPayload ); |
| 6234 | if ( DOT11F_FAILED( nStatus ) ) |
| 6235 | { |
| 6236 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6237 | "or a Neighbor Report Request(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6238 | nStatus ); |
| 6239 | // We'll fall back on the worst case scenario: |
| 6240 | nPayload = sizeof( tDot11fNeighborReportRequest ); |
| 6241 | } |
| 6242 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6243 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6244 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6245 | "the packed size for a Neighbor Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6246 | "ort Request(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6247 | } |
| 6248 | |
| 6249 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6250 | |
| 6251 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6252 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6253 | { |
| 6254 | 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] | 6255 | "Report Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6256 | return eSIR_FAILURE; |
| 6257 | } |
| 6258 | |
| 6259 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6260 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6261 | |
| 6262 | // Copy necessary info to BD |
| 6263 | if( eSIR_SUCCESS != |
| 6264 | (statusCode = limPopulateMacHeader( pMac, |
| 6265 | pFrame, |
| 6266 | SIR_MAC_MGMT_FRAME, |
| 6267 | SIR_MAC_MGMT_ACTION, |
| 6268 | peer, psessionEntry->selfMacAddr))) |
| 6269 | goto returnAfterError; |
| 6270 | |
| 6271 | // Update A3 with the BSSID |
| 6272 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6273 | |
| 6274 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 6275 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6276 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 6277 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6278 | #endif |
| 6279 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6280 | // Now, we're ready to "pack" the frames |
| 6281 | nStatus = dot11fPackNeighborReportRequest( pMac, |
| 6282 | &frm, |
| 6283 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6284 | nPayload, |
| 6285 | &nPayload ); |
| 6286 | |
| 6287 | if( DOT11F_FAILED( nStatus )) |
| 6288 | { |
| 6289 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6290 | FL( "Failed to pack an Neighbor Report Request (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6291 | nStatus ); |
| 6292 | |
| 6293 | // FIXME - Need to convert to tSirRetStatus |
| 6294 | statusCode = eSIR_FAILURE; |
| 6295 | goto returnAfterError; |
| 6296 | } |
| 6297 | else if( DOT11F_WARNED( nStatus )) |
| 6298 | { |
| 6299 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6300 | FL( "There were warnings while packing Neighbor Report " |
| 6301 | "Request (0x%08x)." ), nStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6302 | } |
| 6303 | |
| 6304 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6305 | FL( "Sending a Neighbor Report Request to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6306 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6307 | |
| 6308 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6309 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6310 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6311 | ) |
| 6312 | { |
| 6313 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6314 | } |
| 6315 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6316 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6317 | psessionEntry->peSessionId, |
| 6318 | pMacHdr->fc.subType)); |
| 6319 | halstatus = halTxFrame( pMac, |
| 6320 | pPacket, |
| 6321 | (tANI_U16) nBytes, |
| 6322 | HAL_TXRX_FRM_802_11_MGMT, |
| 6323 | ANI_TXDIR_TODS, |
| 6324 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6325 | limTxComplete, |
| 6326 | pFrame, txFlag ); |
| 6327 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 6328 | psessionEntry->peSessionId, |
| 6329 | halstatus)); |
| 6330 | if( eHAL_STATUS_SUCCESS != halstatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6331 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6332 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6333 | statusCode = eSIR_FAILURE; |
| 6334 | //Pkt will be freed up by the callback |
| 6335 | return statusCode; |
| 6336 | } |
| 6337 | else |
| 6338 | return eSIR_SUCCESS; |
| 6339 | |
| 6340 | returnAfterError: |
| 6341 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 6342 | |
| 6343 | return statusCode; |
| 6344 | } // End limSendNeighborReportRequestFrame. |
| 6345 | |
| 6346 | /** |
| 6347 | * \brief Send a Link Report Action frame |
| 6348 | * |
| 6349 | * |
| 6350 | * \param pMac Pointer to the global MAC structure |
| 6351 | * |
| 6352 | * \param pLinkReport Address of a tSirMacLinkReport |
| 6353 | * |
| 6354 | * \param peer mac address of peer station. |
| 6355 | * |
| 6356 | * \param psessionEntry address of session entry. |
| 6357 | * |
| 6358 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 6359 | * |
| 6360 | * |
| 6361 | */ |
| 6362 | |
| 6363 | tSirRetStatus |
| 6364 | limSendLinkReportActionFrame(tpAniSirGlobal pMac, |
| 6365 | tpSirMacLinkReport pLinkReport, |
| 6366 | tSirMacAddr peer, |
| 6367 | tpPESession psessionEntry |
| 6368 | ) |
| 6369 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6370 | tSirRetStatus statusCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6371 | tDot11fLinkMeasurementReport frm; |
| 6372 | tANI_U8 *pFrame; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6373 | tpSirMacMgmtHdr pMacHdr; |
| 6374 | tANI_U32 nBytes, nPayload, nStatus; |
| 6375 | void *pPacket; |
| 6376 | eHalStatus halstatus; |
| 6377 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6378 | |
| 6379 | |
| 6380 | if ( psessionEntry == NULL ) |
| 6381 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6382 | 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] | 6383 | return eSIR_FAILURE; |
| 6384 | } |
| 6385 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6386 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6387 | |
| 6388 | frm.Category.category = SIR_MAC_ACTION_RRM; |
| 6389 | frm.Action.action = SIR_MAC_RRM_LINK_MEASUREMENT_RPT; |
| 6390 | frm.DialogToken.token = pLinkReport->dialogToken; |
| 6391 | |
| 6392 | |
| 6393 | //IEEE Std. 802.11 7.3.2.18. for the report element. |
| 6394 | //Even though TPC report an IE, it is represented using fixed fields since it is positioned |
| 6395 | //in the middle of other fixed fields in the link report frame(IEEE Std. 802.11k section7.4.6.4 |
| 6396 | //and frame parser always expects IEs to come after all fixed fields. It is easier to handle |
| 6397 | //such case this way than changing the frame parser. |
| 6398 | frm.TPCEleID.TPCId = SIR_MAC_TPC_RPT_EID; |
| 6399 | frm.TPCEleLen.TPCLen = 2; |
| 6400 | frm.TxPower.txPower = pLinkReport->txPower; |
| 6401 | frm.LinkMargin.linkMargin = 0; |
| 6402 | |
| 6403 | frm.RxAntennaId.antennaId = pLinkReport->rxAntenna; |
| 6404 | frm.TxAntennaId.antennaId = pLinkReport->txAntenna; |
| 6405 | frm.RCPI.rcpi = pLinkReport->rcpi; |
| 6406 | frm.RSNI.rsni = pLinkReport->rsni; |
| 6407 | |
| 6408 | nStatus = dot11fGetPackedLinkMeasurementReportSize( pMac, &frm, &nPayload ); |
| 6409 | if ( DOT11F_FAILED( nStatus ) ) |
| 6410 | { |
| 6411 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6412 | "or a Link Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6413 | nStatus ); |
| 6414 | // We'll fall back on the worst case scenario: |
| 6415 | nPayload = sizeof( tDot11fLinkMeasurementReport ); |
| 6416 | } |
| 6417 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6418 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6419 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6420 | "the packed size for a Link Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6421 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6422 | } |
| 6423 | |
| 6424 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6425 | |
| 6426 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6427 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6428 | { |
| 6429 | 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] | 6430 | "Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6431 | return eSIR_FAILURE; |
| 6432 | } |
| 6433 | |
| 6434 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6435 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6436 | |
| 6437 | // Copy necessary info to BD |
| 6438 | if( eSIR_SUCCESS != |
| 6439 | (statusCode = limPopulateMacHeader( pMac, |
| 6440 | pFrame, |
| 6441 | SIR_MAC_MGMT_FRAME, |
| 6442 | SIR_MAC_MGMT_ACTION, |
| 6443 | peer, psessionEntry->selfMacAddr))) |
| 6444 | goto returnAfterError; |
| 6445 | |
| 6446 | // Update A3 with the BSSID |
| 6447 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6448 | |
| 6449 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 6450 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6451 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 6452 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6453 | #endif |
| 6454 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6455 | // Now, we're ready to "pack" the frames |
| 6456 | nStatus = dot11fPackLinkMeasurementReport( pMac, |
| 6457 | &frm, |
| 6458 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6459 | nPayload, |
| 6460 | &nPayload ); |
| 6461 | |
| 6462 | if( DOT11F_FAILED( nStatus )) |
| 6463 | { |
| 6464 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6465 | FL( "Failed to pack an Link Report (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6466 | nStatus ); |
| 6467 | |
| 6468 | // FIXME - Need to convert to tSirRetStatus |
| 6469 | statusCode = eSIR_FAILURE; |
| 6470 | goto returnAfterError; |
| 6471 | } |
| 6472 | else if( DOT11F_WARNED( nStatus )) |
| 6473 | { |
| 6474 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6475 | FL( "There were warnings while packing Link Report (0x%08x)." ), |
| 6476 | nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6477 | } |
| 6478 | |
| 6479 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6480 | FL( "Sending a Link Report to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6481 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6482 | |
| 6483 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6484 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6485 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6486 | ) |
| 6487 | { |
| 6488 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6489 | } |
| 6490 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6491 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6492 | psessionEntry->peSessionId, |
| 6493 | pMacHdr->fc.subType)); |
| 6494 | halstatus = halTxFrame( pMac, |
| 6495 | pPacket, |
| 6496 | (tANI_U16) nBytes, |
| 6497 | HAL_TXRX_FRM_802_11_MGMT, |
| 6498 | ANI_TXDIR_TODS, |
| 6499 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6500 | limTxComplete, |
| 6501 | pFrame, txFlag ); |
| 6502 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 6503 | psessionEntry->peSessionId, |
| 6504 | halstatus)); |
| 6505 | if( eHAL_STATUS_SUCCESS != halstatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6506 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6507 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6508 | statusCode = eSIR_FAILURE; |
| 6509 | //Pkt will be freed up by the callback |
| 6510 | return statusCode; |
| 6511 | } |
| 6512 | else |
| 6513 | return eSIR_SUCCESS; |
| 6514 | |
| 6515 | returnAfterError: |
| 6516 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 6517 | |
| 6518 | return statusCode; |
| 6519 | } // End limSendLinkReportActionFrame. |
| 6520 | |
| 6521 | /** |
| 6522 | * \brief Send a Beacon Report Action frame |
| 6523 | * |
| 6524 | * |
| 6525 | * \param pMac Pointer to the global MAC structure |
| 6526 | * |
| 6527 | * \param dialog_token dialog token to be used in the action frame. |
| 6528 | * |
| 6529 | * \param num_report number of reports in pRRMReport. |
| 6530 | * |
| 6531 | * \param pRRMReport Address of a tSirMacRadioMeasureReport. |
| 6532 | * |
| 6533 | * \param peer mac address of peer station. |
| 6534 | * |
| 6535 | * \param psessionEntry address of session entry. |
| 6536 | * |
| 6537 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 6538 | * |
| 6539 | * |
| 6540 | */ |
| 6541 | |
| 6542 | tSirRetStatus |
| 6543 | limSendRadioMeasureReportActionFrame(tpAniSirGlobal pMac, |
| 6544 | tANI_U8 dialog_token, |
| 6545 | tANI_U8 num_report, |
| 6546 | tpSirMacRadioMeasureReport pRRMReport, |
| 6547 | tSirMacAddr peer, |
| 6548 | tpPESession psessionEntry |
| 6549 | ) |
| 6550 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6551 | tSirRetStatus statusCode = eSIR_SUCCESS; |
| 6552 | tANI_U8 *pFrame; |
| 6553 | tpSirMacMgmtHdr pMacHdr; |
| 6554 | tANI_U32 nBytes, nPayload, nStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6555 | void *pPacket; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6556 | eHalStatus halstatus; |
| 6557 | tANI_U8 i; |
| 6558 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6559 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6560 | tDot11fRadioMeasurementReport *frm = |
| 6561 | vos_mem_malloc(sizeof(tDot11fRadioMeasurementReport)); |
| 6562 | if (!frm) { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6563 | limLog( pMac, LOGE, FL("Not enough memory to allocate tDot11fRadioMeasurementReport") ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6564 | return eSIR_FAILURE; |
| 6565 | } |
| 6566 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6567 | if ( psessionEntry == NULL ) |
| 6568 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6569 | 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] | 6570 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6571 | return eSIR_FAILURE; |
| 6572 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6573 | vos_mem_set( ( tANI_U8* )frm, sizeof( *frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6574 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6575 | frm->Category.category = SIR_MAC_ACTION_RRM; |
| 6576 | frm->Action.action = SIR_MAC_RRM_RADIO_MEASURE_RPT; |
| 6577 | frm->DialogToken.token = dialog_token; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6578 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6579 | 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] | 6580 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6581 | for( i = 0 ; i < frm->num_MeasurementReport ; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6582 | { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6583 | frm->MeasurementReport[i].type = pRRMReport[i].type; |
| 6584 | frm->MeasurementReport[i].token = pRRMReport[i].token; |
| 6585 | 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] | 6586 | switch( pRRMReport[i].type ) |
| 6587 | { |
| 6588 | case SIR_MAC_RRM_BEACON_TYPE: |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6589 | PopulateDot11fBeaconReport( pMac, &frm->MeasurementReport[i], &pRRMReport[i].report.beaconReport ); |
| 6590 | frm->MeasurementReport[i].incapable = pRRMReport[i].incapable; |
| 6591 | frm->MeasurementReport[i].refused = pRRMReport[i].refused; |
| 6592 | frm->MeasurementReport[i].present = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6593 | break; |
| 6594 | default: |
Gopichand Nakkala | 72717fd | 2013-02-08 12:23:45 +0530 | [diff] [blame] | 6595 | frm->MeasurementReport[i].incapable = pRRMReport[i].incapable; |
| 6596 | frm->MeasurementReport[i].refused = pRRMReport[i].refused; |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6597 | frm->MeasurementReport[i].present = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6598 | break; |
| 6599 | } |
| 6600 | } |
| 6601 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6602 | nStatus = dot11fGetPackedRadioMeasurementReportSize( pMac, frm, &nPayload ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6603 | if ( DOT11F_FAILED( nStatus ) ) |
| 6604 | { |
| 6605 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6606 | "or a Radio Measure Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6607 | nStatus ); |
| 6608 | // We'll fall back on the worst case scenario: |
| 6609 | nPayload = sizeof( tDot11fLinkMeasurementReport ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6610 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6611 | return eSIR_FAILURE; |
| 6612 | } |
| 6613 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6614 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6615 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6616 | "the packed size for a Radio Measure Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6617 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6618 | } |
| 6619 | |
| 6620 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6621 | |
| 6622 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6623 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6624 | { |
| 6625 | 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] | 6626 | "Report."), nBytes ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6627 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6628 | return eSIR_FAILURE; |
| 6629 | } |
| 6630 | |
| 6631 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6632 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6633 | |
| 6634 | // Copy necessary info to BD |
| 6635 | if( eSIR_SUCCESS != |
| 6636 | (statusCode = limPopulateMacHeader( pMac, |
| 6637 | pFrame, |
| 6638 | SIR_MAC_MGMT_FRAME, |
| 6639 | SIR_MAC_MGMT_ACTION, |
| 6640 | peer, psessionEntry->selfMacAddr))) |
| 6641 | goto returnAfterError; |
| 6642 | |
| 6643 | // Update A3 with the BSSID |
| 6644 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6645 | |
| 6646 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 6647 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6648 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 6649 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6650 | #endif |
| 6651 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6652 | // Now, we're ready to "pack" the frames |
| 6653 | nStatus = dot11fPackRadioMeasurementReport( pMac, |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6654 | frm, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6655 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6656 | nPayload, |
| 6657 | &nPayload ); |
| 6658 | |
| 6659 | if( DOT11F_FAILED( nStatus )) |
| 6660 | { |
| 6661 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6662 | FL( "Failed to pack an Radio Measure Report (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6663 | nStatus ); |
| 6664 | |
| 6665 | // FIXME - Need to convert to tSirRetStatus |
| 6666 | statusCode = eSIR_FAILURE; |
| 6667 | goto returnAfterError; |
| 6668 | } |
| 6669 | else if( DOT11F_WARNED( nStatus )) |
| 6670 | { |
| 6671 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6672 | FL( "There were warnings while packing Radio " |
| 6673 | "Measure Report (0x%08x)." ), nStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6674 | } |
| 6675 | |
| 6676 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6677 | FL( "Sending a Radio Measure Report to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6678 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6679 | |
| 6680 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6681 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6682 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6683 | ) |
| 6684 | { |
| 6685 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6686 | } |
| 6687 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6688 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6689 | psessionEntry->peSessionId, |
| 6690 | pMacHdr->fc.subType)); |
| 6691 | halstatus = halTxFrame( pMac, |
| 6692 | pPacket, |
| 6693 | (tANI_U16) nBytes, |
| 6694 | HAL_TXRX_FRM_802_11_MGMT, |
| 6695 | ANI_TXDIR_TODS, |
| 6696 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6697 | limTxComplete, |
| 6698 | pFrame, txFlag ); |
| 6699 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 6700 | psessionEntry->peSessionId, |
| 6701 | halstatus)); |
| 6702 | if( eHAL_STATUS_SUCCESS != halstatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6703 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6704 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6705 | statusCode = eSIR_FAILURE; |
| 6706 | //Pkt will be freed up by the callback |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6707 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6708 | return statusCode; |
| 6709 | } |
Madan Mohan Koyyalamudi | eeb56b1 | 2012-10-31 15:10:04 -0700 | [diff] [blame] | 6710 | else { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6711 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6712 | return eSIR_SUCCESS; |
Madan Mohan Koyyalamudi | eeb56b1 | 2012-10-31 15:10:04 -0700 | [diff] [blame] | 6713 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6714 | |
| 6715 | returnAfterError: |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6716 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6717 | 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] | 6718 | return statusCode; |
| 6719 | } // End limSendBeaconReportActionFrame. |
| 6720 | |
| 6721 | #endif |
| 6722 | |
| 6723 | #ifdef WLAN_FEATURE_11W |
| 6724 | /** |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 6725 | * \brief Send SA query request action frame to peer |
| 6726 | * |
| 6727 | * \sa limSendSaQueryRequestFrame |
| 6728 | * |
| 6729 | * |
| 6730 | * \param pMac The global tpAniSirGlobal object |
| 6731 | * |
| 6732 | * \param transId Transaction identifier |
| 6733 | * |
| 6734 | * \param peer The Mac address of the station to which this action frame is addressed |
| 6735 | * |
| 6736 | * \param psessionEntry The PE session entry |
| 6737 | * |
| 6738 | * \return eSIR_SUCCESS if setup completes successfully |
| 6739 | * eSIR_FAILURE is some problem is encountered |
| 6740 | */ |
| 6741 | |
| 6742 | tSirRetStatus limSendSaQueryRequestFrame( tpAniSirGlobal pMac, tANI_U8 *transId, |
| 6743 | tSirMacAddr peer, tpPESession psessionEntry ) |
| 6744 | { |
| 6745 | |
| 6746 | tDot11fSaQueryReq frm; // SA query request action frame |
| 6747 | tANI_U8 *pFrame; |
| 6748 | tSirRetStatus nSirStatus; |
| 6749 | tpSirMacMgmtHdr pMacHdr; |
| 6750 | tANI_U32 nBytes, nPayload, nStatus; |
| 6751 | void *pPacket; |
| 6752 | eHalStatus halstatus; |
| 6753 | tANI_U8 txFlag = 0; |
| 6754 | |
| 6755 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
| 6756 | frm.Category.category = SIR_MAC_ACTION_SA_QUERY; |
| 6757 | /* 11w action field is : |
| 6758 | action: 0 --> SA Query Request action frame |
| 6759 | action: 1 --> SA Query Response action frame */ |
| 6760 | frm.Action.action = SIR_MAC_SA_QUERY_REQ; |
| 6761 | /* 11w SA Query Request transId */ |
| 6762 | vos_mem_copy( &frm.TransactionId.transId[0], &transId[0], 2 ); |
| 6763 | |
| 6764 | nStatus = dot11fGetPackedSaQueryReqSize(pMac, &frm, &nPayload); |
| 6765 | if ( DOT11F_FAILED( nStatus ) ) |
| 6766 | { |
| 6767 | limLog( pMac, LOGP, FL("Failed to calculate the packed size " |
| 6768 | "for an SA Query Request (0x%08x)."), |
| 6769 | nStatus ); |
| 6770 | // We'll fall back on the worst case scenario: |
| 6771 | nPayload = sizeof( tDot11fSaQueryReq ); |
| 6772 | } |
| 6773 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6774 | { |
| 6775 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
| 6776 | "the packed size for an SA Query Request" |
| 6777 | " (0x%08x)."), nStatus ); |
| 6778 | } |
| 6779 | |
| 6780 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6781 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6782 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6783 | { |
| 6784 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a SA Query Request " |
| 6785 | "action frame"), nBytes ); |
| 6786 | return eSIR_FAILURE; |
| 6787 | } |
| 6788 | |
| 6789 | // Paranoia: |
| 6790 | vos_mem_set( pFrame, nBytes, 0 ); |
| 6791 | |
| 6792 | // Copy necessary info to BD |
| 6793 | nSirStatus = limPopulateMacHeader( pMac, |
| 6794 | pFrame, |
| 6795 | SIR_MAC_MGMT_FRAME, |
| 6796 | SIR_MAC_MGMT_ACTION, |
| 6797 | peer, psessionEntry->selfMacAddr ); |
| 6798 | if ( eSIR_SUCCESS != nSirStatus ) |
| 6799 | goto returnAfterError; |
| 6800 | |
| 6801 | // Update A3 with the BSSID |
| 6802 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6803 | |
| 6804 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 6805 | |
| 6806 | // Since this is a SA Query Request, set the "protect" (aka WEP) bit |
| 6807 | // in the FC |
| 6808 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
| 6809 | |
| 6810 | // Pack 11w SA Query Request frame |
| 6811 | nStatus = dot11fPackSaQueryReq( pMac, |
| 6812 | &frm, |
| 6813 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6814 | nPayload, |
| 6815 | &nPayload ); |
| 6816 | |
| 6817 | if ( DOT11F_FAILED( nStatus )) |
| 6818 | { |
| 6819 | limLog( pMac, LOGE, |
| 6820 | FL( "Failed to pack an SA Query Request (0x%08x)." ), |
| 6821 | nStatus ); |
| 6822 | // FIXME - Need to convert to tSirRetStatus |
| 6823 | nSirStatus = eSIR_FAILURE; |
| 6824 | goto returnAfterError; |
| 6825 | } |
| 6826 | else if ( DOT11F_WARNED( nStatus )) |
| 6827 | { |
| 6828 | limLog( pMac, LOGW, |
| 6829 | FL( "There were warnings while packing SA Query Request (0x%08x)." ), |
| 6830 | nStatus); |
| 6831 | } |
| 6832 | |
| 6833 | limLog( pMac, LOG1, |
| 6834 | FL( "Sending an SA Query Request to " )); |
| 6835 | limPrintMacAddr( pMac, peer, LOG1 ); |
| 6836 | limPrintMacAddr( pMac, peer, LOGE ); |
| 6837 | limLog( pMac, LOGE, |
| 6838 | FL( "Sending an SA Query Request from " )); |
| 6839 | limPrintMacAddr( pMac, psessionEntry->selfMacAddr, LOGE ); |
| 6840 | |
| 6841 | if ( ( SIR_BAND_5_GHZ == limGetRFBand( psessionEntry->currentOperChannel ) ) |
| 6842 | #ifdef WLAN_FEATURE_P2P |
| 6843 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6844 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE ) |
| 6845 | #endif |
| 6846 | ) |
| 6847 | { |
| 6848 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6849 | } |
| 6850 | |
| 6851 | halstatus = halTxFrame( pMac, |
| 6852 | pPacket, |
| 6853 | (tANI_U16) nBytes, |
| 6854 | HAL_TXRX_FRM_802_11_MGMT, |
| 6855 | ANI_TXDIR_TODS, |
| 6856 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6857 | limTxComplete, |
| 6858 | pFrame, txFlag ); |
| 6859 | if ( eHAL_STATUS_SUCCESS != halstatus ) |
| 6860 | { |
| 6861 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
| 6862 | nSirStatus = eSIR_FAILURE; |
| 6863 | //Pkt will be freed up by the callback |
| 6864 | return nSirStatus; |
| 6865 | } |
| 6866 | else { |
| 6867 | return eSIR_SUCCESS; |
| 6868 | } |
| 6869 | |
| 6870 | returnAfterError: |
| 6871 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 6872 | return nSirStatus; |
| 6873 | } // End limSendSaQueryRequestFrame |
| 6874 | |
| 6875 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6876 | * \brief Send SA query response action frame to peer |
| 6877 | * |
| 6878 | * \sa limSendSaQueryResponseFrame |
| 6879 | * |
| 6880 | * |
| 6881 | * \param pMac The global tpAniSirGlobal object |
| 6882 | * |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6883 | * \param transId Transaction identifier received in SA query request action frame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6884 | * |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6885 | * \param peer The Mac address of the AP to which this action frame is addressed |
| 6886 | * |
| 6887 | * \param psessionEntry The PE session entry |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6888 | * |
| 6889 | * \return eSIR_SUCCESS if setup completes successfully |
| 6890 | * eSIR_FAILURE is some problem is encountered |
| 6891 | */ |
| 6892 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6893 | tSirRetStatus limSendSaQueryResponseFrame( tpAniSirGlobal pMac, tANI_U8 *transId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6894 | tSirMacAddr peer,tpPESession psessionEntry) |
| 6895 | { |
| 6896 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6897 | tDot11fSaQueryRsp frm; // SA query reponse action frame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6898 | tANI_U8 *pFrame; |
| 6899 | tSirRetStatus nSirStatus; |
| 6900 | tpSirMacMgmtHdr pMacHdr; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6901 | tANI_U32 nBytes, nPayload, nStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6902 | void *pPacket; |
| 6903 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6904 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6905 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6906 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6907 | frm.Category.category = SIR_MAC_ACTION_SA_QUERY; |
| 6908 | /*11w action field is : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6909 | action: 0 --> SA query request action frame |
| 6910 | action: 1 --> SA query response action frame */ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6911 | frm.Action.action = SIR_MAC_SA_QUERY_RSP; |
| 6912 | /*11w SA query response transId is same as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6913 | SA query request transId*/ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6914 | vos_mem_copy( &frm.TransactionId.transId[0], &transId[0], 2 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6915 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6916 | nStatus = dot11fGetPackedSaQueryRspSize(pMac, &frm, &nPayload); |
| 6917 | if ( DOT11F_FAILED( nStatus ) ) |
| 6918 | { |
| 6919 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
| 6920 | "or a SA Query Response (0x%08x)."), |
| 6921 | nStatus ); |
| 6922 | // We'll fall back on the worst case scenario: |
| 6923 | nPayload = sizeof( tDot11fSaQueryRsp ); |
| 6924 | } |
| 6925 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6926 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6927 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6928 | "the packed size for an SA Query Response" |
| 6929 | " (0x%08x)."), nStatus ); |
| 6930 | } |
| 6931 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6932 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6933 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6934 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6935 | { |
| 6936 | 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] | 6937 | " action frame"), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6938 | return eSIR_FAILURE; |
| 6939 | } |
| 6940 | |
| 6941 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6942 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6943 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6944 | // Copy necessary info to BD |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6945 | nSirStatus = limPopulateMacHeader( pMac, |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6946 | pFrame, |
| 6947 | SIR_MAC_MGMT_FRAME, |
| 6948 | SIR_MAC_MGMT_ACTION, |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6949 | peer, psessionEntry->selfMacAddr ); |
| 6950 | if ( eSIR_SUCCESS != nSirStatus ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6951 | goto returnAfterError; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6952 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6953 | // Update A3 with the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6954 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6955 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6956 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6957 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6958 | // Since this is a SA Query Response, set the "protect" (aka WEP) bit |
| 6959 | // in the FC |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 6960 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6961 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6962 | // Pack 11w SA query response frame |
| 6963 | nStatus = dot11fPackSaQueryRsp( pMac, |
| 6964 | &frm, |
| 6965 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6966 | nPayload, |
| 6967 | &nPayload ); |
| 6968 | |
| 6969 | if ( DOT11F_FAILED( nStatus )) |
| 6970 | { |
| 6971 | limLog( pMac, LOGE, |
| 6972 | FL( "Failed to pack an SA Query Response (0x%08x)." ), |
| 6973 | nStatus ); |
| 6974 | // FIXME - Need to convert to tSirRetStatus |
| 6975 | nSirStatus = eSIR_FAILURE; |
| 6976 | goto returnAfterError; |
| 6977 | } |
| 6978 | else if ( DOT11F_WARNED( nStatus )) |
| 6979 | { |
| 6980 | limLog( pMac, LOGW, |
| 6981 | FL( "There were warnings while packing SA Query Response (0x%08x)." ), |
| 6982 | nStatus); |
| 6983 | } |
| 6984 | |
| 6985 | limLog( pMac, LOG1, |
| 6986 | FL( "Sending a SA Query Response to " )); |
| 6987 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6988 | |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6989 | if ( ( SIR_BAND_5_GHZ == limGetRFBand( psessionEntry->currentOperChannel ) ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6990 | #ifdef WLAN_FEATURE_P2P |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6991 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6992 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6993 | #endif |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6994 | ) |
| 6995 | { |
| 6996 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6997 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6998 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6999 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 7000 | psessionEntry->peSessionId, |
| 7001 | pMacHdr->fc.subType)); |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 7002 | halstatus = halTxFrame( pMac, |
| 7003 | pPacket, |
| 7004 | (tANI_U16) nBytes, |
| 7005 | HAL_TXRX_FRM_802_11_MGMT, |
| 7006 | ANI_TXDIR_TODS, |
| 7007 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 7008 | limTxComplete, |
| 7009 | pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 7010 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 7011 | psessionEntry->peSessionId, |
| 7012 | halstatus)); |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 7013 | if ( eHAL_STATUS_SUCCESS != halstatus ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 7014 | { |
| 7015 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
| 7016 | nSirStatus = eSIR_FAILURE; |
| 7017 | //Pkt will be freed up by the callback |
| 7018 | return nSirStatus; |
| 7019 | } |
| 7020 | else { |
| 7021 | return eSIR_SUCCESS; |
| 7022 | } |
| 7023 | |
| 7024 | returnAfterError: |
| 7025 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 7026 | return nSirStatus; |
| 7027 | } // End limSendSaQueryResponseFrame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7028 | #endif |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame^] | 7029 | |
| 7030 | #ifdef WLAN_FEATURE_RMC |
| 7031 | tSirRetStatus |
| 7032 | limSendRMCActionFrame(tpAniSirGlobal pMac, |
| 7033 | tSirMacAddr peerMacAddr, |
| 7034 | tSirRMCInfo *pRMC, |
| 7035 | tpPESession psessionEntry) |
| 7036 | { |
| 7037 | tSirRetStatus nSirStatus; |
| 7038 | tANI_U8 *pFrame; |
| 7039 | tDot11fRMC RMC; |
| 7040 | tANI_U32 nPayload, nBytes, nStatus; |
| 7041 | tpSirMacMgmtHdr pMacHdr; |
| 7042 | void *pPacket; |
| 7043 | eHalStatus halstatus; |
| 7044 | tANI_U8 txFlag = 0; |
| 7045 | tANI_U8 MagicCode[] = { 0x4f, 0x58, 0x59, 0x47, 0x45, 0x4e }; |
| 7046 | |
| 7047 | if (NULL == psessionEntry) |
| 7048 | { |
| 7049 | return eSIR_FAILURE; |
| 7050 | } |
| 7051 | |
| 7052 | vos_mem_set(( tANI_U8* )&RMC, sizeof( RMC ), 0); |
| 7053 | |
| 7054 | RMC.Action.action = pRMC->action; |
| 7055 | RMC.RMCDialogToken.token = pRMC->dialogToken; |
| 7056 | RMC.Category.category = SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY; |
| 7057 | RMC.RMCVersion.version = SIR_MAC_RMC_VER; |
| 7058 | |
| 7059 | vos_mem_copy(&RMC.RMCOUI.oui, SIR_MAC_RMC_OUI, SIR_MAC_RMC_OUI_SIZE); |
| 7060 | vos_mem_copy(&RMC.MagicCode.magic, MagicCode, sizeof(MagicCode)); |
| 7061 | |
| 7062 | vos_mem_copy(&RMC.Ruler.mac, pRMC->mcastRuler, sizeof(tSirMacAddr)); |
| 7063 | |
| 7064 | nStatus = dot11fGetPackedRMCSize( pMac, &RMC, &nPayload ); |
| 7065 | if ( DOT11F_FAILED( nStatus ) ) |
| 7066 | { |
| 7067 | limLog( pMac, LOGE, FL("Failed to calculate the packed size for " |
| 7068 | "an RMC (0x%08x)."), |
| 7069 | nStatus ); |
| 7070 | // We'll fall back on the worst case scenario: |
| 7071 | nPayload = sizeof( tDot11fRMC ); |
| 7072 | } |
| 7073 | else if ( DOT11F_WARNED( nStatus ) ) |
| 7074 | { |
| 7075 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
| 7076 | "the packed size for an RMC Action Frame" |
| 7077 | " (0x%08x)."), nStatus ); |
| 7078 | } |
| 7079 | |
| 7080 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 7081 | |
| 7082 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 7083 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 7084 | ( void** ) &pPacket ); |
| 7085 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 7086 | { |
| 7087 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for an RMC " |
| 7088 | "Action Frame."), nBytes ); |
| 7089 | return eSIR_FAILURE; |
| 7090 | } |
| 7091 | |
| 7092 | // Paranoia: |
| 7093 | vos_mem_set( pFrame, nBytes, 0 ); |
| 7094 | |
| 7095 | // Next, we fill out the buffer descriptor: |
| 7096 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 7097 | SIR_MAC_MGMT_ACTION, peerMacAddr, |
| 7098 | psessionEntry->selfMacAddr); |
| 7099 | if ( eSIR_SUCCESS != nSirStatus ) |
| 7100 | { |
| 7101 | limLog( pMac, LOGE, FL("Failed to populate the buffer descriptor " |
| 7102 | "for an RMC Action Frame (%d)."), |
| 7103 | nSirStatus ); |
| 7104 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 7105 | ( void* ) pFrame, ( void* ) pPacket ); |
| 7106 | return nSirStatus; |
| 7107 | } |
| 7108 | |
| 7109 | // Update A3 with the BSSID |
| 7110 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 7111 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 7112 | |
| 7113 | // That done, pack the struct: |
| 7114 | nStatus = dot11fPackRMC( pMac, &RMC, |
| 7115 | pFrame + sizeof(tSirMacMgmtHdr), |
| 7116 | nPayload, &nPayload ); |
| 7117 | if ( DOT11F_FAILED( nStatus ) ) |
| 7118 | { |
| 7119 | limLog( pMac, LOGE, FL("Failed to pack an RMC " |
| 7120 | "(0x%08x)."), |
| 7121 | nStatus ); |
| 7122 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, |
| 7123 | ( void* ) pPacket ); |
| 7124 | return eSIR_FAILURE; |
| 7125 | } |
| 7126 | else if ( DOT11F_WARNED( nStatus ) ) |
| 7127 | { |
| 7128 | limLog( pMac, LOGW, FL("There were warnings while packing " |
| 7129 | "an RMC (0x%08x)."), nStatus ); |
| 7130 | } |
| 7131 | |
| 7132 | limLog( pMac, LOG1, FL("Sending an RMC Action frame to " |
| 7133 | MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMacAddr)); |
| 7134 | |
| 7135 | /* |
| 7136 | * With this masking, RMC action frames will be sent |
| 7137 | * at self-sta rates for both 2G and 5G bands. |
| 7138 | */ |
| 7139 | txFlag |= HAL_USE_SELF_STA_REQUESTED_MASK; |
| 7140 | |
| 7141 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 7142 | psessionEntry->peSessionId, |
| 7143 | pMacHdr->fc.subType)); |
| 7144 | // Queue RMC Action frame in high priority WQ |
| 7145 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 7146 | HAL_TXRX_FRM_802_11_MGMT, |
| 7147 | ANI_TXDIR_TODS, |
| 7148 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 7149 | limTxComplete, pFrame, txFlag ); |
| 7150 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 7151 | psessionEntry->peSessionId, |
| 7152 | halstatus)); |
| 7153 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 7154 | { |
| 7155 | limLog( pMac, LOGE, FL( "*** Could not send an RMC Action frame" |
| 7156 | " (%X) ***" ), halstatus ); |
| 7157 | //Pkt will be freed up by the callback |
| 7158 | return eSIR_FAILURE; |
| 7159 | } |
| 7160 | |
| 7161 | return eSIR_SUCCESS; |
| 7162 | |
| 7163 | } // End limSendRMCActionFrame. |
| 7164 | |
| 7165 | #endif /* WLAN_FEATURE_RMC */ |