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