Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 21 | |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 22 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | * This file limSendSmeRspMessages.cc contains the functions |
| 30 | * for sending SME response/notification messages to applications |
| 31 | * above MAC software. |
| 32 | * Author: Chandra Modumudi |
| 33 | * Date: 02/13/02 |
| 34 | * History:- |
| 35 | * Date Modified by Modification Information |
| 36 | * -------------------------------------------------------------------- |
| 37 | */ |
| 38 | |
| 39 | #include "vos_types.h" |
| 40 | #include "wniApi.h" |
| 41 | #include "sirCommon.h" |
| 42 | #include "aniGlobal.h" |
| 43 | |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 44 | #include "wniCfg.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 45 | #include "sysDef.h" |
| 46 | #include "cfgApi.h" |
| 47 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 48 | |
| 49 | #include "schApi.h" |
| 50 | #include "utilsApi.h" |
| 51 | #include "limUtils.h" |
| 52 | #include "limSecurityUtils.h" |
| 53 | #include "limSerDesUtils.h" |
| 54 | #include "limSendSmeRspMessages.h" |
| 55 | #include "limIbssPeerMgmt.h" |
| 56 | #include "limSessionUtils.h" |
| 57 | |
| 58 | |
| 59 | /** |
| 60 | * limSendSmeRsp() |
| 61 | * |
| 62 | *FUNCTION: |
| 63 | * This function is called by limProcessSmeReqMessages() to send |
| 64 | * eWNI_SME_START_RSP, eWNI_SME_MEASUREMENT_RSP, eWNI_SME_STOP_BSS_RSP |
| 65 | * or eWNI_SME_SWITCH_CHL_RSP messages to applications above MAC |
| 66 | * Software. |
| 67 | * |
| 68 | *PARAMS: |
| 69 | * |
| 70 | *LOGIC: |
| 71 | * |
| 72 | *ASSUMPTIONS: |
| 73 | * NA |
| 74 | * |
| 75 | *NOTE: |
| 76 | * NA |
| 77 | * |
| 78 | * @param pMac Pointer to Global MAC structure |
| 79 | * @param msgType Indicates message type |
| 80 | * @param resultCode Indicates the result of previously issued |
| 81 | * eWNI_SME_msgType_REQ message |
| 82 | * |
| 83 | * @return None |
| 84 | */ |
| 85 | |
| 86 | void |
| 87 | limSendSmeRsp(tpAniSirGlobal pMac, tANI_U16 msgType, |
| 88 | tSirResultCodes resultCode,tANI_U8 smesessionId, tANI_U16 smetransactionId) |
| 89 | { |
| 90 | tSirMsgQ mmhMsg; |
| 91 | tSirSmeRsp *pSirSmeRsp; |
| 92 | |
| 93 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 94 | FL("Sending message %s with reasonCode %s"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 95 | limMsgStr(msgType), limResultCodeStr(resultCode));) |
| 96 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 97 | pSirSmeRsp = vos_mem_malloc(sizeof(tSirSmeRsp)); |
| 98 | if ( NULL == pSirSmeRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 99 | { |
| 100 | /// Buffer not available. Log error |
| 101 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 102 | FL("call to AllocateMemory failed for eWNI_SME_*_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 103 | |
| 104 | return; |
| 105 | } |
| 106 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 107 | pSirSmeRsp->messageType = msgType; |
| 108 | pSirSmeRsp->length = sizeof(tSirSmeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | pSirSmeRsp->statusCode = resultCode; |
| 110 | |
| 111 | /* Update SME session Id and Transaction Id */ |
| 112 | pSirSmeRsp->sessionId = smesessionId; |
| 113 | pSirSmeRsp->transactionId = smetransactionId; |
| 114 | |
| 115 | |
| 116 | mmhMsg.type = msgType; |
| 117 | mmhMsg.bodyptr = pSirSmeRsp; |
| 118 | mmhMsg.bodyval = 0; |
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; |
| 1372 | pSirSmeDisConDoneInd->reasonCode = reasonCode; |
| 1373 | pMsg = (tANI_U32 *)pSirSmeDisConDoneInd; |
| 1374 | break; |
| 1375 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1376 | default: |
| 1377 | /** |
| 1378 | * Disassociation indication due to Disassociation |
| 1379 | * frame reception from peer entity or due to |
| 1380 | * loss of link with peer entity. |
| 1381 | */ |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1382 | pSirSmeDisassocInd = vos_mem_malloc(sizeof(tSirSmeDisassocInd)); |
| 1383 | if ( NULL == pSirSmeDisassocInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1384 | { |
| 1385 | // Log error |
| 1386 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1387 | FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1388 | |
Sushant Kaushik | 7ac65f0 | 2015-04-13 16:12:23 +0530 | [diff] [blame] | 1389 | failure = TRUE; |
| 1390 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1391 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 1392 | limLog(pMac, LOG1, FL("send eWNI_SME_DISASSOC_IND with " |
| 1393 | "retCode: %d for "MAC_ADDRESS_STR),reasonCode, |
| 1394 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1395 | pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND; |
| 1396 | pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd); |
| 1397 | |
| 1398 | /* Update SME session Id and Transaction Id */ |
| 1399 | pSirSmeDisassocInd->sessionId = smesessionId; |
| 1400 | pSirSmeDisassocInd->transactionId = smetransactionId; |
Mohit Khanna | 99d5fd0 | 2012-09-11 14:51:20 -0700 | [diff] [blame] | 1401 | pSirSmeDisassocInd->reasonCode = reasonCode; |
Wu Gao | 742b735 | 2015-10-16 19:10:40 +0800 | [diff] [blame] | 1402 | pSirSmeDisassocInd->assocId = aid; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1403 | pBuf = (tANI_U8 *) &pSirSmeDisassocInd->statusCode; |
| 1404 | |
| 1405 | limCopyU32(pBuf, reasonCode); |
| 1406 | pBuf += sizeof(tSirResultCodes); |
| 1407 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1408 | vos_mem_copy( pBuf, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1409 | pBuf += sizeof(tSirMacAddr); |
| 1410 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1411 | vos_mem_copy( pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1412 | |
| 1413 | |
| 1414 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1415 | limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, |
| 1416 | psessionEntry, (tANI_U16)reasonCode, 0); |
| 1417 | #endif |
| 1418 | pMsg = (tANI_U32*) pSirSmeDisassocInd; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1419 | |
| 1420 | break; |
| 1421 | } |
| 1422 | |
Sushant Kaushik | 7ac65f0 | 2015-04-13 16:12:23 +0530 | [diff] [blame] | 1423 | error: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1424 | /* Delete the PE session Created */ |
| 1425 | if((psessionEntry != NULL) && ((psessionEntry ->limSystemRole == eLIM_STA_ROLE) || |
| 1426 | (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE)) ) |
| 1427 | { |
| 1428 | peDeleteSession(pMac,psessionEntry); |
| 1429 | } |
Sushant Kaushik | 7ac65f0 | 2015-04-13 16:12:23 +0530 | [diff] [blame] | 1430 | if (failure == FALSE) |
| 1431 | limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, |
| 1432 | (tANI_U32*) pMsg ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1433 | } /*** end limSendSmeDisassocNtf() ***/ |
| 1434 | |
| 1435 | |
| 1436 | /** ----------------------------------------------------------------- |
| 1437 | \brief limSendSmeDisassocInd() - sends SME_DISASSOC_IND |
| 1438 | |
| 1439 | After receiving disassociation frame from peer entity, this |
| 1440 | function sends a eWNI_SME_DISASSOC_IND to SME with a specific |
| 1441 | reason code. |
| 1442 | |
| 1443 | \param pMac - global mac structure |
| 1444 | \param pStaDs - station dph hash node |
| 1445 | \return none |
| 1446 | \sa |
| 1447 | ----------------------------------------------------------------- */ |
| 1448 | void |
| 1449 | limSendSmeDisassocInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionEntry) |
| 1450 | { |
| 1451 | tSirMsgQ mmhMsg; |
| 1452 | tSirSmeDisassocInd *pSirSmeDisassocInd; |
| 1453 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1454 | pSirSmeDisassocInd = vos_mem_malloc(sizeof(tSirSmeDisassocInd)); |
| 1455 | if ( NULL == pSirSmeDisassocInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1456 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1457 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_DISASSOC_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1458 | return; |
| 1459 | } |
| 1460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1461 | pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND; |
| 1462 | pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1463 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1464 | pSirSmeDisassocInd->sessionId = psessionEntry->smeSessionId; |
| 1465 | pSirSmeDisassocInd->transactionId = psessionEntry->transactionId; |
| 1466 | pSirSmeDisassocInd->statusCode = pStaDs->mlmStaContext.disassocReason; |
Mohit Khanna | 99d5fd0 | 2012-09-11 14:51:20 -0700 | [diff] [blame] | 1467 | pSirSmeDisassocInd->reasonCode = pStaDs->mlmStaContext.disassocReason; |
Wu Gao | 742b735 | 2015-10-16 19:10:40 +0800 | [diff] [blame] | 1468 | pSirSmeDisassocInd->assocId = pStaDs->assocId; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1469 | |
| 1470 | vos_mem_copy( pSirSmeDisassocInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr)); |
| 1471 | |
| 1472 | vos_mem_copy( pSirSmeDisassocInd->peerMacAddr, pStaDs->staAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1473 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1474 | pSirSmeDisassocInd->staId = pStaDs->staIndex; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1475 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1476 | mmhMsg.type = eWNI_SME_DISASSOC_IND; |
| 1477 | mmhMsg.bodyptr = pSirSmeDisassocInd; |
| 1478 | mmhMsg.bodyval = 0; |
| 1479 | |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 1480 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId, |
| 1481 | mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1482 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1483 | limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, psessionEntry, 0, (tANI_U16)pStaDs->mlmStaContext.disassocReason); |
| 1484 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1485 | |
| 1486 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1487 | |
| 1488 | } /*** end limSendSmeDisassocInd() ***/ |
| 1489 | |
| 1490 | |
| 1491 | /** ----------------------------------------------------------------- |
| 1492 | \brief limSendSmeDeauthInd() - sends SME_DEAUTH_IND |
| 1493 | |
| 1494 | After receiving deauthentication frame from peer entity, this |
| 1495 | function sends a eWNI_SME_DEAUTH_IND to SME with a specific |
| 1496 | reason code. |
| 1497 | |
| 1498 | \param pMac - global mac structure |
| 1499 | \param pStaDs - station dph hash node |
| 1500 | \return none |
| 1501 | \sa |
| 1502 | ----------------------------------------------------------------- */ |
| 1503 | void |
| 1504 | limSendSmeDeauthInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry) |
| 1505 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1506 | tSirMsgQ mmhMsg; |
| 1507 | tSirSmeDeauthInd *pSirSmeDeauthInd; |
| 1508 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1509 | pSirSmeDeauthInd = vos_mem_malloc(sizeof(tSirSmeDeauthInd)); |
| 1510 | if ( NULL == pSirSmeDeauthInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1511 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1512 | limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_DEAUTH_IND ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1513 | return; |
| 1514 | } |
| 1515 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1516 | pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND; |
| 1517 | pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1518 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1519 | pSirSmeDeauthInd->sessionId = psessionEntry->smeSessionId; |
| 1520 | pSirSmeDeauthInd->transactionId = psessionEntry->transactionId; |
Wu Gao | 742b735 | 2015-10-16 19:10:40 +0800 | [diff] [blame] | 1521 | pSirSmeDeauthInd->assocId = pStaDs->assocId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1522 | if(eSIR_INFRA_AP_MODE == psessionEntry->bssType) |
| 1523 | { |
| 1524 | pSirSmeDeauthInd->statusCode = (tSirResultCodes)pStaDs->mlmStaContext.cleanupTrigger; |
| 1525 | } |
| 1526 | else |
| 1527 | { |
| 1528 | //Need to indicatet he reascon code over the air |
| 1529 | pSirSmeDeauthInd->statusCode = (tSirResultCodes)pStaDs->mlmStaContext.disassocReason; |
| 1530 | } |
| 1531 | //BSSID |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1532 | vos_mem_copy( pSirSmeDeauthInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1533 | //peerMacAddr |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1534 | vos_mem_copy( pSirSmeDeauthInd->peerMacAddr, pStaDs->staAddr, sizeof(tSirMacAddr)); |
Mohit Khanna | 99d5fd0 | 2012-09-11 14:51:20 -0700 | [diff] [blame] | 1535 | pSirSmeDeauthInd->reasonCode = pStaDs->mlmStaContext.disassocReason; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1536 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1537 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1538 | pSirSmeDeauthInd->staId = pStaDs->staIndex; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1539 | |
| 1540 | mmhMsg.type = eWNI_SME_DEAUTH_IND; |
| 1541 | mmhMsg.bodyptr = pSirSmeDeauthInd; |
| 1542 | mmhMsg.bodyval = 0; |
| 1543 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1544 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1545 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1546 | limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, psessionEntry, 0, pStaDs->mlmStaContext.cleanupTrigger); |
| 1547 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1548 | |
| 1549 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1550 | return; |
| 1551 | } /*** end limSendSmeDeauthInd() ***/ |
| 1552 | |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1553 | #ifdef FEATURE_WLAN_TDLS |
| 1554 | /** |
| 1555 | * limSendSmeTDLSDelStaInd() |
| 1556 | * |
| 1557 | *FUNCTION: |
| 1558 | * This function is called to send the TDLS STA context deletion to SME. |
| 1559 | * |
| 1560 | *LOGIC: |
| 1561 | * |
| 1562 | *ASSUMPTIONS: |
| 1563 | * |
| 1564 | *NOTE: |
| 1565 | * NA |
| 1566 | * |
| 1567 | * @param pMac - Pointer to global MAC structure |
| 1568 | * @param pStaDs - Pointer to internal STA Datastructure |
| 1569 | * @param psessionEntry - Pointer to the session entry |
| 1570 | * @param reasonCode - Reason for TDLS sta deletion |
| 1571 | * @return None |
| 1572 | */ |
| 1573 | void |
| 1574 | limSendSmeTDLSDelStaInd(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry, tANI_U16 reasonCode) |
| 1575 | { |
| 1576 | tSirMsgQ mmhMsg; |
| 1577 | tSirTdlsDelStaInd *pSirTdlsDelStaInd; |
| 1578 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1579 | pSirTdlsDelStaInd = vos_mem_malloc(sizeof(tSirTdlsDelStaInd)); |
| 1580 | if ( NULL == pSirTdlsDelStaInd ) |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1581 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1582 | 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] | 1583 | return; |
| 1584 | } |
| 1585 | |
| 1586 | //messageType |
| 1587 | pSirTdlsDelStaInd->messageType = eWNI_SME_TDLS_DEL_STA_IND; |
| 1588 | pSirTdlsDelStaInd->length = sizeof(tSirTdlsDelStaInd); |
| 1589 | |
| 1590 | //sessionId |
| 1591 | pSirTdlsDelStaInd->sessionId = psessionEntry->smeSessionId; |
| 1592 | |
| 1593 | //peerMacAddr |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1594 | vos_mem_copy( pSirTdlsDelStaInd->peerMac, pStaDs->staAddr, sizeof(tSirMacAddr)); |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1595 | |
| 1596 | //staId |
| 1597 | limCopyU16((tANI_U8*)(&pSirTdlsDelStaInd->staId), (tANI_U16)pStaDs->staIndex); |
| 1598 | |
| 1599 | //reasonCode |
| 1600 | limCopyU16((tANI_U8*)(&pSirTdlsDelStaInd->reasonCode), reasonCode); |
| 1601 | |
| 1602 | mmhMsg.type = eWNI_SME_TDLS_DEL_STA_IND; |
| 1603 | mmhMsg.bodyptr = pSirTdlsDelStaInd; |
| 1604 | mmhMsg.bodyval = 0; |
| 1605 | |
| 1606 | |
| 1607 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1608 | return; |
| 1609 | }/*** end limSendSmeTDLSDelStaInd() ***/ |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 1610 | |
| 1611 | /** |
| 1612 | * limSendSmeTDLSDeleteAllPeerInd() |
| 1613 | * |
| 1614 | *FUNCTION: |
| 1615 | * This function is called to send the eWNI_SME_TDLS_DEL_ALL_PEER_IND |
| 1616 | * message to SME. |
| 1617 | * |
| 1618 | *LOGIC: |
| 1619 | * |
| 1620 | *ASSUMPTIONS: |
| 1621 | * |
| 1622 | *NOTE: |
| 1623 | * NA |
| 1624 | * |
| 1625 | * @param pMac - Pointer to global MAC structure |
| 1626 | * @param psessionEntry - Pointer to the session entry |
| 1627 | * @return None |
| 1628 | */ |
| 1629 | void |
| 1630 | limSendSmeTDLSDeleteAllPeerInd(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 1631 | { |
| 1632 | tSirMsgQ mmhMsg; |
| 1633 | tSirTdlsDelAllPeerInd *pSirTdlsDelAllPeerInd; |
| 1634 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1635 | pSirTdlsDelAllPeerInd = vos_mem_malloc(sizeof(tSirTdlsDelAllPeerInd)); |
| 1636 | if ( NULL == pSirTdlsDelAllPeerInd ) |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 1637 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1638 | 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] | 1639 | return; |
| 1640 | } |
| 1641 | |
| 1642 | //messageType |
| 1643 | pSirTdlsDelAllPeerInd->messageType = eWNI_SME_TDLS_DEL_ALL_PEER_IND; |
| 1644 | pSirTdlsDelAllPeerInd->length = sizeof(tSirTdlsDelAllPeerInd); |
| 1645 | |
| 1646 | //sessionId |
| 1647 | pSirTdlsDelAllPeerInd->sessionId = psessionEntry->smeSessionId; |
| 1648 | |
| 1649 | mmhMsg.type = eWNI_SME_TDLS_DEL_ALL_PEER_IND; |
| 1650 | mmhMsg.bodyptr = pSirTdlsDelAllPeerInd; |
| 1651 | mmhMsg.bodyval = 0; |
| 1652 | |
| 1653 | |
| 1654 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1655 | return; |
| 1656 | }/*** end limSendSmeTDLSDeleteAllPeerInd() ***/ |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1657 | |
| 1658 | /** |
| 1659 | * limSendSmeMgmtTXCompletion() |
| 1660 | * |
| 1661 | *FUNCTION: |
| 1662 | * This function is called to send the eWNI_SME_MGMT_FRM_TX_COMPLETION_IND |
| 1663 | * message to SME. |
| 1664 | * |
| 1665 | *LOGIC: |
| 1666 | * |
| 1667 | *ASSUMPTIONS: |
| 1668 | * |
| 1669 | *NOTE: |
| 1670 | * NA |
| 1671 | * |
| 1672 | * @param pMac - Pointer to global MAC structure |
| 1673 | * @param psessionEntry - Pointer to the session entry |
| 1674 | * @param txCompleteStatus - TX Complete Status of Mgmt Frames |
| 1675 | * @return None |
| 1676 | */ |
| 1677 | void |
| 1678 | limSendSmeMgmtTXCompletion(tpAniSirGlobal pMac, |
Ganesh Kondabattini | ff98702 | 2015-08-11 19:43:44 +0530 | [diff] [blame] | 1679 | tANI_U32 smeSessionId, |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1680 | tANI_U32 txCompleteStatus) |
| 1681 | { |
| 1682 | tSirMsgQ mmhMsg; |
| 1683 | tSirMgmtTxCompletionInd *pSirMgmtTxCompletionInd; |
| 1684 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1685 | pSirMgmtTxCompletionInd = vos_mem_malloc(sizeof(tSirMgmtTxCompletionInd)); |
| 1686 | if ( NULL == pSirMgmtTxCompletionInd ) |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1687 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1688 | 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] | 1689 | return; |
| 1690 | } |
| 1691 | |
| 1692 | //messageType |
| 1693 | pSirMgmtTxCompletionInd->messageType = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND; |
| 1694 | pSirMgmtTxCompletionInd->length = sizeof(tSirMgmtTxCompletionInd); |
| 1695 | |
| 1696 | //sessionId |
Ganesh Kondabattini | ff98702 | 2015-08-11 19:43:44 +0530 | [diff] [blame] | 1697 | pSirMgmtTxCompletionInd->sessionId = smeSessionId; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1698 | |
| 1699 | pSirMgmtTxCompletionInd->txCompleteStatus = txCompleteStatus; |
| 1700 | |
| 1701 | mmhMsg.type = eWNI_SME_MGMT_FRM_TX_COMPLETION_IND; |
| 1702 | mmhMsg.bodyptr = pSirMgmtTxCompletionInd; |
| 1703 | mmhMsg.bodyval = 0; |
| 1704 | |
| 1705 | |
| 1706 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 1707 | return; |
| 1708 | }/*** end limSendSmeTDLSDeleteAllPeerInd() ***/ |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 1709 | #endif |
| 1710 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1711 | |
| 1712 | /** |
| 1713 | * limSendSmeDeauthNtf() |
| 1714 | * |
| 1715 | *FUNCTION: |
| 1716 | * This function is called by limProcessSmeMessages() to send |
| 1717 | * eWNI_SME_DISASSOC_RSP/IND message to host |
| 1718 | * |
| 1719 | *PARAMS: |
| 1720 | * |
| 1721 | *LOGIC: |
| 1722 | * |
| 1723 | *ASSUMPTIONS: |
| 1724 | * NA |
| 1725 | * |
| 1726 | *NOTE: |
| 1727 | * This function is used for sending eWNI_SME_DEAUTH_CNF or |
| 1728 | * eWNI_SME_DEAUTH_IND to host depending on deauthentication trigger. |
| 1729 | * |
| 1730 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 1731 | * deauthentication was initiated |
| 1732 | * @param reasonCode Indicates the reason for Deauthetication |
| 1733 | * @param deauthTrigger Indicates the trigger for Deauthetication |
| 1734 | * @param aid Indicates the STAID. This parameter is present |
| 1735 | * only on AP. |
| 1736 | * |
| 1737 | * @return None |
| 1738 | */ |
| 1739 | void |
| 1740 | limSendSmeDeauthNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tSirResultCodes reasonCode, |
| 1741 | tANI_U16 deauthTrigger, tANI_U16 aid,tANI_U8 smesessionId, tANI_U16 smetransactionId) |
| 1742 | { |
| 1743 | tANI_U8 *pBuf; |
| 1744 | tSirSmeDeauthRsp *pSirSmeDeauthRsp; |
| 1745 | tSirSmeDeauthInd *pSirSmeDeauthInd; |
Hanumantha Reddy Pothula | 1b6eb2f | 2015-11-30 20:50:23 +0530 | [diff] [blame] | 1746 | tSirSmeDisConDoneInd *pSirSmeDisConDoneInd; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1747 | tpPESession psessionEntry; |
| 1748 | tANI_U8 sessionId; |
| 1749 | tANI_U32 *pMsg; |
| 1750 | |
| 1751 | psessionEntry = peFindSessionByBssid(pMac,peerMacAddr,&sessionId); |
| 1752 | switch (deauthTrigger) |
| 1753 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1754 | case eLIM_HOST_DEAUTH: |
| 1755 | /** |
| 1756 | * Deauthentication response to host triggered |
| 1757 | * deauthentication. |
| 1758 | */ |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1759 | pSirSmeDeauthRsp = vos_mem_malloc(sizeof(tSirSmeDeauthRsp)); |
| 1760 | if ( NULL == pSirSmeDeauthRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1761 | { |
| 1762 | // Log error |
| 1763 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1764 | FL("call to AllocateMemory failed for eWNI_SME_DEAUTH_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1765 | |
| 1766 | return; |
| 1767 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 1768 | limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_RSP with " |
| 1769 | "retCode: %d for"MAC_ADDRESS_STR),reasonCode, |
| 1770 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1771 | pSirSmeDeauthRsp->messageType = eWNI_SME_DEAUTH_RSP; |
| 1772 | pSirSmeDeauthRsp->length = sizeof(tSirSmeDeauthRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1773 | pSirSmeDeauthRsp->statusCode = reasonCode; |
| 1774 | pSirSmeDeauthRsp->sessionId = smesessionId; |
| 1775 | pSirSmeDeauthRsp->transactionId = smetransactionId; |
| 1776 | |
| 1777 | pBuf = (tANI_U8 *) pSirSmeDeauthRsp->peerMacAddr; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1778 | vos_mem_copy( pBuf, peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1779 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1780 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1781 | limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT, |
| 1782 | psessionEntry, 0, (tANI_U16)reasonCode); |
| 1783 | #endif |
| 1784 | pMsg = (tANI_U32*)pSirSmeDeauthRsp; |
| 1785 | |
| 1786 | break; |
| 1787 | |
Hanumantha Reddy Pothula | 1b6eb2f | 2015-11-30 20:50:23 +0530 | [diff] [blame] | 1788 | case eLIM_PEER_ENTITY_DEAUTH: |
| 1789 | case eLIM_LINK_MONITORING_DEAUTH: |
| 1790 | pSirSmeDisConDoneInd = vos_mem_malloc(sizeof(tSirSmeDisConDoneInd)); |
| 1791 | if ( NULL == pSirSmeDisConDoneInd ) |
| 1792 | { |
| 1793 | // Log error |
| 1794 | limLog(pMac, LOGP, |
| 1795 | FL("call to AllocateMemory failed for disconnect indication")); |
| 1796 | |
| 1797 | return; |
| 1798 | } |
| 1799 | vos_mem_zero(pSirSmeDisConDoneInd, sizeof(tSirSmeDisConDoneInd)); |
| 1800 | limLog(pMac, LOG1, |
| 1801 | FL("send eWNI_SME_DISCONNECT_DONE_IND withretCode: %d"), |
| 1802 | reasonCode); |
Deepthi Gowri | dc197d0 | 2015-12-30 16:48:32 +0530 | [diff] [blame^] | 1803 | |
Hanumantha Reddy Pothula | 1b6eb2f | 2015-11-30 20:50:23 +0530 | [diff] [blame] | 1804 | pSirSmeDisConDoneInd->messageType = eWNI_SME_DISCONNECT_DONE_IND; |
| 1805 | pSirSmeDisConDoneInd->length = sizeof(tSirSmeDisConDoneInd); |
Deepthi Gowri | dc197d0 | 2015-12-30 16:48:32 +0530 | [diff] [blame^] | 1806 | vos_mem_copy(pSirSmeDisConDoneInd->peerMacAddr, peerMacAddr, |
| 1807 | sizeof(tSirMacAddr)); |
Hanumantha Reddy Pothula | 1b6eb2f | 2015-11-30 20:50:23 +0530 | [diff] [blame] | 1808 | pSirSmeDisConDoneInd->sessionId = smesessionId; |
| 1809 | pSirSmeDisConDoneInd->reasonCode = reasonCode; |
| 1810 | pMsg = (tANI_U32 *)pSirSmeDisConDoneInd; |
| 1811 | break; |
| 1812 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1813 | default: |
| 1814 | /** |
| 1815 | * Deauthentication indication due to Deauthentication |
| 1816 | * frame reception from peer entity or due to |
| 1817 | * loss of link with peer entity. |
| 1818 | */ |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1819 | pSirSmeDeauthInd = vos_mem_malloc(sizeof(tSirSmeDeauthInd)); |
| 1820 | if ( NULL == pSirSmeDeauthInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1821 | { |
| 1822 | // Log error |
| 1823 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1824 | FL("call to AllocateMemory failed for eWNI_SME_DEAUTH_Ind")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1825 | |
| 1826 | return; |
| 1827 | } |
Abhishek Singh | cd09b56 | 2013-12-24 16:02:20 +0530 | [diff] [blame] | 1828 | limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_IND with " |
| 1829 | "retCode: %d for "MAC_ADDRESS_STR),reasonCode, |
| 1830 | MAC_ADDR_ARRAY(peerMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1831 | pSirSmeDeauthInd->messageType = eWNI_SME_DEAUTH_IND; |
| 1832 | pSirSmeDeauthInd->length = sizeof(tSirSmeDeauthInd); |
Mohit Khanna | 99d5fd0 | 2012-09-11 14:51:20 -0700 | [diff] [blame] | 1833 | pSirSmeDeauthInd->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
Wu Gao | 742b735 | 2015-10-16 19:10:40 +0800 | [diff] [blame] | 1834 | pSirSmeDeauthInd->assocId = aid; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1835 | |
| 1836 | // sessionId |
| 1837 | pBuf = (tANI_U8*) &pSirSmeDeauthInd->sessionId; |
| 1838 | *pBuf++ = smesessionId; |
| 1839 | |
| 1840 | //transaction ID |
| 1841 | limCopyU16(pBuf, smetransactionId); |
| 1842 | pBuf += sizeof(tANI_U16); |
| 1843 | |
| 1844 | // status code |
| 1845 | limCopyU32(pBuf, reasonCode); |
| 1846 | pBuf += sizeof(tSirResultCodes); |
| 1847 | |
| 1848 | //bssId |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1849 | vos_mem_copy( pBuf, psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1850 | pBuf += sizeof(tSirMacAddr); |
| 1851 | |
| 1852 | //peerMacAddr |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1853 | vos_mem_copy( pSirSmeDeauthInd->peerMacAddr, peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1854 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1855 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1856 | limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_IND_EVENT, |
| 1857 | psessionEntry, 0, (tANI_U16)reasonCode); |
| 1858 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1859 | pMsg = (tANI_U32*)pSirSmeDeauthInd; |
| 1860 | |
| 1861 | break; |
| 1862 | } |
| 1863 | |
| 1864 | /*Delete the PE session created */ |
| 1865 | if(psessionEntry != NULL) |
| 1866 | { |
| 1867 | peDeleteSession(pMac,psessionEntry); |
| 1868 | } |
| 1869 | |
Madan Mohan Koyyalamudi | 27ecc28 | 2012-11-06 15:07:28 -0800 | [diff] [blame] | 1870 | limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, |
| 1871 | (tANI_U32*) pMsg ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1872 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1873 | } /*** end limSendSmeDeauthNtf() ***/ |
| 1874 | |
| 1875 | |
| 1876 | /** |
| 1877 | * limSendSmeWmStatusChangeNtf() |
| 1878 | * |
| 1879 | *FUNCTION: |
| 1880 | * This function is called by limProcessSmeMessages() to send |
| 1881 | * eWNI_SME_WM_STATUS_CHANGE_NTF message to host. |
| 1882 | * |
| 1883 | *PARAMS: |
| 1884 | * |
| 1885 | *LOGIC: |
| 1886 | * |
| 1887 | *ASSUMPTIONS: |
| 1888 | * NA |
| 1889 | * |
| 1890 | *NOTE: |
| 1891 | * |
| 1892 | * @param statusChangeCode Indicates the change in the wireless medium. |
| 1893 | * @param statusChangeInfo Indicates the information associated with |
| 1894 | * change in the wireless medium. |
| 1895 | * @param infoLen Indicates the length of status change information |
| 1896 | * being sent. |
| 1897 | * |
| 1898 | * @return None |
| 1899 | */ |
| 1900 | void |
| 1901 | limSendSmeWmStatusChangeNtf(tpAniSirGlobal pMac, tSirSmeStatusChangeCode statusChangeCode, |
| 1902 | tANI_U32 *pStatusChangeInfo, tANI_U16 infoLen, tANI_U8 sessionId) |
| 1903 | { |
| 1904 | tSirMsgQ mmhMsg; |
| 1905 | tSirSmeWmStatusChangeNtf *pSirSmeWmStatusChangeNtf; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1906 | pSirSmeWmStatusChangeNtf = vos_mem_malloc(sizeof(tSirSmeWmStatusChangeNtf)); |
| 1907 | if ( NULL == pSirSmeWmStatusChangeNtf ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1908 | { |
| 1909 | limLog(pMac, LOGE, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1910 | FL("call to AllocateMemory failed for eWNI_SME_WM_STATUS_CHANGE_NTF")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1911 | return; |
| 1912 | } |
| 1913 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1914 | |
| 1915 | mmhMsg.type = eWNI_SME_WM_STATUS_CHANGE_NTF; |
| 1916 | mmhMsg.bodyval = 0; |
| 1917 | mmhMsg.bodyptr = pSirSmeWmStatusChangeNtf; |
| 1918 | |
| 1919 | switch(statusChangeCode) |
| 1920 | { |
| 1921 | case eSIR_SME_RADAR_DETECTED: |
| 1922 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1923 | break; |
| 1924 | |
| 1925 | case eSIR_SME_CB_LEGACY_BSS_FOUND_BY_AP: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1926 | break; |
| 1927 | |
| 1928 | case eSIR_SME_BACKGROUND_SCAN_FAIL: |
| 1929 | limPackBkgndScanFailNotify(pMac, |
| 1930 | statusChangeCode, |
| 1931 | (tpSirBackgroundScanInfo)pStatusChangeInfo, |
| 1932 | pSirSmeWmStatusChangeNtf, sessionId); |
| 1933 | break; |
| 1934 | |
| 1935 | default: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1936 | pSirSmeWmStatusChangeNtf->messageType = eWNI_SME_WM_STATUS_CHANGE_NTF; |
| 1937 | pSirSmeWmStatusChangeNtf->statusChangeCode = statusChangeCode; |
| 1938 | pSirSmeWmStatusChangeNtf->length = sizeof(tSirSmeWmStatusChangeNtf); |
| 1939 | pSirSmeWmStatusChangeNtf->sessionId = sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1940 | if(sizeof(pSirSmeWmStatusChangeNtf->statusChangeInfo) >= infoLen) |
| 1941 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1942 | vos_mem_copy( (tANI_U8 *)&pSirSmeWmStatusChangeNtf->statusChangeInfo, |
| 1943 | (tANI_U8 *)pStatusChangeInfo, infoLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1944 | } |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 1945 | limLog(pMac, LOGE, FL("***---*** StatusChg: code %d, length %d ***---***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1946 | statusChangeCode, infoLen); |
| 1947 | break; |
| 1948 | } |
| 1949 | |
| 1950 | |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 1951 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1952 | if (eSIR_SUCCESS != limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT)) |
| 1953 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1954 | vos_mem_free(pSirSmeWmStatusChangeNtf); |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 1955 | limLog( pMac, LOGP, FL("limSysProcessMmhMsgApi failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1956 | } |
| 1957 | |
| 1958 | } /*** end limSendSmeWmStatusChangeNtf() ***/ |
| 1959 | |
| 1960 | |
| 1961 | /** |
| 1962 | * limSendSmeSetContextRsp() |
| 1963 | * |
| 1964 | *FUNCTION: |
| 1965 | * This function is called by limProcessSmeMessages() to send |
| 1966 | * eWNI_SME_SETCONTEXT_RSP message to host |
| 1967 | * |
| 1968 | *PARAMS: |
| 1969 | * |
| 1970 | *LOGIC: |
| 1971 | * |
| 1972 | *ASSUMPTIONS: |
| 1973 | * NA |
| 1974 | * |
| 1975 | *NOTE: |
| 1976 | * |
| 1977 | * @param pMac Pointer to Global MAC structure |
| 1978 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 1979 | * setContext was performed |
| 1980 | * @param aid Indicates the aid corresponding to the peer MAC |
| 1981 | * address |
| 1982 | * @param resultCode Indicates the result of previously issued |
| 1983 | * eWNI_SME_SETCONTEXT_RSP message |
| 1984 | * |
| 1985 | * @return None |
| 1986 | */ |
| 1987 | void |
| 1988 | limSendSmeSetContextRsp(tpAniSirGlobal pMac, |
| 1989 | tSirMacAddr peerMacAddr, tANI_U16 aid, |
| 1990 | tSirResultCodes resultCode, |
| 1991 | tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId) |
| 1992 | { |
| 1993 | |
| 1994 | tANI_U8 *pBuf; |
| 1995 | tSirMsgQ mmhMsg; |
| 1996 | tSirSmeSetContextRsp *pSirSmeSetContextRsp; |
| 1997 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 1998 | pSirSmeSetContextRsp = vos_mem_malloc(sizeof(tSirSmeSetContextRsp)); |
| 1999 | if ( NULL == pSirSmeSetContextRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2000 | { |
| 2001 | // Log error |
| 2002 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2003 | FL("call to AllocateMemory failed for SmeSetContextRsp")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2004 | |
| 2005 | return; |
| 2006 | } |
| 2007 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2008 | pSirSmeSetContextRsp->messageType = eWNI_SME_SETCONTEXT_RSP; |
| 2009 | pSirSmeSetContextRsp->length = sizeof(tSirSmeSetContextRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2010 | pSirSmeSetContextRsp->statusCode = resultCode; |
| 2011 | |
| 2012 | pBuf = pSirSmeSetContextRsp->peerMacAddr; |
| 2013 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2014 | vos_mem_copy( pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2015 | pBuf += sizeof(tSirMacAddr); |
| 2016 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2017 | |
| 2018 | /* Update SME session and transaction Id*/ |
| 2019 | pSirSmeSetContextRsp->sessionId = smesessionId; |
| 2020 | pSirSmeSetContextRsp->transactionId = smetransactionId; |
| 2021 | |
| 2022 | mmhMsg.type = eWNI_SME_SETCONTEXT_RSP; |
| 2023 | mmhMsg.bodyptr = pSirSmeSetContextRsp; |
| 2024 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2025 | if(NULL == psessionEntry) |
| 2026 | { |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2027 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, |
| 2028 | mmhMsg.type)); |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2029 | } |
| 2030 | else |
| 2031 | { |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2032 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, |
| 2033 | psessionEntry->peSessionId, mmhMsg.type)); |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2034 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2035 | |
| 2036 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2037 | limDiagEventReport(pMac, WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0); |
| 2038 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2039 | |
| 2040 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2041 | } /*** end limSendSmeSetContextRsp() ***/ |
| 2042 | |
| 2043 | /** |
| 2044 | * limSendSmeRemoveKeyRsp() |
| 2045 | * |
| 2046 | *FUNCTION: |
| 2047 | * This function is called by limProcessSmeMessages() to send |
| 2048 | * eWNI_SME_REMOVEKEY_RSP message to host |
| 2049 | * |
| 2050 | *PARAMS: |
| 2051 | * |
| 2052 | *LOGIC: |
| 2053 | * |
| 2054 | *ASSUMPTIONS: |
| 2055 | * NA |
| 2056 | * |
| 2057 | *NOTE: |
| 2058 | * |
| 2059 | * @param pMac Pointer to Global MAC structure |
| 2060 | * @param peerMacAddr Indicates the peer MAC addr to which |
| 2061 | * Removekey was performed |
| 2062 | * @param aid Indicates the aid corresponding to the peer MAC |
| 2063 | * address |
| 2064 | * @param resultCode Indicates the result of previously issued |
| 2065 | * eWNI_SME_REMOVEKEY_RSP message |
| 2066 | * |
| 2067 | * @return None |
| 2068 | */ |
| 2069 | void |
| 2070 | limSendSmeRemoveKeyRsp(tpAniSirGlobal pMac, |
| 2071 | tSirMacAddr peerMacAddr, |
| 2072 | tSirResultCodes resultCode, |
| 2073 | tpPESession psessionEntry,tANI_U8 smesessionId, |
| 2074 | tANI_U16 smetransactionId) |
| 2075 | { |
| 2076 | tANI_U8 *pBuf; |
| 2077 | tSirMsgQ mmhMsg; |
| 2078 | tSirSmeRemoveKeyRsp *pSirSmeRemoveKeyRsp; |
| 2079 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2080 | pSirSmeRemoveKeyRsp = vos_mem_malloc(sizeof(tSirSmeRemoveKeyRsp)); |
| 2081 | if ( NULL == pSirSmeRemoveKeyRsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2082 | { |
| 2083 | // Log error |
| 2084 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2085 | FL("call to AllocateMemory failed for SmeRemoveKeyRsp")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2086 | |
| 2087 | return; |
| 2088 | } |
| 2089 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2090 | |
| 2091 | |
| 2092 | if(psessionEntry != NULL) |
| 2093 | { |
| 2094 | pBuf = pSirSmeRemoveKeyRsp->peerMacAddr; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2095 | vos_mem_copy( pBuf, (tANI_U8 *) peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2096 | } |
| 2097 | |
| 2098 | pSirSmeRemoveKeyRsp->messageType = eWNI_SME_REMOVEKEY_RSP; |
| 2099 | pSirSmeRemoveKeyRsp->length = sizeof(tSirSmeRemoveKeyRsp); |
| 2100 | pSirSmeRemoveKeyRsp->statusCode = resultCode; |
| 2101 | |
| 2102 | /* Update SME session and transaction Id*/ |
| 2103 | pSirSmeRemoveKeyRsp->sessionId = smesessionId; |
| 2104 | pSirSmeRemoveKeyRsp->transactionId = smetransactionId; |
| 2105 | |
| 2106 | mmhMsg.type = eWNI_SME_REMOVEKEY_RSP; |
| 2107 | mmhMsg.bodyptr = pSirSmeRemoveKeyRsp; |
| 2108 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2109 | if(NULL == psessionEntry) |
| 2110 | { |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2111 | 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] | 2112 | } |
| 2113 | else |
| 2114 | { |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2115 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, |
| 2116 | psessionEntry->peSessionId, mmhMsg.type)); |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2117 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2118 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2119 | } /*** end limSendSmeSetContextRsp() ***/ |
| 2120 | |
| 2121 | |
| 2122 | /** |
| 2123 | * limSendSmePromiscuousModeRsp() |
| 2124 | * |
| 2125 | *FUNCTION: |
| 2126 | * This function is called by limProcessSmeMessages() to send |
| 2127 | * eWNI_PROMISCUOUS_MODE_RSP message to host |
| 2128 | * |
| 2129 | *PARAMS: |
| 2130 | * |
| 2131 | *LOGIC: |
| 2132 | * |
| 2133 | *ASSUMPTIONS: |
| 2134 | * NA |
| 2135 | * |
| 2136 | *NOTE: |
| 2137 | * This function is used for sending eWNI_SME_PROMISCUOUS_MODE_RSP to |
| 2138 | * host as a reply to eWNI_SME_PROMISCUOUS_MODE_REQ directive from it. |
| 2139 | * |
| 2140 | * @param None |
| 2141 | * @return None |
| 2142 | */ |
| 2143 | void |
| 2144 | limSendSmePromiscuousModeRsp(tpAniSirGlobal pMac) |
| 2145 | { |
| 2146 | #if 0 |
| 2147 | tSirMsgQ mmhMsg; |
| 2148 | tSirMbMsg *pMbMsg; |
| 2149 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2150 | pMbMsg = vos_mem_malloc(sizeof(tSirMbMsg)); |
| 2151 | if ( NULL == pMbMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2152 | { |
| 2153 | // Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2154 | limLog(pMac, LOGP, FL("call to AllocateMemory failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2155 | |
| 2156 | return; |
| 2157 | } |
| 2158 | |
| 2159 | pMbMsg->type = eWNI_SME_PROMISCUOUS_MODE_RSP; |
| 2160 | pMbMsg->msgLen = 4; |
| 2161 | |
| 2162 | mmhMsg.type = eWNI_SME_PROMISCUOUS_MODE_RSP; |
| 2163 | mmhMsg.bodyptr = pMbMsg; |
| 2164 | mmhMsg.bodyval = 0; |
| 2165 | MTRACE(macTraceMsgTx(pMac, 0, mmhMsg.type)); |
| 2166 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2167 | #endif |
| 2168 | } /*** end limSendSmePromiscuousModeRsp() ***/ |
| 2169 | |
| 2170 | |
| 2171 | |
| 2172 | /** |
| 2173 | * limSendSmeNeighborBssInd() |
| 2174 | * |
| 2175 | *FUNCTION: |
| 2176 | * This function is called by limLookupNaddHashEntry() to send |
| 2177 | * eWNI_SME_NEIGHBOR_BSS_IND message to host |
| 2178 | * |
| 2179 | *PARAMS: |
| 2180 | * |
| 2181 | *LOGIC: |
| 2182 | * |
| 2183 | *ASSUMPTIONS: |
| 2184 | * NA |
| 2185 | * |
| 2186 | *NOTE: |
| 2187 | * This function is used for sending eWNI_SME_NEIGHBOR_BSS_IND to |
| 2188 | * host upon detecting new BSS during background scanning if CFG |
| 2189 | * option is enabled for sending such indication |
| 2190 | * |
| 2191 | * @param pMac - Pointer to Global MAC structure |
| 2192 | * @return None |
| 2193 | */ |
| 2194 | |
| 2195 | void |
| 2196 | limSendSmeNeighborBssInd(tpAniSirGlobal pMac, |
| 2197 | tLimScanResultNode *pBssDescr) |
| 2198 | { |
| 2199 | tSirMsgQ msgQ; |
| 2200 | tANI_U32 val; |
| 2201 | tSirSmeNeighborBssInd *pNewBssInd; |
| 2202 | |
| 2203 | if ((pMac->lim.gLimSmeState != eLIM_SME_LINK_EST_WT_SCAN_STATE) || |
| 2204 | ((pMac->lim.gLimSmeState == eLIM_SME_LINK_EST_WT_SCAN_STATE) && |
| 2205 | pMac->lim.gLimRspReqd)) |
| 2206 | { |
| 2207 | // LIM is not in background scan state OR |
| 2208 | // current scan is initiated by HDD. |
| 2209 | // No need to send new BSS indication to HDD |
| 2210 | return; |
| 2211 | } |
| 2212 | |
| 2213 | if (wlan_cfgGetInt(pMac, WNI_CFG_NEW_BSS_FOUND_IND, &val) != eSIR_SUCCESS) |
| 2214 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2215 | limLog(pMac, LOGP, FL("could not get NEIGHBOR_BSS_IND from CFG")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2216 | |
| 2217 | return; |
| 2218 | } |
| 2219 | |
| 2220 | if (val == 0) |
| 2221 | return; |
| 2222 | |
| 2223 | /** |
| 2224 | * Need to indicate new BSSs found during |
| 2225 | * background scanning to host. |
| 2226 | * Allocate buffer for sending indication. |
| 2227 | * Length of buffer is length of BSS description |
| 2228 | * and length of header itself |
| 2229 | */ |
| 2230 | 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] | 2231 | pNewBssInd = vos_mem_malloc(val); |
| 2232 | if ( NULL == pNewBssInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2233 | { |
| 2234 | // Log error |
| 2235 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2236 | FL("call to AllocateMemory failed for eWNI_SME_NEIGHBOR_BSS_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2237 | |
| 2238 | return; |
| 2239 | } |
| 2240 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2241 | pNewBssInd->messageType = eWNI_SME_NEIGHBOR_BSS_IND; |
| 2242 | pNewBssInd->length = (tANI_U16) val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2243 | pNewBssInd->sessionId = 0; |
| 2244 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2245 | vos_mem_copy( (tANI_U8 *) pNewBssInd->bssDescription, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2246 | (tANI_U8 *) &pBssDescr->bssDescription, |
| 2247 | pBssDescr->bssDescription.length + sizeof(tANI_U16)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2248 | |
| 2249 | msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND; |
| 2250 | msgQ.bodyptr = pNewBssInd; |
| 2251 | msgQ.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2252 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2253 | limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); |
| 2254 | } /*** end limSendSmeNeighborBssInd() ***/ |
| 2255 | |
| 2256 | /** ----------------------------------------------------------------- |
| 2257 | \brief limSendSmeAddtsRsp() - sends SME ADDTS RSP |
| 2258 | \ This function sends a eWNI_SME_ADDTS_RSP to SME. |
| 2259 | \ SME only looks at rc and tspec field. |
| 2260 | \param pMac - global mac structure |
| 2261 | \param rspReqd - is SmeAddTsRsp required |
| 2262 | \param status - status code of SME_ADD_TS_RSP |
| 2263 | \return tspec |
| 2264 | \sa |
| 2265 | ----------------------------------------------------------------- */ |
| 2266 | void |
| 2267 | limSendSmeAddtsRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, tANI_U32 status, tpPESession psessionEntry, |
| 2268 | tSirMacTspecIE tspec, tANI_U8 smesessionId, tANI_U16 smetransactionId) |
| 2269 | { |
| 2270 | tpSirAddtsRsp rsp; |
| 2271 | tSirMsgQ mmhMsg; |
| 2272 | |
| 2273 | if (! rspReqd) |
| 2274 | return; |
| 2275 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2276 | rsp = vos_mem_malloc(sizeof(tSirAddtsRsp)); |
| 2277 | if ( NULL == rsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2278 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2279 | limLog(pMac, LOGP, FL("AllocateMemory failed for ADDTS_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2280 | return; |
| 2281 | } |
| 2282 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2283 | vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2284 | rsp->messageType = eWNI_SME_ADDTS_RSP; |
| 2285 | rsp->rc = status; |
| 2286 | rsp->rsp.status = (enum eSirMacStatusCodes) status; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2287 | //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] | 2288 | rsp->rsp.tspec = tspec; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2289 | /* Update SME session Id and transcation Id */ |
| 2290 | rsp->sessionId = smesessionId; |
| 2291 | rsp->transactionId = smetransactionId; |
| 2292 | |
| 2293 | mmhMsg.type = eWNI_SME_ADDTS_RSP; |
| 2294 | mmhMsg.bodyptr = rsp; |
| 2295 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2296 | if(NULL == psessionEntry) |
| 2297 | { |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2298 | 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] | 2299 | } |
| 2300 | else |
| 2301 | { |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2302 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, |
| 2303 | psessionEntry->peSessionId, mmhMsg.type)); |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2304 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2305 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2306 | limDiagEventReport(pMac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, psessionEntry, 0, 0); |
| 2307 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2308 | |
| 2309 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2310 | return; |
| 2311 | } |
| 2312 | |
| 2313 | void |
| 2314 | limSendSmeAddtsInd(tpAniSirGlobal pMac, tpSirAddtsReqInfo addts) |
| 2315 | { |
| 2316 | tpSirAddtsRsp rsp; |
| 2317 | tSirMsgQ mmhMsg; |
| 2318 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2319 | limLog(pMac, LOGW, "SendSmeAddtsInd (token %d, tsid %d, up %d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2320 | addts->dialogToken, |
| 2321 | addts->tspec.tsinfo.traffic.tsid, |
| 2322 | addts->tspec.tsinfo.traffic.userPrio); |
| 2323 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2324 | rsp = vos_mem_malloc(sizeof(tSirAddtsRsp)); |
| 2325 | if ( NULL == rsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2326 | { |
| 2327 | // Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2328 | limLog(pMac, LOGP, FL("AllocateMemory failed for ADDTS_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2329 | return; |
| 2330 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2331 | vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2332 | |
| 2333 | rsp->messageType = eWNI_SME_ADDTS_IND; |
| 2334 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2335 | vos_mem_copy( (tANI_U8 *) &rsp->rsp, (tANI_U8 *) addts, sizeof(*addts)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2336 | |
| 2337 | mmhMsg.type = eWNI_SME_ADDTS_IND; |
| 2338 | mmhMsg.bodyptr = rsp; |
| 2339 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2340 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2341 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2342 | } |
| 2343 | |
| 2344 | void |
| 2345 | limSendSmeDeltsRsp(tpAniSirGlobal pMac, tpSirDeltsReq delts, tANI_U32 status,tpPESession psessionEntry,tANI_U8 smesessionId,tANI_U16 smetransactionId) |
| 2346 | { |
| 2347 | tpSirDeltsRsp rsp; |
| 2348 | tSirMsgQ mmhMsg; |
| 2349 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2350 | limLog(pMac, LOGW, "SendSmeDeltsRsp (aid %d, tsid %d, up %d) status %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2351 | delts->aid, |
| 2352 | delts->req.tsinfo.traffic.tsid, |
| 2353 | delts->req.tsinfo.traffic.userPrio, |
| 2354 | status); |
| 2355 | if (! delts->rspReqd) |
| 2356 | return; |
| 2357 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2358 | rsp = vos_mem_malloc(sizeof(tSirDeltsRsp)); |
| 2359 | if ( NULL == rsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2360 | { |
| 2361 | // Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2362 | limLog(pMac, LOGP, FL("AllocateMemory failed for DELTS_RSP")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2363 | return; |
| 2364 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2365 | vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2366 | |
| 2367 | if(psessionEntry != NULL) |
| 2368 | { |
| 2369 | |
| 2370 | rsp->aid = delts->aid; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2371 | vos_mem_copy( (tANI_U8 *) &rsp->macAddr[0], (tANI_U8 *) &delts->macAddr[0], 6); |
| 2372 | 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] | 2373 | } |
| 2374 | |
| 2375 | |
| 2376 | rsp->messageType = eWNI_SME_DELTS_RSP; |
| 2377 | rsp->rc = status; |
| 2378 | |
| 2379 | /* Update SME session Id and transcation Id */ |
| 2380 | rsp->sessionId = smesessionId; |
| 2381 | rsp->transactionId = smetransactionId; |
| 2382 | |
| 2383 | mmhMsg.type = eWNI_SME_DELTS_RSP; |
| 2384 | mmhMsg.bodyptr = rsp; |
| 2385 | mmhMsg.bodyval = 0; |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2386 | if(NULL == psessionEntry) |
| 2387 | { |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2388 | 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] | 2389 | } |
| 2390 | else |
| 2391 | { |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2392 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, |
| 2393 | psessionEntry->peSessionId, mmhMsg.type)); |
Leela Venkata Kiran Kumar Reddy Chirala | 68a6abe | 2013-02-28 07:43:16 -0800 | [diff] [blame] | 2394 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2395 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2396 | limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_RSP_EVENT, psessionEntry, (tANI_U16)status, 0); |
| 2397 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2398 | |
| 2399 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2400 | } |
| 2401 | |
| 2402 | void |
| 2403 | limSendSmeDeltsInd(tpAniSirGlobal pMac, tpSirDeltsReqInfo delts, tANI_U16 aid,tpPESession psessionEntry) |
| 2404 | { |
| 2405 | tpSirDeltsRsp rsp; |
| 2406 | tSirMsgQ mmhMsg; |
| 2407 | |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2408 | limLog(pMac, LOGW, "SendSmeDeltsInd (aid %d, tsid %d, up %d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2409 | aid, |
| 2410 | delts->tsinfo.traffic.tsid, |
| 2411 | delts->tsinfo.traffic.userPrio); |
| 2412 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2413 | rsp = vos_mem_malloc(sizeof(tSirDeltsRsp)); |
| 2414 | if ( NULL == rsp ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2415 | { |
| 2416 | // Log error |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2417 | limLog(pMac, LOGP, FL("AllocateMemory failed for DELTS_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2418 | return; |
| 2419 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2420 | vos_mem_set( (tANI_U8 *) rsp, sizeof(*rsp), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2421 | |
| 2422 | rsp->messageType = eWNI_SME_DELTS_IND; |
| 2423 | rsp->rc = eSIR_SUCCESS; |
| 2424 | rsp->aid = aid; |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2425 | vos_mem_copy( (tANI_U8 *) &rsp->rsp, (tANI_U8 *) delts, sizeof(*delts)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2426 | |
| 2427 | /* Update SME session Id and SME transaction Id */ |
| 2428 | |
| 2429 | rsp->sessionId = psessionEntry->smeSessionId; |
| 2430 | rsp->transactionId = psessionEntry->transactionId; |
| 2431 | |
| 2432 | mmhMsg.type = eWNI_SME_DELTS_IND; |
| 2433 | mmhMsg.bodyptr = rsp; |
| 2434 | mmhMsg.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2435 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2436 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2437 | limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_IND_EVENT, psessionEntry, 0, 0); |
| 2438 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2439 | |
| 2440 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2441 | } |
| 2442 | |
| 2443 | /** |
| 2444 | * limSendSmeStatsRsp() |
| 2445 | * |
| 2446 | *FUNCTION: |
| 2447 | * This function is called to send 802.11 statistics response to HDD. |
| 2448 | * This function posts the result back to HDD. This is a response to |
| 2449 | * HDD's request for statistics. |
| 2450 | * |
| 2451 | *PARAMS: |
| 2452 | * |
| 2453 | *LOGIC: |
| 2454 | * |
| 2455 | *ASSUMPTIONS: |
| 2456 | * NA |
| 2457 | * |
| 2458 | *NOTE: |
| 2459 | * NA |
| 2460 | * |
| 2461 | * @param pMac Pointer to Global MAC structure |
| 2462 | * @param p80211Stats Statistics sent in response |
| 2463 | * @param resultCode TODO: |
| 2464 | * |
| 2465 | * |
| 2466 | * @return none |
| 2467 | */ |
| 2468 | |
| 2469 | void |
| 2470 | limSendSmeStatsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) |
| 2471 | { |
| 2472 | tSirMsgQ mmhMsg; |
| 2473 | tSirSmeRsp *pMsgHdr = (tSirSmeRsp*) stats; |
| 2474 | |
| 2475 | switch(msgType) |
| 2476 | { |
| 2477 | case WDA_STA_STAT_RSP: |
| 2478 | mmhMsg.type = eWNI_SME_STA_STAT_RSP; |
| 2479 | break; |
| 2480 | case WDA_AGGR_STAT_RSP: |
| 2481 | mmhMsg.type = eWNI_SME_AGGR_STAT_RSP; |
| 2482 | break; |
| 2483 | case WDA_GLOBAL_STAT_RSP: |
| 2484 | mmhMsg.type = eWNI_SME_GLOBAL_STAT_RSP; |
| 2485 | break; |
| 2486 | case WDA_STAT_SUMM_RSP: |
| 2487 | mmhMsg.type = eWNI_SME_STAT_SUMM_RSP; |
| 2488 | break; |
| 2489 | default: |
| 2490 | mmhMsg.type = msgType; //Response from within PE |
| 2491 | break; |
| 2492 | } |
| 2493 | |
| 2494 | pMsgHdr->messageType = mmhMsg.type; |
| 2495 | |
| 2496 | mmhMsg.bodyptr = stats; |
| 2497 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2498 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2499 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2500 | |
| 2501 | return; |
| 2502 | |
| 2503 | } /*** end limSendSmeStatsRsp() ***/ |
| 2504 | |
| 2505 | /** |
| 2506 | * limSendSmePEStatisticsRsp() |
| 2507 | * |
| 2508 | *FUNCTION: |
| 2509 | * This function is called to send 802.11 statistics response to HDD. |
| 2510 | * This function posts the result back to HDD. This is a response to |
| 2511 | * HDD's request for statistics. |
| 2512 | * |
| 2513 | *PARAMS: |
| 2514 | * |
| 2515 | *LOGIC: |
| 2516 | * |
| 2517 | *ASSUMPTIONS: |
| 2518 | * NA |
| 2519 | * |
| 2520 | *NOTE: |
| 2521 | * NA |
| 2522 | * |
| 2523 | * @param pMac Pointer to Global MAC structure |
| 2524 | * @param p80211Stats Statistics sent in response |
| 2525 | * @param resultCode TODO: |
| 2526 | * |
| 2527 | * |
| 2528 | * @return none |
| 2529 | */ |
| 2530 | |
| 2531 | void |
| 2532 | limSendSmePEStatisticsRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) |
| 2533 | { |
| 2534 | tSirMsgQ mmhMsg; |
| 2535 | tANI_U8 sessionId; |
| 2536 | tAniGetPEStatsRsp *pPeStats = (tAniGetPEStatsRsp *) stats; |
| 2537 | tpPESession pPeSessionEntry; |
| 2538 | |
| 2539 | //Get the Session Id based on Sta Id |
| 2540 | pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId); |
| 2541 | |
| 2542 | //Fill the Session Id |
| 2543 | if(NULL != pPeSessionEntry) |
| 2544 | { |
| 2545 | //Fill the Session Id |
| 2546 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 2547 | } |
| 2548 | |
| 2549 | pPeStats->msgType = eWNI_SME_GET_STATISTICS_RSP; |
| 2550 | |
| 2551 | |
| 2552 | //msgType should be WDA_GET_STATISTICS_RSP |
| 2553 | mmhMsg.type = eWNI_SME_GET_STATISTICS_RSP; |
| 2554 | |
| 2555 | mmhMsg.bodyptr = stats; |
| 2556 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2557 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2558 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2559 | |
| 2560 | return; |
| 2561 | |
| 2562 | } /*** end limSendSmePEStatisticsRsp() ***/ |
| 2563 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2564 | #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] | 2565 | /** |
| 2566 | * limSendSmePEGetRoamRssiRsp() |
| 2567 | * |
| 2568 | *FUNCTION: |
| 2569 | * This function is called to send roam rssi response to HDD. |
| 2570 | * This function posts the result back to HDD. This is a response to |
| 2571 | * HDD's request to get roam rssi. |
| 2572 | * |
| 2573 | *PARAMS: |
| 2574 | * |
| 2575 | *LOGIC: |
| 2576 | * |
| 2577 | *ASSUMPTIONS: |
| 2578 | * NA |
| 2579 | * |
| 2580 | *NOTE: |
| 2581 | * NA |
| 2582 | * |
| 2583 | * @param pMac Pointer to Global MAC structure |
| 2584 | * @param p80211Stats Statistics sent in response |
| 2585 | * @param resultCode TODO: |
| 2586 | * |
| 2587 | * |
| 2588 | * @return none |
| 2589 | */ |
| 2590 | |
| 2591 | void |
| 2592 | limSendSmePEGetRoamRssiRsp(tpAniSirGlobal pMac, tANI_U16 msgType, void* stats) |
| 2593 | { |
| 2594 | tSirMsgQ mmhMsg; |
| 2595 | tANI_U8 sessionId; |
| 2596 | tAniGetRoamRssiRsp *pPeStats = (tAniGetRoamRssiRsp *) stats; |
| 2597 | tpPESession pPeSessionEntry = NULL; |
| 2598 | |
| 2599 | //Get the Session Id based on Sta Id |
| 2600 | pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId); |
| 2601 | |
| 2602 | //Fill the Session Id |
| 2603 | if(NULL != pPeSessionEntry) |
| 2604 | { |
| 2605 | //Fill the Session Id |
| 2606 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 2607 | } |
| 2608 | |
| 2609 | pPeStats->msgType = eWNI_SME_GET_ROAM_RSSI_RSP; |
| 2610 | |
| 2611 | //msgType should be WDA_GET_STATISTICS_RSP |
| 2612 | mmhMsg.type = eWNI_SME_GET_ROAM_RSSI_RSP; |
| 2613 | |
| 2614 | mmhMsg.bodyptr = stats; |
| 2615 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2616 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 2617 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2618 | |
| 2619 | return; |
| 2620 | |
| 2621 | } /*** end limSendSmePEGetRoamRssiRsp() ***/ |
| 2622 | |
| 2623 | #endif |
| 2624 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2625 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2626 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2627 | /** |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2628 | * limSendSmePEEseTsmRsp() |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2629 | * |
| 2630 | *FUNCTION: |
| 2631 | * This function is called to send tsm stats response to HDD. |
| 2632 | * This function posts the result back to HDD. This is a response to |
| 2633 | * HDD's request to get tsm stats. |
| 2634 | * |
| 2635 | *PARAMS: |
| 2636 | * @param pMac - Pointer to global pMac structure |
| 2637 | * @param pStats - Pointer to TSM Stats |
| 2638 | * |
| 2639 | * @return none |
| 2640 | */ |
| 2641 | |
| 2642 | void |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2643 | limSendSmePEEseTsmRsp(tpAniSirGlobal pMac, tAniGetTsmStatsRsp *pStats) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2644 | { |
| 2645 | tSirMsgQ mmhMsg; |
| 2646 | tANI_U8 sessionId; |
| 2647 | tAniGetTsmStatsRsp *pPeStats = (tAniGetTsmStatsRsp *) pStats; |
| 2648 | tpPESession pPeSessionEntry = NULL; |
| 2649 | |
| 2650 | //Get the Session Id based on Sta Id |
| 2651 | pPeSessionEntry = peFindSessionByStaId(pMac, pPeStats->staId, &sessionId); |
| 2652 | |
| 2653 | //Fill the Session Id |
| 2654 | if(NULL != pPeSessionEntry) |
| 2655 | { |
| 2656 | //Fill the Session Id |
| 2657 | pPeStats->sessionId = pPeSessionEntry->smeSessionId; |
| 2658 | } |
| 2659 | else |
| 2660 | { |
| 2661 | PELOGE(limLog(pMac, LOGE, FL("Session not found for the Sta id(%d)"), |
| 2662 | pPeStats->staId);) |
| 2663 | return; |
| 2664 | } |
| 2665 | |
| 2666 | pPeStats->msgType = eWNI_SME_GET_TSM_STATS_RSP; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2667 | pPeStats->tsmMetrics.RoamingCount = pPeSessionEntry->eseContext.tsm.tsmMetrics.RoamingCount; |
| 2668 | pPeStats->tsmMetrics.RoamingDly = pPeSessionEntry->eseContext.tsm.tsmMetrics.RoamingDly; |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2669 | |
| 2670 | mmhMsg.type = eWNI_SME_GET_TSM_STATS_RSP; |
| 2671 | mmhMsg.bodyptr = pStats; |
| 2672 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2673 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2674 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2675 | |
| 2676 | return; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2677 | } /*** end limSendSmePEEseTsmRsp() ***/ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2678 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2679 | #endif /* FEATURE_WLAN_ESE) && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2680 | |
| 2681 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2682 | void |
| 2683 | limSendSmeIBSSPeerInd( |
| 2684 | tpAniSirGlobal pMac, |
| 2685 | tSirMacAddr peerMacAddr, |
| 2686 | tANI_U16 staIndex, |
| 2687 | tANI_U8 ucastIdx, |
| 2688 | tANI_U8 bcastIdx, |
| 2689 | tANI_U8 *beacon, |
| 2690 | tANI_U16 beaconLen, |
| 2691 | tANI_U16 msgType, |
| 2692 | tANI_U8 sessionId) |
| 2693 | { |
| 2694 | tSirMsgQ mmhMsg; |
| 2695 | tSmeIbssPeerInd *pNewPeerInd; |
| 2696 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2697 | pNewPeerInd = vos_mem_malloc(sizeof(tSmeIbssPeerInd) + beaconLen); |
| 2698 | if ( NULL == pNewPeerInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2699 | { |
| 2700 | PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) |
| 2701 | return; |
| 2702 | } |
| 2703 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2704 | vos_mem_set((void *) pNewPeerInd, (sizeof(tSmeIbssPeerInd) + beaconLen), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2705 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2706 | vos_mem_copy( (tANI_U8 *) pNewPeerInd->peerAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2707 | peerMacAddr, sizeof(tSirMacAddr)); |
| 2708 | pNewPeerInd->staId= staIndex; |
| 2709 | pNewPeerInd->ucastSig = ucastIdx; |
| 2710 | pNewPeerInd->bcastSig = bcastIdx; |
| 2711 | pNewPeerInd->mesgLen = sizeof(tSmeIbssPeerInd) + beaconLen; |
| 2712 | pNewPeerInd->mesgType = msgType; |
| 2713 | pNewPeerInd->sessionId = sessionId; |
| 2714 | |
| 2715 | if ( beacon != NULL ) |
| 2716 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2717 | vos_mem_copy((void*) ((tANI_U8*)pNewPeerInd+sizeof(tSmeIbssPeerInd)), |
| 2718 | (void*)beacon, beaconLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2719 | } |
| 2720 | |
| 2721 | mmhMsg.type = msgType; |
| 2722 | // mmhMsg.bodyval = (tANI_U32) pNewPeerInd; |
| 2723 | mmhMsg.bodyptr = pNewPeerInd; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2724 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2725 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2726 | |
| 2727 | } |
| 2728 | |
| 2729 | |
| 2730 | /** ----------------------------------------------------------------- |
| 2731 | \brief limSendExitBmpsInd() - sends exit bmps indication |
| 2732 | |
| 2733 | This function sends a eWNI_PMC_EXIT_BMPS_IND with a specific reason |
| 2734 | code to SME. This will trigger SME to get out of BMPS mode. |
| 2735 | |
| 2736 | \param pMac - global mac structure |
| 2737 | \param reasonCode - reason for which PE wish to exit BMPS |
| 2738 | \return none |
| 2739 | \sa |
| 2740 | ----------------------------------------------------------------- */ |
| 2741 | void limSendExitBmpsInd(tpAniSirGlobal pMac, tExitBmpsReason reasonCode) |
| 2742 | { |
| 2743 | tSirMsgQ mmhMsg; |
| 2744 | tANI_U16 msgLen = 0; |
| 2745 | tpSirSmeExitBmpsInd pExitBmpsInd; |
| 2746 | |
| 2747 | msgLen = sizeof(tSirSmeExitBmpsInd); |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2748 | pExitBmpsInd = vos_mem_malloc(msgLen); |
| 2749 | if ( NULL == pExitBmpsInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2750 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2751 | limLog(pMac, LOGP, FL("AllocateMemory failed for PMC_EXIT_BMPS_IND ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2752 | return; |
| 2753 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2754 | vos_mem_set(pExitBmpsInd, msgLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2755 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2756 | pExitBmpsInd->mesgType = eWNI_PMC_EXIT_BMPS_IND; |
| 2757 | pExitBmpsInd->mesgLen = msgLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2758 | pExitBmpsInd->exitBmpsReason = reasonCode; |
| 2759 | pExitBmpsInd->statusCode = eSIR_SME_SUCCESS; |
| 2760 | |
| 2761 | mmhMsg.type = eWNI_PMC_EXIT_BMPS_IND; |
| 2762 | mmhMsg.bodyptr = pExitBmpsInd; |
| 2763 | mmhMsg.bodyval = 0; |
| 2764 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2765 | limLog(pMac, LOG1, FL("Sending eWNI_PMC_EXIT_BMPS_IND to SME. ")); |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2766 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2767 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 2768 | limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, peGetValidPowerSaveSession(pMac), 0, (tANI_U16)reasonCode); |
| 2769 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 2770 | |
| 2771 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2772 | return; |
| 2773 | |
| 2774 | } /*** end limSendExitBmpsInd() ***/ |
| 2775 | |
| 2776 | |
| 2777 | |
| 2778 | |
| 2779 | /*-------------------------------------------------------------------------- |
| 2780 | \brief peDeleteSession() - Handle the Delete BSS Response from HAL. |
| 2781 | |
| 2782 | |
| 2783 | \param pMac - pointer to global adapter context |
| 2784 | \param sessionId - Message pointer. |
| 2785 | |
| 2786 | \sa |
| 2787 | --------------------------------------------------------------------------*/ |
| 2788 | |
| 2789 | void limHandleDeleteBssRsp(tpAniSirGlobal pMac,tpSirMsgQ MsgQ) |
| 2790 | { |
| 2791 | tpPESession psessionEntry; |
| 2792 | tpDeleteBssParams pDelBss = (tpDeleteBssParams)(MsgQ->bodyptr); |
| 2793 | if((psessionEntry = peFindSessionBySessionId(pMac,pDelBss->sessionId))==NULL) |
| 2794 | { |
Kiran Kumar Lokere | 5be73a6 | 2013-04-01 18:40:00 -0700 | [diff] [blame] | 2795 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2796 | return; |
| 2797 | } |
| 2798 | if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) |
| 2799 | { |
| 2800 | limIbssDelBssRsp(pMac, MsgQ->bodyptr,psessionEntry); |
| 2801 | } |
| 2802 | else if(psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) |
| 2803 | { |
| 2804 | limProcessSmeDelBssRsp(pMac, MsgQ->bodyval,psessionEntry); |
| 2805 | } |
| 2806 | |
| 2807 | else |
| 2808 | limProcessMlmDelBssRsp(pMac,MsgQ,psessionEntry); |
| 2809 | |
| 2810 | } |
| 2811 | |
| 2812 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2813 | /** ----------------------------------------------------------------- |
| 2814 | \brief limSendSmeAggrQosRsp() - sends SME FT AGGR QOS RSP |
| 2815 | \ This function sends a eWNI_SME_FT_AGGR_QOS_RSP to SME. |
| 2816 | \ SME only looks at rc and tspec field. |
| 2817 | \param pMac - global mac structure |
| 2818 | \param rspReqd - is SmeAddTsRsp required |
| 2819 | \param status - status code of eWNI_SME_FT_AGGR_QOS_RSP |
| 2820 | \return tspec |
| 2821 | \sa |
| 2822 | ----------------------------------------------------------------- */ |
| 2823 | void |
| 2824 | limSendSmeAggrQosRsp(tpAniSirGlobal pMac, tpSirAggrQosRsp aggrQosRsp, |
| 2825 | tANI_U8 smesessionId) |
| 2826 | { |
| 2827 | tSirMsgQ mmhMsg; |
| 2828 | |
| 2829 | mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP; |
| 2830 | mmhMsg.bodyptr = aggrQosRsp; |
| 2831 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2832 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, smesessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2833 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2834 | |
| 2835 | return; |
| 2836 | } |
| 2837 | #endif |
| 2838 | |
| 2839 | /** ----------------------------------------------------------------- |
| 2840 | \brief limSendSmePreChannelSwitchInd() - sends an indication to SME |
| 2841 | before switching channels for spectrum manangement. |
| 2842 | |
| 2843 | This function sends a eWNI_SME_PRE_SWITCH_CHL_IND to SME. |
| 2844 | |
| 2845 | \param pMac - global mac structure |
| 2846 | \return none |
| 2847 | \sa |
| 2848 | ----------------------------------------------------------------- */ |
| 2849 | void |
| 2850 | limSendSmePreChannelSwitchInd(tpAniSirGlobal pMac) |
| 2851 | { |
| 2852 | tSirMsgQ mmhMsg; |
| 2853 | |
| 2854 | mmhMsg.type = eWNI_SME_PRE_SWITCH_CHL_IND; |
| 2855 | mmhMsg.bodyptr = NULL; |
| 2856 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2857 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2858 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2859 | |
| 2860 | return; |
| 2861 | } |
| 2862 | |
| 2863 | /** ----------------------------------------------------------------- |
| 2864 | \brief limSendSmePostChannelSwitchInd() - sends an indication to SME |
| 2865 | after channel switch for spectrum manangement is complete. |
| 2866 | |
| 2867 | This function sends a eWNI_SME_POST_SWITCH_CHL_IND to SME. |
| 2868 | |
| 2869 | \param pMac - global mac structure |
| 2870 | \return none |
| 2871 | \sa |
| 2872 | ----------------------------------------------------------------- */ |
| 2873 | void |
| 2874 | limSendSmePostChannelSwitchInd(tpAniSirGlobal pMac) |
| 2875 | { |
| 2876 | tSirMsgQ mmhMsg; |
| 2877 | |
| 2878 | mmhMsg.type = eWNI_SME_POST_SWITCH_CHL_IND; |
| 2879 | mmhMsg.bodyptr = NULL; |
| 2880 | mmhMsg.bodyval = 0; |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 2881 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2882 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2883 | |
| 2884 | return; |
| 2885 | } |
| 2886 | |
| 2887 | void limSendSmeMaxAssocExceededNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, |
| 2888 | tANI_U8 smesessionId) |
| 2889 | { |
| 2890 | tSirMsgQ mmhMsg; |
| 2891 | tSmeMaxAssocInd *pSmeMaxAssocInd; |
| 2892 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2893 | pSmeMaxAssocInd = vos_mem_malloc(sizeof(tSmeMaxAssocInd)); |
| 2894 | if ( NULL == pSmeMaxAssocInd ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2895 | { |
| 2896 | PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) |
| 2897 | return; |
| 2898 | } |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2899 | vos_mem_set((void *) pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd),0); |
| 2900 | vos_mem_copy( (tANI_U8 *)pSmeMaxAssocInd->peerMac, |
| 2901 | (tANI_U8 *)peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2902 | pSmeMaxAssocInd->mesgType = eWNI_SME_MAX_ASSOC_EXCEEDED; |
| 2903 | pSmeMaxAssocInd->mesgLen = sizeof(tSmeMaxAssocInd); |
| 2904 | pSmeMaxAssocInd->sessionId = smesessionId; |
| 2905 | mmhMsg.type = pSmeMaxAssocInd->mesgType; |
| 2906 | mmhMsg.bodyptr = pSmeMaxAssocInd; |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2907 | limLog(pMac, LOG1, FL("msgType %s peerMacAddr "MAC_ADDRESS_STR |
| 2908 | " 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] | 2909 | MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, smesessionId, mmhMsg.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2910 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2911 | |
| 2912 | return; |
| 2913 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2914 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2915 | /** ----------------------------------------------------------------- |
| 2916 | \brief limSendSmeCandidateFoundInd() - sends |
| 2917 | eWNI_SME_CANDIDATE_FOUND_IND |
| 2918 | |
| 2919 | After receiving candidate found indication frame from FW, this |
| 2920 | function sends a eWNI_SME_CANDIDATE_FOUND_IND to SME to notify |
| 2921 | roam candidate(s) are available. |
| 2922 | |
| 2923 | \param pMac - global mac structure |
| 2924 | \param psessionEntry - session info |
| 2925 | \return none |
| 2926 | \sa |
| 2927 | ----------------------------------------------------------------- */ |
| 2928 | void |
| 2929 | limSendSmeCandidateFoundInd(tpAniSirGlobal pMac, tANI_U8 sessionId) |
| 2930 | { |
| 2931 | tSirMsgQ mmhMsg; |
| 2932 | tSirSmeCandidateFoundInd *pSirSmeCandidateFoundInd; |
| 2933 | |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2934 | pSirSmeCandidateFoundInd = vos_mem_malloc(sizeof(tSirSmeCandidateFoundInd)); |
| 2935 | if ( NULL == pSirSmeCandidateFoundInd ) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2936 | { |
Bansidhar Gopalachari | 1273123 | 2013-07-11 10:56:36 +0530 | [diff] [blame] | 2937 | 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] | 2938 | return; |
| 2939 | } |
| 2940 | |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 2941 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 2942 | limDiagEventReport(pMac, WLAN_PE_DIAG_ROAM_CANDIDATE_FOUND, |
| 2943 | NULL, eSIR_SUCCESS, eSIR_SUCCESS); |
| 2944 | #endif |
| 2945 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2946 | pSirSmeCandidateFoundInd->messageType = eWNI_SME_CANDIDATE_FOUND_IND; |
Kanchanapally, Vidyullatha | 31b8d14 | 2015-01-30 14:25:18 +0530 | [diff] [blame] | 2947 | pSirSmeCandidateFoundInd->length = sizeof(tSirSmeCandidateFoundInd); |
| 2948 | pSirSmeCandidateFoundInd->sessionId = sessionId; |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 2949 | |
| 2950 | |
| 2951 | limLog( pMac, LOGE, FL("posting candidate ind to SME")); |
| 2952 | mmhMsg.type = eWNI_SME_CANDIDATE_FOUND_IND; |
| 2953 | mmhMsg.bodyptr = pSirSmeCandidateFoundInd; |
| 2954 | mmhMsg.bodyval = 0; |
| 2955 | |
| 2956 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2957 | |
| 2958 | } /*** end limSendSmeCandidateFoundInd() ***/ |
| 2959 | #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD |