Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 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 | { |
| 2313 | if(extractedExtCap.interworkingService) |
| 2314 | { |
| 2315 | extractedExtCap.qosMap = 1; |
| 2316 | } |
Abhishek Singh | 15d9560 | 2015-03-24 15:52:57 +0530 | [diff] [blame] | 2317 | /* No need to merge the EXT Cap from Supplicant |
| 2318 | * if interworkingService is not set, as currently |
| 2319 | * driver is only interested in interworkingService |
| 2320 | * capability from supplicant. if in |
| 2321 | * future any other EXT Cap info is required from |
| 2322 | * supplicant it needs to be handled here. |
| 2323 | */ |
| 2324 | else |
| 2325 | { |
| 2326 | extractedExtCapFlag = eANI_BOOLEAN_FALSE; |
| 2327 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 2f9b571 | 2014-05-06 00:09:42 -0700 | [diff] [blame] | 2328 | } |
Kalikinkar dhara | 205da78 | 2014-03-21 15:49:32 -0700 | [diff] [blame] | 2329 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2330 | caps = pMlmAssocReq->capabilityInfo; |
| 2331 | if ( PROP_CAPABILITY_GET( 11EQOS, psessionEntry->limCurrentBssPropCap ) ) |
| 2332 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 2333 | #if defined(FEATURE_WLAN_WAPI) |
| 2334 | /* CR: 262463 : |
| 2335 | According to WAPI standard: |
| 2336 | 7.3.1.4 Capability Information field |
| 2337 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 2338 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 2339 | Reassociation management frames. */ |
| 2340 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 2341 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 2342 | #endif |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2343 | swapBitField16(caps, ( tANI_U16* )&pFrm->Capabilities ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2344 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2345 | pFrm->ListenInterval.interval = pMlmAssocReq->listenInterval; |
| 2346 | PopulateDot11fSSID2( pMac, &pFrm->SSID ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2347 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2348 | &pFrm->SuppRates,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2349 | |
| 2350 | fQosEnabled = ( psessionEntry->limQosEnabled) && |
| 2351 | SIR_MAC_GET_QOS( psessionEntry->limCurrentBssCaps ); |
| 2352 | |
| 2353 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 2354 | LIM_BSS_CAPS_GET( WME, psessionEntry->limCurrentBssQosCaps ); |
| 2355 | |
| 2356 | // We prefer .11e asociations: |
| 2357 | if ( fQosEnabled ) fWmeEnabled = false; |
| 2358 | |
| 2359 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 2360 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limCurrentBssQosCaps ); |
| 2361 | |
| 2362 | if ( psessionEntry->lim11hEnable && |
| 2363 | psessionEntry->pLimJoinReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 2364 | { |
| 2365 | #if defined WLAN_FEATURE_VOWIFI |
| 2366 | PowerCapsPopulated = TRUE; |
| 2367 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2368 | PopulateDot11fPowerCaps( pMac, &pFrm->PowerCaps, LIM_ASSOC,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2369 | #endif |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2370 | PopulateDot11fSuppChannels( pMac, &pFrm->SuppChannels, LIM_ASSOC,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2371 | |
| 2372 | } |
| 2373 | |
| 2374 | #if defined WLAN_FEATURE_VOWIFI |
| 2375 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2376 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2377 | { |
| 2378 | if (PowerCapsPopulated == FALSE) |
| 2379 | { |
| 2380 | PowerCapsPopulated = TRUE; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2381 | PopulateDot11fPowerCaps(pMac, &pFrm->PowerCaps, LIM_ASSOC, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2382 | } |
| 2383 | } |
| 2384 | #endif |
| 2385 | |
| 2386 | if ( fQosEnabled && |
| 2387 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limCurrentBssPropCap))) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2388 | PopulateDot11fQOSCapsStation( pMac, &pFrm->QOSCapsStation ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2389 | |
| 2390 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2391 | &pFrm->ExtSuppRates, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2392 | |
| 2393 | #if defined WLAN_FEATURE_VOWIFI |
| 2394 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2395 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2396 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2397 | PopulateDot11fRRMIe( pMac, &pFrm->RRMEnabledCap, psessionEntry ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2398 | } |
| 2399 | #endif |
| 2400 | // The join request *should* contain zero or one of the WPA and RSN |
| 2401 | // IEs. The payload send along with the request is a |
| 2402 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 2403 | |
| 2404 | // typedef struct sSirRSNie |
| 2405 | // { |
| 2406 | // tANI_U16 length; |
| 2407 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 2408 | // } tSirRSNie, *tpSirRSNie; |
| 2409 | |
| 2410 | // So, we should be able to make the following two calls harmlessly, |
| 2411 | // since they do nothing if they don't find the given IE in the |
| 2412 | // bytestream with which they're provided. |
| 2413 | |
| 2414 | // The net effect of this will be to faithfully transmit whatever |
| 2415 | // security IE is in the join request. |
| 2416 | |
| 2417 | // *However*, if we're associating for the purpose of WPS |
| 2418 | // enrollment, and we've been configured to indicate that by |
| 2419 | // eliding the WPA or RSN IE, we just skip this: |
| 2420 | if( nAddIELen && pAddIE ) |
| 2421 | { |
| 2422 | wpsIe = limGetWscIEPtr (pMac, pAddIE, nAddIELen); |
| 2423 | } |
| 2424 | if ( NULL == wpsIe ) |
| 2425 | { |
| 2426 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2427 | &pFrm->RSNOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2428 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2429 | &pFrm->WPAOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2430 | #if defined(FEATURE_WLAN_WAPI) |
| 2431 | PopulateDot11fWAPIOpaque( pMac, &( psessionEntry->pLimJoinReq->rsnIE ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2432 | &pFrm->WAPIOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2433 | #endif // defined(FEATURE_WLAN_WAPI) |
| 2434 | } |
| 2435 | |
| 2436 | // include WME EDCA IE as well |
| 2437 | if ( fWmeEnabled ) |
| 2438 | { |
| 2439 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limCurrentBssPropCap ) ) |
| 2440 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2441 | PopulateDot11fWMMInfoStation( pMac, &pFrm->WMMInfoStation ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2442 | } |
| 2443 | |
| 2444 | if ( fWsmEnabled && |
| 2445 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limCurrentBssPropCap ))) |
| 2446 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2447 | PopulateDot11fWMMCaps( &pFrm->WMMCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2448 | } |
| 2449 | } |
| 2450 | |
| 2451 | //Populate HT IEs, when operating in 11n or Taurus modes AND |
| 2452 | //when AP is also operating in 11n mode. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2453 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2454 | pMac->lim.htCapabilityPresentInBeacon) |
| 2455 | { |
Krishna Kumaar Natarajan | 025a860 | 2015-08-04 16:31:36 +0530 | [diff] [blame] | 2456 | limLog(pMac, LOG1, FL("Populate HT IEs in Assoc Request")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2457 | PopulateDot11fHTCaps( pMac, psessionEntry, &pFrm->HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2458 | #ifdef DISABLE_GF_FOR_INTEROP |
| 2459 | |
| 2460 | /* |
| 2461 | * To resolve the interop problem with Broadcom AP, |
| 2462 | * where TQ STA could not pass traffic with GF enabled, |
| 2463 | * TQ STA will do Greenfield only with TQ AP, for |
| 2464 | * everybody else it will be turned off. |
| 2465 | */ |
| 2466 | |
| 2467 | if( (psessionEntry->pLimJoinReq != NULL) && (!psessionEntry->pLimJoinReq->bssDescription.aniIndicator)) |
| 2468 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2469 | limLog( pMac, LOG1, FL("Sending Assoc Req to Non-TQ AP," |
| 2470 | " Turning off Greenfield")); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2471 | pFrm->HTCaps.greenField = WNI_CFG_GREENFIELD_CAPABILITY_DISABLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2472 | } |
| 2473 | #endif |
| 2474 | |
| 2475 | } |
Agrawal Ashish | b10d039 | 2015-08-06 16:18:20 +0530 | [diff] [blame] | 2476 | |
| 2477 | limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," |
| 2478 | "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), |
| 2479 | pFrm->HTCaps.supportedChannelWidthSet, pFrm->HTCaps.mimoPowerSave, |
| 2480 | pFrm->HTCaps.greenField, pFrm->HTCaps.shortGI20MHz, pFrm->HTCaps.shortGI40MHz, |
| 2481 | pFrm->HTCaps.dsssCckMode40MHz, pFrm->HTCaps.maxRxAMPDUFactor); |
| 2482 | |
| 2483 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2484 | #ifdef WLAN_FEATURE_11AC |
| 2485 | if ( psessionEntry->vhtCapability && |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 2486 | psessionEntry->vhtCapabilityPresentInBeacon) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2487 | { |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 2488 | limLog( pMac, LOG1, FL("Populate VHT IEs in Assoc Request")); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 2489 | PopulateDot11fVHTCaps( pMac, &pFrm->VHTCaps, |
| 2490 | psessionEntry->currentOperChannel, eSIR_FALSE ); |
Abhishek Singh | e038dc6 | 2015-05-22 11:36:45 +0530 | [diff] [blame] | 2491 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2492 | } |
| 2493 | #endif |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 2494 | if (psessionEntry->is_ext_caps_present) |
| 2495 | PopulateDot11fExtCap( pMac, &pFrm->ExtCap, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2496 | |
| 2497 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2498 | if (psessionEntry->pLimJoinReq->is11Rconnection) |
| 2499 | { |
| 2500 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2501 | limLog( pMac, LOG1, FL("mdie = %02x %02x %02x"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2502 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[0], |
| 2503 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[1], |
| 2504 | (unsigned int)psessionEntry->pLimJoinReq->bssDescription.mdie[2]); |
| 2505 | #endif |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2506 | PopulateMDIE( pMac, &pFrm->MobilityDomain, |
| 2507 | psessionEntry->pLimJoinReq->bssDescription.mdie); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2508 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2509 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2510 | { |
| 2511 | // No 11r IEs dont send any MDIE |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2512 | limLog( pMac, LOG1, FL("MDIE not present")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2513 | } |
| 2514 | #endif |
| 2515 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2516 | #ifdef FEATURE_WLAN_ESE |
| 2517 | /* For ESE Associations fill the ESE IEs */ |
| 2518 | if (psessionEntry->isESEconnection && |
| 2519 | psessionEntry->pLimJoinReq->isESEFeatureIniEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2520 | { |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2521 | #ifndef FEATURE_DISABLE_RM |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2522 | PopulateDot11fESERadMgmtCap(&pFrm->ESERadMgmtCap); |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2523 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2524 | PopulateDot11fESEVersion(&pFrm->ESEVersion); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2525 | } |
| 2526 | #endif |
| 2527 | |
c_hpothu | bcd7865 | 2014-04-28 22:31:08 +0530 | [diff] [blame] | 2528 | /* merge the ExtCap struct*/ |
| 2529 | if (extractedExtCapFlag && extractedExtCap.present) |
| 2530 | { |
| 2531 | limMergeExtCapIEStruct(&pFrm->ExtCap, &extractedExtCap); |
| 2532 | } |
| 2533 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2534 | nStatus = dot11fGetPackedAssocRequestSize( pMac, pFrm, &nPayload ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2535 | if ( DOT11F_FAILED( nStatus ) ) |
| 2536 | { |
| 2537 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2538 | "or an Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2539 | nStatus ); |
| 2540 | // We'll fall back on the worst case scenario: |
| 2541 | nPayload = sizeof( tDot11fAssocRequest ); |
| 2542 | } |
| 2543 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2544 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 2545 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2546 | "the packed size for an Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2547 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2548 | } |
| 2549 | |
| 2550 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
| 2551 | |
| 2552 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2553 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 2554 | ( void** ) &pPacket ); |
| 2555 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2556 | { |
| 2557 | 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] | 2558 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2559 | |
| 2560 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2561 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2562 | |
| 2563 | |
| 2564 | /* Update PE session id*/ |
| 2565 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 2566 | |
| 2567 | mlmAssocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 2568 | |
| 2569 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2570 | ( void* ) pFrame, ( void* ) pPacket ); |
| 2571 | |
| 2572 | limPostSmeMessage( pMac, LIM_MLM_ASSOC_CNF, |
| 2573 | ( tANI_U32* ) &mlmAssocCnf); |
| 2574 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2575 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2576 | return; |
| 2577 | } |
| 2578 | |
| 2579 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2580 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2581 | |
| 2582 | // Next, we fill out the buffer descriptor: |
| 2583 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 2584 | SIR_MAC_MGMT_ASSOC_REQ, psessionEntry->bssId,psessionEntry->selfMacAddr); |
| 2585 | if ( eSIR_SUCCESS != nSirStatus ) |
| 2586 | { |
| 2587 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2588 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2589 | nSirStatus ); |
| 2590 | 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] | 2591 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2592 | return; |
| 2593 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2594 | |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2595 | // That done, pack the Assoc Request: |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2596 | nStatus = dot11fPackAssocRequest( pMac, pFrm, pFrame + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2597 | sizeof(tSirMacMgmtHdr), |
| 2598 | nPayload, &nPayload ); |
| 2599 | if ( DOT11F_FAILED( nStatus ) ) |
| 2600 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2601 | 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] | 2602 | "8x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2603 | nStatus ); |
| 2604 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 2605 | ( void* ) pFrame, ( void* ) pPacket ); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2606 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2607 | return; |
| 2608 | } |
| 2609 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2610 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2611 | limLog( pMac, LOGW, FL("There were warnings while packing a Assoc" |
| 2612 | "Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2613 | } |
| 2614 | |
| 2615 | PELOG1(limLog( pMac, LOG1, FL("*** Sending Association Request length %d" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2616 | "to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2617 | nBytes );) |
| 2618 | // limPrintMacAddr( pMac, bssid, LOG1 ); |
| 2619 | |
| 2620 | if( psessionEntry->assocReq != NULL ) |
| 2621 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2622 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2623 | psessionEntry->assocReq = NULL; |
| 2624 | } |
| 2625 | |
| 2626 | if( nAddIELen ) |
| 2627 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2628 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 2629 | pAddIE, |
| 2630 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2631 | nPayload += nAddIELen; |
| 2632 | } |
| 2633 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2634 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 2635 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2636 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 2637 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store " |
| 2638 | "assoc request"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2639 | } |
| 2640 | else |
| 2641 | { |
| 2642 | //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] | 2643 | vos_mem_copy( psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2644 | psessionEntry->assocReqLen = nPayload; |
| 2645 | } |
| 2646 | |
| 2647 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2648 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 2649 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2650 | ) |
| 2651 | { |
| 2652 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 2653 | } |
| 2654 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 2655 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || |
| 2656 | psessionEntry->pePersona == VOS_STA_MODE) |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 2657 | { |
| 2658 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 2659 | } |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame^] | 2660 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 2661 | limDiagEventReport(pMac, WLAN_PE_DIAG_ASSOC_START_EVENT, psessionEntry, |
| 2662 | eSIR_SUCCESS, eSIR_SUCCESS); |
| 2663 | #endif |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2664 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 2665 | limLog( pMac, LOG1, FL("Sending Assoc req over WQ5 to "MAC_ADDRESS_STR |
| 2666 | " From " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMacHdr->da), |
| 2667 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
| 2668 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 2669 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2670 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 2671 | psessionEntry->peSessionId, |
| 2672 | pMacHdr->fc.subType)); |
Katya Nigam | 6390293 | 2014-06-26 19:04:23 +0530 | [diff] [blame] | 2673 | |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 2674 | if( ( psessionEntry->is11Gonly == true ) && |
| 2675 | ( !IS_BROADCAST_MAC(pMlmAssocReq->peerMacAddr) ) ){ |
| 2676 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 2677 | } |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 2678 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 2679 | { |
| 2680 | limLog(pMac, LOG1, FL("Assoc Req - txBdToken %u"), pMac->lim.txBdToken); |
| 2681 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, |
| 2682 | ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 2683 | HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, |
| 2684 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 2685 | limTxComplete, pFrame, limTxBdComplete, txFlag, |
| 2686 | pMac->lim.txBdToken); |
| 2687 | pMac->lim.txBdToken++; |
| 2688 | } |
| 2689 | else |
| 2690 | { |
| 2691 | halstatus = halTxFrame( pMac, pPacket, |
| 2692 | ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 2693 | HAL_TXRX_FRM_802_11_MGMT, |
| 2694 | ANI_TXDIR_TODS, |
| 2695 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 2696 | limTxComplete, pFrame, txFlag ); |
| 2697 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2698 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 2699 | psessionEntry->peSessionId, |
| 2700 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2701 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 2702 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2703 | limLog( pMac, LOGE, FL("Failed to send Association Request (%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2704 | halstatus ); |
| 2705 | //Pkt will be freed up by the callback |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2706 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2707 | return; |
| 2708 | } |
| 2709 | |
Katya Nigam | ccaeda7 | 2015-04-20 18:51:22 +0530 | [diff] [blame] | 2710 | //Enable caching only if Assoc Request is successfully submitted to the h/w |
| 2711 | WLANTL_EnableCaching(psessionEntry->staId); |
| 2712 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2713 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2714 | vos_mem_free(pMlmAssocReq); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2715 | pMlmAssocReq = NULL; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2716 | vos_mem_free(pFrm); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2717 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2718 | } // End limSendAssocReqMgmtFrame |
| 2719 | |
| 2720 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2721 | #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] | 2722 | /*------------------------------------------------------------------------------------ |
| 2723 | * |
| 2724 | * Send Reassoc Req with FTIEs. |
| 2725 | * |
| 2726 | *----------------------------------------------------------------------------------- |
| 2727 | */ |
| 2728 | void |
| 2729 | limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, |
| 2730 | tLimMlmReassocReq *pMlmReassocReq,tpPESession psessionEntry) |
| 2731 | { |
| 2732 | static tDot11fReAssocRequest frm; |
| 2733 | tANI_U16 caps; |
| 2734 | tANI_U8 *pFrame; |
| 2735 | tSirRetStatus nSirStatus; |
| 2736 | tANI_U32 nBytes, nPayload, nStatus; |
| 2737 | tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; |
| 2738 | void *pPacket; |
| 2739 | eHalStatus halstatus; |
| 2740 | #if defined WLAN_FEATURE_VOWIFI |
| 2741 | tANI_U8 PowerCapsPopulated = FALSE; |
| 2742 | #endif |
| 2743 | tANI_U16 ft_ies_length = 0; |
| 2744 | tANI_U8 *pBody; |
| 2745 | tANI_U16 nAddIELen; |
| 2746 | tANI_U8 *pAddIE; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2747 | #if defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2748 | tANI_U8 *wpsIe = NULL; |
| 2749 | #endif |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 2750 | tANI_U32 txFlag = 0; |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 2751 | tpSirMacMgmtHdr pMacHdr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2752 | |
| 2753 | if (NULL == psessionEntry) |
| 2754 | { |
| 2755 | return; |
| 2756 | } |
| 2757 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2758 | /* check this early to avoid unncessary operation */ |
| 2759 | if(NULL == psessionEntry->pLimReAssocReq) |
| 2760 | { |
| 2761 | return; |
| 2762 | } |
| 2763 | nAddIELen = psessionEntry->pLimReAssocReq->addIEAssoc.length; |
| 2764 | pAddIE = psessionEntry->pLimReAssocReq->addIEAssoc.addIEdata; |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 2765 | limLog( pMac, LOG1, FL("limSendReassocReqWithFTIEsMgmtFrame received in " |
| 2766 | "state (%d)."), psessionEntry->limMlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2767 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2768 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2769 | |
| 2770 | caps = pMlmReassocReq->capabilityInfo; |
| 2771 | if (PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap)) |
| 2772 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 2773 | #if defined(FEATURE_WLAN_WAPI) |
| 2774 | /* CR: 262463 : |
| 2775 | According to WAPI standard: |
| 2776 | 7.3.1.4 Capability Information field |
| 2777 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 2778 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 2779 | Reassociation management frames. */ |
| 2780 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 2781 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 2782 | #endif |
| 2783 | swapBitField16(caps, ( tANI_U16* )&frm.Capabilities ); |
| 2784 | |
| 2785 | frm.ListenInterval.interval = pMlmReassocReq->listenInterval; |
| 2786 | |
| 2787 | // Get the old bssid of the older AP. |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2788 | vos_mem_copy( ( tANI_U8* )frm.CurrentAPAddress.mac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2789 | pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, 6); |
| 2790 | |
| 2791 | PopulateDot11fSSID2( pMac, &frm.SSID ); |
| 2792 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 2793 | &frm.SuppRates,psessionEntry); |
| 2794 | |
| 2795 | fQosEnabled = ( psessionEntry->limQosEnabled) && |
| 2796 | SIR_MAC_GET_QOS( psessionEntry->limReassocBssCaps ); |
| 2797 | |
| 2798 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 2799 | LIM_BSS_CAPS_GET( WME, psessionEntry->limReassocBssQosCaps ); |
| 2800 | |
| 2801 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 2802 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limReassocBssQosCaps ); |
| 2803 | |
| 2804 | if ( psessionEntry->lim11hEnable && |
| 2805 | psessionEntry->pLimReAssocReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 2806 | { |
| 2807 | #if defined WLAN_FEATURE_VOWIFI |
| 2808 | PowerCapsPopulated = TRUE; |
| 2809 | |
| 2810 | PopulateDot11fPowerCaps( pMac, &frm.PowerCaps, LIM_REASSOC,psessionEntry); |
| 2811 | PopulateDot11fSuppChannels( pMac, &frm.SuppChannels, LIM_REASSOC,psessionEntry); |
| 2812 | #endif |
| 2813 | } |
| 2814 | |
| 2815 | #if defined WLAN_FEATURE_VOWIFI |
| 2816 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2817 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 2818 | { |
| 2819 | if (PowerCapsPopulated == FALSE) |
| 2820 | { |
| 2821 | PowerCapsPopulated = TRUE; |
| 2822 | PopulateDot11fPowerCaps(pMac, &frm.PowerCaps, LIM_REASSOC, psessionEntry); |
| 2823 | } |
| 2824 | } |
| 2825 | #endif |
| 2826 | |
| 2827 | if ( fQosEnabled && |
| 2828 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap ) )) |
| 2829 | { |
| 2830 | PopulateDot11fQOSCapsStation( pMac, &frm.QOSCapsStation ); |
| 2831 | } |
| 2832 | |
| 2833 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 2834 | &frm.ExtSuppRates, psessionEntry ); |
| 2835 | |
| 2836 | #if defined WLAN_FEATURE_VOWIFI |
| 2837 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 2838 | SIR_MAC_GET_RRM( psessionEntry->limReassocBssCaps ) ) |
| 2839 | { |
| 2840 | PopulateDot11fRRMIe( pMac, &frm.RRMEnabledCap, psessionEntry ); |
| 2841 | } |
| 2842 | #endif |
| 2843 | |
| 2844 | // Ideally this should be enabled for 11r also. But 11r does |
| 2845 | // not follow the usual norm of using the Opaque object |
| 2846 | // for rsnie and fties. Instead we just add |
| 2847 | // the rsnie and fties at the end of the pack routine for 11r. |
| 2848 | // This should ideally! be fixed. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2849 | #if defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2850 | // |
| 2851 | // The join request *should* contain zero or one of the WPA and RSN |
| 2852 | // IEs. The payload send along with the request is a |
| 2853 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 2854 | |
| 2855 | // typedef struct sSirRSNie |
| 2856 | // { |
| 2857 | // tANI_U16 length; |
| 2858 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 2859 | // } tSirRSNie, *tpSirRSNie; |
| 2860 | |
| 2861 | // So, we should be able to make the following two calls harmlessly, |
| 2862 | // since they do nothing if they don't find the given IE in the |
| 2863 | // bytestream with which they're provided. |
| 2864 | |
| 2865 | // The net effect of this will be to faithfully transmit whatever |
| 2866 | // security IE is in the join request. |
| 2867 | |
| 2868 | // *However*, if we're associating for the purpose of WPS |
| 2869 | // enrollment, and we've been configured to indicate that by |
| 2870 | // eliding the WPA or RSN IE, we just skip this: |
| 2871 | if (!psessionEntry->is11Rconnection) |
| 2872 | { |
| 2873 | if( nAddIELen && pAddIE ) |
| 2874 | { |
| 2875 | wpsIe = limGetWscIEPtr(pMac, pAddIE, nAddIELen); |
| 2876 | } |
| 2877 | if ( NULL == wpsIe ) |
| 2878 | { |
| 2879 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2880 | &frm.RSNOpaque ); |
| 2881 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 2882 | &frm.WPAOpaque ); |
| 2883 | } |
| 2884 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2885 | #ifdef FEATURE_WLAN_ESE |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2886 | if (psessionEntry->pLimReAssocReq->cckmIE.length) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2887 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2888 | PopulateDot11fESECckmOpaque( pMac, &( psessionEntry->pLimReAssocReq->cckmIE ), |
| 2889 | &frm.ESECckmOpaque ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2890 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2891 | #endif //FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2892 | } |
| 2893 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2894 | #ifdef FEATURE_WLAN_ESE |
| 2895 | // For ESE Associations fill the ESE IEs |
| 2896 | if (psessionEntry->isESEconnection && |
| 2897 | psessionEntry->pLimReAssocReq->isESEFeatureIniEnabled) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2898 | { |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2899 | #ifndef FEATURE_DISABLE_RM |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2900 | PopulateDot11fESERadMgmtCap(&frm.ESERadMgmtCap); |
Varun Reddy Yeturu | 30779b4 | 2013-04-09 09:57:16 -0700 | [diff] [blame] | 2901 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2902 | PopulateDot11fESEVersion(&frm.ESEVersion); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2903 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2904 | #endif //FEATURE_WLAN_ESE |
| 2905 | #endif //FEATURE_WLAN_ESE || FEATURE_WLAN_LFR |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2906 | |
| 2907 | // include WME EDCA IE as well |
| 2908 | if ( fWmeEnabled ) |
| 2909 | { |
| 2910 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limReassocBssPropCap ) ) |
| 2911 | { |
| 2912 | PopulateDot11fWMMInfoStation( pMac, &frm.WMMInfoStation ); |
| 2913 | } |
| 2914 | |
| 2915 | if ( fWsmEnabled && |
| 2916 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limReassocBssPropCap ))) |
| 2917 | { |
| 2918 | PopulateDot11fWMMCaps( &frm.WMMCaps ); |
| 2919 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2920 | #ifdef FEATURE_WLAN_ESE |
| 2921 | if (psessionEntry->isESEconnection) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2922 | { |
| 2923 | PopulateDot11fReAssocTspec(pMac, &frm, psessionEntry); |
| 2924 | |
| 2925 | // 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] | 2926 | if (psessionEntry->pLimReAssocReq->eseTspecInfo.numTspecs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2927 | { |
| 2928 | tANI_U32 phyMode; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2929 | tSirMacESETSRSIE tsrsIE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2930 | limGetPhyMode(pMac, &phyMode, psessionEntry); |
| 2931 | |
| 2932 | tsrsIE.tsid = 0; |
| 2933 | if( phyMode == WNI_CFG_PHY_MODE_11G || phyMode == WNI_CFG_PHY_MODE_11A) |
| 2934 | { |
| 2935 | tsrsIE.rates[0] = TSRS_11AG_RATE_6MBPS; |
| 2936 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2937 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2938 | { |
| 2939 | tsrsIE.rates[0] = TSRS_11B_RATE_5_5MBPS; |
| 2940 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2941 | PopulateDot11TSRSIE(pMac,&tsrsIE, &frm.ESETrafStrmRateSet, sizeof(tANI_U8)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2942 | } |
| 2943 | } |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 2944 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2945 | } |
| 2946 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2947 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2948 | pMac->lim.htCapabilityPresentInBeacon) |
| 2949 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2950 | PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2951 | } |
Agrawal Ashish | b10d039 | 2015-08-06 16:18:20 +0530 | [diff] [blame] | 2952 | limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," |
| 2953 | "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), |
| 2954 | frm.HTCaps.supportedChannelWidthSet, frm.HTCaps.mimoPowerSave, |
| 2955 | frm.HTCaps.greenField, frm.HTCaps.shortGI20MHz, frm.HTCaps.shortGI40MHz, |
| 2956 | frm.HTCaps.dsssCckMode40MHz, frm.HTCaps.maxRxAMPDUFactor); |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 2957 | #if defined WLAN_FEATURE_VOWIFI_11R |
Kanchanapally, Vidyullatha | 4f84f68 | 2014-04-29 20:40:34 +0530 | [diff] [blame] | 2958 | if ( psessionEntry->pLimReAssocReq->bssDescription.mdiePresent && |
| 2959 | (pMac->ft.ftSmeContext.addMDIE == TRUE) |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2960 | #if defined FEATURE_WLAN_ESE |
| 2961 | && !psessionEntry->isESEconnection |
Gopichand Nakkala | 0ac5506 | 2013-04-08 14:43:07 +0530 | [diff] [blame] | 2962 | #endif |
| 2963 | ) |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 2964 | { |
| 2965 | PopulateMDIE( pMac, &frm.MobilityDomain, psessionEntry->pLimReAssocReq->bssDescription.mdie); |
| 2966 | } |
| 2967 | #endif |
| 2968 | |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 2969 | #ifdef WLAN_FEATURE_11AC |
| 2970 | if ( psessionEntry->vhtCapability && |
| 2971 | psessionEntry->vhtCapabilityPresentInBeacon) |
| 2972 | { |
| 2973 | limLog( pMac, LOG1, FL("Populate VHT IEs in Re-Assoc Request")); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 2974 | PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, |
| 2975 | psessionEntry->currentOperChannel, eSIR_FALSE ); |
Abhishek Singh | e038dc6 | 2015-05-22 11:36:45 +0530 | [diff] [blame] | 2976 | |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 2977 | } |
| 2978 | #endif |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 2979 | if (psessionEntry->is_ext_caps_present) |
| 2980 | PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 2981 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2982 | nStatus = dot11fGetPackedReAssocRequestSize( pMac, &frm, &nPayload ); |
| 2983 | if ( DOT11F_FAILED( nStatus ) ) |
| 2984 | { |
| 2985 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2986 | "or a Re-Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2987 | nStatus ); |
| 2988 | // We'll fall back on the worst case scenario: |
| 2989 | nPayload = sizeof( tDot11fReAssocRequest ); |
| 2990 | } |
| 2991 | else if ( DOT11F_WARNED( nStatus ) ) |
| 2992 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 2993 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2994 | "the packed size for a Re-Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2995 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2996 | } |
| 2997 | |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 2998 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2999 | |
| 3000 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 3001 | limLog( pMac, LOG1, FL("FT IE Reassoc Req (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3002 | pMac->ft.ftSmeContext.reassoc_ft_ies_length); |
| 3003 | #endif |
| 3004 | |
| 3005 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 3006 | if (psessionEntry->is11Rconnection) |
| 3007 | { |
| 3008 | ft_ies_length = pMac->ft.ftSmeContext.reassoc_ft_ies_length; |
| 3009 | } |
| 3010 | #endif |
| 3011 | |
| 3012 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3013 | ( tANI_U16 )nBytes+ft_ies_length, ( void** ) &pFrame, |
| 3014 | ( void** ) &pPacket ); |
| 3015 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3016 | { |
| 3017 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3018 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3019 | 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] | 3020 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3021 | goto end; |
| 3022 | } |
| 3023 | |
| 3024 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3025 | vos_mem_set( pFrame, nBytes + ft_ies_length, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3026 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3027 | #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] | 3028 | limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3029 | #endif |
| 3030 | // Next, we fill out the buffer descriptor: |
| 3031 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3032 | SIR_MAC_MGMT_REASSOC_REQ, |
| 3033 | psessionEntry->limReAssocbssId,psessionEntry->selfMacAddr); |
| 3034 | if ( eSIR_SUCCESS != nSirStatus ) |
| 3035 | { |
| 3036 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3037 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3038 | nSirStatus ); |
| 3039 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3040 | goto end; |
| 3041 | } |
| 3042 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3043 | pMacHdr = (tpSirMacMgmtHdr) pFrame; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3044 | // That done, pack the ReAssoc Request: |
| 3045 | nStatus = dot11fPackReAssocRequest( pMac, &frm, pFrame + |
| 3046 | sizeof(tSirMacMgmtHdr), |
| 3047 | nPayload, &nPayload ); |
| 3048 | if ( DOT11F_FAILED( nStatus ) ) |
| 3049 | { |
| 3050 | limLog( pMac, LOGE, FL("Failed to pack a Re-Association Reque" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3051 | "st (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3052 | nStatus ); |
| 3053 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3054 | goto end; |
| 3055 | } |
| 3056 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3057 | { |
| 3058 | limLog( pMac, LOGW, FL("There were warnings while packing a R" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 3059 | "e-Association Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3060 | } |
| 3061 | |
| 3062 | PELOG3(limLog( pMac, LOG3, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3063 | FL("*** Sending Re-Association Request length %d %d to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3064 | nBytes, nPayload );) |
| 3065 | if( psessionEntry->assocReq != NULL ) |
| 3066 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3067 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3068 | psessionEntry->assocReq = NULL; |
| 3069 | } |
| 3070 | |
| 3071 | if( nAddIELen ) |
| 3072 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3073 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 3074 | pAddIE, |
| 3075 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3076 | nPayload += nAddIELen; |
| 3077 | } |
| 3078 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3079 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 3080 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3081 | { |
| 3082 | 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] | 3083 | } |
| 3084 | else |
| 3085 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3086 | //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] | 3087 | vos_mem_copy( psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3088 | psessionEntry->assocReqLen = nPayload; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3089 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3090 | |
| 3091 | if (psessionEntry->is11Rconnection) |
| 3092 | { |
| 3093 | { |
| 3094 | int i = 0; |
| 3095 | |
| 3096 | pBody = pFrame + nBytes; |
| 3097 | for (i=0; i<ft_ies_length; i++) |
| 3098 | { |
| 3099 | *pBody = pMac->ft.ftSmeContext.reassoc_ft_ies[i]; |
| 3100 | pBody++; |
| 3101 | } |
| 3102 | } |
| 3103 | } |
| 3104 | |
| 3105 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3106 | PELOGE(limLog(pMac, LOG1, FL("Re-assoc Req Frame is: ")); |
| 3107 | sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3108 | (tANI_U8 *)pFrame, |
| 3109 | (nBytes + ft_ies_length));) |
| 3110 | #endif |
| 3111 | |
| 3112 | |
| 3113 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3114 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3115 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3116 | ) |
| 3117 | { |
| 3118 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3119 | } |
| 3120 | |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3121 | if( NULL != psessionEntry->assocReq ) |
| 3122 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3123 | vos_mem_free(psessionEntry->assocReq); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3124 | psessionEntry->assocReq = NULL; |
| 3125 | } |
| 3126 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3127 | psessionEntry->assocReq = vos_mem_malloc(ft_ies_length); |
| 3128 | if ( NULL == psessionEntry->assocReq ) |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3129 | { |
| 3130 | PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));) |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3131 | psessionEntry->assocReqLen = 0; |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3132 | } |
| 3133 | else |
| 3134 | { |
| 3135 | //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] | 3136 | vos_mem_copy( psessionEntry->assocReq, pMac->ft.ftSmeContext.reassoc_ft_ies, |
| 3137 | (ft_ies_length)); |
Madan Mohan Koyyalamudi | ea77388 | 2012-11-02 13:37:21 -0700 | [diff] [blame] | 3138 | psessionEntry->assocReqLen = (ft_ies_length); |
| 3139 | } |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame^] | 3140 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 3141 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_START_EVENT, psessionEntry, |
| 3142 | eSIR_SUCCESS, eSIR_SUCCESS); |
| 3143 | #endif |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3144 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 3145 | psessionEntry->peSessionId, |
| 3146 | pMacHdr->fc.subType)); |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3147 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 3148 | { |
| 3149 | limLog( pMac, LOG1, FL("Reassoc req - txBdToken %u"), pMac->lim.txBdToken); |
| 3150 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, |
| 3151 | ( tANI_U16 ) (nBytes + ft_ies_length), |
| 3152 | HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, |
| 3153 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3154 | limTxComplete, pFrame, limTxBdComplete, txFlag, |
| 3155 | pMac->lim.txBdToken); |
| 3156 | pMac->lim.txBdToken++; |
| 3157 | } |
| 3158 | else |
| 3159 | { |
| 3160 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (nBytes + ft_ies_length), |
| 3161 | HAL_TXRX_FRM_802_11_MGMT, |
| 3162 | ANI_TXDIR_TODS, |
| 3163 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3164 | limTxComplete, pFrame, txFlag ); |
| 3165 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3166 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 3167 | psessionEntry->peSessionId, |
| 3168 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3169 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3170 | { |
| 3171 | limLog( pMac, LOGE, FL("Failed to send Re-Association Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3172 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3173 | nSirStatus ); |
| 3174 | //Pkt will be freed up by the callback |
| 3175 | goto end; |
| 3176 | } |
| 3177 | |
Katya Nigam | ccaeda7 | 2015-04-20 18:51:22 +0530 | [diff] [blame] | 3178 | // Enable TL cahching in case of roaming |
| 3179 | WLANTL_EnableCaching(psessionEntry->staId); |
| 3180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3181 | end: |
| 3182 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3183 | vos_mem_free( pMlmReassocReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3184 | psessionEntry->pLimMlmReassocReq = NULL; |
| 3185 | |
| 3186 | } |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3187 | |
| 3188 | void limSendRetryReassocReqFrame(tpAniSirGlobal pMac, |
| 3189 | tLimMlmReassocReq *pMlmReassocReq, |
| 3190 | tpPESession psessionEntry) |
| 3191 | { |
| 3192 | tLimMlmReassocCnf mlmReassocCnf; // keep sme |
| 3193 | tLimMlmReassocReq *pTmpMlmReassocReq = NULL; |
Sachin Ahuja | 07a4301 | 2015-01-30 17:04:38 +0530 | [diff] [blame] | 3194 | #ifdef FEATURE_WLAN_ESE |
| 3195 | tANI_U32 val=0; |
| 3196 | #endif |
| 3197 | if (pMlmReassocReq == NULL) |
| 3198 | { |
| 3199 | limLog(pMac, LOGE, |
| 3200 | FL("Invalid pMlmReassocReq")); |
| 3201 | goto end; |
| 3202 | } |
Hema Aparna Medicharla | 43d0f7b | 2015-02-12 17:07:59 +0530 | [diff] [blame] | 3203 | |
| 3204 | pTmpMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); |
| 3205 | if ( NULL == pTmpMlmReassocReq ) goto end; |
| 3206 | vos_mem_set( pTmpMlmReassocReq, sizeof(tLimMlmReassocReq), 0); |
| 3207 | vos_mem_copy( pTmpMlmReassocReq, pMlmReassocReq, sizeof(tLimMlmReassocReq)); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3208 | |
| 3209 | // Prepare and send Reassociation request frame |
| 3210 | // start reassoc timer. |
Sachin Ahuja | 07a4301 | 2015-01-30 17:04:38 +0530 | [diff] [blame] | 3211 | #ifdef FEATURE_WLAN_ESE |
| 3212 | /* |
| 3213 | * In case of Ese Reassociation, change the reassoc timer |
| 3214 | * value. |
| 3215 | */ |
| 3216 | val = pMlmReassocReq->reassocFailureTimeout; |
| 3217 | if (psessionEntry->isESEconnection) |
| 3218 | { |
| 3219 | val = val/LIM_MAX_REASSOC_RETRY_LIMIT; |
| 3220 | } |
| 3221 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != |
| 3222 | TX_SUCCESS) |
| 3223 | { |
| 3224 | limLog(pMac, LOGP, |
| 3225 | FL("unable to deactivate Reassoc failure timer")); |
| 3226 | } |
| 3227 | val = SYS_MS_TO_TICKS(val); |
| 3228 | if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, |
| 3229 | val, 0) != TX_SUCCESS) |
| 3230 | { |
| 3231 | limLog(pMac, LOGP, |
| 3232 | FL("unable to change Reassociation failure timer")); |
| 3233 | } |
| 3234 | #endif |
| 3235 | |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3236 | pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; |
| 3237 | // Start reassociation failure timer |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 3238 | 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] | 3239 | if (tx_timer_activate(&pMac->lim.limTimers.gLimReassocFailureTimer) |
| 3240 | != TX_SUCCESS) |
| 3241 | { |
| 3242 | // Could not start reassoc failure timer. |
| 3243 | // Log error |
| 3244 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3245 | FL("could not start Reassociation failure timer")); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3246 | // Return Reassoc confirm with |
| 3247 | // Resources Unavailable |
| 3248 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3249 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 3250 | goto end; |
| 3251 | } |
| 3252 | |
| 3253 | limSendReassocReqWithFTIEsMgmtFrame(pMac, pTmpMlmReassocReq, psessionEntry); |
| 3254 | return; |
| 3255 | |
| 3256 | end: |
| 3257 | // Free up buffer allocated for reassocReq |
| 3258 | if (pMlmReassocReq != NULL) |
| 3259 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3260 | vos_mem_free(pMlmReassocReq); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3261 | pMlmReassocReq = NULL; |
| 3262 | } |
| 3263 | if (pTmpMlmReassocReq != NULL) |
| 3264 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3265 | vos_mem_free(pTmpMlmReassocReq); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3266 | pTmpMlmReassocReq = NULL; |
| 3267 | } |
| 3268 | mlmReassocCnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; |
| 3269 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 3270 | /* Update PE sessio Id*/ |
| 3271 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 3272 | |
| 3273 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 3274 | } |
| 3275 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3276 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 3277 | |
| 3278 | |
| 3279 | void |
| 3280 | limSendReassocReqMgmtFrame(tpAniSirGlobal pMac, |
| 3281 | tLimMlmReassocReq *pMlmReassocReq,tpPESession psessionEntry) |
| 3282 | { |
| 3283 | static tDot11fReAssocRequest frm; |
| 3284 | tANI_U16 caps; |
| 3285 | tANI_U8 *pFrame; |
| 3286 | tSirRetStatus nSirStatus; |
| 3287 | tANI_U32 nBytes, nPayload, nStatus; |
| 3288 | tANI_U8 fQosEnabled, fWmeEnabled, fWsmEnabled; |
| 3289 | void *pPacket; |
| 3290 | eHalStatus halstatus; |
| 3291 | tANI_U16 nAddIELen; |
| 3292 | tANI_U8 *pAddIE; |
| 3293 | tANI_U8 *wpsIe = NULL; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 3294 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3295 | #if defined WLAN_FEATURE_VOWIFI |
| 3296 | tANI_U8 PowerCapsPopulated = FALSE; |
| 3297 | #endif |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3298 | tpSirMacMgmtHdr pMacHdr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3299 | |
| 3300 | if(NULL == psessionEntry) |
| 3301 | { |
| 3302 | return; |
| 3303 | } |
| 3304 | |
| 3305 | /* check this early to avoid unncessary operation */ |
| 3306 | if(NULL == psessionEntry->pLimReAssocReq) |
| 3307 | { |
| 3308 | return; |
| 3309 | } |
| 3310 | nAddIELen = psessionEntry->pLimReAssocReq->addIEAssoc.length; |
| 3311 | pAddIE = psessionEntry->pLimReAssocReq->addIEAssoc.addIEdata; |
| 3312 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3313 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3314 | |
| 3315 | caps = pMlmReassocReq->capabilityInfo; |
| 3316 | if (PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap)) |
| 3317 | ((tSirMacCapabilityInfo *) &caps)->qos = 0; |
| 3318 | #if defined(FEATURE_WLAN_WAPI) |
| 3319 | /* CR: 262463 : |
| 3320 | According to WAPI standard: |
| 3321 | 7.3.1.4 Capability Information field |
| 3322 | In WAPI, non-AP STAs within an ESS set the Privacy subfield to 0 in transmitted |
| 3323 | Association or Reassociation management frames. APs ignore the Privacy subfield within received Association and |
| 3324 | Reassociation management frames. */ |
| 3325 | if ( psessionEntry->encryptType == eSIR_ED_WPI) |
| 3326 | ((tSirMacCapabilityInfo *) &caps)->privacy = 0; |
| 3327 | #endif |
| 3328 | swapBitField16(caps, ( tANI_U16* )&frm.Capabilities ); |
| 3329 | |
| 3330 | frm.ListenInterval.interval = pMlmReassocReq->listenInterval; |
| 3331 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3332 | vos_mem_copy(( tANI_U8* )frm.CurrentAPAddress.mac, |
| 3333 | ( tANI_U8* )psessionEntry->bssId, 6 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3334 | |
| 3335 | PopulateDot11fSSID2( pMac, &frm.SSID ); |
| 3336 | PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 3337 | &frm.SuppRates,psessionEntry); |
| 3338 | |
| 3339 | fQosEnabled = ( psessionEntry->limQosEnabled ) && |
| 3340 | SIR_MAC_GET_QOS( psessionEntry->limReassocBssCaps ); |
| 3341 | |
| 3342 | fWmeEnabled = ( psessionEntry->limWmeEnabled ) && |
| 3343 | LIM_BSS_CAPS_GET( WME, psessionEntry->limReassocBssQosCaps ); |
| 3344 | |
| 3345 | fWsmEnabled = ( psessionEntry->limWsmEnabled ) && fWmeEnabled && |
| 3346 | LIM_BSS_CAPS_GET( WSM, psessionEntry->limReassocBssQosCaps ); |
| 3347 | |
| 3348 | |
| 3349 | if ( psessionEntry->lim11hEnable && |
| 3350 | psessionEntry->pLimReAssocReq->spectrumMgtIndicator == eSIR_TRUE ) |
| 3351 | { |
| 3352 | #if defined WLAN_FEATURE_VOWIFI |
| 3353 | PowerCapsPopulated = TRUE; |
| 3354 | PopulateDot11fPowerCaps( pMac, &frm.PowerCaps, LIM_REASSOC,psessionEntry); |
| 3355 | PopulateDot11fSuppChannels( pMac, &frm.SuppChannels, LIM_REASSOC,psessionEntry); |
| 3356 | #endif |
| 3357 | } |
| 3358 | |
| 3359 | #if defined WLAN_FEATURE_VOWIFI |
| 3360 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 3361 | SIR_MAC_GET_RRM( psessionEntry->limCurrentBssCaps ) ) |
| 3362 | { |
| 3363 | if (PowerCapsPopulated == FALSE) |
| 3364 | { |
| 3365 | PowerCapsPopulated = TRUE; |
| 3366 | PopulateDot11fPowerCaps(pMac, &frm.PowerCaps, LIM_REASSOC, psessionEntry); |
| 3367 | } |
| 3368 | } |
| 3369 | #endif |
| 3370 | |
| 3371 | if ( fQosEnabled && |
| 3372 | ( ! PROP_CAPABILITY_GET(11EQOS, psessionEntry->limReassocBssPropCap ) )) |
| 3373 | { |
| 3374 | PopulateDot11fQOSCapsStation( pMac, &frm.QOSCapsStation ); |
| 3375 | } |
| 3376 | |
| 3377 | PopulateDot11fExtSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, |
| 3378 | &frm.ExtSuppRates, psessionEntry ); |
| 3379 | |
| 3380 | #if defined WLAN_FEATURE_VOWIFI |
| 3381 | if( pMac->rrm.rrmPEContext.rrmEnable && |
| 3382 | SIR_MAC_GET_RRM( psessionEntry->limReassocBssCaps ) ) |
| 3383 | { |
| 3384 | PopulateDot11fRRMIe( pMac, &frm.RRMEnabledCap, psessionEntry ); |
| 3385 | } |
| 3386 | #endif |
| 3387 | // The join request *should* contain zero or one of the WPA and RSN |
| 3388 | // IEs. The payload send along with the request is a |
| 3389 | // 'tSirSmeJoinReq'; the IE portion is held inside a 'tSirRSNie': |
| 3390 | |
| 3391 | // typedef struct sSirRSNie |
| 3392 | // { |
| 3393 | // tANI_U16 length; |
| 3394 | // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 3395 | // } tSirRSNie, *tpSirRSNie; |
| 3396 | |
| 3397 | // So, we should be able to make the following two calls harmlessly, |
| 3398 | // since they do nothing if they don't find the given IE in the |
| 3399 | // bytestream with which they're provided. |
| 3400 | |
| 3401 | // The net effect of this will be to faithfully transmit whatever |
| 3402 | // security IE is in the join request. |
| 3403 | |
| 3404 | // *However*, if we're associating for the purpose of WPS |
| 3405 | // enrollment, and we've been configured to indicate that by |
| 3406 | // eliding the WPA or RSN IE, we just skip this: |
| 3407 | if( nAddIELen && pAddIE ) |
| 3408 | { |
| 3409 | wpsIe = limGetWscIEPtr(pMac, pAddIE, nAddIELen); |
| 3410 | } |
| 3411 | if ( NULL == wpsIe ) |
| 3412 | { |
| 3413 | PopulateDot11fRSNOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 3414 | &frm.RSNOpaque ); |
| 3415 | PopulateDot11fWPAOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 3416 | &frm.WPAOpaque ); |
| 3417 | #if defined(FEATURE_WLAN_WAPI) |
| 3418 | PopulateDot11fWAPIOpaque( pMac, &( psessionEntry->pLimReAssocReq->rsnIE ), |
| 3419 | &frm.WAPIOpaque ); |
| 3420 | #endif // defined(FEATURE_WLAN_WAPI) |
| 3421 | } |
| 3422 | |
| 3423 | // include WME EDCA IE as well |
| 3424 | if ( fWmeEnabled ) |
| 3425 | { |
| 3426 | if ( ! PROP_CAPABILITY_GET( WME, psessionEntry->limReassocBssPropCap ) ) |
| 3427 | { |
| 3428 | PopulateDot11fWMMInfoStation( pMac, &frm.WMMInfoStation ); |
| 3429 | } |
| 3430 | |
| 3431 | if ( fWsmEnabled && |
| 3432 | ( ! PROP_CAPABILITY_GET(WSM, psessionEntry->limReassocBssPropCap ))) |
| 3433 | { |
| 3434 | PopulateDot11fWMMCaps( &frm.WMMCaps ); |
| 3435 | } |
| 3436 | } |
| 3437 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3438 | if ( psessionEntry->htCapability && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3439 | pMac->lim.htCapabilityPresentInBeacon) |
| 3440 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3441 | PopulateDot11fHTCaps( pMac, psessionEntry, &frm.HTCaps ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3442 | } |
Agrawal Ashish | b10d039 | 2015-08-06 16:18:20 +0530 | [diff] [blame] | 3443 | limLog(pMac, LOG1, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d," |
| 3444 | "shortGI20:%d, shortGI40: %d, dsssCck: %d, AMPDU Param: %x"), |
| 3445 | frm.HTCaps.supportedChannelWidthSet, frm.HTCaps.mimoPowerSave, |
| 3446 | frm.HTCaps.greenField, frm.HTCaps.shortGI20MHz, frm.HTCaps.shortGI40MHz, |
| 3447 | frm.HTCaps.dsssCckMode40MHz, frm.HTCaps.maxRxAMPDUFactor); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3448 | #ifdef WLAN_FEATURE_11AC |
| 3449 | if ( psessionEntry->vhtCapability && |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 3450 | psessionEntry->vhtCapabilityPresentInBeacon) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3451 | { |
Chet Lanctot | f19c1f6 | 2013-12-13 13:56:21 -0800 | [diff] [blame] | 3452 | limLog( pMac, LOG1, FL("Populate VHT IEs in Re-Assoc Request")); |
Abhishek Singh | 33f76ea | 2015-06-04 12:27:30 +0530 | [diff] [blame] | 3453 | PopulateDot11fVHTCaps( pMac, &frm.VHTCaps, |
| 3454 | psessionEntry->currentOperChannel, eSIR_FALSE ); |
Agrawal Ashish | 5ac89da | 2015-10-26 19:08:47 +0530 | [diff] [blame] | 3455 | if (psessionEntry->is_ext_caps_present) |
| 3456 | PopulateDot11fExtCap( pMac, &frm.ExtCap, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3457 | } |
| 3458 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3459 | |
| 3460 | nStatus = dot11fGetPackedReAssocRequestSize( pMac, &frm, &nPayload ); |
| 3461 | if ( DOT11F_FAILED( nStatus ) ) |
| 3462 | { |
| 3463 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3464 | "or a Re-Association Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3465 | nStatus ); |
| 3466 | // We'll fall back on the worst case scenario: |
| 3467 | nPayload = sizeof( tDot11fReAssocRequest ); |
| 3468 | } |
| 3469 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3470 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 3471 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3472 | "the packed size for a Re-Association Re " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3473 | "quest(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3474 | } |
| 3475 | |
| 3476 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ) + nAddIELen; |
| 3477 | |
| 3478 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 3479 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 3480 | ( void** ) &pPacket ); |
| 3481 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3482 | { |
| 3483 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3484 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3485 | 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] | 3486 | "sociation Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3487 | goto end; |
| 3488 | } |
| 3489 | |
| 3490 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3491 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3492 | |
| 3493 | // Next, we fill out the buffer descriptor: |
| 3494 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3495 | SIR_MAC_MGMT_REASSOC_REQ, |
| 3496 | psessionEntry->limReAssocbssId,psessionEntry->selfMacAddr); |
| 3497 | if ( eSIR_SUCCESS != nSirStatus ) |
| 3498 | { |
| 3499 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3500 | "tor for an Association Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3501 | nSirStatus ); |
| 3502 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3503 | goto end; |
| 3504 | } |
| 3505 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3506 | pMacHdr = (tpSirMacMgmtHdr) pFrame; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3507 | // That done, pack the Probe Request: |
| 3508 | nStatus = dot11fPackReAssocRequest( pMac, &frm, pFrame + |
| 3509 | sizeof(tSirMacMgmtHdr), |
| 3510 | nPayload, &nPayload ); |
| 3511 | if ( DOT11F_FAILED( nStatus ) ) |
| 3512 | { |
| 3513 | limLog( pMac, LOGE, FL("Failed to pack a Re-Association Reque" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3514 | "st (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3515 | nStatus ); |
| 3516 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3517 | goto end; |
| 3518 | } |
| 3519 | else if ( DOT11F_WARNED( nStatus ) ) |
| 3520 | { |
| 3521 | limLog( pMac, LOGW, FL("There were warnings while packing a R" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 3522 | "e-Association Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3523 | } |
| 3524 | |
| 3525 | PELOG1(limLog( pMac, LOG1, FL("*** Sending Re-Association Request length %d" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3526 | "to "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3527 | nBytes );) |
| 3528 | |
| 3529 | if( psessionEntry->assocReq != NULL ) |
| 3530 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3531 | vos_mem_free(psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3532 | psessionEntry->assocReq = NULL; |
| 3533 | } |
| 3534 | |
| 3535 | if( nAddIELen ) |
| 3536 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3537 | vos_mem_copy( pFrame + sizeof(tSirMacMgmtHdr) + nPayload, |
| 3538 | pAddIE, |
| 3539 | nAddIELen ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3540 | nPayload += nAddIELen; |
| 3541 | } |
| 3542 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3543 | psessionEntry->assocReq = vos_mem_malloc(nPayload); |
| 3544 | if ( NULL == psessionEntry->assocReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3545 | { |
| 3546 | 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] | 3547 | } |
| 3548 | else |
| 3549 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3550 | //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] | 3551 | vos_mem_copy(psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3552 | psessionEntry->assocReqLen = nPayload; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3553 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3554 | |
| 3555 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3556 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3557 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3558 | ) |
| 3559 | { |
| 3560 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3561 | } |
| 3562 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 3563 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || |
| 3564 | psessionEntry->pePersona == VOS_STA_MODE) |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 3565 | { |
| 3566 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 3567 | } |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame^] | 3568 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 3569 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_START_EVENT, psessionEntry, |
| 3570 | eSIR_SUCCESS, eSIR_SUCCESS); |
| 3571 | #endif |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3572 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3573 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 3574 | psessionEntry->peSessionId, |
| 3575 | pMacHdr->fc.subType)); |
Katya Nigam | 6390293 | 2014-06-26 19:04:23 +0530 | [diff] [blame] | 3576 | |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3577 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 3578 | { |
| 3579 | limLog(pMac, LOG1, FL("Reassoc req - txBdToken %u"), pMac->lim.txBdToken); |
| 3580 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, |
| 3581 | ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 3582 | HAL_TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, |
| 3583 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3584 | limTxComplete, pFrame, limTxBdComplete, |
| 3585 | txFlag, pMac->lim.txBdToken ); |
| 3586 | pMac->lim.txBdToken++; |
| 3587 | } |
| 3588 | else |
| 3589 | { |
| 3590 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) (sizeof(tSirMacMgmtHdr) + nPayload), |
| 3591 | HAL_TXRX_FRM_802_11_MGMT, |
| 3592 | ANI_TXDIR_TODS, |
| 3593 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 3594 | limTxComplete, pFrame, txFlag ); |
| 3595 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3596 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 3597 | psessionEntry->peSessionId, |
| 3598 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3599 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3600 | { |
| 3601 | limLog( pMac, LOGE, FL("Failed to send Re-Association Request" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3602 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3603 | nSirStatus ); |
| 3604 | //Pkt will be freed up by the callback |
| 3605 | goto end; |
| 3606 | } |
| 3607 | |
Katya Nigam | ccaeda7 | 2015-04-20 18:51:22 +0530 | [diff] [blame] | 3608 | // enable caching |
| 3609 | WLANTL_EnableCaching(psessionEntry->staId); |
| 3610 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3611 | end: |
| 3612 | // Free up buffer allocated for mlmAssocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3613 | vos_mem_free( pMlmReassocReq ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3614 | psessionEntry->pLimMlmReassocReq = NULL; |
| 3615 | |
| 3616 | } // limSendReassocReqMgmtFrame |
| 3617 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3618 | eHalStatus limAuthTxCompleteCnf(tpAniSirGlobal pMac, void *pData) |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3619 | { |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3620 | tANI_U32 txCompleteSuccess; |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3621 | tpSirTxBdStatus pTxBdStatus; |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3622 | |
| 3623 | if (!pData) |
| 3624 | { |
| 3625 | limLog(pMac, LOG1, |
| 3626 | FL(" pData is NULL")); |
| 3627 | return eHAL_STATUS_FAILURE; |
| 3628 | } |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3629 | |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3630 | if (IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 3631 | { |
| 3632 | pTxBdStatus = (tpSirTxBdStatus) pData; |
| 3633 | txCompleteSuccess = pTxBdStatus->txCompleteStatus; |
| 3634 | limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), |
| 3635 | pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); |
| 3636 | } |
| 3637 | else |
| 3638 | { |
| 3639 | txCompleteSuccess = *((tANI_U32*) pData); |
| 3640 | limLog(pMac, LOG1, |
| 3641 | FL("txCompleteSuccess= %d"), txCompleteSuccess); |
| 3642 | } |
| 3643 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3644 | if(txCompleteSuccess) |
| 3645 | { |
| 3646 | pMac->authAckStatus = LIM_AUTH_ACK_RCD_SUCCESS; |
| 3647 | // 'Change' timer for future activations |
| 3648 | limDeactivateAndChangeTimer(pMac, eLIM_AUTH_RETRY_TIMER); |
| 3649 | } |
| 3650 | else |
| 3651 | pMac->authAckStatus = LIM_AUTH_ACK_RCD_FAILURE; |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 3652 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame^] | 3653 | limDiagEventReport(pMac, WLAN_PE_DIAG_AUTH_START_EVENT, NULL, |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 3654 | pMac->authAckStatus, eSIR_SUCCESS); |
| 3655 | #endif |
| 3656 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3657 | return eHAL_STATUS_SUCCESS; |
| 3658 | } |
| 3659 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3660 | /** |
| 3661 | * \brief Send an Authentication frame |
| 3662 | * |
| 3663 | * |
| 3664 | * \param pMac Pointer to Global MAC structure |
| 3665 | * |
| 3666 | * \param pAuthFrameBody Pointer to Authentication frame structure that need |
| 3667 | * to be sent |
| 3668 | * |
| 3669 | * \param peerMacAddr MAC address of the peer entity to which Authentication |
| 3670 | * frame is destined |
| 3671 | * |
| 3672 | * \param wepBit Indicates whether wep bit to be set in FC while sending |
| 3673 | * Authentication frame3 |
| 3674 | * |
| 3675 | * |
| 3676 | * This function is called by limProcessMlmMessages(). Authentication frame |
| 3677 | * is formatted and sent when this function is called. |
| 3678 | * |
| 3679 | * |
| 3680 | */ |
| 3681 | |
| 3682 | void |
| 3683 | limSendAuthMgmtFrame(tpAniSirGlobal pMac, |
| 3684 | tpSirMacAuthFrameBody pAuthFrameBody, |
| 3685 | tSirMacAddr peerMacAddr, |
| 3686 | tANI_U8 wepBit, |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3687 | tpPESession psessionEntry, |
| 3688 | tAniBool waitForAck |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3689 | ) |
| 3690 | { |
| 3691 | tANI_U8 *pFrame, *pBody; |
| 3692 | tANI_U32 frameLen = 0, bodyLen = 0; |
| 3693 | tpSirMacMgmtHdr pMacHdr; |
| 3694 | tANI_U16 i; |
| 3695 | void *pPacket; |
| 3696 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 3697 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3698 | |
| 3699 | if(NULL == psessionEntry) |
| 3700 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3701 | limLog(pMac, LOGE, FL("Error: psession Entry is NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3702 | return; |
| 3703 | } |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3704 | |
| 3705 | limLog(pMac, LOG1, |
| 3706 | FL("Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), |
| 3707 | pAuthFrameBody->authTransactionSeqNumber, |
| 3708 | pAuthFrameBody->authStatusCode, |
| 3709 | (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), |
| 3710 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3711 | if (wepBit == LIM_WEP_IN_FC) |
| 3712 | { |
| 3713 | /// Auth frame3 to be sent with encrypted framebody |
| 3714 | /** |
| 3715 | * Allocate buffer for Authenticaton frame of size equal |
| 3716 | * to management frame header length plus 2 bytes each for |
| 3717 | * auth algorithm number, transaction number, status code, |
| 3718 | * 128 bytes for challenge text and 4 bytes each for |
| 3719 | * IV & ICV. |
| 3720 | */ |
| 3721 | |
| 3722 | frameLen = sizeof(tSirMacMgmtHdr) + LIM_ENCR_AUTH_BODY_LEN; |
| 3723 | |
| 3724 | bodyLen = LIM_ENCR_AUTH_BODY_LEN; |
| 3725 | } // if (wepBit == LIM_WEP_IN_FC) |
| 3726 | else |
| 3727 | { |
| 3728 | switch (pAuthFrameBody->authTransactionSeqNumber) |
| 3729 | { |
| 3730 | case SIR_MAC_AUTH_FRAME_1: |
| 3731 | /** |
| 3732 | * Allocate buffer for Authenticaton frame of size |
| 3733 | * equal to management frame header length plus 2 bytes |
| 3734 | * each for auth algorithm number, transaction number |
| 3735 | * and status code. |
| 3736 | */ |
| 3737 | |
| 3738 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3739 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3740 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3741 | |
| 3742 | #if defined WLAN_FEATURE_VOWIFI_11R |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3743 | if (pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) |
| 3744 | { |
| 3745 | if (0 != pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3746 | { |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3747 | frameLen += pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3748 | limLog(pMac, LOG3, FL("Auth frame, FTIES length added=%d"), |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3749 | pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3750 | } |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3751 | else |
| 3752 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3753 | limLog(pMac, LOG3, FL("Auth frame, Does not contain " |
| 3754 | "FTIES!!!")); |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3755 | frameLen += (2+SIR_MDIE_SIZE); |
| 3756 | } |
| 3757 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3758 | #endif |
| 3759 | break; |
| 3760 | |
| 3761 | case SIR_MAC_AUTH_FRAME_2: |
| 3762 | if ((pAuthFrameBody->authAlgoNumber == eSIR_OPEN_SYSTEM) || |
| 3763 | ((pAuthFrameBody->authAlgoNumber == eSIR_SHARED_KEY) && |
| 3764 | (pAuthFrameBody->authStatusCode != eSIR_MAC_SUCCESS_STATUS))) |
| 3765 | { |
| 3766 | /** |
| 3767 | * Allocate buffer for Authenticaton frame of size |
| 3768 | * equal to management frame header length plus |
| 3769 | * 2 bytes each for auth algorithm number, |
| 3770 | * transaction number and status code. |
| 3771 | */ |
| 3772 | |
| 3773 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3774 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3775 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3776 | } |
| 3777 | else |
| 3778 | { |
| 3779 | // Shared Key algorithm with challenge text |
| 3780 | // to be sent |
| 3781 | /** |
| 3782 | * Allocate buffer for Authenticaton frame of size |
| 3783 | * equal to management frame header length plus |
| 3784 | * 2 bytes each for auth algorithm number, |
| 3785 | * transaction number, status code and 128 bytes |
| 3786 | * for challenge text. |
| 3787 | */ |
| 3788 | |
| 3789 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3790 | sizeof(tSirMacAuthFrame); |
| 3791 | bodyLen = sizeof(tSirMacAuthFrameBody); |
| 3792 | } |
| 3793 | |
| 3794 | break; |
| 3795 | |
| 3796 | case SIR_MAC_AUTH_FRAME_3: |
| 3797 | /// Auth frame3 to be sent without encrypted framebody |
| 3798 | /** |
| 3799 | * Allocate buffer for Authenticaton frame of size equal |
| 3800 | * to management frame header length plus 2 bytes each |
| 3801 | * for auth algorithm number, transaction number and |
| 3802 | * status code. |
| 3803 | */ |
| 3804 | |
| 3805 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3806 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3807 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3808 | |
| 3809 | break; |
| 3810 | |
| 3811 | case SIR_MAC_AUTH_FRAME_4: |
| 3812 | /** |
| 3813 | * Allocate buffer for Authenticaton frame of size equal |
| 3814 | * to management frame header length plus 2 bytes each |
| 3815 | * for auth algorithm number, transaction number and |
| 3816 | * status code. |
| 3817 | */ |
| 3818 | |
| 3819 | frameLen = sizeof(tSirMacMgmtHdr) + |
| 3820 | SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3821 | bodyLen = SIR_MAC_AUTH_CHALLENGE_OFFSET; |
| 3822 | |
| 3823 | break; |
| 3824 | } // switch (pAuthFrameBody->authTransactionSeqNumber) |
| 3825 | } // end if (wepBit == LIM_WEP_IN_FC) |
| 3826 | |
| 3827 | |
| 3828 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )frameLen, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 3829 | |
| 3830 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 3831 | { |
| 3832 | // Log error |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 3833 | limLog(pMac, LOGP, FL("call to bufAlloc failed for AUTH frame")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3834 | |
| 3835 | return; |
| 3836 | } |
| 3837 | |
| 3838 | for (i = 0; i < frameLen; i++) |
| 3839 | pFrame[i] = 0; |
| 3840 | |
| 3841 | // Prepare BD |
| 3842 | if (limPopulateMacHeader(pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 3843 | SIR_MAC_MGMT_AUTH, peerMacAddr,psessionEntry->selfMacAddr) != eSIR_SUCCESS) |
| 3844 | { |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3845 | limLog(pMac, LOGE, FL("call to limPopulateMacHeader failed for " |
| 3846 | "AUTH frame")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3847 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 3848 | return; |
| 3849 | } |
| 3850 | |
| 3851 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 3852 | pMacHdr->fc.wep = wepBit; |
| 3853 | |
| 3854 | // Prepare BSSId |
| 3855 | if( (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 3856 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3857 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 3858 | (tANI_U8 *) psessionEntry->bssId, |
| 3859 | sizeof( tSirMacAddr )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3860 | } |
| 3861 | |
| 3862 | /// Prepare Authentication frame body |
| 3863 | pBody = pFrame + sizeof(tSirMacMgmtHdr); |
| 3864 | |
| 3865 | if (wepBit == LIM_WEP_IN_FC) |
| 3866 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3867 | vos_mem_copy(pBody, (tANI_U8 *) pAuthFrameBody, bodyLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3868 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3869 | limLog(pMac, LOG1, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3870 | FL("*** Sending Auth seq# 3 status %d (%d) to"MAC_ADDRESS_STR), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3871 | pAuthFrameBody->authStatusCode, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3872 | (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3873 | MAC_ADDR_ARRAY(pMacHdr->da)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3874 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3875 | } |
| 3876 | else |
| 3877 | { |
| 3878 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authAlgoNumber); |
| 3879 | pBody += sizeof(tANI_U16); |
| 3880 | bodyLen -= sizeof(tANI_U16); |
| 3881 | |
| 3882 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authTransactionSeqNumber); |
| 3883 | pBody += sizeof(tANI_U16); |
| 3884 | bodyLen -= sizeof(tANI_U16); |
| 3885 | |
| 3886 | *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authStatusCode); |
| 3887 | pBody += sizeof(tANI_U16); |
| 3888 | bodyLen -= sizeof(tANI_U16); |
Leela Venkata Kiran Kumar Reddy Chirala | 7d3fa55 | 2013-08-28 10:52:21 -0700 | [diff] [blame] | 3889 | if ( bodyLen <= (sizeof (pAuthFrameBody->type) + |
| 3890 | sizeof (pAuthFrameBody->length) + |
| 3891 | sizeof (pAuthFrameBody->challengeText))) |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 3892 | vos_mem_copy(pBody, (tANI_U8 *) &pAuthFrameBody->type, bodyLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3893 | |
| 3894 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 3895 | if ((pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) && |
| 3896 | (pAuthFrameBody->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_1)) |
| 3897 | { |
| 3898 | |
| 3899 | { |
| 3900 | int i = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3901 | if (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length) |
| 3902 | { |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3903 | #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG |
Srinivas Girigowda | d63eb49 | 2014-02-06 12:21:47 -0800 | [diff] [blame] | 3904 | PELOG2(limLog(pMac, LOG2, FL("Auth1 Frame FTIE is: ")); |
| 3905 | sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3906 | (tANI_U8 *)pBody, |
| 3907 | (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3908 | #endif |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3909 | for (i=0; i<pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length; i++) |
| 3910 | { |
Madan Mohan Koyyalamudi | 6a00a80 | 2012-11-28 16:12:11 -0800 | [diff] [blame] | 3911 | *pBody = pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[i]; |
| 3912 | pBody++; |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3913 | } |
| 3914 | } |
| 3915 | else |
| 3916 | { |
| 3917 | /* MDID attr is 54*/ |
| 3918 | *pBody = 54; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3919 | pBody++; |
Madan Mohan Koyyalamudi | 5e32b96 | 2012-11-28 16:07:55 -0800 | [diff] [blame] | 3920 | *pBody = SIR_MDIE_SIZE; |
| 3921 | pBody++; |
| 3922 | for(i=0;i<SIR_MDIE_SIZE;i++) |
| 3923 | { |
| 3924 | *pBody = pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription->mdie[i]; |
| 3925 | pBody++; |
| 3926 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3927 | } |
| 3928 | } |
| 3929 | } |
| 3930 | #endif |
| 3931 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3932 | limLog(pMac, LOG1, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3933 | FL("*** Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3934 | pAuthFrameBody->authTransactionSeqNumber, |
| 3935 | pAuthFrameBody->authStatusCode, |
Abhishek Singh | 57aebef | 2014-02-03 18:47:44 +0530 | [diff] [blame] | 3936 | (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 3937 | MAC_ADDR_ARRAY(pMacHdr->da)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3938 | } |
| 3939 | PELOG2(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, pFrame, frameLen);) |
| 3940 | |
| 3941 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3942 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 3943 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3944 | #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] | 3945 | || ((NULL != pMac->ft.ftPEContext.pFTPreAuthReq) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3946 | && ( SIR_BAND_5_GHZ == limGetRFBand(pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum))) |
| 3947 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3948 | ) |
| 3949 | { |
| 3950 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3951 | } |
| 3952 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 3953 | if(psessionEntry->pePersona == VOS_P2P_CLIENT_MODE || |
| 3954 | psessionEntry->pePersona == VOS_STA_MODE) |
Ganesh K | 08bce95 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 3955 | { |
| 3956 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
| 3957 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 3958 | |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3959 | limLog( pMac, LOG1, |
| 3960 | FL("Sending Auth Frame over WQ5 with waitForAck %d to "MAC_ADDRESS_STR |
| 3961 | " From " MAC_ADDRESS_STR), waitForAck, MAC_ADDR_ARRAY(pMacHdr->da), |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 3962 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
| 3963 | |
| 3964 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 3965 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 3966 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 3967 | psessionEntry->peSessionId, |
| 3968 | pMacHdr->fc.subType)); |
Masti, Narayanraddi | 67ea591 | 2015-01-08 12:34:05 +0530 | [diff] [blame] | 3969 | |
| 3970 | if( ( psessionEntry->is11Gonly == true ) && |
| 3971 | ( !IS_BROADCAST_MAC(peerMacAddr) ) ){ |
| 3972 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 3973 | } |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3974 | if(eSIR_TRUE == waitForAck) |
| 3975 | { |
| 3976 | pMac->authAckStatus = LIM_AUTH_ACK_NOT_RCD; |
Sushant Kaushik | 0b34342 | 2015-05-25 17:15:55 +0530 | [diff] [blame] | 3977 | limLog(pMac, LOG1, FL("Auth frame - txBdToken %u"), |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3978 | pMac->lim.txBdToken); |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3979 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, |
| 3980 | ( tANI_U16 ) frameLen, |
| 3981 | HAL_TXRX_FRM_802_11_MGMT, |
| 3982 | ANI_TXDIR_TODS, |
| 3983 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
Ganesh Kondabattini | ffc00b1 | 2015-03-18 13:11:33 +0530 | [diff] [blame] | 3984 | limTxComplete, pFrame, limAuthTxCompleteCnf, txFlag, |
| 3985 | pMac->lim.txBdToken); |
| 3986 | pMac->lim.txBdToken++; |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 3987 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 3988 | psessionEntry->peSessionId, |
| 3989 | halstatus)); |
| 3990 | if (!HAL_STATUS_SUCCESS(halstatus)) |
| 3991 | { |
| 3992 | limLog( pMac, LOGE, |
| 3993 | FL("Could not send Auth frame, retCode=%X "), |
| 3994 | halstatus ); |
| 3995 | pMac->authAckStatus = LIM_AUTH_ACK_RCD_FAILURE; |
| 3996 | //Pkt will be freed up by the callback |
| 3997 | } |
| 3998 | } |
| 3999 | else |
| 4000 | { |
| 4001 | /// Queue Authentication frame in high priority WQ |
| 4002 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) frameLen, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4003 | HAL_TXRX_FRM_802_11_MGMT, |
| 4004 | ANI_TXDIR_TODS, |
| 4005 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4006 | limTxComplete, pFrame, txFlag ); |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 4007 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4008 | psessionEntry->peSessionId, |
| 4009 | halstatus)); |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 4010 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4011 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4012 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4013 | FL("*** Could not send Auth frame, retCode=%X ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4014 | halstatus); |
| 4015 | |
| 4016 | //Pkt will be freed up by the callback |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 4017 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4018 | } |
| 4019 | |
| 4020 | return; |
| 4021 | } /*** end limSendAuthMgmtFrame() ***/ |
| 4022 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4023 | eHalStatus limSendDeauthCnf(tpAniSirGlobal pMac) |
| 4024 | { |
| 4025 | tANI_U16 aid; |
| 4026 | tpDphHashNode pStaDs; |
| 4027 | tLimMlmDeauthReq *pMlmDeauthReq; |
| 4028 | tLimMlmDeauthCnf mlmDeauthCnf; |
| 4029 | tpPESession psessionEntry; |
| 4030 | |
| 4031 | pMlmDeauthReq = pMac->lim.limDisassocDeauthCnfReq.pMlmDeauthReq; |
| 4032 | if (pMlmDeauthReq) |
| 4033 | { |
| 4034 | if (tx_timer_running(&pMac->lim.limTimers.gLimDeauthAckTimer)) |
| 4035 | { |
| 4036 | limDeactivateAndChangeTimer(pMac, eLIM_DEAUTH_ACK_TIMER); |
| 4037 | } |
| 4038 | |
| 4039 | if((psessionEntry = peFindSessionBySessionId(pMac, pMlmDeauthReq->sessionId))== NULL) |
| 4040 | { |
| 4041 | |
| 4042 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4043 | FL("session does not exist for given sessionId"));) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4044 | mlmDeauthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 4045 | goto end; |
| 4046 | } |
| 4047 | |
| 4048 | pStaDs = dphLookupHashEntry(pMac, pMlmDeauthReq->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 4049 | if (pStaDs == NULL) |
| 4050 | { |
| 4051 | mlmDeauthCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 4052 | goto end; |
| 4053 | } |
| 4054 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4055 | /// Receive path cleanup with dummy packet |
| 4056 | limCleanupRxPath(pMac, pStaDs,psessionEntry); |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4057 | |
| 4058 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4059 | if ( psessionEntry->limSystemRole == eLIM_STA_ROLE ) |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4060 | { |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4061 | PELOGE(limLog(pMac, LOG1, |
| 4062 | FL("FT Preauth SessionId %d Cleanup" |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4063 | #ifdef FEATURE_WLAN_ESE |
| 4064 | " isESE %d" |
| 4065 | #endif |
| 4066 | #ifdef FEATURE_WLAN_LFR |
| 4067 | " isLFR %d" |
| 4068 | #endif |
| 4069 | " is11r %d, Deauth reason %d Trigger = %d"), |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4070 | psessionEntry->peSessionId, |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4071 | #ifdef FEATURE_WLAN_ESE |
| 4072 | psessionEntry->isESEconnection, |
| 4073 | #endif |
| 4074 | #ifdef FEATURE_WLAN_LFR |
| 4075 | psessionEntry->isFastRoamIniFeatureEnabled, |
| 4076 | #endif |
| 4077 | psessionEntry->is11Rconnection, |
| 4078 | pMlmDeauthReq->reasonCode, |
| 4079 | pMlmDeauthReq->deauthTrigger);); |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4080 | |
| 4081 | limFTCleanup(pMac); |
Abhishek Singh | cf4590b | 2014-04-16 18:58:08 +0530 | [diff] [blame] | 4082 | } |
| 4083 | #endif |
| 4084 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4085 | /// Free up buffer allocated for mlmDeauthReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4086 | vos_mem_free(pMlmDeauthReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4087 | pMac->lim.limDisassocDeauthCnfReq.pMlmDeauthReq = NULL; |
| 4088 | } |
| 4089 | return eHAL_STATUS_SUCCESS; |
| 4090 | end: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4091 | vos_mem_copy( (tANI_U8 *) &mlmDeauthCnf.peerMacAddr, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4092 | (tANI_U8 *) pMlmDeauthReq->peerMacAddr, |
| 4093 | sizeof(tSirMacAddr)); |
| 4094 | mlmDeauthCnf.deauthTrigger = pMlmDeauthReq->deauthTrigger; |
| 4095 | mlmDeauthCnf.aid = pMlmDeauthReq->aid; |
| 4096 | mlmDeauthCnf.sessionId = pMlmDeauthReq->sessionId; |
| 4097 | |
| 4098 | // Free up buffer allocated |
| 4099 | // for mlmDeauthReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4100 | vos_mem_free(pMlmDeauthReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4101 | |
| 4102 | limPostSmeMessage(pMac, |
| 4103 | LIM_MLM_DEAUTH_CNF, |
| 4104 | (tANI_U32 *) &mlmDeauthCnf); |
| 4105 | return eHAL_STATUS_SUCCESS; |
| 4106 | } |
| 4107 | |
| 4108 | eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) |
| 4109 | { |
| 4110 | tANI_U16 aid; |
| 4111 | tpDphHashNode pStaDs; |
| 4112 | tLimMlmDisassocCnf mlmDisassocCnf; |
| 4113 | tpPESession psessionEntry; |
| 4114 | tLimMlmDisassocReq *pMlmDisassocReq; |
| 4115 | |
| 4116 | pMlmDisassocReq = pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq; |
| 4117 | if (pMlmDisassocReq) |
| 4118 | { |
| 4119 | if (tx_timer_running(&pMac->lim.limTimers.gLimDisassocAckTimer)) |
| 4120 | { |
| 4121 | limDeactivateAndChangeTimer(pMac, eLIM_DISASSOC_ACK_TIMER); |
| 4122 | } |
| 4123 | |
| 4124 | if((psessionEntry = peFindSessionBySessionId(pMac, pMlmDisassocReq->sessionId))== NULL) |
| 4125 | { |
| 4126 | |
| 4127 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4128 | FL("session does not exist for given sessionId"));) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4129 | mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 4130 | goto end; |
| 4131 | } |
| 4132 | |
| 4133 | pStaDs = dphLookupHashEntry(pMac, pMlmDisassocReq->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 4134 | if (pStaDs == NULL) |
| 4135 | { |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 4136 | limLog(pMac, LOGE, |
| 4137 | FL("StaDs Null")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4138 | mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; |
| 4139 | goto end; |
| 4140 | } |
| 4141 | |
| 4142 | /// Receive path cleanup with dummy packet |
| 4143 | if(eSIR_SUCCESS != limCleanupRxPath(pMac, pStaDs, psessionEntry)) |
| 4144 | { |
| 4145 | mlmDisassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 4146 | limLog(pMac, LOGE, |
| 4147 | FL("CleanupRxPath error")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4148 | goto end; |
| 4149 | } |
| 4150 | |
| 4151 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4152 | if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE ) && |
Gopichand Nakkala | 0ae39db | 2013-06-10 20:35:49 +0530 | [diff] [blame] | 4153 | (pMlmDisassocReq->reasonCode != |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4154 | eSIR_MAC_DISASSOC_DUE_TO_FTHANDOFF_REASON)) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4155 | { |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4156 | PELOGE(limLog(pMac, LOG1, |
| 4157 | FL("FT Preauth SessionId %d Cleanup" |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4158 | #ifdef FEATURE_WLAN_ESE |
| 4159 | " isESE %d" |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4160 | #endif |
| 4161 | #ifdef FEATURE_WLAN_LFR |
| 4162 | " isLFR %d" |
| 4163 | #endif |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4164 | " is11r %d reason %d"), |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4165 | psessionEntry->peSessionId, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4166 | #ifdef FEATURE_WLAN_ESE |
| 4167 | psessionEntry->isESEconnection, |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4168 | #endif |
| 4169 | #ifdef FEATURE_WLAN_LFR |
| 4170 | psessionEntry->isFastRoamIniFeatureEnabled, |
| 4171 | #endif |
| 4172 | psessionEntry->is11Rconnection, |
| 4173 | pMlmDisassocReq->reasonCode);); |
Mukul Sharma | 0820d0e | 2014-11-11 19:49:02 +0530 | [diff] [blame] | 4174 | limFTCleanup(pMac); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4175 | } |
| 4176 | #endif |
| 4177 | |
| 4178 | /// Free up buffer allocated for mlmDisassocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4179 | vos_mem_free(pMlmDisassocReq); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4180 | pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL; |
| 4181 | return eHAL_STATUS_SUCCESS; |
| 4182 | } |
| 4183 | else |
| 4184 | { |
| 4185 | return eHAL_STATUS_SUCCESS; |
| 4186 | } |
| 4187 | end: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4188 | vos_mem_copy( (tANI_U8 *) &mlmDisassocCnf.peerMacAddr, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4189 | (tANI_U8 *) pMlmDisassocReq->peerMacAddr, |
| 4190 | sizeof(tSirMacAddr)); |
| 4191 | mlmDisassocCnf.aid = pMlmDisassocReq->aid; |
| 4192 | mlmDisassocCnf.disassocTrigger = pMlmDisassocReq->disassocTrigger; |
| 4193 | |
| 4194 | /* Update PE session ID*/ |
| 4195 | mlmDisassocCnf.sessionId = pMlmDisassocReq->sessionId; |
| 4196 | |
Madan Mohan Koyyalamudi | b7f5a67 | 2012-11-29 11:17:46 -0800 | [diff] [blame] | 4197 | if(pMlmDisassocReq != NULL) |
| 4198 | { |
| 4199 | /// Free up buffer allocated for mlmDisassocReq |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4200 | vos_mem_free(pMlmDisassocReq); |
Madan Mohan Koyyalamudi | b7f5a67 | 2012-11-29 11:17:46 -0800 | [diff] [blame] | 4201 | pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL; |
| 4202 | } |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4203 | |
| 4204 | limPostSmeMessage(pMac, |
| 4205 | LIM_MLM_DISASSOC_CNF, |
| 4206 | (tANI_U32 *) &mlmDisassocCnf); |
| 4207 | return eHAL_STATUS_SUCCESS; |
| 4208 | } |
| 4209 | |
Ganesh Kondabattini | 358fc9b | 2015-03-11 16:14:25 +0530 | [diff] [blame] | 4210 | eHalStatus limDisassocTxCompleteCnf(tpAniSirGlobal pMac, void *pData) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4211 | { |
Ganesh Kondabattini | b18b329 | 2015-03-16 16:59:26 +0530 | [diff] [blame] | 4212 | if (pData && IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 4213 | { |
| 4214 | tpSirTxBdStatus pTxBdStatus; |
| 4215 | pTxBdStatus = (tpSirTxBdStatus) pData; |
| 4216 | limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), |
| 4217 | pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); |
| 4218 | } |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4219 | return limSendDisassocCnf(pMac); |
| 4220 | } |
| 4221 | |
Ganesh Kondabattini | 358fc9b | 2015-03-11 16:14:25 +0530 | [diff] [blame] | 4222 | eHalStatus limDeauthTxCompleteCnf(tpAniSirGlobal pMac, void *pData) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4223 | { |
Ganesh Kondabattini | b18b329 | 2015-03-16 16:59:26 +0530 | [diff] [blame] | 4224 | if (pData && IS_FEATURE_SUPPORTED_BY_FW(ENHANCED_TXBD_COMPLETION)) |
| 4225 | { |
| 4226 | tpSirTxBdStatus pTxBdStatus; |
| 4227 | pTxBdStatus = (tpSirTxBdStatus) pData; |
| 4228 | limLog(pMac, LOG1, FL("txCompleteStatus %u, txBdToken %u"), |
| 4229 | pTxBdStatus->txCompleteStatus, pTxBdStatus->txBdToken); |
| 4230 | } |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4231 | return limSendDeauthCnf(pMac); |
| 4232 | } |
| 4233 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4234 | /** |
| 4235 | * \brief This function is called to send Disassociate frame. |
| 4236 | * |
| 4237 | * |
| 4238 | * \param pMac Pointer to Global MAC structure |
| 4239 | * |
| 4240 | * \param nReason Indicates the reason that need to be sent in |
| 4241 | * Disassociation frame |
| 4242 | * |
| 4243 | * \param peerMacAddr MAC address of the STA to which Disassociation frame is |
| 4244 | * sent |
| 4245 | * |
| 4246 | * |
| 4247 | */ |
| 4248 | |
| 4249 | void |
| 4250 | limSendDisassocMgmtFrame(tpAniSirGlobal pMac, |
| 4251 | tANI_U16 nReason, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4252 | tSirMacAddr peer, |
| 4253 | tpPESession psessionEntry, |
| 4254 | tANI_BOOLEAN waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4255 | { |
| 4256 | tDot11fDisassociation frm; |
| 4257 | tANI_U8 *pFrame; |
| 4258 | tSirRetStatus nSirStatus; |
| 4259 | tpSirMacMgmtHdr pMacHdr; |
| 4260 | tANI_U32 nBytes, nPayload, nStatus; |
| 4261 | void *pPacket; |
| 4262 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4263 | tANI_U32 txFlag = 0; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4264 | tANI_U32 val = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4265 | if(NULL == psessionEntry) |
| 4266 | { |
| 4267 | return; |
| 4268 | } |
| 4269 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4270 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4271 | |
| 4272 | frm.Reason.code = nReason; |
| 4273 | |
| 4274 | nStatus = dot11fGetPackedDisassociationSize( pMac, &frm, &nPayload ); |
| 4275 | if ( DOT11F_FAILED( nStatus ) ) |
| 4276 | { |
| 4277 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4278 | "or a Disassociation (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4279 | nStatus ); |
| 4280 | // We'll fall back on the worst case scenario: |
| 4281 | nPayload = sizeof( tDot11fDisassociation ); |
| 4282 | } |
| 4283 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4284 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4285 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4286 | "the packed size for a Disassociation " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4287 | "(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4288 | } |
| 4289 | |
| 4290 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4291 | |
| 4292 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4293 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 4294 | ( void** ) &pPacket ); |
| 4295 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4296 | { |
| 4297 | 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] | 4298 | "association."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4299 | return; |
| 4300 | } |
| 4301 | |
| 4302 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4303 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4304 | |
| 4305 | // Next, we fill out the buffer descriptor: |
| 4306 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4307 | SIR_MAC_MGMT_DISASSOC, peer,psessionEntry->selfMacAddr); |
| 4308 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4309 | { |
| 4310 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4311 | "tor for a Disassociation (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4312 | nSirStatus ); |
| 4313 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4314 | ( void* ) pFrame, ( void* ) pPacket ); |
| 4315 | return; // just allocated... |
| 4316 | } |
| 4317 | |
| 4318 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4319 | |
| 4320 | // Prepare the BSSID |
| 4321 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 4322 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4323 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4324 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4325 | #endif |
| 4326 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4327 | nStatus = dot11fPackDisassociation( pMac, &frm, pFrame + |
| 4328 | sizeof(tSirMacMgmtHdr), |
| 4329 | nPayload, &nPayload ); |
| 4330 | if ( DOT11F_FAILED( nStatus ) ) |
| 4331 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4332 | limLog( pMac, LOGE, FL("Failed to pack a Disassociation (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4333 | nStatus ); |
| 4334 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4335 | ( void* ) pFrame, ( void* ) pPacket ); |
| 4336 | return; // allocated! |
| 4337 | } |
| 4338 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4339 | { |
| 4340 | limLog( pMac, LOGW, FL("There were warnings while packing a D" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4341 | "isassociation (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4342 | } |
| 4343 | |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 4344 | limLog( pMac, LOG1, FL("***Sessionid %d Sending Disassociation frame with " |
| 4345 | "reason %u and waitForAck %d to "MAC_ADDRESS_STR" ,From " |
| 4346 | MAC_ADDRESS_STR), psessionEntry->peSessionId, nReason, waitForAck, |
| 4347 | MAC_ADDR_ARRAY(pMacHdr->da), |
| 4348 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4349 | |
| 4350 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4351 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 4352 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4353 | ) |
| 4354 | { |
| 4355 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 4356 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 4357 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 4358 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 4359 | |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4360 | if( IS_FW_IN_TX_PATH_FEATURE_ENABLE ) |
| 4361 | { |
| 4362 | /* This frame will be sent on air by firmware, |
| 4363 | which will ensure that this frame goes out |
| 4364 | even though DEL_STA is sent immediately */ |
| 4365 | /* Without this for DEL_STA command there is |
| 4366 | risk of flushing frame in BTQM queue without |
| 4367 | sending on air */ |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 4368 | limLog( pMac, LOG1, FL("Sending Disassoc Frame over WQ5 to "MAC_ADDRESS_STR |
| 4369 | " From " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMacHdr->da), |
| 4370 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4371 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 4372 | } |
| 4373 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4374 | if (waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4375 | { |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4376 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4377 | psessionEntry->peSessionId, |
| 4378 | pMacHdr->fc.subType)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4379 | // Queue Disassociation frame in high priority WQ |
| 4380 | /* get the duration from the request */ |
| 4381 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4382 | HAL_TXRX_FRM_802_11_MGMT, |
| 4383 | ANI_TXDIR_TODS, |
| 4384 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4385 | limTxComplete, pFrame, limDisassocTxCompleteCnf, |
Ganesh Kondabattini | 10e6735 | 2015-03-16 17:41:57 +0530 | [diff] [blame] | 4386 | txFlag, |
| 4387 | pMac->lim.txBdToken++); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4388 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4389 | psessionEntry->peSessionId, |
| 4390 | halstatus)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4391 | val = SYS_MS_TO_TICKS(LIM_DISASSOC_DEAUTH_ACK_TIMEOUT); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4392 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4393 | if (tx_timer_change( |
| 4394 | &pMac->lim.limTimers.gLimDisassocAckTimer, val, 0) |
| 4395 | != TX_SUCCESS) |
| 4396 | { |
| 4397 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4398 | FL("Unable to change Disassoc ack Timer val")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4399 | return; |
| 4400 | } |
| 4401 | else if(TX_SUCCESS != tx_timer_activate( |
| 4402 | &pMac->lim.limTimers.gLimDisassocAckTimer)) |
| 4403 | { |
| 4404 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4405 | FL("Unable to activate Disassoc ack Timer")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4406 | limDeactivateAndChangeTimer(pMac, eLIM_DISASSOC_ACK_TIMER); |
| 4407 | return; |
| 4408 | } |
| 4409 | } |
Madan Mohan Koyyalamudi | b6af061 | 2012-11-19 13:45:45 -0800 | [diff] [blame] | 4410 | else |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4411 | { |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4412 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4413 | psessionEntry->peSessionId, |
| 4414 | pMacHdr->fc.subType)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4415 | // Queue Disassociation frame in high priority WQ |
| 4416 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4417 | HAL_TXRX_FRM_802_11_MGMT, |
| 4418 | ANI_TXDIR_TODS, |
| 4419 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4420 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4421 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4422 | psessionEntry->peSessionId, |
| 4423 | halstatus)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4424 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4425 | { |
| 4426 | limLog( pMac, LOGE, FL("Failed to send Disassociation " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4427 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4428 | nSirStatus ); |
| 4429 | //Pkt will be freed up by the callback |
| 4430 | return; |
| 4431 | } |
| 4432 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4433 | } // End limSendDisassocMgmtFrame. |
| 4434 | |
| 4435 | /** |
| 4436 | * \brief This function is called to send a Deauthenticate frame |
| 4437 | * |
| 4438 | * |
| 4439 | * \param pMac Pointer to global MAC structure |
| 4440 | * |
| 4441 | * \param nReason Indicates the reason that need to be sent in the |
| 4442 | * Deauthenticate frame |
| 4443 | * |
| 4444 | * \param peeer address of the STA to which the frame is to be sent |
| 4445 | * |
| 4446 | * |
| 4447 | */ |
| 4448 | |
| 4449 | void |
| 4450 | limSendDeauthMgmtFrame(tpAniSirGlobal pMac, |
| 4451 | tANI_U16 nReason, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4452 | tSirMacAddr peer, |
| 4453 | tpPESession psessionEntry, |
| 4454 | tANI_BOOLEAN waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4455 | { |
| 4456 | tDot11fDeAuth frm; |
| 4457 | tANI_U8 *pFrame; |
| 4458 | tSirRetStatus nSirStatus; |
| 4459 | tpSirMacMgmtHdr pMacHdr; |
| 4460 | tANI_U32 nBytes, nPayload, nStatus; |
| 4461 | void *pPacket; |
| 4462 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4463 | tANI_U32 txFlag = 0; |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4464 | tANI_U32 val = 0; |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4465 | #ifdef FEATURE_WLAN_TDLS |
| 4466 | tANI_U16 aid; |
| 4467 | tpDphHashNode pStaDs; |
| 4468 | #endif |
| 4469 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4470 | if(NULL == psessionEntry) |
| 4471 | { |
| 4472 | return; |
| 4473 | } |
| 4474 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4475 | vos_mem_set( ( tANI_U8* ) &frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4476 | |
| 4477 | frm.Reason.code = nReason; |
| 4478 | |
| 4479 | nStatus = dot11fGetPackedDeAuthSize( pMac, &frm, &nPayload ); |
| 4480 | if ( DOT11F_FAILED( nStatus ) ) |
| 4481 | { |
| 4482 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4483 | "or a De-Authentication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4484 | nStatus ); |
| 4485 | // We'll fall back on the worst case scenario: |
| 4486 | nPayload = sizeof( tDot11fDeAuth ); |
| 4487 | } |
| 4488 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4489 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4490 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4491 | "the packed size for a De-Authentication " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4492 | "(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4493 | } |
| 4494 | |
| 4495 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4496 | |
| 4497 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4498 | ( tANI_U16 )nBytes, ( void** ) &pFrame, |
| 4499 | ( void** ) &pPacket ); |
| 4500 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4501 | { |
| 4502 | 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] | 4503 | "Authentication."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4504 | return; |
| 4505 | } |
| 4506 | |
| 4507 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4508 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4509 | |
| 4510 | // Next, we fill out the buffer descriptor: |
| 4511 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4512 | SIR_MAC_MGMT_DEAUTH, peer,psessionEntry->selfMacAddr); |
| 4513 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4514 | { |
| 4515 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4516 | "tor for a De-Authentication (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4517 | nSirStatus ); |
| 4518 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4519 | ( void* ) pFrame, ( void* ) pPacket ); |
| 4520 | return; // just allocated... |
| 4521 | } |
| 4522 | |
| 4523 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4524 | |
| 4525 | // Prepare the BSSID |
| 4526 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 4527 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4528 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4529 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4530 | #endif |
| 4531 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4532 | nStatus = dot11fPackDeAuth( pMac, &frm, pFrame + |
| 4533 | sizeof(tSirMacMgmtHdr), |
| 4534 | nPayload, &nPayload ); |
| 4535 | if ( DOT11F_FAILED( nStatus ) ) |
| 4536 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4537 | limLog( pMac, LOGE, FL("Failed to pack a DeAuthentication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4538 | nStatus ); |
| 4539 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, |
| 4540 | ( void* ) pFrame, ( void* ) pPacket ); |
| 4541 | return; |
| 4542 | } |
| 4543 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4544 | { |
| 4545 | limLog( pMac, LOGW, FL("There were warnings while packing a D" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4546 | "e-Authentication (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4547 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 4548 | limLog( pMac, LOG1, FL("***Sessionid %d Sending Deauth frame with " |
| 4549 | "reason %u and waitForAck %d to "MAC_ADDRESS_STR" ,From " |
| 4550 | MAC_ADDRESS_STR), psessionEntry->peSessionId, nReason, waitForAck, |
| 4551 | MAC_ADDR_ARRAY(pMacHdr->da), |
| 4552 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4553 | |
| 4554 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4555 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 4556 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4557 | ) |
| 4558 | { |
| 4559 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 4560 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 4561 | |
Sushant Kaushik | e8681d2 | 2015-04-21 12:08:25 +0530 | [diff] [blame] | 4562 | txFlag |= HAL_USE_PEER_STA_REQUESTED_MASK; |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 4563 | |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4564 | if( IS_FW_IN_TX_PATH_FEATURE_ENABLE ) |
| 4565 | { |
| 4566 | /* This frame will be sent on air by firmware, |
| 4567 | which will ensure that this frame goes out |
| 4568 | even though DEL_STA is sent immediately */ |
| 4569 | /* Without this for DEL_STA command there is |
| 4570 | risk of flushing frame in BTQM queue without |
| 4571 | sending on air */ |
Agarwal Ashish | a8e81f5 | 2014-04-02 01:59:52 +0530 | [diff] [blame] | 4572 | limLog( pMac, LOG1, FL("Sending Deauth Frame over WQ5 to "MAC_ADDRESS_STR |
| 4573 | " From " MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pMacHdr->da), |
| 4574 | MAC_ADDR_ARRAY(psessionEntry->selfMacAddr)); |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4575 | txFlag |= HAL_USE_FW_IN_TX_PATH; |
| 4576 | } |
| 4577 | |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4578 | #ifdef FEATURE_WLAN_TDLS |
| 4579 | pStaDs = dphLookupHashEntry(pMac, peer, &aid, &psessionEntry->dph.dphHashTable); |
| 4580 | #endif |
| 4581 | |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4582 | if (waitForAck) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4583 | { |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4584 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4585 | psessionEntry->peSessionId, |
| 4586 | pMacHdr->fc.subType)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4587 | // Queue Disassociation frame in high priority WQ |
| 4588 | halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4589 | HAL_TXRX_FRM_802_11_MGMT, |
| 4590 | ANI_TXDIR_TODS, |
| 4591 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
Ganesh Kondabattini | 10e6735 | 2015-03-16 17:41:57 +0530 | [diff] [blame] | 4592 | limTxComplete, pFrame, limDeauthTxCompleteCnf, txFlag, |
| 4593 | pMac->lim.txBdToken++); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4594 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4595 | psessionEntry->peSessionId, |
| 4596 | halstatus)); |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4597 | if (!HAL_STATUS_SUCCESS(halstatus)) |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4598 | { |
| 4599 | limLog( pMac, LOGE, FL("Failed to send De-Authentication " |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4600 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4601 | nSirStatus ); |
Gopichand Nakkala | 4261ea5 | 2012-12-31 16:43:00 -0800 | [diff] [blame] | 4602 | //Pkt will be freed up by the callback limTxComplete |
| 4603 | |
| 4604 | /*Call limProcessDeauthAckTimeout which will send |
| 4605 | * DeauthCnf for this frame |
| 4606 | */ |
| 4607 | limProcessDeauthAckTimeout(pMac); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4608 | return; |
| 4609 | } |
| 4610 | |
| 4611 | val = SYS_MS_TO_TICKS(LIM_DISASSOC_DEAUTH_ACK_TIMEOUT); |
| 4612 | |
| 4613 | if (tx_timer_change( |
| 4614 | &pMac->lim.limTimers.gLimDeauthAckTimer, val, 0) |
| 4615 | != TX_SUCCESS) |
| 4616 | { |
| 4617 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4618 | FL("Unable to change Deauth ack Timer val")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4619 | return; |
| 4620 | } |
| 4621 | else if(TX_SUCCESS != tx_timer_activate( |
| 4622 | &pMac->lim.limTimers.gLimDeauthAckTimer)) |
| 4623 | { |
| 4624 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4625 | FL("Unable to activate Deauth ack Timer")); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4626 | limDeactivateAndChangeTimer(pMac, eLIM_DEAUTH_ACK_TIMER); |
| 4627 | return; |
| 4628 | } |
| 4629 | } |
| 4630 | else |
| 4631 | { |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4632 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4633 | psessionEntry->peSessionId, |
| 4634 | pMacHdr->fc.subType)); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4635 | #ifdef FEATURE_WLAN_TDLS |
| 4636 | if ((NULL != pStaDs) && (STA_ENTRY_TDLS_PEER == pStaDs->staType)) |
| 4637 | { |
| 4638 | // Queue Disassociation frame in high priority WQ |
| 4639 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4640 | HAL_TXRX_FRM_802_11_MGMT, |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4641 | ANI_TXDIR_IBSS, |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4642 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4643 | limTxComplete, pFrame, txFlag ); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 4644 | } |
| 4645 | else |
| 4646 | { |
| 4647 | #endif |
| 4648 | // Queue Disassociation frame in high priority WQ |
| 4649 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4650 | HAL_TXRX_FRM_802_11_MGMT, |
| 4651 | ANI_TXDIR_TODS, |
| 4652 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4653 | limTxComplete, pFrame, txFlag ); |
| 4654 | #ifdef FEATURE_WLAN_TDLS |
| 4655 | } |
| 4656 | #endif |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4657 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4658 | psessionEntry->peSessionId, |
| 4659 | halstatus)); |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4660 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4661 | { |
| 4662 | limLog( pMac, LOGE, FL("Failed to send De-Authentication " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4663 | "(%X)!"), |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 4664 | nSirStatus ); |
| 4665 | //Pkt will be freed up by the callback |
| 4666 | return; |
| 4667 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4668 | } |
| 4669 | |
| 4670 | } // End limSendDeauthMgmtFrame. |
| 4671 | |
| 4672 | |
| 4673 | #ifdef ANI_SUPPORT_11H |
| 4674 | /** |
| 4675 | * \brief Send a Measurement Report Action frame |
| 4676 | * |
| 4677 | * |
| 4678 | * \param pMac Pointer to the global MAC structure |
| 4679 | * |
| 4680 | * \param pMeasReqFrame Address of a tSirMacMeasReqActionFrame |
| 4681 | * |
| 4682 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 4683 | * |
| 4684 | * |
| 4685 | */ |
| 4686 | |
| 4687 | tSirRetStatus |
| 4688 | limSendMeasReportFrame(tpAniSirGlobal pMac, |
| 4689 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 4690 | tSirMacAddr peer) |
| 4691 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4692 | tDot11fMeasurementReport frm; |
| 4693 | tANI_U8 *pFrame; |
| 4694 | tSirRetStatus nSirStatus; |
| 4695 | tpSirMacMgmtHdr pMacHdr; |
| 4696 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4697 | void *pPacket; |
| 4698 | eHalStatus halstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4699 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4700 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4701 | |
| 4702 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4703 | frm.Action.action = SIR_MAC_ACTION_MEASURE_REPORT_ID; |
| 4704 | frm.DialogToken.token = pMeasReqFrame->actionHeader.dialogToken; |
| 4705 | |
| 4706 | switch ( pMeasReqFrame->measReqIE.measType ) |
| 4707 | { |
| 4708 | case SIR_MAC_BASIC_MEASUREMENT_TYPE: |
| 4709 | nSirStatus = |
| 4710 | PopulateDot11fMeasurementReport0( pMac, pMeasReqFrame, |
| 4711 | &frm.MeasurementReport ); |
| 4712 | break; |
| 4713 | case SIR_MAC_CCA_MEASUREMENT_TYPE: |
| 4714 | nSirStatus = |
| 4715 | PopulateDot11fMeasurementReport1( pMac, pMeasReqFrame, |
| 4716 | &frm.MeasurementReport ); |
| 4717 | break; |
| 4718 | case SIR_MAC_RPI_MEASUREMENT_TYPE: |
| 4719 | nSirStatus = |
| 4720 | PopulateDot11fMeasurementReport2( pMac, pMeasReqFrame, |
| 4721 | &frm.MeasurementReport ); |
| 4722 | break; |
| 4723 | default: |
| 4724 | limLog( pMac, LOGE, FL("Unknown measurement type %d in limSen" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4725 | "dMeasReportFrame."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4726 | pMeasReqFrame->measReqIE.measType ); |
| 4727 | return eSIR_FAILURE; |
| 4728 | } |
| 4729 | |
| 4730 | if ( eSIR_SUCCESS != nSirStatus ) return eSIR_FAILURE; |
| 4731 | |
| 4732 | nStatus = dot11fGetPackedMeasurementReportSize( pMac, &frm, &nPayload ); |
| 4733 | if ( DOT11F_FAILED( nStatus ) ) |
| 4734 | { |
| 4735 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4736 | "or a Measurement Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4737 | nStatus ); |
| 4738 | // We'll fall back on the worst case scenario: |
| 4739 | nPayload = sizeof( tDot11fMeasurementReport ); |
| 4740 | } |
| 4741 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4742 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4743 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4744 | "the packed size for a Measurement Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4745 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4746 | } |
| 4747 | |
| 4748 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4749 | |
| 4750 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4751 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4752 | { |
| 4753 | 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] | 4754 | "Authentication."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4755 | return eSIR_FAILURE; |
| 4756 | } |
| 4757 | |
| 4758 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4759 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4760 | |
| 4761 | // Next, we fill out the buffer descriptor: |
| 4762 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4763 | SIR_MAC_MGMT_ACTION, peer); |
| 4764 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4765 | { |
| 4766 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4767 | "tor for a Measurement Report (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4768 | nSirStatus ); |
| 4769 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4770 | return eSIR_FAILURE; // just allocated... |
| 4771 | } |
| 4772 | |
| 4773 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4774 | |
| 4775 | nCfg = 6; |
| 4776 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 4777 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4778 | { |
| 4779 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4780 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4781 | nSirStatus ); |
| 4782 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4783 | return eSIR_FAILURE; // just allocated... |
| 4784 | } |
| 4785 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4786 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4787 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4788 | #endif |
| 4789 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4790 | nStatus = dot11fPackMeasurementReport( pMac, &frm, pFrame + |
| 4791 | sizeof(tSirMacMgmtHdr), |
| 4792 | nPayload, &nPayload ); |
| 4793 | if ( DOT11F_FAILED( nStatus ) ) |
| 4794 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4795 | limLog( pMac, LOGE, FL("Failed to pack a Measurement Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4796 | nStatus ); |
| 4797 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4798 | return eSIR_FAILURE; // allocated! |
| 4799 | } |
| 4800 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4801 | { |
| 4802 | limLog( pMac, LOGW, FL("There were warnings while packing a M" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4803 | "easurement Report (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4804 | } |
| 4805 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4806 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4807 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 4808 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4809 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4810 | HAL_TXRX_FRM_802_11_MGMT, |
| 4811 | ANI_TXDIR_TODS, |
| 4812 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4813 | limTxComplete, pFrame, 0 ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4814 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4815 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 4816 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4817 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4818 | { |
| 4819 | limLog( pMac, LOGE, FL("Failed to send a Measurement Report " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4820 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4821 | nSirStatus ); |
| 4822 | //Pkt will be freed up by the callback |
| 4823 | return eSIR_FAILURE; // just allocated... |
| 4824 | } |
| 4825 | |
| 4826 | return eSIR_SUCCESS; |
| 4827 | |
| 4828 | } // End limSendMeasReportFrame. |
| 4829 | |
| 4830 | |
| 4831 | /** |
| 4832 | * \brief Send a TPC Request Action frame |
| 4833 | * |
| 4834 | * |
| 4835 | * \param pMac Pointer to the global MAC datastructure |
| 4836 | * |
| 4837 | * \param peer MAC address to which the frame should be sent |
| 4838 | * |
| 4839 | * |
| 4840 | */ |
| 4841 | |
| 4842 | void |
| 4843 | limSendTpcRequestFrame(tpAniSirGlobal pMac, |
| 4844 | tSirMacAddr peer) |
| 4845 | { |
| 4846 | tDot11fTPCRequest frm; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4847 | tANI_U8 *pFrame; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4848 | tSirRetStatus nSirStatus; |
| 4849 | tpSirMacMgmtHdr pMacHdr; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4850 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4851 | void *pPacket; |
| 4852 | eHalStatus halstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4853 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4854 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4855 | |
| 4856 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4857 | frm.Action.action = SIR_MAC_ACTION_TPC_REQUEST_ID; |
| 4858 | frm.DialogToken.token = 1; |
| 4859 | frm.TPCRequest.present = 1; |
| 4860 | |
| 4861 | nStatus = dot11fGetPackedTPCRequestSize( pMac, &frm, &nPayload ); |
| 4862 | if ( DOT11F_FAILED( nStatus ) ) |
| 4863 | { |
| 4864 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4865 | "or a TPC Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4866 | nStatus ); |
| 4867 | // We'll fall back on the worst case scenario: |
| 4868 | nPayload = sizeof( tDot11fTPCRequest ); |
| 4869 | } |
| 4870 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4871 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4872 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4873 | "the packed size for a TPC Request (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4874 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4875 | } |
| 4876 | |
| 4877 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 4878 | |
| 4879 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 4880 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4881 | { |
| 4882 | 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] | 4883 | " Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4884 | return; |
| 4885 | } |
| 4886 | |
| 4887 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4888 | vos_mem_set(pFrame, nBytes,0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4889 | |
| 4890 | // Next, we fill out the buffer descriptor: |
| 4891 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 4892 | SIR_MAC_MGMT_ACTION, peer); |
| 4893 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4894 | { |
| 4895 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4896 | "tor for a TPC Request (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4897 | nSirStatus ); |
| 4898 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4899 | return; // just allocated... |
| 4900 | } |
| 4901 | |
| 4902 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 4903 | |
| 4904 | nCfg = 6; |
| 4905 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 4906 | if ( eSIR_SUCCESS != nSirStatus ) |
| 4907 | { |
| 4908 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4909 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4910 | nSirStatus ); |
| 4911 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4912 | return; // just allocated... |
| 4913 | } |
| 4914 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4915 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 4916 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 4917 | #endif |
| 4918 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4919 | nStatus = dot11fPackTPCRequest( pMac, &frm, pFrame + |
| 4920 | sizeof(tSirMacMgmtHdr), |
| 4921 | nPayload, &nPayload ); |
| 4922 | if ( DOT11F_FAILED( nStatus ) ) |
| 4923 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4924 | limLog( pMac, LOGE, FL("Failed to pack a TPC Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4925 | nStatus ); |
| 4926 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 4927 | return; // allocated! |
| 4928 | } |
| 4929 | else if ( DOT11F_WARNED( nStatus ) ) |
| 4930 | { |
| 4931 | limLog( pMac, LOGW, FL("There were warnings while packing a T" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4932 | "PC Request (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4933 | } |
| 4934 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4935 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 4936 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 4937 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4938 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 4939 | HAL_TXRX_FRM_802_11_MGMT, |
| 4940 | ANI_TXDIR_TODS, |
| 4941 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 4942 | limTxComplete, pFrame, 0 ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 4943 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 4944 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 4945 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4946 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 4947 | { |
| 4948 | limLog( pMac, LOGE, FL("Failed to send a TPC Request " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 4949 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4950 | nSirStatus ); |
| 4951 | //Pkt will be freed up by the callback |
| 4952 | return; |
| 4953 | } |
| 4954 | |
| 4955 | } // End limSendTpcRequestFrame. |
| 4956 | |
| 4957 | |
| 4958 | /** |
| 4959 | * \brief Send a TPC Report Action frame |
| 4960 | * |
| 4961 | * |
| 4962 | * \param pMac Pointer to the global MAC datastructure |
| 4963 | * |
| 4964 | * \param pTpcReqFrame Pointer to the received TPC Request |
| 4965 | * |
| 4966 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 4967 | * |
| 4968 | * |
| 4969 | */ |
| 4970 | |
| 4971 | tSirRetStatus |
| 4972 | limSendTpcReportFrame(tpAniSirGlobal pMac, |
| 4973 | tpSirMacTpcReqActionFrame pTpcReqFrame, |
| 4974 | tSirMacAddr peer) |
| 4975 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 4976 | tDot11fTPCReport frm; |
| 4977 | tANI_U8 *pFrame; |
| 4978 | tSirRetStatus nSirStatus; |
| 4979 | tpSirMacMgmtHdr pMacHdr; |
| 4980 | tANI_U32 nBytes, nPayload, nStatus, nCfg; |
| 4981 | void *pPacket; |
| 4982 | eHalStatus halstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4983 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 4984 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4985 | |
| 4986 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 4987 | frm.Action.action = SIR_MAC_ACTION_TPC_REPORT_ID; |
| 4988 | frm.DialogToken.token = pTpcReqFrame->actionHeader.dialogToken; |
| 4989 | |
| 4990 | // FramesToDo: On the Gen4_TVM branch, there was a comment: |
| 4991 | // "misplaced this function, need to replace: |
| 4992 | // txPower = halGetRateToPwrValue(pMac, staid, |
| 4993 | // pMac->lim.gLimCurrentChannelId, 0); |
| 4994 | frm.TPCReport.tx_power = 0; |
| 4995 | frm.TPCReport.link_margin = 0; |
| 4996 | frm.TPCReport.present = 1; |
| 4997 | |
| 4998 | nStatus = dot11fGetPackedTPCReportSize( pMac, &frm, &nPayload ); |
| 4999 | if ( DOT11F_FAILED( nStatus ) ) |
| 5000 | { |
| 5001 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5002 | "or a TPC Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5003 | nStatus ); |
| 5004 | // We'll fall back on the worst case scenario: |
| 5005 | nPayload = sizeof( tDot11fTPCReport ); |
| 5006 | } |
| 5007 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5008 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5009 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5010 | "the packed size for a TPC Report (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5011 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5012 | } |
| 5013 | |
| 5014 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5015 | |
| 5016 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5017 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5018 | { |
| 5019 | 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] | 5020 | " Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5021 | return eSIR_FAILURE; |
| 5022 | } |
| 5023 | |
| 5024 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5025 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5026 | |
| 5027 | // Next, we fill out the buffer descriptor: |
| 5028 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 5029 | SIR_MAC_MGMT_ACTION, peer); |
| 5030 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5031 | { |
| 5032 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5033 | "tor for a TPC Report (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5034 | nSirStatus ); |
| 5035 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5036 | return eSIR_FAILURE; // just allocated... |
| 5037 | } |
| 5038 | |
| 5039 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 5040 | |
| 5041 | nCfg = 6; |
| 5042 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 5043 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5044 | { |
| 5045 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5046 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5047 | nSirStatus ); |
| 5048 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5049 | return eSIR_FAILURE; // just allocated... |
| 5050 | } |
| 5051 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5052 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5053 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5054 | #endif |
| 5055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5056 | nStatus = dot11fPackTPCReport( pMac, &frm, pFrame + |
| 5057 | sizeof(tSirMacMgmtHdr), |
| 5058 | nPayload, &nPayload ); |
| 5059 | if ( DOT11F_FAILED( nStatus ) ) |
| 5060 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5061 | limLog( pMac, LOGE, FL("Failed to pack a TPC Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5062 | nStatus ); |
| 5063 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5064 | return eSIR_FAILURE; // allocated! |
| 5065 | } |
| 5066 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5067 | { |
| 5068 | limLog( pMac, LOGW, FL("There were warnings while packing a T" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5069 | "PC Report (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5070 | } |
| 5071 | |
| 5072 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5073 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5074 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 5075 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5076 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 5077 | HAL_TXRX_FRM_802_11_MGMT, |
| 5078 | ANI_TXDIR_TODS, |
| 5079 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5080 | limTxComplete, pFrame, 0 ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5081 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5082 | ((psessionEntry)? psessionEntry->peSessionId : NO_SESSION), |
| 5083 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5084 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5085 | { |
| 5086 | limLog( pMac, LOGE, FL("Failed to send a TPC Report " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5087 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5088 | nSirStatus ); |
| 5089 | //Pkt will be freed up by the callback |
| 5090 | return eSIR_FAILURE; // just allocated... |
| 5091 | } |
| 5092 | |
| 5093 | return eSIR_SUCCESS; |
| 5094 | |
| 5095 | } // End limSendTpcReportFrame. |
| 5096 | #endif //ANI_SUPPORT_11H |
| 5097 | |
| 5098 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5099 | /** |
| 5100 | * \brief Send a Channel Switch Announcement |
| 5101 | * |
| 5102 | * |
| 5103 | * \param pMac Pointer to the global MAC datastructure |
| 5104 | * |
| 5105 | * \param peer MAC address to which this frame will be sent |
| 5106 | * |
| 5107 | * \param nMode |
| 5108 | * |
| 5109 | * \param nNewChannel |
| 5110 | * |
| 5111 | * \param nCount |
| 5112 | * |
| 5113 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 5114 | * |
| 5115 | * |
| 5116 | */ |
| 5117 | |
| 5118 | tSirRetStatus |
| 5119 | limSendChannelSwitchMgmtFrame(tpAniSirGlobal pMac, |
| 5120 | tSirMacAddr peer, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5121 | tANI_U8 nMode, |
| 5122 | tANI_U8 nNewChannel, |
| 5123 | tANI_U8 nCount, |
| 5124 | tpPESession psessionEntry ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5125 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5126 | tDot11fChannelSwitch frm; |
| 5127 | tANI_U8 *pFrame; |
| 5128 | tSirRetStatus nSirStatus; |
| 5129 | tpSirMacMgmtHdr pMacHdr; |
| 5130 | tANI_U32 nBytes, nPayload, nStatus;//, nCfg; |
| 5131 | void *pPacket; |
| 5132 | eHalStatus halstatus; |
| 5133 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5134 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5135 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5136 | |
| 5137 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 5138 | frm.Action.action = SIR_MAC_ACTION_CHANNEL_SWITCH_ID; |
| 5139 | frm.ChanSwitchAnn.switchMode = nMode; |
| 5140 | frm.ChanSwitchAnn.newChannel = nNewChannel; |
| 5141 | frm.ChanSwitchAnn.switchCount = nCount; |
| 5142 | frm.ChanSwitchAnn.present = 1; |
| 5143 | |
| 5144 | nStatus = dot11fGetPackedChannelSwitchSize( pMac, &frm, &nPayload ); |
| 5145 | if ( DOT11F_FAILED( nStatus ) ) |
| 5146 | { |
| 5147 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5148 | "or a Channel Switch (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5149 | nStatus ); |
| 5150 | // We'll fall back on the worst case scenario: |
| 5151 | nPayload = sizeof( tDot11fChannelSwitch ); |
| 5152 | } |
| 5153 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5154 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5155 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5156 | "the packed size for a Channel Switch (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5157 | "%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5158 | } |
| 5159 | |
| 5160 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5161 | |
| 5162 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5163 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5164 | { |
| 5165 | 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] | 5166 | " Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5167 | return eSIR_FAILURE; |
| 5168 | } |
| 5169 | |
| 5170 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5171 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5172 | |
| 5173 | // Next, we fill out the buffer descriptor: |
| 5174 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5175 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 5176 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5177 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 5178 | (tANI_U8 *) psessionEntry->bssId, |
| 5179 | sizeof( tSirMacAddr )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5180 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5181 | { |
| 5182 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5183 | "tor for a Channel Switch (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5184 | nSirStatus ); |
| 5185 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5186 | return eSIR_FAILURE; // just allocated... |
| 5187 | } |
| 5188 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5189 | #if 0 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5190 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 5191 | |
| 5192 | nCfg = 6; |
| 5193 | nSirStatus = wlan_cfgGetStr( pMac, WNI_CFG_BSSID, pMacHdr->bssId, &nCfg ); |
| 5194 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5195 | { |
| 5196 | limLog( pMac, LOGE, FL("Failed to retrieve WNI_CFG_BSSID from" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5197 | " CFG (%d)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5198 | nSirStatus ); |
| 5199 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5200 | return eSIR_FAILURE; // just allocated... |
| 5201 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5202 | #endif |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5203 | |
| 5204 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5205 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5206 | #endif |
| 5207 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5208 | nStatus = dot11fPackChannelSwitch( pMac, &frm, pFrame + |
| 5209 | sizeof(tSirMacMgmtHdr), |
| 5210 | nPayload, &nPayload ); |
| 5211 | if ( DOT11F_FAILED( nStatus ) ) |
| 5212 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5213 | limLog( pMac, LOGE, FL("Failed to pack a Channel Switch (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5214 | nStatus ); |
| 5215 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5216 | return eSIR_FAILURE; // allocated! |
| 5217 | } |
| 5218 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5219 | { |
| 5220 | limLog( pMac, LOGW, FL("There were warnings while packing a C" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5221 | "hannel Switch (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5222 | } |
| 5223 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5224 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5225 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5226 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5227 | ) |
| 5228 | { |
| 5229 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5230 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5231 | |
| 5232 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5233 | psessionEntry->peSessionId, |
| 5234 | pMacHdr->fc.subType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5235 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 5236 | HAL_TXRX_FRM_802_11_MGMT, |
| 5237 | ANI_TXDIR_TODS, |
| 5238 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5239 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5240 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5241 | psessionEntry->peSessionId, |
| 5242 | halstatus)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5243 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5244 | { |
| 5245 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5246 | "(%X)!"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5247 | nSirStatus ); |
| 5248 | //Pkt will be freed up by the callback |
| 5249 | return eSIR_FAILURE; |
| 5250 | } |
| 5251 | |
| 5252 | return eSIR_SUCCESS; |
| 5253 | |
| 5254 | } // End limSendChannelSwitchMgmtFrame. |
| 5255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5256 | |
| 5257 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5258 | #ifdef WLAN_FEATURE_11AC |
| 5259 | tSirRetStatus |
| 5260 | limSendVHTOpmodeNotificationFrame(tpAniSirGlobal pMac, |
| 5261 | tSirMacAddr peer, |
| 5262 | tANI_U8 nMode, |
| 5263 | tpPESession psessionEntry ) |
| 5264 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5265 | tDot11fOperatingMode frm; |
| 5266 | tANI_U8 *pFrame; |
| 5267 | tSirRetStatus nSirStatus; |
| 5268 | tpSirMacMgmtHdr pMacHdr; |
| 5269 | tANI_U32 nBytes, nPayload = 0, nStatus;//, nCfg; |
| 5270 | void *pPacket; |
| 5271 | eHalStatus halstatus; |
| 5272 | tANI_U32 txFlag = 0; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5273 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5274 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5275 | |
| 5276 | frm.Category.category = SIR_MAC_ACTION_VHT; |
| 5277 | frm.Action.action = SIR_MAC_VHT_OPMODE_NOTIFICATION; |
| 5278 | frm.OperatingMode.chanWidth = nMode; |
| 5279 | frm.OperatingMode.rxNSS = 0; |
| 5280 | frm.OperatingMode.rxNSSType = 0; |
| 5281 | |
| 5282 | nStatus = dot11fGetPackedOperatingModeSize( pMac, &frm, &nPayload ); |
| 5283 | if ( DOT11F_FAILED( nStatus ) ) |
| 5284 | { |
| 5285 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5286 | "or a Operating Mode (0x%08x)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5287 | nStatus ); |
| 5288 | // We'll fall back on the worst case scenario: |
| 5289 | nPayload = sizeof( tDot11fOperatingMode); |
| 5290 | } |
| 5291 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5292 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5293 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5294 | "the packed size for a Operating Mode (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5295 | "%08x)."), nStatus ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5296 | } |
| 5297 | |
| 5298 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5299 | |
| 5300 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5301 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5302 | { |
| 5303 | 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] | 5304 | " Report."), nBytes ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5305 | return eSIR_FAILURE; |
| 5306 | } |
| 5307 | |
| 5308 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5309 | vos_mem_set( pFrame, nBytes, 0 ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5310 | |
| 5311 | |
| 5312 | // Next, we fill out the buffer descriptor: |
| 5313 | if(psessionEntry->pePersona == VOS_STA_SAP_MODE) { |
| 5314 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 5315 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 5316 | } else |
| 5317 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 5318 | SIR_MAC_MGMT_ACTION, psessionEntry->bssId, psessionEntry->selfMacAddr); |
| 5319 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5320 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 5321 | (tANI_U8 *) psessionEntry->bssId, |
| 5322 | sizeof( tSirMacAddr )); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5323 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5324 | { |
| 5325 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5326 | "tor for a Operating Mode (%d)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5327 | nSirStatus ); |
| 5328 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5329 | return eSIR_FAILURE; // just allocated... |
| 5330 | } |
| 5331 | nStatus = dot11fPackOperatingMode( pMac, &frm, pFrame + |
| 5332 | sizeof(tSirMacMgmtHdr), |
| 5333 | nPayload, &nPayload ); |
| 5334 | if ( DOT11F_FAILED( nStatus ) ) |
| 5335 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5336 | limLog( pMac, LOGE, FL("Failed to pack a Operating Mode (0x%08x)."), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5337 | nStatus ); |
| 5338 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5339 | return eSIR_FAILURE; // allocated! |
| 5340 | } |
| 5341 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5342 | { |
| 5343 | limLog( pMac, LOGW, FL("There were warnings while packing a Operating Mode" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5344 | " (0x%08x)."), nStatus ); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5345 | } |
| 5346 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5347 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5348 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5349 | ) |
| 5350 | { |
| 5351 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5352 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5353 | |
| 5354 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5355 | psessionEntry->peSessionId, |
| 5356 | pMacHdr->fc.subType)); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5357 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 5358 | HAL_TXRX_FRM_802_11_MGMT, |
| 5359 | ANI_TXDIR_TODS, |
| 5360 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5361 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5362 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5363 | psessionEntry->peSessionId, |
| 5364 | halstatus)); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5365 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5366 | { |
| 5367 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5368 | "(%X)!"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5369 | nSirStatus ); |
| 5370 | //Pkt will be freed up by the callback |
| 5371 | return eSIR_FAILURE; |
| 5372 | } |
| 5373 | |
| 5374 | return eSIR_SUCCESS; |
| 5375 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5376 | |
| 5377 | /** |
| 5378 | * \brief Send a VHT Channel Switch Announcement |
| 5379 | * |
| 5380 | * |
| 5381 | * \param pMac Pointer to the global MAC datastructure |
| 5382 | * |
| 5383 | * \param peer MAC address to which this frame will be sent |
| 5384 | * |
| 5385 | * \param nChanWidth |
| 5386 | * |
| 5387 | * \param nNewChannel |
| 5388 | * |
| 5389 | * |
| 5390 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 5391 | * |
| 5392 | * |
| 5393 | */ |
| 5394 | |
| 5395 | tSirRetStatus |
| 5396 | limSendVHTChannelSwitchMgmtFrame(tpAniSirGlobal pMac, |
| 5397 | tSirMacAddr peer, |
| 5398 | tANI_U8 nChanWidth, |
| 5399 | tANI_U8 nNewChannel, |
| 5400 | tANI_U8 ncbMode, |
| 5401 | tpPESession psessionEntry ) |
| 5402 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5403 | tDot11fChannelSwitch frm; |
| 5404 | tANI_U8 *pFrame; |
| 5405 | tSirRetStatus nSirStatus; |
| 5406 | tpSirMacMgmtHdr pMacHdr; |
| 5407 | tANI_U32 nBytes, nPayload, nStatus;//, nCfg; |
| 5408 | void *pPacket; |
| 5409 | eHalStatus halstatus; |
| 5410 | tANI_U32 txFlag = 0; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5411 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5412 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5413 | |
| 5414 | |
| 5415 | frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT; |
| 5416 | frm.Action.action = SIR_MAC_ACTION_CHANNEL_SWITCH_ID; |
| 5417 | frm.ChanSwitchAnn.switchMode = 1; |
| 5418 | frm.ChanSwitchAnn.newChannel = nNewChannel; |
| 5419 | frm.ChanSwitchAnn.switchCount = 1; |
| 5420 | frm.ExtChanSwitchAnn.secondaryChannelOffset = limGetHTCBState(ncbMode); |
| 5421 | frm.ExtChanSwitchAnn.present = 1; |
| 5422 | frm.WiderBWChanSwitchAnn.newChanWidth = nChanWidth; |
| 5423 | frm.WiderBWChanSwitchAnn.newCenterChanFreq0 = limGetCenterChannel(pMac,nNewChannel,ncbMode,nChanWidth); |
| 5424 | frm.WiderBWChanSwitchAnn.newCenterChanFreq1 = 0; |
| 5425 | frm.ChanSwitchAnn.present = 1; |
| 5426 | frm.WiderBWChanSwitchAnn.present = 1; |
| 5427 | |
| 5428 | nStatus = dot11fGetPackedChannelSwitchSize( pMac, &frm, &nPayload ); |
| 5429 | if ( DOT11F_FAILED( nStatus ) ) |
| 5430 | { |
| 5431 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5432 | "or a Channel Switch (0x%08x)."), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5433 | nStatus ); |
| 5434 | // We'll fall back on the worst case scenario: |
| 5435 | nPayload = sizeof( tDot11fChannelSwitch ); |
| 5436 | } |
| 5437 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5438 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5439 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5440 | "the packed size for a Channel Switch (0x" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5441 | "%08x)."), nStatus ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5442 | } |
| 5443 | |
| 5444 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5445 | |
| 5446 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 5447 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5448 | { |
| 5449 | 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] | 5450 | " Report."), nBytes ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5451 | return eSIR_FAILURE; |
| 5452 | } |
| 5453 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5454 | vos_mem_set( pFrame, nBytes, 0 ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5455 | |
| 5456 | // Next, we fill out the buffer descriptor: |
| 5457 | nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME, |
| 5458 | SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr); |
| 5459 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5460 | vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, |
| 5461 | (tANI_U8 *) psessionEntry->bssId, |
| 5462 | sizeof( tSirMacAddr )); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5463 | if ( eSIR_SUCCESS != nSirStatus ) |
| 5464 | { |
| 5465 | limLog( pMac, LOGE, FL("Failed to populate the buffer descrip" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5466 | "tor for a Channel Switch (%d)."), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5467 | nSirStatus ); |
| 5468 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5469 | return eSIR_FAILURE; // just allocated... |
| 5470 | } |
| 5471 | nStatus = dot11fPackChannelSwitch( pMac, &frm, pFrame + |
| 5472 | sizeof(tSirMacMgmtHdr), |
| 5473 | nPayload, &nPayload ); |
| 5474 | if ( DOT11F_FAILED( nStatus ) ) |
| 5475 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5476 | 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] | 5477 | nStatus ); |
| 5478 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 5479 | return eSIR_FAILURE; // allocated! |
| 5480 | } |
| 5481 | else if ( DOT11F_WARNED( nStatus ) ) |
| 5482 | { |
| 5483 | limLog( pMac, LOGW, FL("There were warnings while packing a C" |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5484 | "hannel Switch (0x%08x)."), nStatus ); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5485 | } |
| 5486 | |
| 5487 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5488 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5489 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5490 | ) |
| 5491 | { |
| 5492 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5493 | } |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5494 | |
| 5495 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5496 | psessionEntry->peSessionId, |
| 5497 | pMacHdr->fc.subType)); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5498 | halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes, |
| 5499 | HAL_TXRX_FRM_802_11_MGMT, |
| 5500 | ANI_TXDIR_TODS, |
| 5501 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5502 | limTxComplete, pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5503 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5504 | psessionEntry->peSessionId, |
| 5505 | halstatus)); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5506 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 5507 | { |
| 5508 | limLog( pMac, LOGE, FL("Failed to send a Channel Switch " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5509 | "(%X)!"), |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 5510 | nSirStatus ); |
| 5511 | //Pkt will be freed up by the callback |
| 5512 | return eSIR_FAILURE; |
| 5513 | } |
| 5514 | |
| 5515 | return eSIR_SUCCESS; |
| 5516 | |
| 5517 | } // End limSendVHTChannelSwitchMgmtFrame. |
| 5518 | |
| 5519 | |
| 5520 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 5521 | #endif |
| 5522 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5523 | /** |
| 5524 | * \brief Send an ADDBA Req Action Frame to peer |
| 5525 | * |
| 5526 | * \sa limSendAddBAReq |
| 5527 | * |
| 5528 | * \param pMac The global tpAniSirGlobal object |
| 5529 | * |
| 5530 | * \param pMlmAddBAReq A pointer to tLimMlmAddBAReq. This contains |
| 5531 | * the necessary parameters reqd by PE send the ADDBA Req Action |
| 5532 | * Frame to the peer |
| 5533 | * |
| 5534 | * \return eSIR_SUCCESS if setup completes successfully |
| 5535 | * eSIR_FAILURE is some problem is encountered |
| 5536 | */ |
| 5537 | tSirRetStatus limSendAddBAReq( tpAniSirGlobal pMac, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5538 | tpLimMlmAddBAReq pMlmAddBAReq, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5539 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5540 | tDot11fAddBAReq frmAddBAReq; |
| 5541 | tANI_U8 *pAddBAReqBuffer = NULL; |
| 5542 | tpSirMacMgmtHdr pMacHdr; |
| 5543 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 5544 | tSirRetStatus statusCode; |
| 5545 | eHalStatus halStatus; |
| 5546 | void *pPacket; |
| 5547 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5548 | |
| 5549 | if(NULL == psessionEntry) |
| 5550 | { |
| 5551 | return eSIR_FAILURE; |
| 5552 | } |
| 5553 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5554 | vos_mem_set( (void *) &frmAddBAReq, sizeof( frmAddBAReq ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5555 | |
| 5556 | // Category - 3 (BA) |
| 5557 | frmAddBAReq.Category.category = SIR_MAC_ACTION_BLKACK; |
| 5558 | |
| 5559 | // Action - 0 (ADDBA Req) |
| 5560 | frmAddBAReq.Action.action = SIR_MAC_BLKACK_ADD_REQ; |
| 5561 | |
| 5562 | // FIXME - Dialog Token, generalize this... |
| 5563 | frmAddBAReq.DialogToken.token = pMlmAddBAReq->baDialogToken; |
| 5564 | |
| 5565 | // Fill the ADDBA Parameter Set |
| 5566 | frmAddBAReq.AddBAParameterSet.tid = pMlmAddBAReq->baTID; |
| 5567 | frmAddBAReq.AddBAParameterSet.policy = pMlmAddBAReq->baPolicy; |
| 5568 | frmAddBAReq.AddBAParameterSet.bufferSize = pMlmAddBAReq->baBufferSize; |
| 5569 | |
| 5570 | // BA timeout |
| 5571 | // 0 - indicates no BA timeout |
| 5572 | frmAddBAReq.BATimeout.timeout = pMlmAddBAReq->baTimeout; |
| 5573 | |
Abhishek Singh | 1f6e653 | 2014-06-05 17:35:08 +0530 | [diff] [blame] | 5574 | /* Send SSN whatever we get from FW. |
| 5575 | */ |
| 5576 | frmAddBAReq.BAStartingSequenceControl.ssn = pMlmAddBAReq->baSSN; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5577 | |
| 5578 | nStatus = dot11fGetPackedAddBAReqSize( pMac, &frmAddBAReq, &nPayload ); |
| 5579 | |
| 5580 | if( DOT11F_FAILED( nStatus )) |
| 5581 | { |
| 5582 | limLog( pMac, LOGW, |
| 5583 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5584 | "an ADDBA Request (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5585 | nStatus ); |
| 5586 | |
| 5587 | // We'll fall back on the worst case scenario: |
| 5588 | nPayload = sizeof( tDot11fAddBAReq ); |
| 5589 | } |
| 5590 | else if( DOT11F_WARNED( nStatus )) |
| 5591 | { |
| 5592 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5593 | FL( "There were warnings while calculating " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5594 | "the packed size for an ADDBA Req (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5595 | nStatus ); |
| 5596 | } |
| 5597 | |
| 5598 | // Add the MGMT header to frame length |
| 5599 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5600 | |
| 5601 | // Need to allocate a buffer for ADDBA AF |
| 5602 | if( eHAL_STATUS_SUCCESS != |
| 5603 | (halStatus = palPktAlloc( pMac->hHdd, |
| 5604 | HAL_TXRX_FRM_802_11_MGMT, |
| 5605 | (tANI_U16) frameLen, |
| 5606 | (void **) &pAddBAReqBuffer, |
| 5607 | (void **) &pPacket ))) |
| 5608 | { |
| 5609 | // Log error |
| 5610 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5611 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5612 | frameLen, |
| 5613 | halStatus ); |
| 5614 | |
| 5615 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 5616 | goto returnAfterError; |
| 5617 | } |
| 5618 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5619 | vos_mem_set( (void *) pAddBAReqBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5620 | |
| 5621 | // Copy necessary info to BD |
| 5622 | if( eSIR_SUCCESS != |
| 5623 | (statusCode = limPopulateMacHeader( pMac, |
| 5624 | pAddBAReqBuffer, |
| 5625 | SIR_MAC_MGMT_FRAME, |
| 5626 | SIR_MAC_MGMT_ACTION, |
| 5627 | pMlmAddBAReq->peerMacAddr,psessionEntry->selfMacAddr))) |
| 5628 | goto returnAfterError; |
| 5629 | |
| 5630 | // Update A3 with the BSSID |
| 5631 | pMacHdr = ( tpSirMacMgmtHdr ) pAddBAReqBuffer; |
| 5632 | |
| 5633 | #if 0 |
| 5634 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 5635 | if( eSIR_SUCCESS != cfgGetStr( pMac, |
| 5636 | WNI_CFG_BSSID, |
| 5637 | (tANI_U8 *) pMacHdr->bssId, |
| 5638 | &cfgLen )) |
| 5639 | { |
| 5640 | limLog( pMac, LOGP, |
| 5641 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5642 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5643 | |
| 5644 | // FIXME - Need to convert to tSirRetStatus |
| 5645 | statusCode = eSIR_FAILURE; |
| 5646 | goto returnAfterError; |
| 5647 | } |
| 5648 | #endif//TO SUPPORT BT-AMP |
| 5649 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 5650 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5651 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5652 | limSetProtectedBit(pMac, psessionEntry, pMlmAddBAReq->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5653 | #endif |
| 5654 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5655 | // Now, we're ready to "pack" the frames |
| 5656 | nStatus = dot11fPackAddBAReq( pMac, |
| 5657 | &frmAddBAReq, |
| 5658 | pAddBAReqBuffer + sizeof( tSirMacMgmtHdr ), |
| 5659 | nPayload, |
| 5660 | &nPayload ); |
| 5661 | |
| 5662 | if( DOT11F_FAILED( nStatus )) |
| 5663 | { |
| 5664 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5665 | FL( "Failed to pack an ADDBA Req (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5666 | nStatus ); |
| 5667 | |
| 5668 | // FIXME - Need to convert to tSirRetStatus |
| 5669 | statusCode = eSIR_FAILURE; |
| 5670 | goto returnAfterError; |
| 5671 | } |
| 5672 | else if( DOT11F_WARNED( nStatus )) |
| 5673 | { |
| 5674 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5675 | FL( "There were warnings while packing an ADDBA Req (0x%08x)."), |
| 5676 | nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5677 | } |
| 5678 | |
Abhishek Singh | 02d9f6c | 2014-05-12 14:07:53 +0530 | [diff] [blame] | 5679 | limLog( pMac, LOG1, FL( "Sending an ADDBA REQ to "MAC_ADDRESS_STR " with" |
| 5680 | " tid = %d policy = %d buffsize = %d " |
| 5681 | " amsduSupported = %d"), |
| 5682 | MAC_ADDR_ARRAY(pMlmAddBAReq->peerMacAddr), |
| 5683 | frmAddBAReq.AddBAParameterSet.tid, |
| 5684 | frmAddBAReq.AddBAParameterSet.policy, |
| 5685 | frmAddBAReq.AddBAParameterSet.bufferSize, |
| 5686 | frmAddBAReq.AddBAParameterSet.amsduSupported); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5687 | |
Abhishek Singh | 1f6e653 | 2014-06-05 17:35:08 +0530 | [diff] [blame] | 5688 | limLog( pMac, LOG1, FL( "ssn = %d fragNum = %d" ), |
| 5689 | frmAddBAReq.BAStartingSequenceControl.ssn, |
| 5690 | frmAddBAReq.BAStartingSequenceControl.fragNumber); |
| 5691 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5692 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5693 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5694 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5695 | ) |
| 5696 | { |
| 5697 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5698 | } |
| 5699 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5700 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5701 | psessionEntry->peSessionId, |
| 5702 | pMacHdr->fc.subType)); |
| 5703 | halStatus = halTxFrame( pMac, |
| 5704 | pPacket, |
| 5705 | (tANI_U16) frameLen, |
| 5706 | HAL_TXRX_FRM_802_11_MGMT, |
| 5707 | ANI_TXDIR_TODS, |
| 5708 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5709 | limTxComplete, |
| 5710 | pAddBAReqBuffer, txFlag ); |
| 5711 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5712 | psessionEntry->peSessionId, |
| 5713 | halStatus)); |
| 5714 | if( eHAL_STATUS_SUCCESS != halStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5715 | { |
| 5716 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5717 | FL( "halTxFrame FAILED! Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5718 | halStatus ); |
| 5719 | |
| 5720 | // FIXME - Need to convert eHalStatus to tSirRetStatus |
| 5721 | statusCode = eSIR_FAILURE; |
| 5722 | //Pkt will be freed up by the callback |
| 5723 | return statusCode; |
| 5724 | } |
| 5725 | else |
| 5726 | return eSIR_SUCCESS; |
| 5727 | |
| 5728 | returnAfterError: |
| 5729 | |
| 5730 | // Release buffer, if allocated |
| 5731 | if( NULL != pAddBAReqBuffer ) |
| 5732 | palPktFree( pMac->hHdd, |
| 5733 | HAL_TXRX_FRM_802_11_MGMT, |
| 5734 | (void *) pAddBAReqBuffer, |
| 5735 | (void *) pPacket ); |
| 5736 | |
| 5737 | return statusCode; |
| 5738 | } |
| 5739 | |
| 5740 | /** |
| 5741 | * \brief Send an ADDBA Rsp Action Frame to peer |
| 5742 | * |
| 5743 | * \sa limSendAddBARsp |
| 5744 | * |
| 5745 | * \param pMac The global tpAniSirGlobal object |
| 5746 | * |
| 5747 | * \param pMlmAddBARsp A pointer to tLimMlmAddBARsp. This contains |
| 5748 | * the necessary parameters reqd by PE send the ADDBA Rsp Action |
| 5749 | * Frame to the peer |
| 5750 | * |
| 5751 | * \return eSIR_SUCCESS if setup completes successfully |
| 5752 | * eSIR_FAILURE is some problem is encountered |
| 5753 | */ |
| 5754 | tSirRetStatus limSendAddBARsp( tpAniSirGlobal pMac, |
| 5755 | tpLimMlmAddBARsp pMlmAddBARsp, |
| 5756 | tpPESession psessionEntry) |
| 5757 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5758 | tDot11fAddBARsp frmAddBARsp; |
| 5759 | tANI_U8 *pAddBARspBuffer = NULL; |
| 5760 | tpSirMacMgmtHdr pMacHdr; |
| 5761 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 5762 | tSirRetStatus statusCode; |
| 5763 | eHalStatus halStatus; |
| 5764 | void *pPacket; |
| 5765 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5766 | |
| 5767 | if(NULL == psessionEntry) |
| 5768 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5769 | PELOGE(limLog(pMac, LOGE, FL("Session entry is NULL!!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5770 | return eSIR_FAILURE; |
| 5771 | } |
| 5772 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5773 | vos_mem_set( (void *) &frmAddBARsp, sizeof( frmAddBARsp ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5774 | |
| 5775 | // Category - 3 (BA) |
| 5776 | frmAddBARsp.Category.category = SIR_MAC_ACTION_BLKACK; |
| 5777 | // Action - 1 (ADDBA Rsp) |
| 5778 | frmAddBARsp.Action.action = SIR_MAC_BLKACK_ADD_RSP; |
| 5779 | |
| 5780 | // Should be same as the one we received in the ADDBA Req |
| 5781 | frmAddBARsp.DialogToken.token = pMlmAddBARsp->baDialogToken; |
| 5782 | |
| 5783 | // ADDBA Req status |
| 5784 | frmAddBARsp.Status.status = pMlmAddBARsp->addBAResultCode; |
| 5785 | |
| 5786 | // Fill the ADDBA Parameter Set as provided by caller |
| 5787 | frmAddBARsp.AddBAParameterSet.tid = pMlmAddBARsp->baTID; |
| 5788 | frmAddBARsp.AddBAParameterSet.policy = pMlmAddBARsp->baPolicy; |
| 5789 | frmAddBARsp.AddBAParameterSet.bufferSize = pMlmAddBARsp->baBufferSize; |
krunal soni | 5afa96c | 2013-09-06 22:19:02 -0700 | [diff] [blame] | 5790 | |
| 5791 | if(psessionEntry->isAmsduSupportInAMPDU) |
| 5792 | { |
| 5793 | frmAddBARsp.AddBAParameterSet.amsduSupported = |
| 5794 | psessionEntry->amsduSupportedInBA; |
| 5795 | } |
| 5796 | else |
| 5797 | { |
| 5798 | frmAddBARsp.AddBAParameterSet.amsduSupported = 0; |
| 5799 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5800 | |
| 5801 | // BA timeout |
| 5802 | // 0 - indicates no BA timeout |
| 5803 | frmAddBARsp.BATimeout.timeout = pMlmAddBARsp->baTimeout; |
| 5804 | |
| 5805 | nStatus = dot11fGetPackedAddBARspSize( pMac, &frmAddBARsp, &nPayload ); |
| 5806 | |
| 5807 | if( DOT11F_FAILED( nStatus )) |
| 5808 | { |
| 5809 | limLog( pMac, LOGW, |
| 5810 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5811 | "an ADDBA Response (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5812 | nStatus ); |
| 5813 | |
| 5814 | // We'll fall back on the worst case scenario: |
| 5815 | nPayload = sizeof( tDot11fAddBARsp ); |
| 5816 | } |
| 5817 | else if( DOT11F_WARNED( nStatus )) |
| 5818 | { |
| 5819 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5820 | FL( "There were warnings while calculating " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5821 | "the packed size for an ADDBA Rsp (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5822 | nStatus ); |
| 5823 | } |
| 5824 | |
| 5825 | // Need to allocate a buffer for ADDBA AF |
| 5826 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 5827 | |
| 5828 | // Allocate shared memory |
| 5829 | if( eHAL_STATUS_SUCCESS != |
| 5830 | (halStatus = palPktAlloc( pMac->hHdd, |
| 5831 | HAL_TXRX_FRM_802_11_MGMT, |
| 5832 | (tANI_U16) frameLen, |
| 5833 | (void **) &pAddBARspBuffer, |
| 5834 | (void **) &pPacket ))) |
| 5835 | { |
| 5836 | // Log error |
| 5837 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5838 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5839 | frameLen, |
| 5840 | halStatus ); |
| 5841 | |
| 5842 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 5843 | goto returnAfterError; |
| 5844 | } |
| 5845 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 5846 | vos_mem_set( (void *) pAddBARspBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5847 | |
| 5848 | // Copy necessary info to BD |
| 5849 | if( eSIR_SUCCESS != |
| 5850 | (statusCode = limPopulateMacHeader( pMac, |
| 5851 | pAddBARspBuffer, |
| 5852 | SIR_MAC_MGMT_FRAME, |
| 5853 | SIR_MAC_MGMT_ACTION, |
| 5854 | pMlmAddBARsp->peerMacAddr,psessionEntry->selfMacAddr))) |
| 5855 | goto returnAfterError; |
| 5856 | |
| 5857 | // Update A3 with the BSSID |
| 5858 | |
| 5859 | pMacHdr = ( tpSirMacMgmtHdr ) pAddBARspBuffer; |
| 5860 | |
| 5861 | #if 0 |
| 5862 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 5863 | if( eSIR_SUCCESS != wlan_cfgGetStr( pMac, |
| 5864 | WNI_CFG_BSSID, |
| 5865 | (tANI_U8 *) pMacHdr->bssId, |
| 5866 | &cfgLen )) |
| 5867 | { |
| 5868 | limLog( pMac, LOGP, |
| 5869 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5870 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5871 | |
| 5872 | // FIXME - Need to convert to tSirRetStatus |
| 5873 | statusCode = eSIR_FAILURE; |
| 5874 | goto returnAfterError; |
| 5875 | } |
| 5876 | #endif // TO SUPPORT BT-AMP |
| 5877 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 5878 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5879 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 5880 | limSetProtectedBit(pMac, psessionEntry, pMlmAddBARsp->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5881 | #endif |
| 5882 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5883 | // Now, we're ready to "pack" the frames |
| 5884 | nStatus = dot11fPackAddBARsp( pMac, |
| 5885 | &frmAddBARsp, |
| 5886 | pAddBARspBuffer + sizeof( tSirMacMgmtHdr ), |
| 5887 | nPayload, |
| 5888 | &nPayload ); |
| 5889 | |
| 5890 | if( DOT11F_FAILED( nStatus )) |
| 5891 | { |
| 5892 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5893 | FL( "Failed to pack an ADDBA Rsp (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5894 | nStatus ); |
| 5895 | |
| 5896 | // FIXME - Need to convert to tSirRetStatus |
| 5897 | statusCode = eSIR_FAILURE; |
| 5898 | goto returnAfterError; |
| 5899 | } |
| 5900 | else if( DOT11F_WARNED( nStatus )) |
| 5901 | { |
| 5902 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5903 | FL( "There were warnings while packing an ADDBA Rsp (0x%08x)." ), |
| 5904 | nStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5905 | } |
| 5906 | |
Abhishek Singh | 02d9f6c | 2014-05-12 14:07:53 +0530 | [diff] [blame] | 5907 | limLog( pMac, LOG1, FL( "Sending an ADDBA RSP to "MAC_ADDRESS_STR " with" |
| 5908 | " tid = %d policy = %d buffsize = %d" |
| 5909 | " amsduSupported = %d status %d"), |
| 5910 | MAC_ADDR_ARRAY(pMlmAddBARsp->peerMacAddr), |
| 5911 | frmAddBARsp.AddBAParameterSet.tid, |
| 5912 | frmAddBARsp.AddBAParameterSet.policy, |
| 5913 | frmAddBARsp.AddBAParameterSet.bufferSize, |
| 5914 | frmAddBARsp.AddBAParameterSet.amsduSupported, |
| 5915 | frmAddBARsp.Status.status); |
| 5916 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5917 | |
| 5918 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5919 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 5920 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5921 | ) |
| 5922 | { |
| 5923 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 5924 | } |
| 5925 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 5926 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 5927 | psessionEntry->peSessionId, |
| 5928 | pMacHdr->fc.subType)); |
| 5929 | halStatus = halTxFrame( pMac, |
| 5930 | pPacket, |
| 5931 | (tANI_U16) frameLen, |
| 5932 | HAL_TXRX_FRM_802_11_MGMT, |
| 5933 | ANI_TXDIR_TODS, |
| 5934 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 5935 | limTxComplete, |
| 5936 | pAddBARspBuffer, txFlag ); |
| 5937 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 5938 | psessionEntry->peSessionId, |
| 5939 | halStatus)); |
| 5940 | if( eHAL_STATUS_SUCCESS != halStatus ) |
| 5941 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5942 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 5943 | FL( "halTxFrame FAILED! Status [%d]" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5944 | halStatus ); |
| 5945 | |
| 5946 | // FIXME - HAL error codes are different from PE error |
| 5947 | // codes!! And, this routine is returning tSirRetStatus |
| 5948 | statusCode = eSIR_FAILURE; |
| 5949 | //Pkt will be freed up by the callback |
| 5950 | return statusCode; |
| 5951 | } |
| 5952 | else |
| 5953 | return eSIR_SUCCESS; |
| 5954 | |
| 5955 | returnAfterError: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5956 | // Release buffer, if allocated |
| 5957 | if( NULL != pAddBARspBuffer ) |
| 5958 | palPktFree( pMac->hHdd, |
| 5959 | HAL_TXRX_FRM_802_11_MGMT, |
| 5960 | (void *) pAddBARspBuffer, |
| 5961 | (void *) pPacket ); |
| 5962 | |
| 5963 | return statusCode; |
| 5964 | } |
| 5965 | |
| 5966 | /** |
| 5967 | * \brief Send a DELBA Indication Action Frame to peer |
| 5968 | * |
| 5969 | * \sa limSendDelBAInd |
| 5970 | * |
| 5971 | * \param pMac The global tpAniSirGlobal object |
| 5972 | * |
| 5973 | * \param peerMacAddr MAC Address of peer |
| 5974 | * |
| 5975 | * \param reasonCode Reason for the DELBA notification |
| 5976 | * |
| 5977 | * \param pBAParameterSet The DELBA Parameter Set. |
| 5978 | * This identifies the TID for which the BA session is |
| 5979 | * being deleted. |
| 5980 | * |
| 5981 | * \return eSIR_SUCCESS if setup completes successfully |
| 5982 | * eSIR_FAILURE is some problem is encountered |
| 5983 | */ |
| 5984 | tSirRetStatus limSendDelBAInd( tpAniSirGlobal pMac, |
| 5985 | tpLimMlmDelBAReq pMlmDelBAReq,tpPESession psessionEntry) |
| 5986 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5987 | tDot11fDelBAInd frmDelBAInd; |
| 5988 | tANI_U8 *pDelBAIndBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5989 | //tANI_U32 val; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 5990 | tpSirMacMgmtHdr pMacHdr; |
| 5991 | tANI_U32 frameLen = 0, nStatus, nPayload; |
| 5992 | tSirRetStatus statusCode; |
| 5993 | eHalStatus halStatus; |
| 5994 | void *pPacket; |
| 5995 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5996 | |
| 5997 | if(NULL == psessionEntry) |
| 5998 | { |
| 5999 | return eSIR_FAILURE; |
| 6000 | } |
| 6001 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6002 | vos_mem_set( (void *) &frmDelBAInd, sizeof( frmDelBAInd ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6003 | |
| 6004 | // Category - 3 (BA) |
| 6005 | frmDelBAInd.Category.category = SIR_MAC_ACTION_BLKACK; |
| 6006 | // Action - 2 (DELBA) |
| 6007 | frmDelBAInd.Action.action = SIR_MAC_BLKACK_DEL; |
| 6008 | |
| 6009 | // Fill the DELBA Parameter Set as provided by caller |
| 6010 | frmDelBAInd.DelBAParameterSet.tid = pMlmDelBAReq->baTID; |
| 6011 | frmDelBAInd.DelBAParameterSet.initiator = pMlmDelBAReq->baDirection; |
| 6012 | |
| 6013 | // BA Starting Sequence Number |
| 6014 | // Fragment number will always be zero |
| 6015 | frmDelBAInd.Reason.code = pMlmDelBAReq->delBAReasonCode; |
| 6016 | |
| 6017 | nStatus = dot11fGetPackedDelBAIndSize( pMac, &frmDelBAInd, &nPayload ); |
| 6018 | |
| 6019 | if( DOT11F_FAILED( nStatus )) |
| 6020 | { |
| 6021 | limLog( pMac, LOGW, |
| 6022 | FL( "Failed to calculate the packed size for " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6023 | "an DELBA Indication (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6024 | nStatus ); |
| 6025 | |
| 6026 | // We'll fall back on the worst case scenario: |
| 6027 | nPayload = sizeof( tDot11fDelBAInd ); |
| 6028 | } |
| 6029 | else if( DOT11F_WARNED( nStatus )) |
| 6030 | { |
| 6031 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6032 | FL( "There were warnings while calculating " |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6033 | "the packed size for an DELBA Ind (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6034 | nStatus ); |
| 6035 | } |
| 6036 | |
| 6037 | // Add the MGMT header to frame length |
| 6038 | frameLen = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6039 | |
| 6040 | // Allocate shared memory |
| 6041 | if( eHAL_STATUS_SUCCESS != |
| 6042 | (halStatus = palPktAlloc( pMac->hHdd, |
| 6043 | HAL_TXRX_FRM_802_11_MGMT, |
| 6044 | (tANI_U16) frameLen, |
| 6045 | (void **) &pDelBAIndBuffer, |
| 6046 | (void **) &pPacket ))) |
| 6047 | { |
| 6048 | // Log error |
| 6049 | limLog( pMac, LOGP, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6050 | FL("palPktAlloc FAILED! Length [%d], Status [%d]"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6051 | frameLen, |
| 6052 | halStatus ); |
| 6053 | |
| 6054 | statusCode = eSIR_MEM_ALLOC_FAILED; |
| 6055 | goto returnAfterError; |
| 6056 | } |
| 6057 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6058 | vos_mem_set( (void *) pDelBAIndBuffer, frameLen, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6059 | |
| 6060 | // Copy necessary info to BD |
| 6061 | if( eSIR_SUCCESS != |
| 6062 | (statusCode = limPopulateMacHeader( pMac, |
| 6063 | pDelBAIndBuffer, |
| 6064 | SIR_MAC_MGMT_FRAME, |
| 6065 | SIR_MAC_MGMT_ACTION, |
| 6066 | pMlmDelBAReq->peerMacAddr,psessionEntry->selfMacAddr))) |
| 6067 | goto returnAfterError; |
| 6068 | |
| 6069 | // Update A3 with the BSSID |
| 6070 | pMacHdr = ( tpSirMacMgmtHdr ) pDelBAIndBuffer; |
| 6071 | |
| 6072 | #if 0 |
| 6073 | cfgLen = SIR_MAC_ADDR_LENGTH; |
| 6074 | if( eSIR_SUCCESS != cfgGetStr( pMac, |
| 6075 | WNI_CFG_BSSID, |
| 6076 | (tANI_U8 *) pMacHdr->bssId, |
| 6077 | &cfgLen )) |
| 6078 | { |
| 6079 | limLog( pMac, LOGP, |
| 6080 | FL( "Failed to retrieve WNI_CFG_BSSID while" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6081 | "sending an ACTION Frame" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6082 | |
| 6083 | // FIXME - Need to convert to tSirRetStatus |
| 6084 | statusCode = eSIR_FAILURE; |
| 6085 | goto returnAfterError; |
| 6086 | } |
| 6087 | #endif //TO SUPPORT BT-AMP |
| 6088 | sirCopyMacAddr(pMacHdr->bssId,psessionEntry->bssId); |
| 6089 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6090 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 6091 | limSetProtectedBit(pMac, psessionEntry, pMlmDelBAReq->peerMacAddr, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6092 | #endif |
| 6093 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6094 | // Now, we're ready to "pack" the frames |
| 6095 | nStatus = dot11fPackDelBAInd( pMac, |
| 6096 | &frmDelBAInd, |
| 6097 | pDelBAIndBuffer + sizeof( tSirMacMgmtHdr ), |
| 6098 | nPayload, |
| 6099 | &nPayload ); |
| 6100 | |
| 6101 | if( DOT11F_FAILED( nStatus )) |
| 6102 | { |
| 6103 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6104 | FL( "Failed to pack an DELBA Ind (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6105 | nStatus ); |
| 6106 | |
| 6107 | // FIXME - Need to convert to tSirRetStatus |
| 6108 | statusCode = eSIR_FAILURE; |
| 6109 | goto returnAfterError; |
| 6110 | } |
| 6111 | else if( DOT11F_WARNED( nStatus )) |
| 6112 | { |
| 6113 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6114 | FL( "There were warnings while packing an DELBA Ind (0x%08x)." ), |
| 6115 | nStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6116 | } |
| 6117 | |
Abhishek Singh | 1f6e653 | 2014-06-05 17:35:08 +0530 | [diff] [blame] | 6118 | limLog( pMac, LOG1, |
| 6119 | FL( "Sending a DELBA IND to: "MAC_ADDRESS_STR" with Tid = %d" |
| 6120 | " initiator = %d reason = %d" ), |
| 6121 | MAC_ADDR_ARRAY(pMlmDelBAReq->peerMacAddr), |
| 6122 | frmDelBAInd.DelBAParameterSet.tid, |
| 6123 | frmDelBAInd.DelBAParameterSet.initiator, |
| 6124 | frmDelBAInd.Reason.code); |
| 6125 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6126 | |
| 6127 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6128 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6129 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6130 | ) |
| 6131 | { |
| 6132 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6133 | } |
| 6134 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6135 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6136 | psessionEntry->peSessionId, |
| 6137 | pMacHdr->fc.subType)); |
| 6138 | halStatus = halTxFrame( pMac, |
| 6139 | pPacket, |
| 6140 | (tANI_U16) frameLen, |
| 6141 | HAL_TXRX_FRM_802_11_MGMT, |
| 6142 | ANI_TXDIR_TODS, |
| 6143 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6144 | limTxComplete, |
| 6145 | pDelBAIndBuffer, txFlag ); |
| 6146 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 6147 | psessionEntry->peSessionId, |
| 6148 | halStatus)); |
| 6149 | if( eHAL_STATUS_SUCCESS != halStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6150 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6151 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halStatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6152 | statusCode = eSIR_FAILURE; |
| 6153 | //Pkt will be freed up by the callback |
| 6154 | return statusCode; |
| 6155 | } |
| 6156 | else |
| 6157 | return eSIR_SUCCESS; |
| 6158 | |
| 6159 | returnAfterError: |
| 6160 | |
| 6161 | // Release buffer, if allocated |
| 6162 | if( NULL != pDelBAIndBuffer ) |
| 6163 | palPktFree( pMac->hHdd, |
| 6164 | HAL_TXRX_FRM_802_11_MGMT, |
| 6165 | (void *) pDelBAIndBuffer, |
| 6166 | (void *) pPacket ); |
| 6167 | |
| 6168 | return statusCode; |
| 6169 | } |
| 6170 | |
| 6171 | #if defined WLAN_FEATURE_VOWIFI |
| 6172 | |
| 6173 | /** |
| 6174 | * \brief Send a Neighbor Report Request Action frame |
| 6175 | * |
| 6176 | * |
| 6177 | * \param pMac Pointer to the global MAC structure |
| 6178 | * |
| 6179 | * \param pNeighborReq Address of a tSirMacNeighborReportReq |
| 6180 | * |
| 6181 | * \param peer mac address of peer station. |
| 6182 | * |
| 6183 | * \param psessionEntry address of session entry. |
| 6184 | * |
| 6185 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 6186 | * |
| 6187 | * |
| 6188 | */ |
| 6189 | |
| 6190 | tSirRetStatus |
| 6191 | limSendNeighborReportRequestFrame(tpAniSirGlobal pMac, |
| 6192 | tpSirMacNeighborReportReq pNeighborReq, |
| 6193 | tSirMacAddr peer, |
| 6194 | tpPESession psessionEntry |
| 6195 | ) |
| 6196 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6197 | tSirRetStatus statusCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6198 | tDot11fNeighborReportRequest frm; |
| 6199 | tANI_U8 *pFrame; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6200 | tpSirMacMgmtHdr pMacHdr; |
| 6201 | tANI_U32 nBytes, nPayload, nStatus; |
| 6202 | void *pPacket; |
| 6203 | eHalStatus halstatus; |
| 6204 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6205 | |
| 6206 | if ( psessionEntry == NULL ) |
| 6207 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6208 | 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] | 6209 | return eSIR_FAILURE; |
| 6210 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6211 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6212 | |
| 6213 | frm.Category.category = SIR_MAC_ACTION_RRM; |
| 6214 | frm.Action.action = SIR_MAC_RRM_NEIGHBOR_REQ; |
| 6215 | frm.DialogToken.token = pNeighborReq->dialogToken; |
| 6216 | |
| 6217 | |
| 6218 | if( pNeighborReq->ssid_present ) |
| 6219 | { |
| 6220 | PopulateDot11fSSID( pMac, &pNeighborReq->ssid, &frm.SSID ); |
| 6221 | } |
| 6222 | |
| 6223 | nStatus = dot11fGetPackedNeighborReportRequestSize( pMac, &frm, &nPayload ); |
| 6224 | if ( DOT11F_FAILED( nStatus ) ) |
| 6225 | { |
| 6226 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6227 | "or a Neighbor Report Request(0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6228 | nStatus ); |
| 6229 | // We'll fall back on the worst case scenario: |
| 6230 | nPayload = sizeof( tDot11fNeighborReportRequest ); |
| 6231 | } |
| 6232 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6233 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6234 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6235 | "the packed size for a Neighbor Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6236 | "ort Request(0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6237 | } |
| 6238 | |
| 6239 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6240 | |
| 6241 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6242 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6243 | { |
| 6244 | 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] | 6245 | "Report Request."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6246 | return eSIR_FAILURE; |
| 6247 | } |
| 6248 | |
| 6249 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6250 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6251 | |
| 6252 | // Copy necessary info to BD |
| 6253 | if( eSIR_SUCCESS != |
| 6254 | (statusCode = limPopulateMacHeader( pMac, |
| 6255 | pFrame, |
| 6256 | SIR_MAC_MGMT_FRAME, |
| 6257 | SIR_MAC_MGMT_ACTION, |
| 6258 | peer, psessionEntry->selfMacAddr))) |
| 6259 | goto returnAfterError; |
| 6260 | |
| 6261 | // Update A3 with the BSSID |
| 6262 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6263 | |
| 6264 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 6265 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6266 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 6267 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6268 | #endif |
| 6269 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6270 | // Now, we're ready to "pack" the frames |
| 6271 | nStatus = dot11fPackNeighborReportRequest( pMac, |
| 6272 | &frm, |
| 6273 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6274 | nPayload, |
| 6275 | &nPayload ); |
| 6276 | |
| 6277 | if( DOT11F_FAILED( nStatus )) |
| 6278 | { |
| 6279 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6280 | FL( "Failed to pack an Neighbor Report Request (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6281 | nStatus ); |
| 6282 | |
| 6283 | // FIXME - Need to convert to tSirRetStatus |
| 6284 | statusCode = eSIR_FAILURE; |
| 6285 | goto returnAfterError; |
| 6286 | } |
| 6287 | else if( DOT11F_WARNED( nStatus )) |
| 6288 | { |
| 6289 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6290 | FL( "There were warnings while packing Neighbor Report " |
| 6291 | "Request (0x%08x)." ), nStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6292 | } |
| 6293 | |
| 6294 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6295 | FL( "Sending a Neighbor Report Request to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6296 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6297 | |
| 6298 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6299 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6300 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6301 | ) |
| 6302 | { |
| 6303 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6304 | } |
| 6305 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6306 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6307 | psessionEntry->peSessionId, |
| 6308 | pMacHdr->fc.subType)); |
| 6309 | halstatus = halTxFrame( pMac, |
| 6310 | pPacket, |
| 6311 | (tANI_U16) nBytes, |
| 6312 | HAL_TXRX_FRM_802_11_MGMT, |
| 6313 | ANI_TXDIR_TODS, |
| 6314 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6315 | limTxComplete, |
| 6316 | pFrame, txFlag ); |
| 6317 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 6318 | psessionEntry->peSessionId, |
| 6319 | halstatus)); |
| 6320 | if( eHAL_STATUS_SUCCESS != halstatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6321 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6322 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6323 | statusCode = eSIR_FAILURE; |
| 6324 | //Pkt will be freed up by the callback |
| 6325 | return statusCode; |
| 6326 | } |
| 6327 | else |
| 6328 | return eSIR_SUCCESS; |
| 6329 | |
| 6330 | returnAfterError: |
| 6331 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 6332 | |
| 6333 | return statusCode; |
| 6334 | } // End limSendNeighborReportRequestFrame. |
| 6335 | |
| 6336 | /** |
| 6337 | * \brief Send a Link Report Action frame |
| 6338 | * |
| 6339 | * |
| 6340 | * \param pMac Pointer to the global MAC structure |
| 6341 | * |
| 6342 | * \param pLinkReport Address of a tSirMacLinkReport |
| 6343 | * |
| 6344 | * \param peer mac address of peer station. |
| 6345 | * |
| 6346 | * \param psessionEntry address of session entry. |
| 6347 | * |
| 6348 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 6349 | * |
| 6350 | * |
| 6351 | */ |
| 6352 | |
| 6353 | tSirRetStatus |
| 6354 | limSendLinkReportActionFrame(tpAniSirGlobal pMac, |
| 6355 | tpSirMacLinkReport pLinkReport, |
| 6356 | tSirMacAddr peer, |
| 6357 | tpPESession psessionEntry |
| 6358 | ) |
| 6359 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6360 | tSirRetStatus statusCode = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6361 | tDot11fLinkMeasurementReport frm; |
| 6362 | tANI_U8 *pFrame; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6363 | tpSirMacMgmtHdr pMacHdr; |
| 6364 | tANI_U32 nBytes, nPayload, nStatus; |
| 6365 | void *pPacket; |
| 6366 | eHalStatus halstatus; |
| 6367 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6368 | |
| 6369 | |
| 6370 | if ( psessionEntry == NULL ) |
| 6371 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6372 | 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] | 6373 | return eSIR_FAILURE; |
| 6374 | } |
| 6375 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6376 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6377 | |
| 6378 | frm.Category.category = SIR_MAC_ACTION_RRM; |
| 6379 | frm.Action.action = SIR_MAC_RRM_LINK_MEASUREMENT_RPT; |
| 6380 | frm.DialogToken.token = pLinkReport->dialogToken; |
| 6381 | |
| 6382 | |
| 6383 | //IEEE Std. 802.11 7.3.2.18. for the report element. |
| 6384 | //Even though TPC report an IE, it is represented using fixed fields since it is positioned |
| 6385 | //in the middle of other fixed fields in the link report frame(IEEE Std. 802.11k section7.4.6.4 |
| 6386 | //and frame parser always expects IEs to come after all fixed fields. It is easier to handle |
| 6387 | //such case this way than changing the frame parser. |
| 6388 | frm.TPCEleID.TPCId = SIR_MAC_TPC_RPT_EID; |
| 6389 | frm.TPCEleLen.TPCLen = 2; |
| 6390 | frm.TxPower.txPower = pLinkReport->txPower; |
| 6391 | frm.LinkMargin.linkMargin = 0; |
| 6392 | |
| 6393 | frm.RxAntennaId.antennaId = pLinkReport->rxAntenna; |
| 6394 | frm.TxAntennaId.antennaId = pLinkReport->txAntenna; |
| 6395 | frm.RCPI.rcpi = pLinkReport->rcpi; |
| 6396 | frm.RSNI.rsni = pLinkReport->rsni; |
| 6397 | |
| 6398 | nStatus = dot11fGetPackedLinkMeasurementReportSize( pMac, &frm, &nPayload ); |
| 6399 | if ( DOT11F_FAILED( nStatus ) ) |
| 6400 | { |
| 6401 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6402 | "or a Link Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6403 | nStatus ); |
| 6404 | // We'll fall back on the worst case scenario: |
| 6405 | nPayload = sizeof( tDot11fLinkMeasurementReport ); |
| 6406 | } |
| 6407 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6408 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6409 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6410 | "the packed size for a Link Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6411 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6412 | } |
| 6413 | |
| 6414 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6415 | |
| 6416 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6417 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6418 | { |
| 6419 | 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] | 6420 | "Report."), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6421 | return eSIR_FAILURE; |
| 6422 | } |
| 6423 | |
| 6424 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6425 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6426 | |
| 6427 | // Copy necessary info to BD |
| 6428 | if( eSIR_SUCCESS != |
| 6429 | (statusCode = limPopulateMacHeader( pMac, |
| 6430 | pFrame, |
| 6431 | SIR_MAC_MGMT_FRAME, |
| 6432 | SIR_MAC_MGMT_ACTION, |
| 6433 | peer, psessionEntry->selfMacAddr))) |
| 6434 | goto returnAfterError; |
| 6435 | |
| 6436 | // Update A3 with the BSSID |
| 6437 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6438 | |
| 6439 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 6440 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6441 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 6442 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6443 | #endif |
| 6444 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6445 | // Now, we're ready to "pack" the frames |
| 6446 | nStatus = dot11fPackLinkMeasurementReport( pMac, |
| 6447 | &frm, |
| 6448 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6449 | nPayload, |
| 6450 | &nPayload ); |
| 6451 | |
| 6452 | if( DOT11F_FAILED( nStatus )) |
| 6453 | { |
| 6454 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6455 | FL( "Failed to pack an Link Report (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6456 | nStatus ); |
| 6457 | |
| 6458 | // FIXME - Need to convert to tSirRetStatus |
| 6459 | statusCode = eSIR_FAILURE; |
| 6460 | goto returnAfterError; |
| 6461 | } |
| 6462 | else if( DOT11F_WARNED( nStatus )) |
| 6463 | { |
| 6464 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6465 | FL( "There were warnings while packing Link Report (0x%08x)." ), |
| 6466 | nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6467 | } |
| 6468 | |
| 6469 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6470 | FL( "Sending a Link Report to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6471 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6472 | |
| 6473 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6474 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6475 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6476 | ) |
| 6477 | { |
| 6478 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6479 | } |
| 6480 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6481 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6482 | psessionEntry->peSessionId, |
| 6483 | pMacHdr->fc.subType)); |
| 6484 | halstatus = halTxFrame( pMac, |
| 6485 | pPacket, |
| 6486 | (tANI_U16) nBytes, |
| 6487 | HAL_TXRX_FRM_802_11_MGMT, |
| 6488 | ANI_TXDIR_TODS, |
| 6489 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6490 | limTxComplete, |
| 6491 | pFrame, txFlag ); |
| 6492 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 6493 | psessionEntry->peSessionId, |
| 6494 | halstatus)); |
| 6495 | if( eHAL_STATUS_SUCCESS != halstatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6496 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6497 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6498 | statusCode = eSIR_FAILURE; |
| 6499 | //Pkt will be freed up by the callback |
| 6500 | return statusCode; |
| 6501 | } |
| 6502 | else |
| 6503 | return eSIR_SUCCESS; |
| 6504 | |
| 6505 | returnAfterError: |
| 6506 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 6507 | |
| 6508 | return statusCode; |
| 6509 | } // End limSendLinkReportActionFrame. |
| 6510 | |
| 6511 | /** |
| 6512 | * \brief Send a Beacon Report Action frame |
| 6513 | * |
| 6514 | * |
| 6515 | * \param pMac Pointer to the global MAC structure |
| 6516 | * |
| 6517 | * \param dialog_token dialog token to be used in the action frame. |
| 6518 | * |
| 6519 | * \param num_report number of reports in pRRMReport. |
| 6520 | * |
| 6521 | * \param pRRMReport Address of a tSirMacRadioMeasureReport. |
| 6522 | * |
| 6523 | * \param peer mac address of peer station. |
| 6524 | * |
| 6525 | * \param psessionEntry address of session entry. |
| 6526 | * |
| 6527 | * \return eSIR_SUCCESS on success, eSIR_FAILURE else |
| 6528 | * |
| 6529 | * |
| 6530 | */ |
| 6531 | |
| 6532 | tSirRetStatus |
| 6533 | limSendRadioMeasureReportActionFrame(tpAniSirGlobal pMac, |
| 6534 | tANI_U8 dialog_token, |
| 6535 | tANI_U8 num_report, |
| 6536 | tpSirMacRadioMeasureReport pRRMReport, |
| 6537 | tSirMacAddr peer, |
| 6538 | tpPESession psessionEntry |
| 6539 | ) |
| 6540 | { |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6541 | tSirRetStatus statusCode = eSIR_SUCCESS; |
| 6542 | tANI_U8 *pFrame; |
| 6543 | tpSirMacMgmtHdr pMacHdr; |
| 6544 | tANI_U32 nBytes, nPayload, nStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6545 | void *pPacket; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6546 | eHalStatus halstatus; |
| 6547 | tANI_U8 i; |
| 6548 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6549 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6550 | tDot11fRadioMeasurementReport *frm = |
| 6551 | vos_mem_malloc(sizeof(tDot11fRadioMeasurementReport)); |
| 6552 | if (!frm) { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6553 | limLog( pMac, LOGE, FL("Not enough memory to allocate tDot11fRadioMeasurementReport") ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6554 | return eSIR_FAILURE; |
| 6555 | } |
| 6556 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6557 | if ( psessionEntry == NULL ) |
| 6558 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6559 | 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] | 6560 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6561 | return eSIR_FAILURE; |
| 6562 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6563 | vos_mem_set( ( tANI_U8* )frm, sizeof( *frm ), 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6564 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6565 | frm->Category.category = SIR_MAC_ACTION_RRM; |
| 6566 | frm->Action.action = SIR_MAC_RRM_RADIO_MEASURE_RPT; |
| 6567 | frm->DialogToken.token = dialog_token; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6568 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6569 | 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] | 6570 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6571 | for( i = 0 ; i < frm->num_MeasurementReport ; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6572 | { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6573 | frm->MeasurementReport[i].type = pRRMReport[i].type; |
| 6574 | frm->MeasurementReport[i].token = pRRMReport[i].token; |
| 6575 | 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] | 6576 | switch( pRRMReport[i].type ) |
| 6577 | { |
| 6578 | case SIR_MAC_RRM_BEACON_TYPE: |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6579 | PopulateDot11fBeaconReport( pMac, &frm->MeasurementReport[i], &pRRMReport[i].report.beaconReport ); |
| 6580 | frm->MeasurementReport[i].incapable = pRRMReport[i].incapable; |
| 6581 | frm->MeasurementReport[i].refused = pRRMReport[i].refused; |
| 6582 | frm->MeasurementReport[i].present = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6583 | break; |
| 6584 | default: |
Gopichand Nakkala | 72717fd | 2013-02-08 12:23:45 +0530 | [diff] [blame] | 6585 | frm->MeasurementReport[i].incapable = pRRMReport[i].incapable; |
| 6586 | frm->MeasurementReport[i].refused = pRRMReport[i].refused; |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6587 | frm->MeasurementReport[i].present = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6588 | break; |
| 6589 | } |
| 6590 | } |
| 6591 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6592 | nStatus = dot11fGetPackedRadioMeasurementReportSize( pMac, frm, &nPayload ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6593 | if ( DOT11F_FAILED( nStatus ) ) |
| 6594 | { |
| 6595 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6596 | "or a Radio Measure Report (0x%08x)."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6597 | nStatus ); |
| 6598 | // We'll fall back on the worst case scenario: |
| 6599 | nPayload = sizeof( tDot11fLinkMeasurementReport ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6600 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6601 | return eSIR_FAILURE; |
| 6602 | } |
| 6603 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6604 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6605 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6606 | "the packed size for a Radio Measure Rep" |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6607 | "ort (0x%08x)."), nStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6608 | } |
| 6609 | |
| 6610 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6611 | |
| 6612 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( tANI_U16 )nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6613 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6614 | { |
| 6615 | 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] | 6616 | "Report."), nBytes ); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6617 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6618 | return eSIR_FAILURE; |
| 6619 | } |
| 6620 | |
| 6621 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6622 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6623 | |
| 6624 | // Copy necessary info to BD |
| 6625 | if( eSIR_SUCCESS != |
| 6626 | (statusCode = limPopulateMacHeader( pMac, |
| 6627 | pFrame, |
| 6628 | SIR_MAC_MGMT_FRAME, |
| 6629 | SIR_MAC_MGMT_ACTION, |
| 6630 | peer, psessionEntry->selfMacAddr))) |
| 6631 | goto returnAfterError; |
| 6632 | |
| 6633 | // Update A3 with the BSSID |
| 6634 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6635 | |
| 6636 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 6637 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6638 | #ifdef WLAN_FEATURE_11W |
Chet Lanctot | 4b9abd7 | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 6639 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6640 | #endif |
| 6641 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6642 | // Now, we're ready to "pack" the frames |
| 6643 | nStatus = dot11fPackRadioMeasurementReport( pMac, |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6644 | frm, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6645 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6646 | nPayload, |
| 6647 | &nPayload ); |
| 6648 | |
| 6649 | if( DOT11F_FAILED( nStatus )) |
| 6650 | { |
| 6651 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6652 | FL( "Failed to pack an Radio Measure Report (0x%08x)." ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6653 | nStatus ); |
| 6654 | |
| 6655 | // FIXME - Need to convert to tSirRetStatus |
| 6656 | statusCode = eSIR_FAILURE; |
| 6657 | goto returnAfterError; |
| 6658 | } |
| 6659 | else if( DOT11F_WARNED( nStatus )) |
| 6660 | { |
| 6661 | limLog( pMac, LOGW, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6662 | FL( "There were warnings while packing Radio " |
| 6663 | "Measure Report (0x%08x)." ), nStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6664 | } |
| 6665 | |
| 6666 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6667 | FL( "Sending a Radio Measure Report to " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6668 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6669 | |
| 6670 | if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6671 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6672 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6673 | ) |
| 6674 | { |
| 6675 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6676 | } |
| 6677 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6678 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6679 | psessionEntry->peSessionId, |
| 6680 | pMacHdr->fc.subType)); |
| 6681 | halstatus = halTxFrame( pMac, |
| 6682 | pPacket, |
| 6683 | (tANI_U16) nBytes, |
| 6684 | HAL_TXRX_FRM_802_11_MGMT, |
| 6685 | ANI_TXDIR_TODS, |
| 6686 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6687 | limTxComplete, |
| 6688 | pFrame, txFlag ); |
| 6689 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 6690 | psessionEntry->peSessionId, |
| 6691 | halstatus)); |
| 6692 | if( eHAL_STATUS_SUCCESS != halstatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6693 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 6694 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6695 | statusCode = eSIR_FAILURE; |
| 6696 | //Pkt will be freed up by the callback |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6697 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6698 | return statusCode; |
| 6699 | } |
Madan Mohan Koyyalamudi | eeb56b1 | 2012-10-31 15:10:04 -0700 | [diff] [blame] | 6700 | else { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6701 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6702 | return eSIR_SUCCESS; |
Madan Mohan Koyyalamudi | eeb56b1 | 2012-10-31 15:10:04 -0700 | [diff] [blame] | 6703 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6704 | |
| 6705 | returnAfterError: |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 6706 | vos_mem_free(frm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6707 | 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] | 6708 | return statusCode; |
| 6709 | } // End limSendBeaconReportActionFrame. |
| 6710 | |
| 6711 | #endif |
| 6712 | |
| 6713 | #ifdef WLAN_FEATURE_11W |
| 6714 | /** |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 6715 | * \brief Send SA query request action frame to peer |
| 6716 | * |
| 6717 | * \sa limSendSaQueryRequestFrame |
| 6718 | * |
| 6719 | * |
| 6720 | * \param pMac The global tpAniSirGlobal object |
| 6721 | * |
| 6722 | * \param transId Transaction identifier |
| 6723 | * |
| 6724 | * \param peer The Mac address of the station to which this action frame is addressed |
| 6725 | * |
| 6726 | * \param psessionEntry The PE session entry |
| 6727 | * |
| 6728 | * \return eSIR_SUCCESS if setup completes successfully |
| 6729 | * eSIR_FAILURE is some problem is encountered |
| 6730 | */ |
| 6731 | |
| 6732 | tSirRetStatus limSendSaQueryRequestFrame( tpAniSirGlobal pMac, tANI_U8 *transId, |
| 6733 | tSirMacAddr peer, tpPESession psessionEntry ) |
| 6734 | { |
| 6735 | |
| 6736 | tDot11fSaQueryReq frm; // SA query request action frame |
| 6737 | tANI_U8 *pFrame; |
| 6738 | tSirRetStatus nSirStatus; |
| 6739 | tpSirMacMgmtHdr pMacHdr; |
| 6740 | tANI_U32 nBytes, nPayload, nStatus; |
| 6741 | void *pPacket; |
| 6742 | eHalStatus halstatus; |
| 6743 | tANI_U8 txFlag = 0; |
| 6744 | |
| 6745 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
| 6746 | frm.Category.category = SIR_MAC_ACTION_SA_QUERY; |
| 6747 | /* 11w action field is : |
| 6748 | action: 0 --> SA Query Request action frame |
| 6749 | action: 1 --> SA Query Response action frame */ |
| 6750 | frm.Action.action = SIR_MAC_SA_QUERY_REQ; |
| 6751 | /* 11w SA Query Request transId */ |
| 6752 | vos_mem_copy( &frm.TransactionId.transId[0], &transId[0], 2 ); |
| 6753 | |
| 6754 | nStatus = dot11fGetPackedSaQueryReqSize(pMac, &frm, &nPayload); |
| 6755 | if ( DOT11F_FAILED( nStatus ) ) |
| 6756 | { |
| 6757 | limLog( pMac, LOGP, FL("Failed to calculate the packed size " |
| 6758 | "for an SA Query Request (0x%08x)."), |
| 6759 | nStatus ); |
| 6760 | // We'll fall back on the worst case scenario: |
| 6761 | nPayload = sizeof( tDot11fSaQueryReq ); |
| 6762 | } |
| 6763 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6764 | { |
| 6765 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
| 6766 | "the packed size for an SA Query Request" |
| 6767 | " (0x%08x)."), nStatus ); |
| 6768 | } |
| 6769 | |
| 6770 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6771 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6772 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6773 | { |
| 6774 | limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a SA Query Request " |
| 6775 | "action frame"), nBytes ); |
| 6776 | return eSIR_FAILURE; |
| 6777 | } |
| 6778 | |
| 6779 | // Paranoia: |
| 6780 | vos_mem_set( pFrame, nBytes, 0 ); |
| 6781 | |
| 6782 | // Copy necessary info to BD |
| 6783 | nSirStatus = limPopulateMacHeader( pMac, |
| 6784 | pFrame, |
| 6785 | SIR_MAC_MGMT_FRAME, |
| 6786 | SIR_MAC_MGMT_ACTION, |
| 6787 | peer, psessionEntry->selfMacAddr ); |
| 6788 | if ( eSIR_SUCCESS != nSirStatus ) |
| 6789 | goto returnAfterError; |
| 6790 | |
| 6791 | // Update A3 with the BSSID |
| 6792 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6793 | |
| 6794 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
| 6795 | |
| 6796 | // Since this is a SA Query Request, set the "protect" (aka WEP) bit |
| 6797 | // in the FC |
| 6798 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
| 6799 | |
| 6800 | // Pack 11w SA Query Request frame |
| 6801 | nStatus = dot11fPackSaQueryReq( pMac, |
| 6802 | &frm, |
| 6803 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6804 | nPayload, |
| 6805 | &nPayload ); |
| 6806 | |
| 6807 | if ( DOT11F_FAILED( nStatus )) |
| 6808 | { |
| 6809 | limLog( pMac, LOGE, |
| 6810 | FL( "Failed to pack an SA Query Request (0x%08x)." ), |
| 6811 | nStatus ); |
| 6812 | // FIXME - Need to convert to tSirRetStatus |
| 6813 | nSirStatus = eSIR_FAILURE; |
| 6814 | goto returnAfterError; |
| 6815 | } |
| 6816 | else if ( DOT11F_WARNED( nStatus )) |
| 6817 | { |
| 6818 | limLog( pMac, LOGW, |
| 6819 | FL( "There were warnings while packing SA Query Request (0x%08x)." ), |
| 6820 | nStatus); |
| 6821 | } |
| 6822 | |
| 6823 | limLog( pMac, LOG1, |
| 6824 | FL( "Sending an SA Query Request to " )); |
| 6825 | limPrintMacAddr( pMac, peer, LOG1 ); |
| 6826 | limPrintMacAddr( pMac, peer, LOGE ); |
| 6827 | limLog( pMac, LOGE, |
| 6828 | FL( "Sending an SA Query Request from " )); |
| 6829 | limPrintMacAddr( pMac, psessionEntry->selfMacAddr, LOGE ); |
| 6830 | |
| 6831 | if ( ( SIR_BAND_5_GHZ == limGetRFBand( psessionEntry->currentOperChannel ) ) |
| 6832 | #ifdef WLAN_FEATURE_P2P |
| 6833 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6834 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE ) |
| 6835 | #endif |
| 6836 | ) |
| 6837 | { |
| 6838 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6839 | } |
| 6840 | |
| 6841 | halstatus = halTxFrame( pMac, |
| 6842 | pPacket, |
| 6843 | (tANI_U16) nBytes, |
| 6844 | HAL_TXRX_FRM_802_11_MGMT, |
| 6845 | ANI_TXDIR_TODS, |
| 6846 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6847 | limTxComplete, |
| 6848 | pFrame, txFlag ); |
| 6849 | if ( eHAL_STATUS_SUCCESS != halstatus ) |
| 6850 | { |
| 6851 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
| 6852 | nSirStatus = eSIR_FAILURE; |
| 6853 | //Pkt will be freed up by the callback |
| 6854 | return nSirStatus; |
| 6855 | } |
| 6856 | else { |
| 6857 | return eSIR_SUCCESS; |
| 6858 | } |
| 6859 | |
| 6860 | returnAfterError: |
| 6861 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 6862 | return nSirStatus; |
| 6863 | } // End limSendSaQueryRequestFrame |
| 6864 | |
| 6865 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6866 | * \brief Send SA query response action frame to peer |
| 6867 | * |
| 6868 | * \sa limSendSaQueryResponseFrame |
| 6869 | * |
| 6870 | * |
| 6871 | * \param pMac The global tpAniSirGlobal object |
| 6872 | * |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6873 | * \param transId Transaction identifier received in SA query request action frame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6874 | * |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6875 | * \param peer The Mac address of the AP to which this action frame is addressed |
| 6876 | * |
| 6877 | * \param psessionEntry The PE session entry |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6878 | * |
| 6879 | * \return eSIR_SUCCESS if setup completes successfully |
| 6880 | * eSIR_FAILURE is some problem is encountered |
| 6881 | */ |
| 6882 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6883 | tSirRetStatus limSendSaQueryResponseFrame( tpAniSirGlobal pMac, tANI_U8 *transId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6884 | tSirMacAddr peer,tpPESession psessionEntry) |
| 6885 | { |
| 6886 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6887 | tDot11fSaQueryRsp frm; // SA query reponse action frame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6888 | tANI_U8 *pFrame; |
| 6889 | tSirRetStatus nSirStatus; |
| 6890 | tpSirMacMgmtHdr pMacHdr; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6891 | tANI_U32 nBytes, nPayload, nStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6892 | void *pPacket; |
| 6893 | eHalStatus halstatus; |
Kanchanapally, Vidyullatha | f9426e5 | 2013-12-24 17:28:54 +0530 | [diff] [blame] | 6894 | tANI_U32 txFlag = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6895 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6896 | vos_mem_set( ( tANI_U8* )&frm, sizeof( frm ), 0 ); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6897 | frm.Category.category = SIR_MAC_ACTION_SA_QUERY; |
| 6898 | /*11w action field is : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6899 | action: 0 --> SA query request action frame |
| 6900 | action: 1 --> SA query response action frame */ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6901 | frm.Action.action = SIR_MAC_SA_QUERY_RSP; |
| 6902 | /*11w SA query response transId is same as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6903 | SA query request transId*/ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6904 | vos_mem_copy( &frm.TransactionId.transId[0], &transId[0], 2 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6905 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6906 | nStatus = dot11fGetPackedSaQueryRspSize(pMac, &frm, &nPayload); |
| 6907 | if ( DOT11F_FAILED( nStatus ) ) |
| 6908 | { |
| 6909 | limLog( pMac, LOGP, FL("Failed to calculate the packed size f" |
| 6910 | "or a SA Query Response (0x%08x)."), |
| 6911 | nStatus ); |
| 6912 | // We'll fall back on the worst case scenario: |
| 6913 | nPayload = sizeof( tDot11fSaQueryRsp ); |
| 6914 | } |
| 6915 | else if ( DOT11F_WARNED( nStatus ) ) |
| 6916 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 6917 | limLog( pMac, LOGW, FL("There were warnings while calculating " |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6918 | "the packed size for an SA Query Response" |
| 6919 | " (0x%08x)."), nStatus ); |
| 6920 | } |
| 6921 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6922 | nBytes = nPayload + sizeof( tSirMacMgmtHdr ); |
| 6923 | halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, nBytes, ( void** ) &pFrame, ( void** ) &pPacket ); |
| 6924 | if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) |
| 6925 | { |
| 6926 | 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] | 6927 | " action frame"), nBytes ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6928 | return eSIR_FAILURE; |
| 6929 | } |
| 6930 | |
| 6931 | // Paranoia: |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 6932 | vos_mem_set( pFrame, nBytes, 0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6933 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6934 | // Copy necessary info to BD |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6935 | nSirStatus = limPopulateMacHeader( pMac, |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6936 | pFrame, |
| 6937 | SIR_MAC_MGMT_FRAME, |
| 6938 | SIR_MAC_MGMT_ACTION, |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6939 | peer, psessionEntry->selfMacAddr ); |
| 6940 | if ( eSIR_SUCCESS != nSirStatus ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6941 | goto returnAfterError; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6942 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6943 | // Update A3 with the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6944 | pMacHdr = ( tpSirMacMgmtHdr ) pFrame; |
| 6945 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6946 | sirCopyMacAddr( pMacHdr->bssId, psessionEntry->bssId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6947 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6948 | // Since this is a SA Query Response, set the "protect" (aka WEP) bit |
| 6949 | // in the FC |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 6950 | limSetProtectedBit(pMac, psessionEntry, peer, pMacHdr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6951 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6952 | // Pack 11w SA query response frame |
| 6953 | nStatus = dot11fPackSaQueryRsp( pMac, |
| 6954 | &frm, |
| 6955 | pFrame + sizeof( tSirMacMgmtHdr ), |
| 6956 | nPayload, |
| 6957 | &nPayload ); |
| 6958 | |
| 6959 | if ( DOT11F_FAILED( nStatus )) |
| 6960 | { |
| 6961 | limLog( pMac, LOGE, |
| 6962 | FL( "Failed to pack an SA Query Response (0x%08x)." ), |
| 6963 | nStatus ); |
| 6964 | // FIXME - Need to convert to tSirRetStatus |
| 6965 | nSirStatus = eSIR_FAILURE; |
| 6966 | goto returnAfterError; |
| 6967 | } |
| 6968 | else if ( DOT11F_WARNED( nStatus )) |
| 6969 | { |
| 6970 | limLog( pMac, LOGW, |
| 6971 | FL( "There were warnings while packing SA Query Response (0x%08x)." ), |
| 6972 | nStatus); |
| 6973 | } |
| 6974 | |
| 6975 | limLog( pMac, LOG1, |
| 6976 | FL( "Sending a SA Query Response to " )); |
| 6977 | limPrintMacAddr( pMac, peer, LOGW ); |
| 6978 | |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6979 | if ( ( SIR_BAND_5_GHZ == limGetRFBand( psessionEntry->currentOperChannel ) ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6980 | #ifdef WLAN_FEATURE_P2P |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6981 | || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || |
| 6982 | ( psessionEntry->pePersona == VOS_P2P_GO_MODE ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6983 | #endif |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6984 | ) |
| 6985 | { |
| 6986 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 6987 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 6988 | |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 6989 | MTRACE(macTrace(pMac, TRACE_CODE_TX_MGMT, |
| 6990 | psessionEntry->peSessionId, |
| 6991 | pMacHdr->fc.subType)); |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 6992 | halstatus = halTxFrame( pMac, |
| 6993 | pPacket, |
| 6994 | (tANI_U16) nBytes, |
| 6995 | HAL_TXRX_FRM_802_11_MGMT, |
| 6996 | ANI_TXDIR_TODS, |
| 6997 | 7,//SMAC_SWBD_TX_TID_MGMT_HIGH, |
| 6998 | limTxComplete, |
| 6999 | pFrame, txFlag ); |
Edhar Mahesh Kumar | f956b90 | 2013-12-05 09:35:46 +0530 | [diff] [blame] | 7000 | MTRACE(macTrace(pMac, TRACE_CODE_TX_COMPLETE, |
| 7001 | psessionEntry->peSessionId, |
| 7002 | halstatus)); |
Chet Lanctot | b2b0d55 | 2013-03-22 16:58:44 -0700 | [diff] [blame] | 7003 | if ( eHAL_STATUS_SUCCESS != halstatus ) |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 7004 | { |
| 7005 | PELOGE(limLog( pMac, LOGE, FL( "halTxFrame FAILED! Status [%d]" ), halstatus );) |
| 7006 | nSirStatus = eSIR_FAILURE; |
| 7007 | //Pkt will be freed up by the callback |
| 7008 | return nSirStatus; |
| 7009 | } |
| 7010 | else { |
| 7011 | return eSIR_SUCCESS; |
| 7012 | } |
| 7013 | |
| 7014 | returnAfterError: |
| 7015 | palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); |
| 7016 | return nSirStatus; |
| 7017 | } // End limSendSaQueryResponseFrame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7018 | #endif |