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