Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2014 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. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 22 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file limSendSmeRspMessages.cc contains the functions |
| 30 | * for sending SME response/notification messages to applications |
| 31 | * above MAC software. |
| 32 | * Author: Chandra Modumudi |
| 33 | * Date: 02/13/02 |
| 34 | * History:- |
| 35 | * Date Modified by Modification Information |
| 36 | * -------------------------------------------------------------------- |
| 37 | */ |
| 38 | |
| 39 | #include "vos_types.h" |
| 40 | #include "wniApi.h" |
| 41 | #include "sirCommon.h" |
| 42 | #include "aniGlobal.h" |
| 43 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 44 | #include "wniCfgSta.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 45 | #include "sysDef.h" |
| 46 | #include "cfgApi.h" |
| 47 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 48 | |
| 49 | #include "schApi.h" |
| 50 | #include "utilsApi.h" |
| 51 | #include "limUtils.h" |
| 52 | #include "limSecurityUtils.h" |
| 53 | #include "limSerDesUtils.h" |
| 54 | #include "limSendSmeRspMessages.h" |
| 55 | #include "limIbssPeerMgmt.h" |
| 56 | #include "limSessionUtils.h" |
| 57 | |
| 58 | |
| 59 | /** |
| 60 | * limSendSmeRsp() |
| 61 | * |
| 62 | *FUNCTION: |
| 63 | * This function is called by limProcessSmeReqMessages() to send |
| 64 | * eWNI_SME_START_RSP, eWNI_SME_MEASUREMENT_RSP, eWNI_SME_STOP_BSS_RSP |
| 65 | * or eWNI_SME_SWITCH_CHL_RSP messages to applications above MAC |
| 66 | * Software. |
| 67 | * |
| 68 | *PARAMS: |
| 69 | * |
| 70 | *LOGIC: |
| 71 | * |
| 72 | *ASSUMPTIONS: |
| 73 | * NA |
| 74 | * |
| 75 | *NOTE: |
| 76 | * NA |
| 77 | * |
| 78 | * @param pMac Pointer to Global MAC structure |
| 79 | * @param msgType Indicates message type |
| 80 | * @param resultCode Indicates the result of previously issued |
| 81 | * eWNI_SME_msgType_REQ message |
| 82 | * |
| 83 | * @return None |
| 84 | */ |
| 85 | |
| 86 | void |
| 87 | limSendSmeRsp(tpAniSirGlobal pMac, tANI_U16 msgType, |
| 88 | tSirResultCodes resultCode,tANI_U8 smesessionId, tANI_U16 smetransactionId) |
| 89 | { |
| 90 | tSirMsgQ mmhMsg; |
| 91 | tSirSmeRsp *pSirSmeRsp; |
| 92 | |
| 93 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 94 | FL("Sending message %s with reasonCode %s"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 95 | limMsgStr(msgType), limResultCodeStr(resultCode));) |
| 96 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 97 | pSirSmeRsp = vos_mem_malloc(sizeof(tSirSmeRsp)); |
| 98 | if ( NULL == pSirSmeRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 99 | { |
| 100 | /// Buffer not available. Log error |
| 101 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 102 | FL("call to AllocateMemory failed for eWNI_SME_*_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 103 | |
| 104 | return; |
| 105 | } |
| 106 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 107 | pSirSmeRsp->messageType = msgType; |
| 108 | pSirSmeRsp->length = sizeof(tSirSmeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | pSirSmeRsp->statusCode = resultCode; |
| 110 | |
| 111 | /* Update SME session Id and Transaction Id */ |
| 112 | pSirSmeRsp->sessionId = smesessionId; |
| 113 | pSirSmeRsp->transactionId = smetransactionId; |
| 114 | |
| 115 | |
| 116 | mmhMsg.type = msgType; |
| 117 | mmhMsg.bodyptr = pSirSmeRsp; |
| 118 | mmhMsg.bodyval = 0; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 119 | MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 120 | |
| 121 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 122 | { |
| 123 | tpPESession psessionEntry = peGetValidPowerSaveSession(pMac); |
| 124 | switch(msgType) |
| 125 | { |
| 126 | case eWNI_PMC_ENTER_BMPS_RSP: |
| 127 | limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_BMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 128 | break; |
| 129 | case eWNI_PMC_EXIT_BMPS_RSP: |
| 130 | limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 131 | break; |
| 132 | case eWNI_PMC_ENTER_IMPS_RSP: |
| 133 | limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_IMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 134 | break; |
| 135 | case eWNI_PMC_EXIT_IMPS_RSP: |
| 136 | limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_IMPS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 137 | break; |
| 138 | case eWNI_PMC_ENTER_UAPSD_RSP: |
| 139 | limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_UAPSD_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 140 | break; |
| 141 | case eWNI_PMC_EXIT_UAPSD_RSP: |
| 142 | limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_UAPSD_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 143 | break; |
| 144 | case eWNI_SME_SWITCH_CHL_RSP: |
| 145 | limDiagEventReport(pMac, WLAN_PE_DIAG_SWITCH_CHL_RSP_EVENT, NULL, (tANI_U16)resultCode, 0); |
| 146 | break; |
| 147 | case eWNI_SME_STOP_BSS_RSP: |
| 148 | limDiagEventReport(pMac, WLAN_PE_DIAG_STOP_BSS_RSP_EVENT, NULL, (tANI_U16)resultCode, 0); |
| 149 | break; |
| 150 | case eWNI_PMC_ENTER_WOWL_RSP: |
| 151 | limDiagEventReport(pMac, WLAN_PE_DIAG_ENTER_WOWL_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 152 | break; |
| 153 | case eWNI_PMC_EXIT_WOWL_RSP: |
| 154 | limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_WOWL_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 155 | break; |
| 156 | } |
| 157 | } |
| 158 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 159 | |
| 160 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 161 | } /*** end limSendSmeRsp() ***/ |
| 162 | |
| 163 | |
| 164 | /** |
| 165 | * limSendSmeJoinReassocRspAfterResume() |
| 166 | * |
| 167 | *FUNCTION: |
| 168 | * This function is called to send Join/Reassoc rsp |
| 169 | * message to SME after the resume link. |
| 170 | * |
| 171 | *PARAMS: |
| 172 | * |
| 173 | *LOGIC: |
| 174 | * |
| 175 | *ASSUMPTIONS: |
| 176 | * NA |
| 177 | * |
| 178 | *NOTE: |
| 179 | * NA |
| 180 | * |
| 181 | * @param pMac Pointer to Global MAC structure |
| 182 | * @param status Resume link status |
| 183 | * @param ctx context passed while calling resmune link. |
| 184 | * (join response to be sent) |
| 185 | * |
| 186 | * @return None |
| 187 | */ |
| 188 | static void limSendSmeJoinReassocRspAfterResume( tpAniSirGlobal pMac, |
| 189 | eHalStatus status, tANI_U32 *ctx) |
| 190 | { |
| 191 | tSirMsgQ mmhMsg; |
| 192 | tpSirSmeJoinRsp pSirSmeJoinRsp = (tpSirSmeJoinRsp) ctx; |
| 193 | |
| 194 | mmhMsg.type = pSirSmeJoinRsp->messageType; |
| 195 | mmhMsg.bodyptr = pSirSmeJoinRsp; |
| 196 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 197 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 198 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 199 | } |
| 200 | |
c_hpothu | 44ff4e0 | 2014-05-08 00:13:57 +0530 | [diff] [blame] | 201 | /** |
| 202 | * limGetMaxRateFlags() |
| 203 | * |
| 204 | *FUNCTION: |
| 205 | *This function is called by limSendSmeJoinReassocRsp get rateFlags. |
| 206 | *These rateflags are used when MAX link-speed need to be reported |
| 207 | *to UI. |
| 208 | * |
| 209 | *PARAMS: |
| 210 | * @param pStaDs - Pointer to internal STA Datastructure |
| 211 | * @param psessionEntry - Pointer to the session entry |
| 212 | * |
| 213 | *LOGIC: |
| 214 | * |
| 215 | *ASSUMPTIONS: |
| 216 | * |
| 217 | *NOTE: |
| 218 | * |
| 219 | * @return rateFlags |
| 220 | */ |
| 221 | tANI_U32 limGetMaxRateFlags(tpDphHashNode pStaDs, tpPESession psessionEntry) |
| 222 | { |
| 223 | tANI_U32 rate_flags = 0; |
| 224 | |
| 225 | if (NULL == psessionEntry) |
| 226 | { |
| 227 | return rate_flags; |
| 228 | } |
| 229 | |
| 230 | if(!IS_DOT11_MODE_HT(psessionEntry->dot11mode) && |
| 231 | !IS_DOT11_MODE_VHT(psessionEntry->dot11mode)) |
| 232 | { |
| 233 | rate_flags |= eHAL_TX_RATE_LEGACY; |
| 234 | } |
| 235 | else |
| 236 | { |
| 237 | if(IS_DOT11_MODE_HT(psessionEntry->dot11mode)) |
| 238 | { |
| 239 | if (pStaDs->htShortGI20Mhz || pStaDs->htShortGI40Mhz ) |
| 240 | rate_flags |= eHAL_TX_RATE_SGI; |
| 241 | |
c_hpothu | 5eb1a8e | 2014-05-23 17:21:00 +0530 | [diff] [blame] | 242 | if (pStaDs->htSupportedChannelWidthSet) |
c_hpothu | 44ff4e0 | 2014-05-08 00:13:57 +0530 | [diff] [blame] | 243 | rate_flags |=eHAL_TX_RATE_HT40; |
| 244 | else |
| 245 | rate_flags |=eHAL_TX_RATE_HT20; |
| 246 | } |
| 247 | #ifdef WLAN_FEATURE_11AC |
| 248 | if(IS_DOT11_MODE_VHT(psessionEntry->dot11mode)) |
| 249 | { |
c_hpothu | d65d218 | 2014-06-06 21:18:17 +0530 | [diff] [blame^] | 250 | if (WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ == |
| 251 | pStaDs->vhtSupportedChannelWidthSet) |
| 252 | { |
c_hpothu | 44ff4e0 | 2014-05-08 00:13:57 +0530 | [diff] [blame] | 253 | rate_flags |= eHAL_TX_RATE_VHT80; |
c_hpothu | d65d218 | 2014-06-06 21:18:17 +0530 | [diff] [blame^] | 254 | } |
| 255 | else if(WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ == |
| 256 | pStaDs->vhtSupportedChannelWidthSet) |
| 257 | { |
| 258 | if (eHT_CHANNEL_WIDTH_40MHZ == |
| 259 | pStaDs->htSupportedChannelWidthSet) |
| 260 | rate_flags |= eHAL_TX_RATE_VHT40; |
| 261 | else |
| 262 | rate_flags |= eHAL_TX_RATE_VHT20; |
| 263 | } |
c_hpothu | 44ff4e0 | 2014-05-08 00:13:57 +0530 | [diff] [blame] | 264 | } |
c_hpothu | d65d218 | 2014-06-06 21:18:17 +0530 | [diff] [blame^] | 265 | else |
| 266 | rate_flags |= eHAL_TX_RATE_VHT20; |
c_hpothu | 44ff4e0 | 2014-05-08 00:13:57 +0530 | [diff] [blame] | 267 | #endif |
| 268 | } |
| 269 | |
| 270 | return rate_flags; |
| 271 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 272 | |
| 273 | /** |
| 274 | * limSendSmeJoinReassocRsp() |
| 275 | * |
| 276 | *FUNCTION: |
| 277 | * This function is called by limProcessSmeReqMessages() to send |
| 278 | * eWNI_SME_JOIN_RSP or eWNI_SME_REASSOC_RSP messages to applications |
| 279 | * above MAC Software. |
| 280 | * |
| 281 | *PARAMS: |
| 282 | * |
| 283 | *LOGIC: |
| 284 | * |
| 285 | *ASSUMPTIONS: |
| 286 | * NA |
| 287 | * |
| 288 | *NOTE: |
| 289 | * NA |
| 290 | * |
| 291 | * @param pMac Pointer to Global MAC structure |
| 292 | * @param msgType Indicates message type |
| 293 | * @param resultCode Indicates the result of previously issued |
| 294 | * eWNI_SME_msgType_REQ message |
| 295 | * |
| 296 | * @return None |
| 297 | */ |
| 298 | |
| 299 | void |
| 300 | limSendSmeJoinReassocRsp(tpAniSirGlobal pMac, tANI_U16 msgType, |
| 301 | tSirResultCodes resultCode, tANI_U16 protStatusCode, |
| 302 | tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId) |
| 303 | { |
| 304 | tpSirSmeJoinRsp pSirSmeJoinRsp; |
| 305 | tANI_U32 rspLen; |
| 306 | tpDphHashNode pStaDs = NULL; |
| 307 | |
| 308 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 309 | if (msgType == eWNI_SME_REASSOC_RSP) |
| 310 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 311 | else |
| 312 | limDiagEventReport(pMac, WLAN_PE_DIAG_JOIN_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 313 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 314 | |
| 315 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 316 | FL("Sending message %s with reasonCode %s"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 317 | limMsgStr(msgType), limResultCodeStr(resultCode));) |
| 318 | |
| 319 | if(psessionEntry == NULL) |
| 320 | { |
| 321 | |
| 322 | rspLen = sizeof(tSirSmeJoinRsp); |
| 323 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 324 | pSirSmeJoinRsp = vos_mem_malloc(rspLen); |
| 325 | if ( NULL == pSirSmeJoinRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 326 | { |
| 327 | /// Buffer not available. Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 328 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for JOIN/REASSOC_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 329 | return; |
| 330 | } |
| 331 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 332 | vos_mem_set((tANI_U8*)pSirSmeJoinRsp, rspLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 333 | |
| 334 | |
| 335 | pSirSmeJoinRsp->beaconLength = 0; |
| 336 | pSirSmeJoinRsp->assocReqLength = 0; |
| 337 | pSirSmeJoinRsp->assocRspLength = 0; |
| 338 | } |
| 339 | |
| 340 | else |
| 341 | { |
| 342 | rspLen = psessionEntry->assocReqLen + psessionEntry->assocRspLen + |
| 343 | psessionEntry->bcnLen + |
| 344 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 345 | psessionEntry->RICDataLen + |
| 346 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 347 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 348 | psessionEntry->tspecLen + |
| 349 | #endif |
| 350 | sizeof(tSirSmeJoinRsp) - sizeof(tANI_U8) ; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 351 | |
| 352 | pSirSmeJoinRsp = vos_mem_malloc(rspLen); |
| 353 | if ( NULL == pSirSmeJoinRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 354 | { |
| 355 | /// Buffer not available. Log error |
| 356 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 357 | FL("call to AllocateMemory failed for JOIN/REASSOC_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 358 | |
| 359 | return; |
| 360 | } |
| 361 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 362 | vos_mem_set((tANI_U8*)pSirSmeJoinRsp, rspLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 363 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 364 | if (resultCode == eSIR_SME_SUCCESS) |
| 365 | { |
| 366 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 367 | if (pStaDs == NULL) |
| 368 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 369 | PELOGE(limLog(pMac, LOGE, FL("could not Get Self Entry for the station"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 370 | } |
| 371 | else |
| 372 | { |
Jeff Johnson | 62c2798 | 2013-02-27 17:53:55 -0800 | [diff] [blame] | 373 | //Pass the peer's staId |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 374 | pSirSmeJoinRsp->staId = pStaDs->staIndex; |
Jeff Johnson | 62c2798 | 2013-02-27 17:53:55 -0800 | [diff] [blame] | 375 | pSirSmeJoinRsp->ucastSig = pStaDs->ucUcastSig; |
| 376 | pSirSmeJoinRsp->bcastSig = pStaDs->ucBcastSig; |
c_hpothu | 44ff4e0 | 2014-05-08 00:13:57 +0530 | [diff] [blame] | 377 | pSirSmeJoinRsp->maxRateFlags = |
| 378 | limGetMaxRateFlags(pStaDs, psessionEntry); |
| 379 | PELOGE(limLog(pMac, LOG1, FL("maxRateFlags: %x"), |
| 380 | pSirSmeJoinRsp->maxRateFlags);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 381 | } |
| 382 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | |
| 384 | pSirSmeJoinRsp->beaconLength = 0; |
| 385 | pSirSmeJoinRsp->assocReqLength = 0; |
| 386 | pSirSmeJoinRsp->assocRspLength = 0; |
| 387 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 388 | pSirSmeJoinRsp->parsedRicRspLen = 0; |
| 389 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 390 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 391 | pSirSmeJoinRsp->tspecIeLen = 0; |
| 392 | #endif |
| 393 | |
| 394 | if(resultCode == eSIR_SME_SUCCESS) |
| 395 | { |
| 396 | |
| 397 | if(psessionEntry->beacon != NULL) |
| 398 | { |
| 399 | pSirSmeJoinRsp->beaconLength = psessionEntry->bcnLen; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 400 | vos_mem_copy( pSirSmeJoinRsp->frames, psessionEntry->beacon, |
| 401 | pSirSmeJoinRsp->beaconLength); |
| 402 | vos_mem_free( psessionEntry->beacon); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 403 | psessionEntry->beacon = NULL; |
| 404 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 405 | PELOG1(limLog(pMac, LOG1, FL("Beacon=%d"), psessionEntry->bcnLen);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 406 | #endif |
| 407 | } |
| 408 | |
| 409 | if(psessionEntry->assocReq != NULL) |
| 410 | { |
| 411 | pSirSmeJoinRsp->assocReqLength = psessionEntry->assocReqLen; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 412 | vos_mem_copy( pSirSmeJoinRsp->frames + psessionEntry->bcnLen, |
| 413 | psessionEntry->assocReq, pSirSmeJoinRsp->assocReqLength); |
| 414 | vos_mem_free( psessionEntry->assocReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 415 | psessionEntry->assocReq = NULL; |
| 416 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 417 | PELOG1(limLog(pMac, LOG1, FL("AssocReq=%d"), psessionEntry->assocReqLen);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 418 | #endif |
| 419 | } |
| 420 | if(psessionEntry->assocRsp != NULL) |
| 421 | { |
| 422 | pSirSmeJoinRsp->assocRspLength = psessionEntry->assocRspLen; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 423 | vos_mem_copy( pSirSmeJoinRsp->frames + psessionEntry->bcnLen + |
| 424 | psessionEntry->assocReqLen, |
| 425 | psessionEntry->assocRsp, |
| 426 | pSirSmeJoinRsp->assocRspLength); |
| 427 | vos_mem_free( psessionEntry->assocRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 428 | psessionEntry->assocRsp = NULL; |
| 429 | } |
| 430 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 431 | if(psessionEntry->ricData != NULL) |
| 432 | { |
| 433 | pSirSmeJoinRsp->parsedRicRspLen = psessionEntry->RICDataLen; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 434 | vos_mem_copy( pSirSmeJoinRsp->frames + psessionEntry->bcnLen + |
| 435 | psessionEntry->assocReqLen + psessionEntry->assocRspLen, |
| 436 | psessionEntry->ricData, pSirSmeJoinRsp->parsedRicRspLen); |
| 437 | vos_mem_free(psessionEntry->ricData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 438 | psessionEntry->ricData = NULL; |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 439 | PELOG1(limLog(pMac, LOG1, FL("RicLength=%d"), pSirSmeJoinRsp->parsedRicRspLen);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 440 | } |
| 441 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 442 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 443 | if(psessionEntry->tspecIes != NULL) |
| 444 | { |
| 445 | pSirSmeJoinRsp->tspecIeLen = psessionEntry->tspecLen; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 446 | vos_mem_copy( pSirSmeJoinRsp->frames + psessionEntry->bcnLen + |
| 447 | psessionEntry->assocReqLen + psessionEntry->assocRspLen + |
| 448 | psessionEntry->RICDataLen, |
| 449 | psessionEntry->tspecIes, pSirSmeJoinRsp->tspecIeLen); |
| 450 | vos_mem_free(psessionEntry->tspecIes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 451 | psessionEntry->tspecIes = NULL; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 452 | PELOG1(limLog(pMac, LOG1, FL("ESE-TspecLen=%d"), psessionEntry->tspecLen);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 453 | } |
| 454 | #endif |
| 455 | pSirSmeJoinRsp->aid = psessionEntry->limAID; |
| 456 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 457 | PELOG1(limLog(pMac, LOG1, FL("AssocRsp=%d"), psessionEntry->assocRspLen);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 458 | #endif |
| 459 | } |
Madan Mohan Koyyalamudi | b666eb1 | 2012-09-18 17:29:47 -0700 | [diff] [blame] | 460 | else |
| 461 | { |
| 462 | |
| 463 | if(psessionEntry->beacon != NULL) |
| 464 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 465 | vos_mem_free(psessionEntry->beacon); |
Madan Mohan Koyyalamudi | b666eb1 | 2012-09-18 17:29:47 -0700 | [diff] [blame] | 466 | psessionEntry->beacon = NULL; |
| 467 | } |
| 468 | |
| 469 | if(psessionEntry->assocReq != NULL) |
| 470 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 471 | vos_mem_free( psessionEntry->assocReq); |
Madan Mohan Koyyalamudi | b666eb1 | 2012-09-18 17:29:47 -0700 | [diff] [blame] | 472 | psessionEntry->assocReq = NULL; |
| 473 | } |
| 474 | |
| 475 | if(psessionEntry->assocRsp != NULL) |
| 476 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 477 | vos_mem_free( psessionEntry->assocRsp); |
Madan Mohan Koyyalamudi | b666eb1 | 2012-09-18 17:29:47 -0700 | [diff] [blame] | 478 | psessionEntry->assocRsp = NULL; |
| 479 | } |
| 480 | |
| 481 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | } |
| 483 | |
| 484 | |
| 485 | pSirSmeJoinRsp->messageType = msgType; |
| 486 | pSirSmeJoinRsp->length = (tANI_U16) rspLen; |
| 487 | pSirSmeJoinRsp->statusCode = resultCode; |
| 488 | pSirSmeJoinRsp->protStatusCode = protStatusCode; |
| 489 | |
| 490 | /* Update SME session ID and transaction Id */ |
| 491 | pSirSmeJoinRsp->sessionId = smesessionId; |
| 492 | pSirSmeJoinRsp->transactionId = smetransactionId; |
| 493 | |
| 494 | if(IS_MCC_SUPPORTED && limIsLinkSuspended( pMac ) ) |
| 495 | { |
| 496 | if( psessionEntry && psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE ) |
| 497 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 498 | |
| 499 | #ifdef WLAN_FEATURE_11AC |
| 500 | if (psessionEntry->vhtCapability) |
| 501 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 502 | ePhyChanBondState htSecondaryChannelOffset; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 503 | /*Get 11ac cbState from 11n cbState*/ |
| 504 | htSecondaryChannelOffset = limGet11ACPhyCBState(pMac, |
| 505 | psessionEntry->currentOperChannel, |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 506 | psessionEntry->htSecondaryChannelOffset, |
| 507 | psessionEntry->apCenterChan, |
| 508 | psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 509 | peSetResumeChannel( pMac, psessionEntry->currentOperChannel, htSecondaryChannelOffset); |
| 510 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 511 | else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 512 | #endif |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 513 | peSetResumeChannel( pMac, psessionEntry->currentOperChannel, psessionEntry->htSecondaryChannelOffset); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 514 | } |
| 515 | else |
| 516 | { |
| 517 | peSetResumeChannel( pMac, 0, 0); |
| 518 | } |
| 519 | limResumeLink( pMac, limSendSmeJoinReassocRspAfterResume, |
| 520 | (tANI_U32*) pSirSmeJoinRsp ); |
| 521 | } |
| 522 | else |
| 523 | { |
| 524 | limSendSmeJoinReassocRspAfterResume( pMac, eHAL_STATUS_SUCCESS, |
| 525 | (tANI_U32*) pSirSmeJoinRsp ); |
| 526 | } |
| 527 | } /*** end limSendSmeJoinReassocRsp() ***/ |
| 528 | |
| 529 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 530 | /** |
| 531 | * limSendSmeStartBssRsp() |
| 532 | * |
| 533 | *FUNCTION: |
| 534 | * This function is called to send eWNI_SME_START_BSS_RSP |
| 535 | * message to applications above MAC Software. |
| 536 | * |
| 537 | *PARAMS: |
| 538 | * |
| 539 | *LOGIC: |
| 540 | * |
| 541 | *ASSUMPTIONS: |
| 542 | * NA |
| 543 | * |
| 544 | *NOTE: |
| 545 | * NA |
| 546 | * |
| 547 | * @param pMac Pointer to Global MAC structure |
| 548 | * @param msgType Indicates message type |
| 549 | * @param resultCode Indicates the result of previously issued |
| 550 | * eWNI_SME_msgType_REQ message |
| 551 | * |
| 552 | * @return None |
| 553 | */ |
| 554 | |
| 555 | void |
| 556 | limSendSmeStartBssRsp(tpAniSirGlobal pMac, |
| 557 | tANI_U16 msgType, tSirResultCodes resultCode,tpPESession psessionEntry, |
| 558 | tANI_U8 smesessionId,tANI_U16 smetransactionId) |
| 559 | { |
| 560 | |
| 561 | |
| 562 | tANI_U16 size = 0; |
| 563 | tSirMsgQ mmhMsg; |
| 564 | tSirSmeStartBssRsp *pSirSmeRsp; |
| 565 | tANI_U16 ieLen; |
| 566 | tANI_U16 ieOffset, curLen; |
| 567 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 568 | PELOG1(limLog(pMac, LOG1, FL("Sending message %s with reasonCode %s"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 569 | limMsgStr(msgType), limResultCodeStr(resultCode));) |
| 570 | |
| 571 | size = sizeof(tSirSmeStartBssRsp); |
| 572 | |
| 573 | if(psessionEntry == NULL) |
| 574 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 575 | pSirSmeRsp = vos_mem_malloc(size); |
| 576 | if ( NULL == pSirSmeRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 577 | { |
| 578 | /// Buffer not available. Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 579 | limLog(pMac, LOGP,FL("call to AllocateMemory failed for eWNI_SME_START_BSS_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 580 | return; |
| 581 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 582 | vos_mem_set((tANI_U8*)pSirSmeRsp, size, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 583 | |
| 584 | } |
| 585 | else |
| 586 | { |
| 587 | //subtract size of beaconLength + Mac Hdr + Fixed Fields before SSID |
| 588 | ieOffset = sizeof(tAniBeaconStruct) + SIR_MAC_B_PR_SSID_OFFSET; |
| 589 | ieLen = pMac->sch.schObject.gSchBeaconOffsetBegin + pMac->sch.schObject.gSchBeaconOffsetEnd - ieOffset; |
| 590 | //calculate the memory size to allocate |
| 591 | size += ieLen; |
| 592 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 593 | pSirSmeRsp = vos_mem_malloc(size); |
| 594 | if ( NULL == pSirSmeRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 595 | { |
| 596 | /// Buffer not available. Log error |
| 597 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 598 | FL("call to AllocateMemory failed for eWNI_SME_START_BSS_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 599 | |
| 600 | return; |
| 601 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 602 | vos_mem_set((tANI_U8*)pSirSmeRsp, size, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 603 | size = sizeof(tSirSmeStartBssRsp); |
| 604 | if (resultCode == eSIR_SME_SUCCESS) |
| 605 | { |
| 606 | |
| 607 | sirCopyMacAddr(pSirSmeRsp->bssDescription.bssId, psessionEntry->bssId); |
| 608 | |
| 609 | /* Read beacon interval from session */ |
| 610 | pSirSmeRsp->bssDescription.beaconInterval = (tANI_U16) psessionEntry->beaconParams.beaconInterval; |
| 611 | pSirSmeRsp->bssType = psessionEntry->bssType; |
| 612 | |
| 613 | if (cfgGetCapabilityInfo( pMac, &pSirSmeRsp->bssDescription.capabilityInfo,psessionEntry) |
| 614 | != eSIR_SUCCESS) |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 615 | limLog(pMac, LOGP, FL("could not retrieve Capabilities value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 616 | |
| 617 | limGetPhyMode(pMac, (tANI_U32 *)&pSirSmeRsp->bssDescription.nwType, psessionEntry); |
| 618 | |
| 619 | #if 0 |
| 620 | if (wlan_cfgGetInt(pMac, WNI_CFG_CURRENT_CHANNEL, &len) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 621 | limLog(pMac, LOGP, FL("could not retrieve CURRENT_CHANNEL from CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 622 | |
| 623 | #endif// TO SUPPORT BT-AMP |
| 624 | |
| 625 | pSirSmeRsp->bssDescription.channelId = psessionEntry->currentOperChannel; |
| 626 | |
| 627 | pSirSmeRsp->bssDescription.aniIndicator = 1; |
| 628 | |
| 629 | curLen = pMac->sch.schObject.gSchBeaconOffsetBegin - ieOffset; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 630 | vos_mem_copy( (tANI_U8 *) &pSirSmeRsp->bssDescription.ieFields, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 631 | pMac->sch.schObject.gSchBeaconFrameBegin + ieOffset, |
| 632 | (tANI_U32)curLen); |
| 633 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 634 | vos_mem_copy( ((tANI_U8 *) &pSirSmeRsp->bssDescription.ieFields) + curLen, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 635 | pMac->sch.schObject.gSchBeaconFrameEnd, |
| 636 | (tANI_U32)pMac->sch.schObject.gSchBeaconOffsetEnd); |
| 637 | |
| 638 | |
| 639 | //subtracting size of length indicator itself and size of pointer to ieFields |
| 640 | pSirSmeRsp->bssDescription.length = sizeof(tSirBssDescription) - |
| 641 | sizeof(tANI_U16) - sizeof(tANI_U32) + |
| 642 | ieLen; |
| 643 | //This is the size of the message, subtracting the size of the pointer to ieFields |
| 644 | size += ieLen - sizeof(tANI_U32); |
| 645 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 646 | } |
| 647 | |
| 648 | pSirSmeRsp->messageType = msgType; |
| 649 | pSirSmeRsp->length = size; |
| 650 | |
| 651 | /* Update SME session Id and transaction Id */ |
| 652 | pSirSmeRsp->sessionId = smesessionId; |
| 653 | pSirSmeRsp->transactionId = smetransactionId; |
| 654 | pSirSmeRsp->statusCode = resultCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 655 | if(psessionEntry != NULL ) |
| 656 | pSirSmeRsp->staId = psessionEntry->staId; //else it will be always zero smeRsp StaID = 0 |
| 657 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 658 | |
| 659 | mmhMsg.type = msgType; |
| 660 | mmhMsg.bodyptr = pSirSmeRsp; |
| 661 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 662 | if(psessionEntry == NULL) |
| 663 | { |
| 664 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
| 665 | } |
| 666 | else |
| 667 | { |
| 668 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
| 669 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 670 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 671 | limDiagEventReport(pMac, WLAN_PE_DIAG_START_BSS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 672 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 673 | |
| 674 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 675 | } /*** end limSendSmeStartBssRsp() ***/ |
| 676 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 677 | #define LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED 20 |
| 678 | #define LIM_SIZE_OF_EACH_BSS 400 // this is a rough estimate |
| 679 | |
| 680 | |
| 681 | /** |
| 682 | * limSendSmeScanRsp() |
| 683 | * |
| 684 | *FUNCTION: |
| 685 | * This function is called by limProcessSmeReqMessages() to send |
| 686 | * eWNI_SME_SCAN_RSP message to applications above MAC |
| 687 | * Software. |
| 688 | * |
| 689 | *PARAMS: |
| 690 | * |
| 691 | *LOGIC: |
| 692 | * |
| 693 | *ASSUMPTIONS: |
| 694 | * NA |
| 695 | * |
| 696 | *NOTE: |
| 697 | * NA |
| 698 | * |
| 699 | * @param pMac Pointer to Global MAC structure |
| 700 | * @param length Indicates length of message |
| 701 | * @param resultCode Indicates the result of previously issued |
| 702 | * eWNI_SME_SCAN_REQ message |
| 703 | * |
| 704 | * @return None |
| 705 | */ |
| 706 | |
| 707 | void |
| 708 | limSendSmeScanRsp(tpAniSirGlobal pMac, tANI_U16 length, |
| 709 | tSirResultCodes resultCode,tANI_U8 smesessionId,tANI_U16 smetranscationId) |
| 710 | { |
| 711 | tSirMsgQ mmhMsg; |
| 712 | tpSirSmeScanRsp pSirSmeScanRsp=NULL; |
| 713 | tLimScanResultNode *ptemp = NULL; |
| 714 | tANI_U16 msgLen, allocLength, curMsgLen = 0; |
| 715 | tANI_U16 i, bssCount; |
| 716 | tANI_U8 *pbBuf; |
| 717 | tSirBssDescription *pDesc; |
| 718 | |
| 719 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 720 | FL("Sending message SME_SCAN_RSP with length=%d reasonCode %s"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 721 | length, limResultCodeStr(resultCode));) |
| 722 | |
| 723 | if (resultCode != eSIR_SME_SUCCESS) |
| 724 | { |
| 725 | limPostSmeScanRspMessage(pMac, length, resultCode,smesessionId,smetranscationId); |
| 726 | return; |
| 727 | } |
| 728 | |
| 729 | mmhMsg.type = eWNI_SME_SCAN_RSP; |
| 730 | i = 0; |
| 731 | bssCount = 0; |
| 732 | msgLen = 0; |
| 733 | allocLength = LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED * LIM_SIZE_OF_EACH_BSS; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 734 | pSirSmeScanRsp = vos_mem_malloc(allocLength); |
| 735 | if ( NULL == pSirSmeScanRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 736 | { |
| 737 | // Log error |
| 738 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 739 | FL("call to AllocateMemory failed for eWNI_SME_SCAN_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 740 | |
| 741 | return; |
| 742 | } |
| 743 | for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++) |
| 744 | { |
| 745 | //when ptemp is not NULL it is a left over |
| 746 | ptemp = pMac->lim.gLimCachedScanHashTable[i]; |
| 747 | while(ptemp) |
| 748 | { |
| 749 | pbBuf = ((tANI_U8 *)pSirSmeScanRsp) + msgLen; |
| 750 | if(0 == bssCount) |
| 751 | { |
| 752 | msgLen = sizeof(tSirSmeScanRsp) - |
| 753 | sizeof(tSirBssDescription) + |
| 754 | ptemp->bssDescription.length + |
| 755 | sizeof(ptemp->bssDescription.length); |
| 756 | pDesc = pSirSmeScanRsp->bssDescription; |
| 757 | } |
| 758 | else |
| 759 | { |
| 760 | msgLen += ptemp->bssDescription.length + |
| 761 | sizeof(ptemp->bssDescription.length); |
| 762 | pDesc = (tSirBssDescription *)pbBuf; |
| 763 | } |
| 764 | if( (allocLength < msgLen) || |
| 765 | (LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED <= bssCount++) ) |
| 766 | { |
| 767 | pSirSmeScanRsp->statusCode = |
| 768 | eSIR_SME_MORE_SCAN_RESULTS_FOLLOW; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 769 | pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP; |
| 770 | pSirSmeScanRsp->length = curMsgLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 771 | mmhMsg.bodyptr = pSirSmeScanRsp; |
| 772 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 773 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 774 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 775 | pSirSmeScanRsp = vos_mem_malloc(allocLength); |
| 776 | if ( NULL == pSirSmeScanRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 777 | { |
| 778 | // Log error |
| 779 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 780 | FL("call to AllocateMemory failed for eWNI_SME_SCAN_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 781 | return; |
| 782 | } |
| 783 | msgLen = sizeof(tSirSmeScanRsp) - |
| 784 | sizeof(tSirBssDescription) + |
| 785 | ptemp->bssDescription.length + |
| 786 | sizeof(ptemp->bssDescription.length); |
| 787 | pDesc = pSirSmeScanRsp->bssDescription; |
| 788 | bssCount = 1; |
| 789 | } |
| 790 | curMsgLen = msgLen; |
| 791 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 792 | PELOG2(limLog(pMac, LOG2, FL("ScanRsp : msgLen %d, bssDescr Len=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 793 | msgLen, ptemp->bssDescription.length);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 794 | pDesc->length |
| 795 | = ptemp->bssDescription.length; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 796 | vos_mem_copy( (tANI_U8 *) &pDesc->bssId, |
| 797 | (tANI_U8 *) &ptemp->bssDescription.bssId, |
| 798 | ptemp->bssDescription.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 799 | |
| 800 | PELOG2(limLog(pMac, LOG2, FL("BssId ")); |
| 801 | limPrintMacAddr(pMac, ptemp->bssDescription.bssId, LOG2);) |
| 802 | |
| 803 | pSirSmeScanRsp->sessionId = smesessionId; |
| 804 | pSirSmeScanRsp->transcationId = smetranscationId; |
| 805 | |
| 806 | ptemp = ptemp->next; |
| 807 | } //while(ptemp) |
| 808 | } //for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++) |
| 809 | |
| 810 | if(0 == bssCount) |
| 811 | { |
| 812 | limPostSmeScanRspMessage(pMac, length, resultCode, smesessionId, smetranscationId); |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 813 | if (NULL != pSirSmeScanRsp) |
| 814 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 815 | vos_mem_free( pSirSmeScanRsp); |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 816 | pSirSmeScanRsp = NULL; |
| 817 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 818 | } |
| 819 | else |
| 820 | { |
| 821 | // send last message |
| 822 | pSirSmeScanRsp->statusCode = eSIR_SME_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 823 | pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP; |
| 824 | pSirSmeScanRsp->length = curMsgLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 825 | |
| 826 | /* Update SME session Id and SME transcation Id */ |
| 827 | pSirSmeScanRsp->sessionId = smesessionId; |
| 828 | pSirSmeScanRsp->transcationId = smetranscationId; |
| 829 | |
| 830 | mmhMsg.type = eWNI_SME_SCAN_RSP; |
| 831 | mmhMsg.bodyptr = pSirSmeScanRsp; |
| 832 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 833 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 834 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 835 | PELOG2(limLog(pMac, LOG2, FL("statusCode : eSIR_SME_SUCCESS"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 836 | } |
| 837 | |
| 838 | return; |
| 839 | |
| 840 | } /*** end limSendSmeScanRsp() ***/ |
| 841 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 842 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 843 | /** |
| 844 | * limSendSmeLfrScanRsp() |
| 845 | * |
| 846 | *FUNCTION: |
| 847 | * This function is called by limProcessSmeReqMessages() to send |
| 848 | * eWNI_SME_SCAN_RSP message to applications above MAC Software |
| 849 | * only for sending up the roam candidates. |
| 850 | * |
| 851 | *PARAMS: |
| 852 | * |
| 853 | *LOGIC: |
| 854 | * |
| 855 | *ASSUMPTIONS: |
| 856 | * NA |
| 857 | * |
| 858 | *NOTE: |
| 859 | * NA |
| 860 | * |
| 861 | * @param pMac Pointer to Global MAC structure |
| 862 | * @param length Indicates length of message |
| 863 | * @param resultCode Indicates the result of previously issued |
| 864 | * eWNI_SME_SCAN_REQ message |
| 865 | * |
| 866 | * @return None |
| 867 | */ |
| 868 | |
| 869 | void |
| 870 | limSendSmeLfrScanRsp(tpAniSirGlobal pMac, tANI_U16 length, |
| 871 | tSirResultCodes resultCode,tANI_U8 smesessionId,tANI_U16 smetranscationId) |
| 872 | { |
| 873 | tSirMsgQ mmhMsg; |
| 874 | tpSirSmeScanRsp pSirSmeScanRsp=NULL; |
| 875 | tLimScanResultNode *ptemp = NULL; |
| 876 | tANI_U16 msgLen, allocLength, curMsgLen = 0; |
| 877 | tANI_U16 i, bssCount; |
| 878 | tANI_U8 *pbBuf; |
| 879 | tSirBssDescription *pDesc; |
| 880 | |
| 881 | PELOG1(limLog(pMac, LOG1, |
| 882 | FL("Sending message SME_SCAN_RSP with length=%d reasonCode %s\n"), |
| 883 | length, limResultCodeStr(resultCode));) |
| 884 | |
| 885 | if (resultCode != eSIR_SME_SUCCESS) |
| 886 | { |
| 887 | limPostSmeScanRspMessage(pMac, length, resultCode,smesessionId,smetranscationId); |
| 888 | return; |
| 889 | } |
| 890 | |
| 891 | mmhMsg.type = eWNI_SME_SCAN_RSP; |
| 892 | i = 0; |
| 893 | bssCount = 0; |
| 894 | msgLen = 0; |
| 895 | allocLength = LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED * LIM_SIZE_OF_EACH_BSS; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 896 | pSirSmeScanRsp = vos_mem_malloc(allocLength); |
| 897 | if ( NULL == pSirSmeScanRsp ) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 898 | { |
| 899 | // Log error |
| 900 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 901 | FL("call to AllocateMemory failed for eWNI_SME_SCAN_RSP\n")); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 902 | |
| 903 | return; |
| 904 | } |
| 905 | for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++) |
| 906 | { |
| 907 | //when ptemp is not NULL it is a left over |
| 908 | ptemp = pMac->lim.gLimCachedLfrScanHashTable[i]; |
| 909 | while(ptemp) |
| 910 | { |
| 911 | pbBuf = ((tANI_U8 *)pSirSmeScanRsp) + msgLen; |
| 912 | if(0 == bssCount) |
| 913 | { |
| 914 | msgLen = sizeof(tSirSmeScanRsp) - |
| 915 | sizeof(tSirBssDescription) + |
| 916 | ptemp->bssDescription.length + |
| 917 | sizeof(ptemp->bssDescription.length); |
| 918 | pDesc = pSirSmeScanRsp->bssDescription; |
| 919 | } |
| 920 | else |
| 921 | { |
| 922 | msgLen += ptemp->bssDescription.length + |
| 923 | sizeof(ptemp->bssDescription.length); |
| 924 | pDesc = (tSirBssDescription *)pbBuf; |
| 925 | } |
| 926 | if ( (allocLength < msgLen) || |
| 927 | (LIM_MAX_NUM_OF_SCAN_RESULTS_REPORTED <= bssCount++) ) |
| 928 | { |
| 929 | pSirSmeScanRsp->statusCode = |
| 930 | eSIR_SME_MORE_SCAN_RESULTS_FOLLOW; |
| 931 | pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP; |
| 932 | pSirSmeScanRsp->length = curMsgLen; |
| 933 | mmhMsg.bodyptr = pSirSmeScanRsp; |
| 934 | mmhMsg.bodyval = 0; |
| 935 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
| 936 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 937 | pSirSmeScanRsp = vos_mem_malloc(allocLength); |
| 938 | if ( NULL == pSirSmeScanRsp ) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 939 | { |
| 940 | // Log error |
| 941 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 942 | FL("call to AllocateMemory failed for eWNI_SME_SCAN_RSP\n")); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 943 | return; |
| 944 | } |
| 945 | msgLen = sizeof(tSirSmeScanRsp) - |
| 946 | sizeof(tSirBssDescription) + |
| 947 | ptemp->bssDescription.length + |
| 948 | sizeof(ptemp->bssDescription.length); |
| 949 | pDesc = pSirSmeScanRsp->bssDescription; |
| 950 | bssCount = 1; |
| 951 | } |
| 952 | curMsgLen = msgLen; |
| 953 | |
| 954 | PELOG2(limLog(pMac, LOG2, FL("ScanRsp : msgLen %d, bssDescr Len=%d\n"), |
| 955 | msgLen, ptemp->bssDescription.length);) |
| 956 | pDesc->length |
| 957 | = ptemp->bssDescription.length; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 958 | vos_mem_copy( (tANI_U8 *) &pDesc->bssId, |
| 959 | (tANI_U8 *) &ptemp->bssDescription.bssId, |
| 960 | ptemp->bssDescription.length); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 961 | |
| 962 | PELOG2(limLog(pMac, LOG2, FL("BssId ")); |
| 963 | limPrintMacAddr(pMac, ptemp->bssDescription.bssId, LOG2);) |
| 964 | |
| 965 | pSirSmeScanRsp->sessionId = smesessionId; |
| 966 | pSirSmeScanRsp->transcationId = smetranscationId; |
| 967 | |
| 968 | ptemp = ptemp->next; |
| 969 | } //while(ptemp) |
| 970 | } //for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++) |
| 971 | |
| 972 | if (0 == bssCount) |
| 973 | { |
| 974 | limPostSmeScanRspMessage(pMac, length, resultCode, smesessionId, smetranscationId); |
| 975 | if (NULL != pSirSmeScanRsp) |
| 976 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 977 | vos_mem_free( pSirSmeScanRsp); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 978 | pSirSmeScanRsp = NULL; |
| 979 | } |
| 980 | } |
| 981 | else |
| 982 | { |
| 983 | // send last message |
| 984 | pSirSmeScanRsp->statusCode = eSIR_SME_SUCCESS; |
| 985 | pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP; |
| 986 | pSirSmeScanRsp->length = curMsgLen; |
| 987 | |
| 988 | /* Update SME session Id and SME transcation Id */ |
| 989 | pSirSmeScanRsp->sessionId = smesessionId; |
| 990 | pSirSmeScanRsp->transcationId = smetranscationId; |
| 991 | |
| 992 | mmhMsg.type = eWNI_SME_SCAN_RSP; |
| 993 | mmhMsg.bodyptr = pSirSmeScanRsp; |
| 994 | mmhMsg.bodyval = 0; |
| 995 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
| 996 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 997 | PELOG2(limLog(pMac, LOG2, FL("statusCode : eSIR_SME_SUCCESS\n"));) |
| 998 | } |
| 999 | |
| 1000 | return; |
| 1001 | |
| 1002 | } /*** end limSendSmeLfrScanRsp() ***/ |
| 1003 | #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1004 | |
| 1005 | /** |
| 1006 | * limPostSmeScanRspMessage() |
| 1007 | * |
| 1008 | *FUNCTION: |
| 1009 | * This function is called by limSendSmeScanRsp() to send |
| 1010 | * eWNI_SME_SCAN_RSP message with failed result code |
| 1011 | * |
| 1012 | *NOTE: |
| 1013 | * NA |
| 1014 | * |
| 1015 | * @param pMac Pointer to Global MAC structure |
| 1016 | * @param length Indicates length of message |
| 1017 | * @param resultCode failed result code |
| 1018 | * |
| 1019 | * @return None |
| 1020 | */ |
| 1021 | |
| 1022 | void |
| 1023 | limPostSmeScanRspMessage(tpAniSirGlobal pMac, |
| 1024 | tANI_U16 length, |
| 1025 | tSirResultCodes resultCode,tANI_U8 smesessionId, tANI_U16 smetransactionId) |
| 1026 | { |
| 1027 | tpSirSmeScanRsp pSirSmeScanRsp; |
| 1028 | tSirMsgQ mmhMsg; |
| 1029 | |
| 1030 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1031 | FL("limPostSmeScanRspMessage: send SME_SCAN_RSP (len %d, reasonCode %s). "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1032 | length, limResultCodeStr(resultCode));) |
| 1033 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1034 | pSirSmeScanRsp = vos_mem_malloc(length); |
| 1035 | if ( NULL == pSirSmeScanRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1036 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1037 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_SCAN_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1038 | return; |
| 1039 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1040 | vos_mem_set((void*)pSirSmeScanRsp, length, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1041 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1042 | pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP; |
| 1043 | pSirSmeScanRsp->length = length; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1044 | |
| 1045 | if(sizeof(tSirSmeScanRsp) <= length) |
| 1046 | { |
| 1047 | pSirSmeScanRsp->bssDescription->length = sizeof(tSirBssDescription); |
| 1048 | } |
| 1049 | |
| 1050 | pSirSmeScanRsp->statusCode = resultCode; |
| 1051 | |
| 1052 | /*Update SME session Id and transaction Id */ |
| 1053 | pSirSmeScanRsp->sessionId = smesessionId; |
| 1054 | pSirSmeScanRsp->transcationId = smetransactionId; |
| 1055 | |
| 1056 | mmhMsg.type = eWNI_SME_SCAN_RSP; |
| 1057 | mmhMsg.bodyptr = pSirSmeScanRsp; |
| 1058 | mmhMsg.bodyval = 0; |
| 1059 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1060 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1061 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1062 | limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_RSP_EVENT, NULL, (tANI_U16)resultCode, 0); |
| 1063 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1064 | |
| 1065 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1066 | return; |
| 1067 | |
| 1068 | } /*** limPostSmeScanRspMessage ***/ |
| 1069 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1070 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1071 | |
| 1072 | /** |
| 1073 | * limSendSmeOemDataRsp() |
| 1074 | * |
| 1075 | *FUNCTION: |
| 1076 | * This function is called by limProcessSmeReqMessages() to send |
| 1077 | * eWNI_SME_OEM_DATA_RSP message to applications above MAC |
| 1078 | * Software. |
| 1079 | * |
| 1080 | *PARAMS: |
| 1081 | * |
| 1082 | *LOGIC: |
| 1083 | * |
| 1084 | *ASSUMPTIONS: |
| 1085 | * NA |
| 1086 | * |
| 1087 | *NOTE: |
| 1088 | * NA |
| 1089 | * |
| 1090 | * @param pMac Pointer to Global MAC structure |
| 1091 | * @param pMsgBuf Indicates the mlm message |
| 1092 | * @param resultCode Indicates the result of previously issued |
| 1093 | * eWNI_SME_OEM_DATA_RSP message |
| 1094 | * |
| 1095 | * @return None |
| 1096 | */ |
| 1097 | |
| 1098 | void limSendSmeOemDataRsp(tpAniSirGlobal pMac, tANI_U32* pMsgBuf, tSirResultCodes resultCode) |
| 1099 | { |
| 1100 | tSirMsgQ mmhMsg; |
| 1101 | tSirOemDataRsp* pSirSmeOemDataRsp=NULL; |
| 1102 | tLimMlmOemDataRsp* pMlmOemDataRsp=NULL; |
| 1103 | tANI_U16 msgLength; |
| 1104 | |
| 1105 | |
| 1106 | //get the pointer to the mlm message |
| 1107 | pMlmOemDataRsp = (tLimMlmOemDataRsp*)(pMsgBuf); |
| 1108 | |
| 1109 | msgLength = sizeof(tSirOemDataRsp); |
| 1110 | |
| 1111 | //now allocate memory for the char buffer |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1112 | pSirSmeOemDataRsp = vos_mem_malloc(msgLength); |
| 1113 | if (NULL == pSirSmeOemDataRsp) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1114 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1115 | limLog(pMac, LOGP, FL("call to AllocateMemory failed for pSirSmeOemDataRsp")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1116 | return; |
| 1117 | } |
| 1118 | |
| 1119 | #if defined (ANI_LITTLE_BYTE_ENDIAN) |
| 1120 | sirStoreU16N((tANI_U8*)&pSirSmeOemDataRsp->length, msgLength); |
| 1121 | sirStoreU16N((tANI_U8*)&pSirSmeOemDataRsp->messageType, eWNI_SME_OEM_DATA_RSP); |
| 1122 | #else |
| 1123 | pSirSmeOemDataRsp->length = msgLength; |
| 1124 | pSirSmeOemDataRsp->messageType = eWNI_SME_OEM_DATA_RSP; |
| 1125 | #endif |
| 1126 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1127 | vos_mem_copy(pSirSmeOemDataRsp->oemDataRsp, pMlmOemDataRsp->oemDataRsp, OEM_DATA_RSP_SIZE); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1128 | |
| 1129 | //Now free the memory from MLM Rsp Message |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1130 | vos_mem_free(pMlmOemDataRsp); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1131 | |
| 1132 | mmhMsg.type = eWNI_SME_OEM_DATA_RSP; |
| 1133 | mmhMsg.bodyptr = pSirSmeOemDataRsp; |
| 1134 | mmhMsg.bodyval = 0; |
| 1135 | |
| 1136 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1137 | |
| 1138 | return; |
| 1139 | } /*** limSendSmeOemDataRsp ***/ |
| 1140 | |
| 1141 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1142 | |
| 1143 | |
| 1144 | /** |
| 1145 | * limSendSmeAuthRsp() |
| 1146 | * |
| 1147 | *FUNCTION: |
| 1148 | * This function is called by limProcessSmeMessages() to send |
| 1149 | * eWNI_SME_AUTH_RSP message to host |
| 1150 | * |
| 1151 | *PARAMS: |
| 1152 | * |
| 1153 | *LOGIC: |
| 1154 | * |
| 1155 | *ASSUMPTIONS: |
| 1156 | * NA |
| 1157 | * |
| 1158 | *NOTE: |
| 1159 | * NA |
| 1160 | * |
| 1161 | * @param pMac Pointer to Global MAC structure |
| 1162 | * @param statusCode Indicates the result of previously issued |
| 1163 | * eWNI_SME_AUTH_REQ message |
| 1164 | * |
| 1165 | * @return None |
| 1166 | */ |
| 1167 | void |
| 1168 | limSendSmeAuthRsp(tpAniSirGlobal pMac, |
| 1169 | tSirResultCodes statusCode, |
| 1170 | tSirMacAddr peerMacAddr, |
| 1171 | tAniAuthType authType, |
| 1172 | tANI_U16 protStatusCode, |
| 1173 | tpPESession psessionEntry,tANI_U8 smesessionId, |
| 1174 | tANI_U16 smetransactionId) |
| 1175 | { |
| 1176 | #if 0 |
| 1177 | tSirMsgQ mmhMsg; |
| 1178 | tSirSmeAuthRsp *pSirSmeAuthRsp; |
| 1179 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1180 | pSirSmeAuthRsp = vos_mem_malloc(sizeof(tSirSmeAuthRsp)); |
| 1181 | if (NULL == pSirSmeAuthRsp) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1182 | { |
| 1183 | // Log error |
| 1184 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1185 | FL("call to AllocateMemory failed for eWNI_SME_AUTH_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1186 | |
| 1187 | return; |
| 1188 | } |
| 1189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1190 | |
| 1191 | |
| 1192 | if(psessionEntry != NULL) |
| 1193 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1194 | vos_mem_copy( (tANI_U8 *) pSirSmeAuthRsp->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1195 | (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr)); |
| 1196 | pSirSmeAuthRsp->authType = authType; |
| 1197 | |
| 1198 | } |
| 1199 | |
| 1200 | pSirSmeAuthRsp->messageType = eWNI_SME_AUTH_RSP; |
| 1201 | pSirSmeAuthRsp->length = sizeof(tSirSmeAuthRsp); |
| 1202 | pSirSmeAuthRsp->statusCode = statusCode; |
| 1203 | pSirSmeAuthRsp->protStatusCode = protStatusCode; |
| 1204 | |
| 1205 | /* Update SME session and transaction Id*/ |
| 1206 | pSirSmeAuthRsp->sessionId = smesessionId; |
| 1207 | pSirSmeAuthRsp->transactionId = smetransactionId; |
| 1208 | |
| 1209 | mmhMsg.type = eWNI_SME_AUTH_RSP; |
| 1210 | mmhMsg.bodyptr = pSirSmeAuthRsp; |
| 1211 | mmhMsg.bodyval = 0; |
| 1212 | MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type)); |
| 1213 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1214 | #endif |
| 1215 | } /*** end limSendSmeAuthRsp() ***/ |
| 1216 | |
| 1217 | |
Madan Mohan Koyyalamudi | 27ecc28 | 2012-11-06 15:07:28 -0800 | [diff] [blame] | 1218 | void limSendSmeDisassocDeauthNtf( tpAniSirGlobal pMac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1219 | eHalStatus status, tANI_U32 *pCtx ) |
| 1220 | { |
| 1221 | tSirMsgQ mmhMsg; |
| 1222 | tSirMsgQ *pMsg = (tSirMsgQ*) pCtx; |
| 1223 | |
| 1224 | mmhMsg.type = pMsg->type; |
| 1225 | mmhMsg.bodyptr = pMsg; |
| 1226 | mmhMsg.bodyval = 0; |
| 1227 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1228 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1229 | |
| 1230 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1231 | } |
| 1232 | /** |
| 1233 | * limSendSmeDisassocNtf() |
| 1234 | * |
| 1235 | *FUNCTION: |
| 1236 | * This function is called by limProcessSmeMessages() to send |
| 1237 | * eWNI_SME_DISASSOC_RSP/IND message to host |
| 1238 | * |
| 1239 | *PARAMS: |
| 1240 | * |
| 1241 | *LOGIC: |
| 1242 | * |
| 1243 | *ASSUMPTIONS: |
| 1244 | * NA |
| 1245 | * |
| 1246 | *NOTE: |
| 1247 | * This function is used for sending eWNI_SME_DISASSOC_CNF, |
| 1248 | * or eWNI_SME_DISASSOC_IND to host depending on |
| 1249 | * disassociation trigger. |
| 1250 | * |
| 1251 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 1252 | * disassociate was initiated |
| 1253 | * @param reasonCode Indicates the reason for Disassociation |
| 1254 | * @param disassocTrigger Indicates the trigger for Disassociation |
| 1255 | * @param aid Indicates the STAID. This parameter is |
| 1256 | * present only on AP. |
| 1257 | * |
| 1258 | * @return None |
| 1259 | */ |
| 1260 | void |
| 1261 | limSendSmeDisassocNtf(tpAniSirGlobal pMac, |
| 1262 | tSirMacAddr peerMacAddr, |
| 1263 | tSirResultCodes reasonCode, |
| 1264 | tANI_U16 disassocTrigger, |
| 1265 | tANI_U16 aid, |
| 1266 | tANI_U8 smesessionId, |
| 1267 | tANI_U16 smetransactionId, |
| 1268 | tpPESession psessionEntry) |
| 1269 | { |
| 1270 | |
| 1271 | tANI_U8 *pBuf; |
| 1272 | tSirSmeDisassocRsp *pSirSmeDisassocRsp; |
| 1273 | tSirSmeDisassocInd *pSirSmeDisassocInd; |
| 1274 | tANI_U32 *pMsg; |
| 1275 | |
| 1276 | switch (disassocTrigger) |
| 1277 | { |
| 1278 | case eLIM_PEER_ENTITY_DISASSOC: |
| 1279 | return; |
| 1280 | |
| 1281 | case eLIM_HOST_DISASSOC: |
| 1282 | /** |
| 1283 | * Disassociation response due to |
| 1284 | * host triggered disassociation |
| 1285 | */ |
| 1286 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1287 | pSirSmeDisassocRsp = vos_mem_malloc(sizeof(tSirSmeDisassocRsp)); |
| 1288 | if ( NULL == pSirSmeDisassocRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1289 | { |
| 1290 | // Log error |
| 1291 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1292 | FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1293 | |
| 1294 | return; |
| 1295 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 1296 | limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_RSP with " |
| 1297 | "retCode: %d for "MAC_ADDRESS_STR),reasonCode, |
| 1298 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1299 | pSirSmeDisassocRsp->messageType = eWNI_SME_DISASSOC_RSP; |
| 1300 | pSirSmeDisassocRsp->length = sizeof(tSirSmeDisassocRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1301 | //sessionId |
| 1302 | pBuf = (tANI_U8 *) &pSirSmeDisassocRsp->sessionId; |
| 1303 | *pBuf = smesessionId; |
| 1304 | pBuf++; |
| 1305 | |
| 1306 | //transactionId |
| 1307 | limCopyU16(pBuf, smetransactionId); |
| 1308 | pBuf += sizeof(tANI_U16); |
| 1309 | |
| 1310 | //statusCode |
| 1311 | limCopyU32(pBuf, reasonCode); |
| 1312 | pBuf += sizeof(tSirResultCodes); |
| 1313 | |
| 1314 | //peerMacAddr |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1315 | vos_mem_copy( pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1316 | pBuf += sizeof(tSirMacAddr); |
| 1317 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1318 | // Clear Station Stats |
| 1319 | //for sta, it is always 1, IBSS is handled at halInitSta |
| 1320 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1321 | |
| 1322 | |
| 1323 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1324 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1325 | limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_RSP_EVENT, |
| 1326 | psessionEntry, (tANI_U16)reasonCode, 0); |
| 1327 | #endif |
| 1328 | pMsg = (tANI_U32*) pSirSmeDisassocRsp; |
| 1329 | break; |
| 1330 | |
| 1331 | default: |
| 1332 | /** |
| 1333 | * Disassociation indication due to Disassociation |
| 1334 | * frame reception from peer entity or due to |
| 1335 | * loss of link with peer entity. |
| 1336 | */ |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1337 | pSirSmeDisassocInd = vos_mem_malloc(sizeof(tSirSmeDisassocInd)); |
| 1338 | if ( NULL == pSirSmeDisassocInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1339 | { |
| 1340 | // Log error |
| 1341 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1342 | FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1343 | |
| 1344 | return; |
| 1345 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 1346 | limLog(pMac, LOG1, FL("send eWNI_SME_DISASSOC_IND with " |
| 1347 | "retCode: %d for "MAC_ADDRESS_STR),reasonCode, |
| 1348 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1349 | pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND; |
| 1350 | pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd); |
| 1351 | |
| 1352 | /* Update SME session Id and Transaction Id */ |
| 1353 | pSirSmeDisassocInd->sessionId = smesessionId; |
| 1354 | pSirSmeDisassocInd->transactionId = smetransactionId; |
Mohit Khanna | 99d5fd0 | 2012-09-11 14:51:20 -0700 | [diff] [blame] | 1355 | pSirSmeDisassocInd->reasonCode = reasonCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1356 | pBuf = (tANI_U8 *) &pSirSmeDisassocInd->statusCode; |
| 1357 | |
| 1358 | limCopyU32(pBuf, reasonCode); |
| 1359 | pBuf += sizeof(tSirResultCodes); |
| 1360 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1361 | vos_mem_copy( pBuf, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1362 | pBuf += sizeof(tSirMacAddr); |
| 1363 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1364 | vos_mem_copy( pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1365 | |
| 1366 | |
| 1367 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1368 | limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, |
| 1369 | psessionEntry, (tANI_U16)reasonCode, 0); |
| 1370 | #endif |
| 1371 | pMsg = (tANI_U32*) pSirSmeDisassocInd; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1372 | |
| 1373 | break; |
| 1374 | } |
| 1375 | |
| 1376 | /* Delete the PE session Created */ |
| 1377 | if((psessionEntry != NULL) && ((psessionEntry ->limSystemRole == eLIM_STA_ROLE) || |
| 1378 | (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE)) ) |
| 1379 | { |
| 1380 | peDeleteSession(pMac,psessionEntry); |
| 1381 | } |
| 1382 | |
Madan Mohan Koyyalamudi | 27ecc28 | 2012-11-06 15:07:28 -0800 | [diff] [blame] | 1383 | limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1384 | (tANI_U32*) pMsg ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1385 | } /*** end limSendSmeDisassocNtf() ***/ |
| 1386 | |
| 1387 | |
| 1388 | /** ----------------------------------------------------------------- |
| 1389 | \brief limSendSmeDisassocInd() - sends SME_DISASSOC_IND |
| 1390 | |
| 1391 | After receiving disassociation frame from peer entity, this |
| 1392 | function sends a eWNI_SME_DISASSOC_IND to SME with a specific |
| 1393 | reason code. |
| 1394 | |
| 1395 | \param pMac - global mac structure |
| 1396 | \param pStaDs - station dph hash node |
| 1397 | \return none |
| 1398 | \sa |
| 1399 | ----------------------------------------------------------------- */ |
| 1400 | void |
| 1401 | limSendSmeDisassocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionEntry) |
| 1402 | { |
| 1403 | tSirMsgQ mmhMsg; |
| 1404 | tSirSmeDisassocInd *pSirSmeDisassocInd; |
| 1405 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1406 | pSirSmeDisassocInd = vos_mem_malloc(sizeof(tSirSmeDisassocInd)); |
| 1407 | if ( NULL == pSirSmeDisassocInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1408 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1409 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_DISASSOC_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1410 | return; |
| 1411 | } |
| 1412 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1413 | pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND; |
| 1414 | pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1415 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1416 | pSirSmeDisassocInd->sessionId = psessionEntry->smeSessionId; |
| 1417 | pSirSmeDisassocInd->transactionId = psessionEntry->transactionId; |
| 1418 | pSirSmeDisassocInd->statusCode = pStaDs->mlmStaContext.disassocReason; |
Mohit Khanna | 99d5fd0 | 2012-09-11 14:51:20 -0700 | [diff] [blame] | 1419 | pSirSmeDisassocInd->reasonCode = pStaDs->mlmStaContext.disassocReason; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1420 | |
| 1421 | vos_mem_copy( pSirSmeDisassocInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr)); |
| 1422 | |
| 1423 | vos_mem_copy( pSirSmeDisassocInd->peerMacAddr, pStaDs->staAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1424 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1425 | pSirSmeDisassocInd->staId = pStaDs->staIndex; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1426 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1427 | mmhMsg.type = eWNI_SME_DISASSOC_IND; |
| 1428 | mmhMsg.bodyptr = pSirSmeDisassocInd; |
| 1429 | mmhMsg.bodyval = 0; |
| 1430 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1431 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1432 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1433 | limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, psessionEntry, 0, (tANI_U16)pStaDs->mlmStaContext.disassocReason); |
| 1434 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1435 | |
| 1436 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1437 | |
| 1438 | } /*** end limSendSmeDisassocInd() ***/ |
| 1439 | |
| 1440 | |
| 1441 | /** ----------------------------------------------------------------- |
| 1442 | \brief limSendSmeDeauthInd() - sends SME_DEAUTH_IND |
| 1443 | |
| 1444 | After receiving deauthentication frame from peer entity, this |
| 1445 | function sends a eWNI_SME_DEAUTH_IND to SME with a specific |
| 1446 | reason code. |
| 1447 | |
| 1448 | \param pMac - global mac structure |
| 1449 | \param pStaDs - station dph hash node |
| 1450 | \return none |
| 1451 | \sa |
| 1452 | ----------------------------------------------------------------- */ |
| 1453 | void |
| 1454 | limSendSmeDeauthInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry) |
| 1455 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1456 | tSirMsgQ mmhMsg; |
| 1457 | tSirSmeDeauthInd *pSirSmeDeauthInd; |
| 1458 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1459 | pSirSmeDeauthInd = vos_mem_malloc(sizeof(tSirSmeDeauthInd)); |
| 1460 | if ( NULL == pSirSmeDeauthInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1461 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1462 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_DEAUTH_IND ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1463 | return; |
| 1464 | } |
| 1465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1466 | pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND; |
| 1467 | pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1468 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1469 | pSirSmeDeauthInd->sessionId = psessionEntry->smeSessionId; |
| 1470 | pSirSmeDeauthInd->transactionId = psessionEntry->transactionId; |
| 1471 | if(eSIR_INFRA_AP_MODE == psessionEntry->bssType) |
| 1472 | { |
| 1473 | pSirSmeDeauthInd->statusCode = (tSirResultCodes)pStaDs->mlmStaContext.cleanupTrigger; |
| 1474 | } |
| 1475 | else |
| 1476 | { |
| 1477 | //Need to indicatet he reascon code over the air |
| 1478 | pSirSmeDeauthInd->statusCode = (tSirResultCodes)pStaDs->mlmStaContext.disassocReason; |
| 1479 | } |
| 1480 | //BSSID |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1481 | vos_mem_copy( pSirSmeDeauthInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1482 | //peerMacAddr |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1483 | vos_mem_copy( pSirSmeDeauthInd->peerMacAddr, pStaDs->staAddr, sizeof(tSirMacAddr)); |
Mohit Khanna | 99d5fd0 | 2012-09-11 14:51:20 -0700 | [diff] [blame] | 1484 | pSirSmeDeauthInd->reasonCode = pStaDs->mlmStaContext.disassocReason; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1485 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1486 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1487 | pSirSmeDeauthInd->staId = pStaDs->staIndex; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1488 | |
| 1489 | mmhMsg.type = eWNI_SME_DEAUTH_IND; |
| 1490 | mmhMsg.bodyptr = pSirSmeDeauthInd; |
| 1491 | mmhMsg.bodyval = 0; |
| 1492 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1493 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1494 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1495 | limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, psessionEntry, 0, pStaDs->mlmStaContext.cleanupTrigger); |
| 1496 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1497 | |
| 1498 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1499 | return; |
| 1500 | } /*** end limSendSmeDeauthInd() ***/ |
| 1501 | |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1502 | #ifdef FEATURE_WLAN_TDLS |
| 1503 | /** |
| 1504 | * limSendSmeTDLSDelStaInd() |
| 1505 | * |
| 1506 | *FUNCTION: |
| 1507 | * This function is called to send the TDLS STA context deletion to SME. |
| 1508 | * |
| 1509 | *LOGIC: |
| 1510 | * |
| 1511 | *ASSUMPTIONS: |
| 1512 | * |
| 1513 | *NOTE: |
| 1514 | * NA |
| 1515 | * |
| 1516 | * @param pMac - Pointer to global MAC structure |
| 1517 | * @param pStaDs - Pointer to internal STA Datastructure |
| 1518 | * @param psessionEntry - Pointer to the session entry |
| 1519 | * @param reasonCode - Reason for TDLS sta deletion |
| 1520 | * @return None |
| 1521 | */ |
| 1522 | void |
| 1523 | limSendSmeTDLSDelStaInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry, tANI_U16 reasonCode) |
| 1524 | { |
| 1525 | tSirMsgQ mmhMsg; |
| 1526 | tSirTdlsDelStaInd *pSirTdlsDelStaInd; |
| 1527 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1528 | pSirTdlsDelStaInd = vos_mem_malloc(sizeof(tSirTdlsDelStaInd)); |
| 1529 | if ( NULL == pSirTdlsDelStaInd ) |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1530 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1531 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_TDLS_DEL_STA_IND ")); |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1532 | return; |
| 1533 | } |
| 1534 | |
| 1535 | //messageType |
| 1536 | pSirTdlsDelStaInd->messageType = eWNI_SME_TDLS_DEL_STA_IND; |
| 1537 | pSirTdlsDelStaInd->length = sizeof(tSirTdlsDelStaInd); |
| 1538 | |
| 1539 | //sessionId |
| 1540 | pSirTdlsDelStaInd->sessionId = psessionEntry->smeSessionId; |
| 1541 | |
| 1542 | //peerMacAddr |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1543 | vos_mem_copy( pSirTdlsDelStaInd->peerMac, pStaDs->staAddr, sizeof(tSirMacAddr)); |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1544 | |
| 1545 | //staId |
| 1546 | limCopyU16((tANI_U8*)(&pSirTdlsDelStaInd->staId), (tANI_U16)pStaDs->staIndex); |
| 1547 | |
| 1548 | //reasonCode |
| 1549 | limCopyU16((tANI_U8*)(&pSirTdlsDelStaInd->reasonCode), reasonCode); |
| 1550 | |
| 1551 | mmhMsg.type = eWNI_SME_TDLS_DEL_STA_IND; |
| 1552 | mmhMsg.bodyptr = pSirTdlsDelStaInd; |
| 1553 | mmhMsg.bodyval = 0; |
| 1554 | |
| 1555 | |
| 1556 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1557 | return; |
| 1558 | }/*** end limSendSmeTDLSDelStaInd() ***/ |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 1559 | |
| 1560 | /** |
| 1561 | * limSendSmeTDLSDeleteAllPeerInd() |
| 1562 | * |
| 1563 | *FUNCTION: |
| 1564 | * This function is called to send the eWNI_SME_TDLS_DEL_ALL_PEER_IND |
| 1565 | * message to SME. |
| 1566 | * |
| 1567 | *LOGIC: |
| 1568 | * |
| 1569 | *ASSUMPTIONS: |
| 1570 | * |
| 1571 | *NOTE: |
| 1572 | * NA |
| 1573 | * |
| 1574 | * @param pMac - Pointer to global MAC structure |
| 1575 | * @param psessionEntry - Pointer to the session entry |
| 1576 | * @return None |
| 1577 | */ |
| 1578 | void |
| 1579 | limSendSmeTDLSDeleteAllPeerInd(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 1580 | { |
| 1581 | tSirMsgQ mmhMsg; |
| 1582 | tSirTdlsDelAllPeerInd *pSirTdlsDelAllPeerInd; |
| 1583 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1584 | pSirTdlsDelAllPeerInd = vos_mem_malloc(sizeof(tSirTdlsDelAllPeerInd)); |
| 1585 | if ( NULL == pSirTdlsDelAllPeerInd ) |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 1586 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1587 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_TDLS_DEL_ALL_PEER_IND")); |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 1588 | return; |
| 1589 | } |
| 1590 | |
| 1591 | //messageType |
| 1592 | pSirTdlsDelAllPeerInd->messageType = eWNI_SME_TDLS_DEL_ALL_PEER_IND; |
| 1593 | pSirTdlsDelAllPeerInd->length = sizeof(tSirTdlsDelAllPeerInd); |
| 1594 | |
| 1595 | //sessionId |
| 1596 | pSirTdlsDelAllPeerInd->sessionId = psessionEntry->smeSessionId; |
| 1597 | |
| 1598 | mmhMsg.type = eWNI_SME_TDLS_DEL_ALL_PEER_IND; |
| 1599 | mmhMsg.bodyptr = pSirTdlsDelAllPeerInd; |
| 1600 | mmhMsg.bodyval = 0; |
| 1601 | |
| 1602 | |
| 1603 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1604 | return; |
| 1605 | }/*** end limSendSmeTDLSDeleteAllPeerInd() ***/ |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1606 | |
| 1607 | /** |
| 1608 | * limSendSmeMgmtTXCompletion() |
| 1609 | * |
| 1610 | *FUNCTION: |
| 1611 | * This function is called to send the eWNI_SME_MGMT_FRM_TX_COMPLETION_IND |
| 1612 | * message to SME. |
| 1613 | * |
| 1614 | *LOGIC: |
| 1615 | * |
| 1616 | *ASSUMPTIONS: |
| 1617 | * |
| 1618 | *NOTE: |
| 1619 | * NA |
| 1620 | * |
| 1621 | * @param pMac - Pointer to global MAC structure |
| 1622 | * @param psessionEntry - Pointer to the session entry |
| 1623 | * @param txCompleteStatus - TX Complete Status of Mgmt Frames |
| 1624 | * @return None |
| 1625 | */ |
| 1626 | void |
| 1627 | limSendSmeMgmtTXCompletion(tpAniSirGlobal pMac, |
| 1628 | tpPESession psessionEntry, |
| 1629 | tANI_U32 txCompleteStatus) |
| 1630 | { |
| 1631 | tSirMsgQ mmhMsg; |
| 1632 | tSirMgmtTxCompletionInd *pSirMgmtTxCompletionInd; |
| 1633 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1634 | pSirMgmtTxCompletionInd = vos_mem_malloc(sizeof(tSirMgmtTxCompletionInd)); |
| 1635 | if ( NULL == pSirMgmtTxCompletionInd ) |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1636 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1637 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_MGMT_FRM_TX_COMPLETION_IND")); |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1638 | return; |
| 1639 | } |
| 1640 | |
| 1641 | //messageType |
| 1642 | pSirMgmtTxCompletionInd->messageType = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND; |
| 1643 | pSirMgmtTxCompletionInd->length = sizeof(tSirMgmtTxCompletionInd); |
| 1644 | |
| 1645 | //sessionId |
| 1646 | pSirMgmtTxCompletionInd->sessionId = psessionEntry->smeSessionId; |
| 1647 | |
| 1648 | pSirMgmtTxCompletionInd->txCompleteStatus = txCompleteStatus; |
| 1649 | |
| 1650 | mmhMsg.type = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND; |
| 1651 | mmhMsg.bodyptr = pSirMgmtTxCompletionInd; |
| 1652 | mmhMsg.bodyval = 0; |
| 1653 | |
| 1654 | |
| 1655 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1656 | return; |
| 1657 | }/*** end limSendSmeTDLSDeleteAllPeerInd() ***/ |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1658 | #endif |
| 1659 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1660 | |
| 1661 | /** |
| 1662 | * limSendSmeDeauthNtf() |
| 1663 | * |
| 1664 | *FUNCTION: |
| 1665 | * This function is called by limProcessSmeMessages() to send |
| 1666 | * eWNI_SME_DISASSOC_RSP/IND message to host |
| 1667 | * |
| 1668 | *PARAMS: |
| 1669 | * |
| 1670 | *LOGIC: |
| 1671 | * |
| 1672 | *ASSUMPTIONS: |
| 1673 | * NA |
| 1674 | * |
| 1675 | *NOTE: |
| 1676 | * This function is used for sending eWNI_SME_DEAUTH_CNF or |
| 1677 | * eWNI_SME_DEAUTH_IND to host depending on deauthentication trigger. |
| 1678 | * |
| 1679 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 1680 | * deauthentication was initiated |
| 1681 | * @param reasonCode Indicates the reason for Deauthetication |
| 1682 | * @param deauthTrigger Indicates the trigger for Deauthetication |
| 1683 | * @param aid Indicates the STAID. This parameter is present |
| 1684 | * only on AP. |
| 1685 | * |
| 1686 | * @return None |
| 1687 | */ |
| 1688 | void |
| 1689 | limSendSmeDeauthNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tSirResultCodes reasonCode, |
| 1690 | tANI_U16 deauthTrigger, tANI_U16 aid,tANI_U8 smesessionId, tANI_U16 smetransactionId) |
| 1691 | { |
| 1692 | tANI_U8 *pBuf; |
| 1693 | tSirSmeDeauthRsp *pSirSmeDeauthRsp; |
| 1694 | tSirSmeDeauthInd *pSirSmeDeauthInd; |
| 1695 | tpPESession psessionEntry; |
| 1696 | tANI_U8 sessionId; |
| 1697 | tANI_U32 *pMsg; |
| 1698 | |
| 1699 | psessionEntry = peFindSessionByBssid(pMac,peerMacAddr,&sessionId); |
| 1700 | switch (deauthTrigger) |
| 1701 | { |
| 1702 | case eLIM_PEER_ENTITY_DEAUTH: |
| 1703 | return; |
| 1704 | |
| 1705 | case eLIM_HOST_DEAUTH: |
| 1706 | /** |
| 1707 | * Deauthentication response to host triggered |
| 1708 | * deauthentication. |
| 1709 | */ |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1710 | pSirSmeDeauthRsp = vos_mem_malloc(sizeof(tSirSmeDeauthRsp)); |
| 1711 | if ( NULL == pSirSmeDeauthRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1712 | { |
| 1713 | // Log error |
| 1714 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1715 | FL("call to AllocateMemory failed for eWNI_SME_DEAUTH_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1716 | |
| 1717 | return; |
| 1718 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 1719 | limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_RSP with " |
| 1720 | "retCode: %d for"MAC_ADDRESS_STR),reasonCode, |
| 1721 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1722 | pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP; |
| 1723 | pSirSmeDeauthRsp->length = sizeof(tSirSmeDeauthRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1724 | pSirSmeDeauthRsp->statusCode = reasonCode; |
| 1725 | pSirSmeDeauthRsp->sessionId = smesessionId; |
| 1726 | pSirSmeDeauthRsp->transactionId = smetransactionId; |
| 1727 | |
| 1728 | pBuf = (tANI_U8 *) pSirSmeDeauthRsp->peerMacAddr; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1729 | vos_mem_copy( pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1730 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1731 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1732 | limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT, |
| 1733 | psessionEntry, 0, (tANI_U16)reasonCode); |
| 1734 | #endif |
| 1735 | pMsg = (tANI_U32*)pSirSmeDeauthRsp; |
| 1736 | |
| 1737 | break; |
| 1738 | |
| 1739 | default: |
| 1740 | /** |
| 1741 | * Deauthentication indication due to Deauthentication |
| 1742 | * frame reception from peer entity or due to |
| 1743 | * loss of link with peer entity. |
| 1744 | */ |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1745 | pSirSmeDeauthInd = vos_mem_malloc(sizeof(tSirSmeDeauthInd)); |
| 1746 | if ( NULL == pSirSmeDeauthInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1747 | { |
| 1748 | // Log error |
| 1749 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1750 | FL("call to AllocateMemory failed for eWNI_SME_DEAUTH_Ind")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1751 | |
| 1752 | return; |
| 1753 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 1754 | limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_IND with " |
| 1755 | "retCode: %d for "MAC_ADDRESS_STR),reasonCode, |
| 1756 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1757 | pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND; |
| 1758 | pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd); |
Mohit Khanna | 99d5fd0 | 2012-09-11 14:51:20 -0700 | [diff] [blame] | 1759 | pSirSmeDeauthInd->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1760 | |
| 1761 | // sessionId |
| 1762 | pBuf = (tANI_U8*) &pSirSmeDeauthInd->sessionId; |
| 1763 | *pBuf++ = smesessionId; |
| 1764 | |
| 1765 | //transaction ID |
| 1766 | limCopyU16(pBuf, smetransactionId); |
| 1767 | pBuf += sizeof(tANI_U16); |
| 1768 | |
| 1769 | // status code |
| 1770 | limCopyU32(pBuf, reasonCode); |
| 1771 | pBuf += sizeof(tSirResultCodes); |
| 1772 | |
| 1773 | //bssId |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1774 | vos_mem_copy( pBuf, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1775 | pBuf += sizeof(tSirMacAddr); |
| 1776 | |
| 1777 | //peerMacAddr |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1778 | vos_mem_copy( pSirSmeDeauthInd->peerMacAddr, peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1779 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1780 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1781 | limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, |
| 1782 | psessionEntry, 0, (tANI_U16)reasonCode); |
| 1783 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1784 | pMsg = (tANI_U32*)pSirSmeDeauthInd; |
| 1785 | |
| 1786 | break; |
| 1787 | } |
| 1788 | |
| 1789 | /*Delete the PE session created */ |
| 1790 | if(psessionEntry != NULL) |
| 1791 | { |
| 1792 | peDeleteSession(pMac,psessionEntry); |
| 1793 | } |
| 1794 | |
Madan Mohan Koyyalamudi | 27ecc28 | 2012-11-06 15:07:28 -0800 | [diff] [blame] | 1795 | limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, |
| 1796 | (tANI_U32*) pMsg ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1797 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1798 | } /*** end limSendSmeDeauthNtf() ***/ |
| 1799 | |
| 1800 | |
| 1801 | /** |
| 1802 | * limSendSmeWmStatusChangeNtf() |
| 1803 | * |
| 1804 | *FUNCTION: |
| 1805 | * This function is called by limProcessSmeMessages() to send |
| 1806 | * eWNI_SME_WM_STATUS_CHANGE_NTF message to host. |
| 1807 | * |
| 1808 | *PARAMS: |
| 1809 | * |
| 1810 | *LOGIC: |
| 1811 | * |
| 1812 | *ASSUMPTIONS: |
| 1813 | * NA |
| 1814 | * |
| 1815 | *NOTE: |
| 1816 | * |
| 1817 | * @param statusChangeCode Indicates the change in the wireless medium. |
| 1818 | * @param statusChangeInfo Indicates the information associated with |
| 1819 | * change in the wireless medium. |
| 1820 | * @param infoLen Indicates the length of status change information |
| 1821 | * being sent. |
| 1822 | * |
| 1823 | * @return None |
| 1824 | */ |
| 1825 | void |
| 1826 | limSendSmeWmStatusChangeNtf(tpAniSirGlobal pMac, tSirSmeStatusChangeCode statusChangeCode, |
| 1827 | tANI_U32 *pStatusChangeInfo, tANI_U16 infoLen, tANI_U8 sessionId) |
| 1828 | { |
| 1829 | tSirMsgQ mmhMsg; |
| 1830 | tSirSmeWmStatusChangeNtf *pSirSmeWmStatusChangeNtf; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1831 | pSirSmeWmStatusChangeNtf = vos_mem_malloc(sizeof(tSirSmeWmStatusChangeNtf)); |
| 1832 | if ( NULL == pSirSmeWmStatusChangeNtf ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1833 | { |
| 1834 | limLog(pMac, LOGE, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1835 | FL("call to AllocateMemory failed for eWNI_SME_WM_STATUS_CHANGE_NTF")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1836 | return; |
| 1837 | } |
| 1838 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1839 | |
| 1840 | mmhMsg.type = eWNI_SME_WM_STATUS_CHANGE_NTF; |
| 1841 | mmhMsg.bodyval = 0; |
| 1842 | mmhMsg.bodyptr = pSirSmeWmStatusChangeNtf; |
| 1843 | |
| 1844 | switch(statusChangeCode) |
| 1845 | { |
| 1846 | case eSIR_SME_RADAR_DETECTED: |
| 1847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1848 | break; |
| 1849 | |
| 1850 | case eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1851 | break; |
| 1852 | |
| 1853 | case eSIR_SME_BACKGROUND_SCAN_FAIL: |
| 1854 | limPackBkgndScanFailNotify(pMac, |
| 1855 | statusChangeCode, |
| 1856 | (tpSirBackgroundScanInfo)pStatusChangeInfo, |
| 1857 | pSirSmeWmStatusChangeNtf, sessionId); |
| 1858 | break; |
| 1859 | |
| 1860 | default: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1861 | pSirSmeWmStatusChangeNtf->messageType = eWNI_SME_WM_STATUS_CHANGE_NTF; |
| 1862 | pSirSmeWmStatusChangeNtf->statusChangeCode = statusChangeCode; |
| 1863 | pSirSmeWmStatusChangeNtf->length = sizeof(tSirSmeWmStatusChangeNtf); |
| 1864 | pSirSmeWmStatusChangeNtf->sessionId = sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1865 | if(sizeof(pSirSmeWmStatusChangeNtf->statusChangeInfo) >= infoLen) |
| 1866 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1867 | vos_mem_copy( (tANI_U8 *)&pSirSmeWmStatusChangeNtf->statusChangeInfo, |
| 1868 | (tANI_U8 *)pStatusChangeInfo, infoLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1869 | } |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1870 | limLog(pMac, LOGE, FL("***---*** StatusChg: code 0x%x, length %d ***---***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1871 | statusChangeCode, infoLen); |
| 1872 | break; |
| 1873 | } |
| 1874 | |
| 1875 | |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 1876 | MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1877 | if (eSIR_SUCCESS != limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT)) |
| 1878 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1879 | vos_mem_free(pSirSmeWmStatusChangeNtf); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1880 | limLog( pMac, LOGP, FL("limSysProcessMmhMsgApi failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1881 | } |
| 1882 | |
| 1883 | } /*** end limSendSmeWmStatusChangeNtf() ***/ |
| 1884 | |
| 1885 | |
| 1886 | /** |
| 1887 | * limSendSmeSetContextRsp() |
| 1888 | * |
| 1889 | *FUNCTION: |
| 1890 | * This function is called by limProcessSmeMessages() to send |
| 1891 | * eWNI_SME_SETCONTEXT_RSP message to host |
| 1892 | * |
| 1893 | *PARAMS: |
| 1894 | * |
| 1895 | *LOGIC: |
| 1896 | * |
| 1897 | *ASSUMPTIONS: |
| 1898 | * NA |
| 1899 | * |
| 1900 | *NOTE: |
| 1901 | * |
| 1902 | * @param pMac Pointer to Global MAC structure |
| 1903 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 1904 | * setContext was performed |
| 1905 | * @param aid Indicates the aid corresponding to the peer MAC |
| 1906 | * address |
| 1907 | * @param resultCode Indicates the result of previously issued |
| 1908 | * eWNI_SME_SETCONTEXT_RSP message |
| 1909 | * |
| 1910 | * @return None |
| 1911 | */ |
| 1912 | void |
| 1913 | limSendSmeSetContextRsp(tpAniSirGlobal pMac, |
| 1914 | tSirMacAddr peerMacAddr, tANI_U16 aid, |
| 1915 | tSirResultCodes resultCode, |
| 1916 | tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId) |
| 1917 | { |
| 1918 | |
| 1919 | tANI_U8 *pBuf; |
| 1920 | tSirMsgQ mmhMsg; |
| 1921 | tSirSmeSetContextRsp *pSirSmeSetContextRsp; |
| 1922 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1923 | pSirSmeSetContextRsp = vos_mem_malloc(sizeof(tSirSmeSetContextRsp)); |
| 1924 | if ( NULL == pSirSmeSetContextRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1925 | { |
| 1926 | // Log error |
| 1927 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1928 | FL("call to AllocateMemory failed for SmeSetContextRsp")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1929 | |
| 1930 | return; |
| 1931 | } |
| 1932 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1933 | pSirSmeSetContextRsp->messageType = eWNI_SME_SETCONTEXT_RSP; |
| 1934 | pSirSmeSetContextRsp->length = sizeof(tSirSmeSetContextRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1935 | pSirSmeSetContextRsp->statusCode = resultCode; |
| 1936 | |
| 1937 | pBuf = pSirSmeSetContextRsp->peerMacAddr; |
| 1938 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1939 | vos_mem_copy( pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1940 | pBuf += sizeof(tSirMacAddr); |
| 1941 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1942 | |
| 1943 | /* Update SME session and transaction Id*/ |
| 1944 | pSirSmeSetContextRsp->sessionId = smesessionId; |
| 1945 | pSirSmeSetContextRsp->transactionId = smetransactionId; |
| 1946 | |
| 1947 | mmhMsg.type = eWNI_SME_SETCONTEXT_RSP; |
| 1948 | mmhMsg.bodyptr = pSirSmeSetContextRsp; |
| 1949 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 1950 | if(NULL == psessionEntry) |
| 1951 | { |
| 1952 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
| 1953 | } |
| 1954 | else |
| 1955 | { |
| 1956 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
| 1957 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1958 | |
| 1959 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1960 | limDiagEventReport(pMac, WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 1961 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1962 | |
| 1963 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1964 | } /*** end limSendSmeSetContextRsp() ***/ |
| 1965 | |
| 1966 | /** |
| 1967 | * limSendSmeRemoveKeyRsp() |
| 1968 | * |
| 1969 | *FUNCTION: |
| 1970 | * This function is called by limProcessSmeMessages() to send |
| 1971 | * eWNI_SME_REMOVEKEY_RSP message to host |
| 1972 | * |
| 1973 | *PARAMS: |
| 1974 | * |
| 1975 | *LOGIC: |
| 1976 | * |
| 1977 | *ASSUMPTIONS: |
| 1978 | * NA |
| 1979 | * |
| 1980 | *NOTE: |
| 1981 | * |
| 1982 | * @param pMac Pointer to Global MAC structure |
| 1983 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 1984 | * Removekey was performed |
| 1985 | * @param aid Indicates the aid corresponding to the peer MAC |
| 1986 | * address |
| 1987 | * @param resultCode Indicates the result of previously issued |
| 1988 | * eWNI_SME_REMOVEKEY_RSP message |
| 1989 | * |
| 1990 | * @return None |
| 1991 | */ |
| 1992 | void |
| 1993 | limSendSmeRemoveKeyRsp(tpAniSirGlobal pMac, |
| 1994 | tSirMacAddr peerMacAddr, |
| 1995 | tSirResultCodes resultCode, |
| 1996 | tpPESession psessionEntry,tANI_U8 smesessionId, |
| 1997 | tANI_U16 smetransactionId) |
| 1998 | { |
| 1999 | tANI_U8 *pBuf; |
| 2000 | tSirMsgQ mmhMsg; |
| 2001 | tSirSmeRemoveKeyRsp *pSirSmeRemoveKeyRsp; |
| 2002 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2003 | pSirSmeRemoveKeyRsp = vos_mem_malloc(sizeof(tSirSmeRemoveKeyRsp)); |
| 2004 | if ( NULL == pSirSmeRemoveKeyRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2005 | { |
| 2006 | // Log error |
| 2007 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2008 | FL("call to AllocateMemory failed for SmeRemoveKeyRsp")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2009 | |
| 2010 | return; |
| 2011 | } |
| 2012 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2013 | |
| 2014 | |
| 2015 | if(psessionEntry != NULL) |
| 2016 | { |
| 2017 | pBuf = pSirSmeRemoveKeyRsp->peerMacAddr; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2018 | vos_mem_copy( pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2019 | } |
| 2020 | |
| 2021 | pSirSmeRemoveKeyRsp->messageType = eWNI_SME_REMOVEKEY_RSP; |
| 2022 | pSirSmeRemoveKeyRsp->length = sizeof(tSirSmeRemoveKeyRsp); |
| 2023 | pSirSmeRemoveKeyRsp->statusCode = resultCode; |
| 2024 | |
| 2025 | /* Update SME session and transaction Id*/ |
| 2026 | pSirSmeRemoveKeyRsp->sessionId = smesessionId; |
| 2027 | pSirSmeRemoveKeyRsp->transactionId = smetransactionId; |
| 2028 | |
| 2029 | mmhMsg.type = eWNI_SME_REMOVEKEY_RSP; |
| 2030 | mmhMsg.bodyptr = pSirSmeRemoveKeyRsp; |
| 2031 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2032 | if(NULL == psessionEntry) |
| 2033 | { |
| 2034 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
| 2035 | } |
| 2036 | else |
| 2037 | { |
| 2038 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
| 2039 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2040 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2041 | } /*** end limSendSmeSetContextRsp() ***/ |
| 2042 | |
| 2043 | |
| 2044 | /** |
| 2045 | * limSendSmePromiscuousModeRsp() |
| 2046 | * |
| 2047 | *FUNCTION: |
| 2048 | * This function is called by limProcessSmeMessages() to send |
| 2049 | * eWNI_PROMISCUOUS_MODE_RSP message to host |
| 2050 | * |
| 2051 | *PARAMS: |
| 2052 | * |
| 2053 | *LOGIC: |
| 2054 | * |
| 2055 | *ASSUMPTIONS: |
| 2056 | * NA |
| 2057 | * |
| 2058 | *NOTE: |
| 2059 | * This function is used for sending eWNI_SME_PROMISCUOUS_MODE_RSP to |
| 2060 | * host as a reply to eWNI_SME_PROMISCUOUS_MODE_REQ directive from it. |
| 2061 | * |
| 2062 | * @param None |
| 2063 | * @return None |
| 2064 | */ |
| 2065 | void |
| 2066 | limSendSmePromiscuousModeRsp(tpAniSirGlobal pMac) |
| 2067 | { |
| 2068 | #if 0 |
| 2069 | tSirMsgQ mmhMsg; |
| 2070 | tSirMbMsg *pMbMsg; |
| 2071 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2072 | pMbMsg = vos_mem_malloc(sizeof(tSirMbMsg)); |
| 2073 | if ( NULL == pMbMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2074 | { |
| 2075 | // Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2076 | limLog(pMac, LOGP, FL("call to AllocateMemory failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2077 | |
| 2078 | return; |
| 2079 | } |
| 2080 | |
| 2081 | pMbMsg->type = eWNI_SME_PROMISCUOUS_MODE_RSP; |
| 2082 | pMbMsg->msgLen = 4; |
| 2083 | |
| 2084 | mmhMsg.type = eWNI_SME_PROMISCUOUS_MODE_RSP; |
| 2085 | mmhMsg.bodyptr = pMbMsg; |
| 2086 | mmhMsg.bodyval = 0; |
| 2087 | MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type)); |
| 2088 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2089 | #endif |
| 2090 | } /*** end limSendSmePromiscuousModeRsp() ***/ |
| 2091 | |
| 2092 | |
| 2093 | |
| 2094 | /** |
| 2095 | * limSendSmeNeighborBssInd() |
| 2096 | * |
| 2097 | *FUNCTION: |
| 2098 | * This function is called by limLookupNaddHashEntry() to send |
| 2099 | * eWNI_SME_NEIGHBOR_BSS_IND message to host |
| 2100 | * |
| 2101 | *PARAMS: |
| 2102 | * |
| 2103 | *LOGIC: |
| 2104 | * |
| 2105 | *ASSUMPTIONS: |
| 2106 | * NA |
| 2107 | * |
| 2108 | *NOTE: |
| 2109 | * This function is used for sending eWNI_SME_NEIGHBOR_BSS_IND to |
| 2110 | * host upon detecting new BSS during background scanning if CFG |
| 2111 | * option is enabled for sending such indication |
| 2112 | * |
| 2113 | * @param pMac - Pointer to Global MAC structure |
| 2114 | * @return None |
| 2115 | */ |
| 2116 | |
| 2117 | void |
| 2118 | limSendSmeNeighborBssInd(tpAniSirGlobal pMac, |
| 2119 | tLimScanResultNode *pBssDescr) |
| 2120 | { |
| 2121 | tSirMsgQ msgQ; |
| 2122 | tANI_U32 val; |
| 2123 | tSirSmeNeighborBssInd *pNewBssInd; |
| 2124 | |
| 2125 | if ((pMac->lim.gLimSmeState != eLIM_SME_LINK_EST_WT_SCAN_STATE) || |
| 2126 | ((pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_WT_SCAN_STATE) && |
| 2127 | pMac->lim.gLimRspReqd)) |
| 2128 | { |
| 2129 | // LIM is not in background scan state OR |
| 2130 | // current scan is initiated by HDD. |
| 2131 | // No need to send new BSS indication to HDD |
| 2132 | return; |
| 2133 | } |
| 2134 | |
| 2135 | if (wlan_cfgGetInt(pMac, WNI_CFG_NEW_BSS_FOUND_IND, &val) != eSIR_SUCCESS) |
| 2136 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2137 | limLog(pMac, LOGP, FL("could not get NEIGHBOR_BSS_IND from CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2138 | |
| 2139 | return; |
| 2140 | } |
| 2141 | |
| 2142 | if (val == 0) |
| 2143 | return; |
| 2144 | |
| 2145 | /** |
| 2146 | * Need to indicate new BSSs found during |
| 2147 | * background scanning to host. |
| 2148 | * Allocate buffer for sending indication. |
| 2149 | * Length of buffer is length of BSS description |
| 2150 | * and length of header itself |
| 2151 | */ |
| 2152 | val = pBssDescr->bssDescription.length + sizeof(tANI_U16) + sizeof(tANI_U32) + sizeof(tANI_U8); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2153 | pNewBssInd = vos_mem_malloc(val); |
| 2154 | if ( NULL == pNewBssInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2155 | { |
| 2156 | // Log error |
| 2157 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2158 | FL("call to AllocateMemory failed for eWNI_SME_NEIGHBOR_BSS_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2159 | |
| 2160 | return; |
| 2161 | } |
| 2162 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2163 | pNewBssInd->messageType = eWNI_SME_NEIGHBOR_BSS_IND; |
| 2164 | pNewBssInd->length = (tANI_U16) val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2165 | pNewBssInd->sessionId = 0; |
| 2166 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2167 | vos_mem_copy( (tANI_U8 *) pNewBssInd->bssDescription, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2168 | (tANI_U8 *) &pBssDescr->bssDescription, |
| 2169 | pBssDescr->bssDescription.length + sizeof(tANI_U16)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2170 | |
| 2171 | msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND; |
| 2172 | msgQ.bodyptr = pNewBssInd; |
| 2173 | msgQ.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2174 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2175 | limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); |
| 2176 | } /*** end limSendSmeNeighborBssInd() ***/ |
| 2177 | |
| 2178 | /** ----------------------------------------------------------------- |
| 2179 | \brief limSendSmeAddtsRsp() - sends SME ADDTS RSP |
| 2180 | \ This function sends a eWNI_SME_ADDTS_RSP to SME. |
| 2181 | \ SME only looks at rc and tspec field. |
| 2182 | \param pMac - global mac structure |
| 2183 | \param rspReqd - is SmeAddTsRsp required |
| 2184 | \param status - status code of SME_ADD_TS_RSP |
| 2185 | \return tspec |
| 2186 | \sa |
| 2187 | ----------------------------------------------------------------- */ |
| 2188 | void |
| 2189 | limSendSmeAddtsRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, tANI_U32 status, tpPESession psessionEntry, |
| 2190 | tSirMacTspecIE tspec, tANI_U8 smesessionId, tANI_U16 smetransactionId) |
| 2191 | { |
| 2192 | tpSirAddtsRsp rsp; |
| 2193 | tSirMsgQ mmhMsg; |
| 2194 | |
| 2195 | if (! rspReqd) |
| 2196 | return; |
| 2197 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2198 | rsp = vos_mem_malloc(sizeof(tSirAddtsRsp)); |
| 2199 | if ( NULL == rsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2200 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2201 | limLog(pMac, LOGP, FL("AllocateMemory failed for ADDTS_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2202 | return; |
| 2203 | } |
| 2204 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2205 | vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2206 | rsp->messageType = eWNI_SME_ADDTS_RSP; |
| 2207 | rsp->rc = status; |
| 2208 | rsp->rsp.status = (enum eSirMacStatusCodes) status; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2209 | //vos_mem_copy( (tANI_U8 *) &rsp->rsp.tspec, (tANI_U8 *) &addts->tspec, sizeof(addts->tspec)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2210 | rsp->rsp.tspec = tspec; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2211 | /* Update SME session Id and transcation Id */ |
| 2212 | rsp->sessionId = smesessionId; |
| 2213 | rsp->transactionId = smetransactionId; |
| 2214 | |
| 2215 | mmhMsg.type = eWNI_SME_ADDTS_RSP; |
| 2216 | mmhMsg.bodyptr = rsp; |
| 2217 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2218 | if(NULL == psessionEntry) |
| 2219 | { |
| 2220 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
| 2221 | } |
| 2222 | else |
| 2223 | { |
| 2224 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
| 2225 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2226 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2227 | limDiagEventReport(pMac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, psessionEntry, 0, 0); |
| 2228 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2229 | |
| 2230 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2231 | return; |
| 2232 | } |
| 2233 | |
| 2234 | void |
| 2235 | limSendSmeAddtsInd(tpAniSirGlobal pMac, tpSirAddtsReqInfo addts) |
| 2236 | { |
| 2237 | tpSirAddtsRsp rsp; |
| 2238 | tSirMsgQ mmhMsg; |
| 2239 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2240 | limLog(pMac, LOGW, "SendSmeAddtsInd (token %d, tsid %d, up %d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2241 | addts->dialogToken, |
| 2242 | addts->tspec.tsinfo.traffic.tsid, |
| 2243 | addts->tspec.tsinfo.traffic.userPrio); |
| 2244 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2245 | rsp = vos_mem_malloc(sizeof(tSirAddtsRsp)); |
| 2246 | if ( NULL == rsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2247 | { |
| 2248 | // Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2249 | limLog(pMac, LOGP, FL("AllocateMemory failed for ADDTS_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2250 | return; |
| 2251 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2252 | vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2253 | |
| 2254 | rsp->messageType = eWNI_SME_ADDTS_IND; |
| 2255 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2256 | vos_mem_copy( (tANI_U8 *) &rsp->rsp, (tANI_U8 *) addts, sizeof(*addts)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2257 | |
| 2258 | mmhMsg.type = eWNI_SME_ADDTS_IND; |
| 2259 | mmhMsg.bodyptr = rsp; |
| 2260 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2261 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2262 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2263 | } |
| 2264 | |
| 2265 | void |
| 2266 | limSendSmeDeltsRsp(tpAniSirGlobal pMac, tpSirDeltsReq delts, tANI_U32 status,tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId) |
| 2267 | { |
| 2268 | tpSirDeltsRsp rsp; |
| 2269 | tSirMsgQ mmhMsg; |
| 2270 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2271 | limLog(pMac, LOGW, "SendSmeDeltsRsp (aid %d, tsid %d, up %d) status %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2272 | delts->aid, |
| 2273 | delts->req.tsinfo.traffic.tsid, |
| 2274 | delts->req.tsinfo.traffic.userPrio, |
| 2275 | status); |
| 2276 | if (! delts->rspReqd) |
| 2277 | return; |
| 2278 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2279 | rsp = vos_mem_malloc(sizeof(tSirDeltsRsp)); |
| 2280 | if ( NULL == rsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2281 | { |
| 2282 | // Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2283 | limLog(pMac, LOGP, FL("AllocateMemory failed for DELTS_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2284 | return; |
| 2285 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2286 | vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2287 | |
| 2288 | if(psessionEntry != NULL) |
| 2289 | { |
| 2290 | |
| 2291 | rsp->aid = delts->aid; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2292 | vos_mem_copy( (tANI_U8 *) &rsp->macAddr[0], (tANI_U8 *) &delts->macAddr[0], 6); |
| 2293 | vos_mem_copy( (tANI_U8 *) &rsp->rsp, (tANI_U8 *) &delts->req, sizeof(tSirDeltsReqInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2294 | } |
| 2295 | |
| 2296 | |
| 2297 | rsp->messageType = eWNI_SME_DELTS_RSP; |
| 2298 | rsp->rc = status; |
| 2299 | |
| 2300 | /* Update SME session Id and transcation Id */ |
| 2301 | rsp->sessionId = smesessionId; |
| 2302 | rsp->transactionId = smetransactionId; |
| 2303 | |
| 2304 | mmhMsg.type = eWNI_SME_DELTS_RSP; |
| 2305 | mmhMsg.bodyptr = rsp; |
| 2306 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2307 | if(NULL == psessionEntry) |
| 2308 | { |
| 2309 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
| 2310 | } |
| 2311 | else |
| 2312 | { |
| 2313 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
| 2314 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2315 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2316 | limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_RSP_EVENT, psessionEntry, (tANI_U16)status, 0); |
| 2317 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2318 | |
| 2319 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2320 | } |
| 2321 | |
| 2322 | void |
| 2323 | limSendSmeDeltsInd(tpAniSirGlobal pMac, tpSirDeltsReqInfo delts, tANI_U16 aid,tpPESession psessionEntry) |
| 2324 | { |
| 2325 | tpSirDeltsRsp rsp; |
| 2326 | tSirMsgQ mmhMsg; |
| 2327 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2328 | limLog(pMac, LOGW, "SendSmeDeltsInd (aid %d, tsid %d, up %d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2329 | aid, |
| 2330 | delts->tsinfo.traffic.tsid, |
| 2331 | delts->tsinfo.traffic.userPrio); |
| 2332 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2333 | rsp = vos_mem_malloc(sizeof(tSirDeltsRsp)); |
| 2334 | if ( NULL == rsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2335 | { |
| 2336 | // Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2337 | limLog(pMac, LOGP, FL("AllocateMemory failed for DELTS_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2338 | return; |
| 2339 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2340 | vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2341 | |
| 2342 | rsp->messageType = eWNI_SME_DELTS_IND; |
| 2343 | rsp->rc = eSIR_SUCCESS; |
| 2344 | rsp->aid = aid; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2345 | vos_mem_copy( (tANI_U8 *) &rsp->rsp, (tANI_U8 *) delts, sizeof(*delts)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2346 | |
| 2347 | /* Update SME session Id and SME transaction Id */ |
| 2348 | |
| 2349 | rsp->sessionId = psessionEntry->smeSessionId; |
| 2350 | rsp->transactionId = psessionEntry->transactionId; |
| 2351 | |
| 2352 | mmhMsg.type = eWNI_SME_DELTS_IND; |
| 2353 | mmhMsg.bodyptr = rsp; |
| 2354 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2355 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2356 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2357 | limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_IND_EVENT, psessionEntry, 0, 0); |
| 2358 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2359 | |
| 2360 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2361 | } |
| 2362 | |
| 2363 | /** |
| 2364 | * limSendSmeStatsRsp() |
| 2365 | * |
| 2366 | *FUNCTION: |
| 2367 | * This function is called to send 802.11 statistics response to HDD. |
| 2368 | * This function posts the result back to HDD. This is a response to |
| 2369 | * HDD's request for statistics. |
| 2370 | * |
| 2371 | *PARAMS: |
| 2372 | * |
| 2373 | *LOGIC: |
| 2374 | * |
| 2375 | *ASSUMPTIONS: |
| 2376 | * NA |
| 2377 | * |
| 2378 | *NOTE: |
| 2379 | * NA |
| 2380 | * |
| 2381 | * @param pMac Pointer to Global MAC structure |
| 2382 | * @param p80211Stats Statistics sent in response |
| 2383 | * @param resultCode TODO: |
| 2384 | * |
| 2385 | * |
| 2386 | * @return none |
| 2387 | */ |
| 2388 | |
| 2389 | void |
| 2390 | limSendSmeStatsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) |
| 2391 | { |
| 2392 | tSirMsgQ mmhMsg; |
| 2393 | tSirSmeRsp *pMsgHdr = (tSirSmeRsp*) stats; |
| 2394 | |
| 2395 | switch(msgType) |
| 2396 | { |
| 2397 | case WDA_STA_STAT_RSP: |
| 2398 | mmhMsg.type = eWNI_SME_STA_STAT_RSP; |
| 2399 | break; |
| 2400 | case WDA_AGGR_STAT_RSP: |
| 2401 | mmhMsg.type = eWNI_SME_AGGR_STAT_RSP; |
| 2402 | break; |
| 2403 | case WDA_GLOBAL_STAT_RSP: |
| 2404 | mmhMsg.type = eWNI_SME_GLOBAL_STAT_RSP; |
| 2405 | break; |
| 2406 | case WDA_STAT_SUMM_RSP: |
| 2407 | mmhMsg.type = eWNI_SME_STAT_SUMM_RSP; |
| 2408 | break; |
| 2409 | default: |
| 2410 | mmhMsg.type = msgType; //Response from within PE |
| 2411 | break; |
| 2412 | } |
| 2413 | |
| 2414 | pMsgHdr->messageType = mmhMsg.type; |
| 2415 | |
| 2416 | mmhMsg.bodyptr = stats; |
| 2417 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2418 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2419 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2420 | |
| 2421 | return; |
| 2422 | |
| 2423 | } /*** end limSendSmeStatsRsp() ***/ |
| 2424 | |
| 2425 | /** |
| 2426 | * limSendSmePEStatisticsRsp() |
| 2427 | * |
| 2428 | *FUNCTION: |
| 2429 | * This function is called to send 802.11 statistics response to HDD. |
| 2430 | * This function posts the result back to HDD. This is a response to |
| 2431 | * HDD's request for statistics. |
| 2432 | * |
| 2433 | *PARAMS: |
| 2434 | * |
| 2435 | *LOGIC: |
| 2436 | * |
| 2437 | *ASSUMPTIONS: |
| 2438 | * NA |
| 2439 | * |
| 2440 | *NOTE: |
| 2441 | * NA |
| 2442 | * |
| 2443 | * @param pMac Pointer to Global MAC structure |
| 2444 | * @param p80211Stats Statistics sent in response |
| 2445 | * @param resultCode TODO: |
| 2446 | * |
| 2447 | * |
| 2448 | * @return none |
| 2449 | */ |
| 2450 | |
| 2451 | void |
| 2452 | limSendSmePEStatisticsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) |
| 2453 | { |
| 2454 | tSirMsgQ mmhMsg; |
| 2455 | tANI_U8 sessionId; |
| 2456 | tAniGetPEStatsRsp *pPeStats = (tAniGetPEStatsRsp *) stats; |
| 2457 | tpPESession pPeSessionEntry; |
| 2458 | |
| 2459 | //Get the Session Id based on Sta Id |
| 2460 | pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId); |
| 2461 | |
| 2462 | //Fill the Session Id |
| 2463 | if(NULL != pPeSessionEntry) |
| 2464 | { |
| 2465 | //Fill the Session Id |
| 2466 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 2467 | } |
| 2468 | |
| 2469 | pPeStats->msgType = eWNI_SME_GET_STATISTICS_RSP; |
| 2470 | |
| 2471 | |
| 2472 | //msgType should be WDA_GET_STATISTICS_RSP |
| 2473 | mmhMsg.type = eWNI_SME_GET_STATISTICS_RSP; |
| 2474 | |
| 2475 | mmhMsg.bodyptr = stats; |
| 2476 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2477 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2478 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2479 | |
| 2480 | return; |
| 2481 | |
| 2482 | } /*** end limSendSmePEStatisticsRsp() ***/ |
| 2483 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2484 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 2485 | /** |
| 2486 | * limSendSmePEGetRoamRssiRsp() |
| 2487 | * |
| 2488 | *FUNCTION: |
| 2489 | * This function is called to send roam rssi response to HDD. |
| 2490 | * This function posts the result back to HDD. This is a response to |
| 2491 | * HDD's request to get roam rssi. |
| 2492 | * |
| 2493 | *PARAMS: |
| 2494 | * |
| 2495 | *LOGIC: |
| 2496 | * |
| 2497 | *ASSUMPTIONS: |
| 2498 | * NA |
| 2499 | * |
| 2500 | *NOTE: |
| 2501 | * NA |
| 2502 | * |
| 2503 | * @param pMac Pointer to Global MAC structure |
| 2504 | * @param p80211Stats Statistics sent in response |
| 2505 | * @param resultCode TODO: |
| 2506 | * |
| 2507 | * |
| 2508 | * @return none |
| 2509 | */ |
| 2510 | |
| 2511 | void |
| 2512 | limSendSmePEGetRoamRssiRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) |
| 2513 | { |
| 2514 | tSirMsgQ mmhMsg; |
| 2515 | tANI_U8 sessionId; |
| 2516 | tAniGetRoamRssiRsp *pPeStats = (tAniGetRoamRssiRsp *) stats; |
| 2517 | tpPESession pPeSessionEntry = NULL; |
| 2518 | |
| 2519 | //Get the Session Id based on Sta Id |
| 2520 | pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId); |
| 2521 | |
| 2522 | //Fill the Session Id |
| 2523 | if(NULL != pPeSessionEntry) |
| 2524 | { |
| 2525 | //Fill the Session Id |
| 2526 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 2527 | } |
| 2528 | |
| 2529 | pPeStats->msgType = eWNI_SME_GET_ROAM_RSSI_RSP; |
| 2530 | |
| 2531 | //msgType should be WDA_GET_STATISTICS_RSP |
| 2532 | mmhMsg.type = eWNI_SME_GET_ROAM_RSSI_RSP; |
| 2533 | |
| 2534 | mmhMsg.bodyptr = stats; |
| 2535 | mmhMsg.bodyval = 0; |
| 2536 | MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); |
| 2537 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2538 | |
| 2539 | return; |
| 2540 | |
| 2541 | } /*** end limSendSmePEGetRoamRssiRsp() ***/ |
| 2542 | |
| 2543 | #endif |
| 2544 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2545 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2546 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2547 | /** |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2548 | * limSendSmePEEseTsmRsp() |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2549 | * |
| 2550 | *FUNCTION: |
| 2551 | * This function is called to send tsm stats response to HDD. |
| 2552 | * This function posts the result back to HDD. This is a response to |
| 2553 | * HDD's request to get tsm stats. |
| 2554 | * |
| 2555 | *PARAMS: |
| 2556 | * @param pMac - Pointer to global pMac structure |
| 2557 | * @param pStats - Pointer to TSM Stats |
| 2558 | * |
| 2559 | * @return none |
| 2560 | */ |
| 2561 | |
| 2562 | void |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2563 | limSendSmePEEseTsmRsp(tpAniSirGlobal pMac, tAniGetTsmStatsRsp *pStats) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2564 | { |
| 2565 | tSirMsgQ mmhMsg; |
| 2566 | tANI_U8 sessionId; |
| 2567 | tAniGetTsmStatsRsp *pPeStats = (tAniGetTsmStatsRsp *) pStats; |
| 2568 | tpPESession pPeSessionEntry = NULL; |
| 2569 | |
| 2570 | //Get the Session Id based on Sta Id |
| 2571 | pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId); |
| 2572 | |
| 2573 | //Fill the Session Id |
| 2574 | if(NULL != pPeSessionEntry) |
| 2575 | { |
| 2576 | //Fill the Session Id |
| 2577 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 2578 | } |
| 2579 | else |
| 2580 | { |
| 2581 | PELOGE(limLog(pMac, LOGE, FL("Session not found for the Sta id(%d)"), |
| 2582 | pPeStats->staId);) |
| 2583 | return; |
| 2584 | } |
| 2585 | |
| 2586 | pPeStats->msgType = eWNI_SME_GET_TSM_STATS_RSP; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2587 | pPeStats->tsmMetrics.RoamingCount = pPeSessionEntry->eseContext.tsm.tsmMetrics.RoamingCount; |
| 2588 | pPeStats->tsmMetrics.RoamingDly = pPeSessionEntry->eseContext.tsm.tsmMetrics.RoamingDly; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2589 | |
| 2590 | mmhMsg.type = eWNI_SME_GET_TSM_STATS_RSP; |
| 2591 | mmhMsg.bodyptr = pStats; |
| 2592 | mmhMsg.bodyval = 0; |
| 2593 | MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); |
| 2594 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2595 | |
| 2596 | return; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2597 | } /*** end limSendSmePEEseTsmRsp() ***/ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2598 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2599 | #endif /* FEATURE_WLAN_ESE) && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2600 | |
| 2601 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2602 | void |
| 2603 | limSendSmeIBSSPeerInd( |
| 2604 | tpAniSirGlobal pMac, |
| 2605 | tSirMacAddr peerMacAddr, |
| 2606 | tANI_U16 staIndex, |
| 2607 | tANI_U8 ucastIdx, |
| 2608 | tANI_U8 bcastIdx, |
| 2609 | tANI_U8 *beacon, |
| 2610 | tANI_U16 beaconLen, |
| 2611 | tANI_U16 msgType, |
| 2612 | tANI_U8 sessionId) |
| 2613 | { |
| 2614 | tSirMsgQ mmhMsg; |
| 2615 | tSmeIbssPeerInd *pNewPeerInd; |
| 2616 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2617 | pNewPeerInd = vos_mem_malloc(sizeof(tSmeIbssPeerInd) + beaconLen); |
| 2618 | if ( NULL == pNewPeerInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2619 | { |
| 2620 | PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) |
| 2621 | return; |
| 2622 | } |
| 2623 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2624 | vos_mem_set((void *) pNewPeerInd, (sizeof(tSmeIbssPeerInd) + beaconLen), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2625 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2626 | vos_mem_copy( (tANI_U8 *) pNewPeerInd->peerAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2627 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2628 | pNewPeerInd->staId= staIndex; |
| 2629 | pNewPeerInd->ucastSig = ucastIdx; |
| 2630 | pNewPeerInd->bcastSig = bcastIdx; |
| 2631 | pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen; |
| 2632 | pNewPeerInd->mesgType = msgType; |
| 2633 | pNewPeerInd->sessionId = sessionId; |
| 2634 | |
| 2635 | if ( beacon != NULL ) |
| 2636 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2637 | vos_mem_copy((void*) ((tANI_U8*)pNewPeerInd+sizeof(tSmeIbssPeerInd)), |
| 2638 | (void*)beacon, beaconLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2639 | } |
| 2640 | |
| 2641 | mmhMsg.type = msgType; |
| 2642 | // mmhMsg.bodyval = (tANI_U32) pNewPeerInd; |
| 2643 | mmhMsg.bodyptr = pNewPeerInd; |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 2644 | MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2645 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2646 | |
| 2647 | } |
| 2648 | |
| 2649 | |
| 2650 | /** ----------------------------------------------------------------- |
| 2651 | \brief limSendExitBmpsInd() - sends exit bmps indication |
| 2652 | |
| 2653 | This function sends a eWNI_PMC_EXIT_BMPS_IND with a specific reason |
| 2654 | code to SME. This will trigger SME to get out of BMPS mode. |
| 2655 | |
| 2656 | \param pMac - global mac structure |
| 2657 | \param reasonCode - reason for which PE wish to exit BMPS |
| 2658 | \return none |
| 2659 | \sa |
| 2660 | ----------------------------------------------------------------- */ |
| 2661 | void limSendExitBmpsInd(tpAniSirGlobal pMac, tExitBmpsReason reasonCode) |
| 2662 | { |
| 2663 | tSirMsgQ mmhMsg; |
| 2664 | tANI_U16 msgLen = 0; |
| 2665 | tpSirSmeExitBmpsInd pExitBmpsInd; |
| 2666 | |
| 2667 | msgLen = sizeof(tSirSmeExitBmpsInd); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2668 | pExitBmpsInd = vos_mem_malloc(msgLen); |
| 2669 | if ( NULL == pExitBmpsInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2670 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2671 | limLog(pMac, LOGP, FL("AllocateMemory failed for PMC_EXIT_BMPS_IND ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2672 | return; |
| 2673 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2674 | vos_mem_set(pExitBmpsInd, msgLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2675 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2676 | pExitBmpsInd->mesgType = eWNI_PMC_EXIT_BMPS_IND; |
| 2677 | pExitBmpsInd->mesgLen = msgLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2678 | pExitBmpsInd->exitBmpsReason = reasonCode; |
| 2679 | pExitBmpsInd->statusCode = eSIR_SME_SUCCESS; |
| 2680 | |
| 2681 | mmhMsg.type = eWNI_PMC_EXIT_BMPS_IND; |
| 2682 | mmhMsg.bodyptr = pExitBmpsInd; |
| 2683 | mmhMsg.bodyval = 0; |
| 2684 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2685 | PELOG1(limLog(pMac, LOG1, FL("Sending eWNI_PMC_EXIT_BMPS_IND to SME. "));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2686 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2687 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2688 | limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, peGetValidPowerSaveSession(pMac), 0, (tANI_U16)reasonCode); |
| 2689 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2690 | |
| 2691 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2692 | return; |
| 2693 | |
| 2694 | } /*** end limSendExitBmpsInd() ***/ |
| 2695 | |
| 2696 | |
| 2697 | |
| 2698 | |
| 2699 | /*-------------------------------------------------------------------------- |
| 2700 | \brief peDeleteSession() - Handle the Delete BSS Response from HAL. |
| 2701 | |
| 2702 | |
| 2703 | \param pMac - pointer to global adapter context |
| 2704 | \param sessionId - Message pointer. |
| 2705 | |
| 2706 | \sa |
| 2707 | --------------------------------------------------------------------------*/ |
| 2708 | |
| 2709 | void limHandleDeleteBssRsp(tpAniSirGlobal pMac,tpSirMsgQ MsgQ) |
| 2710 | { |
| 2711 | tpPESession psessionEntry; |
| 2712 | tpDeleteBssParams pDelBss = (tpDeleteBssParams)(MsgQ->bodyptr); |
| 2713 | if((psessionEntry = peFindSessionBySessionId(pMac,pDelBss->sessionId))==NULL) |
| 2714 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2715 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2716 | return; |
| 2717 | } |
| 2718 | if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) |
| 2719 | { |
| 2720 | limIbssDelBssRsp(pMac, MsgQ->bodyptr,psessionEntry); |
| 2721 | } |
| 2722 | else if(psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) |
| 2723 | { |
| 2724 | limProcessSmeDelBssRsp(pMac, MsgQ->bodyval,psessionEntry); |
| 2725 | } |
| 2726 | |
| 2727 | else |
| 2728 | limProcessMlmDelBssRsp(pMac,MsgQ,psessionEntry); |
| 2729 | |
| 2730 | } |
| 2731 | |
| 2732 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2733 | /** ----------------------------------------------------------------- |
| 2734 | \brief limSendSmeAggrQosRsp() - sends SME FT AGGR QOS RSP |
| 2735 | \ This function sends a eWNI_SME_FT_AGGR_QOS_RSP to SME. |
| 2736 | \ SME only looks at rc and tspec field. |
| 2737 | \param pMac - global mac structure |
| 2738 | \param rspReqd - is SmeAddTsRsp required |
| 2739 | \param status - status code of eWNI_SME_FT_AGGR_QOS_RSP |
| 2740 | \return tspec |
| 2741 | \sa |
| 2742 | ----------------------------------------------------------------- */ |
| 2743 | void |
| 2744 | limSendSmeAggrQosRsp(tpAniSirGlobal pMac, tpSirAggrQosRsp aggrQosRsp, |
| 2745 | tANI_U8 smesessionId) |
| 2746 | { |
| 2747 | tSirMsgQ mmhMsg; |
| 2748 | |
| 2749 | mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP; |
| 2750 | mmhMsg.bodyptr = aggrQosRsp; |
| 2751 | mmhMsg.bodyval = 0; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2752 | MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2753 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2754 | |
| 2755 | return; |
| 2756 | } |
| 2757 | #endif |
| 2758 | |
| 2759 | /** ----------------------------------------------------------------- |
| 2760 | \brief limSendSmePreChannelSwitchInd() - sends an indication to SME |
| 2761 | before switching channels for spectrum manangement. |
| 2762 | |
| 2763 | This function sends a eWNI_SME_PRE_SWITCH_CHL_IND to SME. |
| 2764 | |
| 2765 | \param pMac - global mac structure |
| 2766 | \return none |
| 2767 | \sa |
| 2768 | ----------------------------------------------------------------- */ |
| 2769 | void |
| 2770 | limSendSmePreChannelSwitchInd(tpAniSirGlobal pMac) |
| 2771 | { |
| 2772 | tSirMsgQ mmhMsg; |
| 2773 | |
| 2774 | mmhMsg.type = eWNI_SME_PRE_SWITCH_CHL_IND; |
| 2775 | mmhMsg.bodyptr = NULL; |
| 2776 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2777 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2778 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2779 | |
| 2780 | return; |
| 2781 | } |
| 2782 | |
| 2783 | /** ----------------------------------------------------------------- |
| 2784 | \brief limSendSmePostChannelSwitchInd() - sends an indication to SME |
| 2785 | after channel switch for spectrum manangement is complete. |
| 2786 | |
| 2787 | This function sends a eWNI_SME_POST_SWITCH_CHL_IND to SME. |
| 2788 | |
| 2789 | \param pMac - global mac structure |
| 2790 | \return none |
| 2791 | \sa |
| 2792 | ----------------------------------------------------------------- */ |
| 2793 | void |
| 2794 | limSendSmePostChannelSwitchInd(tpAniSirGlobal pMac) |
| 2795 | { |
| 2796 | tSirMsgQ mmhMsg; |
| 2797 | |
| 2798 | mmhMsg.type = eWNI_SME_POST_SWITCH_CHL_IND; |
| 2799 | mmhMsg.bodyptr = NULL; |
| 2800 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2801 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2802 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2803 | |
| 2804 | return; |
| 2805 | } |
| 2806 | |
| 2807 | void limSendSmeMaxAssocExceededNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, |
| 2808 | tANI_U8 smesessionId) |
| 2809 | { |
| 2810 | tSirMsgQ mmhMsg; |
| 2811 | tSmeMaxAssocInd *pSmeMaxAssocInd; |
| 2812 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2813 | pSmeMaxAssocInd = vos_mem_malloc(sizeof(tSmeMaxAssocInd)); |
| 2814 | if ( NULL == pSmeMaxAssocInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2815 | { |
| 2816 | PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) |
| 2817 | return; |
| 2818 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2819 | vos_mem_set((void *) pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd),0); |
| 2820 | vos_mem_copy( (tANI_U8 *)pSmeMaxAssocInd->peerMac, |
| 2821 | (tANI_U8 *)peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2822 | pSmeMaxAssocInd->mesgType = eWNI_SME_MAX_ASSOC_EXCEEDED; |
| 2823 | pSmeMaxAssocInd->mesgLen = sizeof(tSmeMaxAssocInd); |
| 2824 | pSmeMaxAssocInd->sessionId = smesessionId; |
| 2825 | mmhMsg.type = pSmeMaxAssocInd->mesgType; |
| 2826 | mmhMsg.bodyptr = pSmeMaxAssocInd; |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 2827 | PELOG1(limLog(pMac, LOG1, FL("msgType %s peerMacAddr "MAC_ADDRESS_STR |
| 2828 | " sme session id %d"), "eWNI_SME_MAX_ASSOC_EXCEEDED", MAC_ADDR_ARRAY(peerMacAddr));) |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 2829 | MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2830 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2831 | |
| 2832 | return; |
| 2833 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2834 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2835 | /** ----------------------------------------------------------------- |
| 2836 | \brief limSendSmeCandidateFoundInd() - sends |
| 2837 | eWNI_SME_CANDIDATE_FOUND_IND |
| 2838 | |
| 2839 | After receiving candidate found indication frame from FW, this |
| 2840 | function sends a eWNI_SME_CANDIDATE_FOUND_IND to SME to notify |
| 2841 | roam candidate(s) are available. |
| 2842 | |
| 2843 | \param pMac - global mac structure |
| 2844 | \param psessionEntry - session info |
| 2845 | \return none |
| 2846 | \sa |
| 2847 | ----------------------------------------------------------------- */ |
| 2848 | void |
| 2849 | limSendSmeCandidateFoundInd(tpAniSirGlobal pMac, tANI_U8 sessionId) |
| 2850 | { |
| 2851 | tSirMsgQ mmhMsg; |
| 2852 | tSirSmeCandidateFoundInd *pSirSmeCandidateFoundInd; |
| 2853 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2854 | pSirSmeCandidateFoundInd = vos_mem_malloc(sizeof(tSirSmeCandidateFoundInd)); |
| 2855 | if ( NULL == pSirSmeCandidateFoundInd ) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2856 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2857 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_CANDIDATE_FOUND_IND\n")); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2858 | return; |
| 2859 | } |
| 2860 | |
| 2861 | pSirSmeCandidateFoundInd->messageType = eWNI_SME_CANDIDATE_FOUND_IND; |
| 2862 | pSirSmeCandidateFoundInd->length = sizeof(tSirSmeDisassocInd); |
| 2863 | |
| 2864 | pSirSmeCandidateFoundInd->sessionId = sessionId; |
| 2865 | |
| 2866 | |
| 2867 | limLog( pMac, LOGE, FL("posting candidate ind to SME")); |
| 2868 | mmhMsg.type = eWNI_SME_CANDIDATE_FOUND_IND; |
| 2869 | mmhMsg.bodyptr = pSirSmeCandidateFoundInd; |
| 2870 | mmhMsg.bodyval = 0; |
| 2871 | |
| 2872 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2873 | |
| 2874 | } /*** end limSendSmeCandidateFoundInd() ***/ |
| 2875 | #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD |