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