Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | /* |
| 43 | * Airgo Networks, Inc proprietary. All rights reserved. |
| 44 | * This file limProcessMlmRspMessages.cc contains the code |
| 45 | * for processing response messages from MLM state machine. |
| 46 | * Author: Chandra Modumudi |
| 47 | * Date: 02/11/02 |
| 48 | * History:- |
| 49 | * Date Modified by Modification Information |
| 50 | * -------------------------------------------------------------------- |
| 51 | * |
| 52 | */ |
| 53 | #include "wniApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 54 | #include "wniCfgSta.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 55 | #include "cfgApi.h" |
| 56 | #include "sirApi.h" |
| 57 | #include "schApi.h" |
| 58 | #include "utilsApi.h" |
| 59 | #include "limUtils.h" |
| 60 | #include "limAssocUtils.h" |
| 61 | #include "limSecurityUtils.h" |
| 62 | #include "limSerDesUtils.h" |
| 63 | #include "limTimerUtils.h" |
| 64 | #include "limSendMessages.h" |
| 65 | #include "limAdmitControl.h" |
| 66 | #include "limSendMessages.h" |
| 67 | #include "limIbssPeerMgmt.h" |
| 68 | #include "limSession.h" |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 69 | #include "limSessionUtils.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 70 | #if defined WLAN_FEATURE_VOWIFI |
| 71 | #include "rrmApi.h" |
| 72 | #endif |
| 73 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 74 | #include <limFT.h> |
| 75 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 76 | #include "wlan_qct_wda.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | |
| 78 | static void limHandleSmeJoinResult(tpAniSirGlobal, tSirResultCodes, tANI_U16,tpPESession); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 79 | static void limHandleSmeReaasocResult(tpAniSirGlobal, tSirResultCodes, tANI_U16, tpPESession); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 80 | void limProcessMlmScanCnf(tpAniSirGlobal, tANI_U32 *); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 81 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 82 | void limProcessMlmOemDataReqCnf(tpAniSirGlobal, tANI_U32 *); |
| 83 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 84 | void limProcessMlmJoinCnf(tpAniSirGlobal, tANI_U32 *); |
| 85 | void limProcessMlmAuthCnf(tpAniSirGlobal, tANI_U32 *); |
| 86 | void limProcessMlmStartCnf(tpAniSirGlobal, tANI_U32 *); |
| 87 | void limProcessMlmAuthInd(tpAniSirGlobal, tANI_U32 *); |
| 88 | void limProcessMlmAssocInd(tpAniSirGlobal, tANI_U32 *); |
| 89 | void limProcessMlmAssocCnf(tpAniSirGlobal, tANI_U32 *); |
| 90 | void limProcessMlmReassocCnf(tpAniSirGlobal, tANI_U32 *); |
| 91 | void limProcessMlmReassocInd(tpAniSirGlobal, tANI_U32 *); |
| 92 | void limProcessMlmSetKeysCnf(tpAniSirGlobal, tANI_U32 *); |
| 93 | void limProcessMlmDisassocInd(tpAniSirGlobal, tANI_U32 *); |
| 94 | void limProcessMlmDisassocCnf(tpAniSirGlobal, tANI_U32 *); |
| 95 | void limProcessMlmDeauthInd(tpAniSirGlobal, tANI_U32 *); |
| 96 | void limProcessMlmDeauthCnf(tpAniSirGlobal, tANI_U32 *); |
| 97 | void limProcessMlmPurgeStaInd(tpAniSirGlobal, tANI_U32 *); |
| 98 | void limProcessMlmAddBACnf(tpAniSirGlobal, tANI_U32 *); |
| 99 | void limProcessMlmDelBACnf(tpAniSirGlobal, tANI_U32 *); |
| 100 | void limProcessMlmRemoveKeyCnf(tpAniSirGlobal pMac, tANI_U32 * pMsgBuf); |
| 101 | static void limHandleDelBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionEntry); |
| 102 | void limGetSessionInfo(tpAniSirGlobal pMac, tANI_U8 *, tANI_U8 *, tANI_U16 *); |
| 103 | static void |
| 104 | limProcessBtampAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession psessionEntry); |
| 105 | /** |
| 106 | * limProcessMlmRspMessages() |
| 107 | * |
| 108 | *FUNCTION: |
| 109 | * This function is called to processes various MLM response (CNF/IND |
| 110 | * messages from MLM State machine. |
| 111 | * |
| 112 | *LOGIC: |
| 113 | * |
| 114 | *ASSUMPTIONS: |
| 115 | * |
| 116 | *NOTE: |
| 117 | * |
| 118 | * @param pMac Pointer to Global MAC structure |
| 119 | * @param msgType Indicates the MLM message type |
| 120 | * @param *pMsgBuf A pointer to the MLM message buffer |
| 121 | * |
| 122 | * @return None |
| 123 | */ |
| 124 | void |
| 125 | limProcessMlmRspMessages(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf) |
| 126 | { |
| 127 | |
| 128 | if(pMsgBuf == NULL) |
| 129 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 130 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 131 | return; |
| 132 | } |
| 133 | switch (msgType) |
| 134 | { |
| 135 | case LIM_MLM_SCAN_CNF: |
| 136 | limProcessMlmScanCnf(pMac, pMsgBuf); |
| 137 | break; |
| 138 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 139 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 140 | case LIM_MLM_OEM_DATA_CNF: |
| 141 | limProcessMlmOemDataReqCnf(pMac, pMsgBuf); |
| 142 | break; |
| 143 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 144 | |
| 145 | case LIM_MLM_AUTH_CNF: |
| 146 | limProcessMlmAuthCnf(pMac, pMsgBuf); |
| 147 | break; |
| 148 | case LIM_MLM_AUTH_IND: |
| 149 | limProcessMlmAuthInd(pMac, pMsgBuf); |
| 150 | break; |
| 151 | case LIM_MLM_ASSOC_CNF: |
| 152 | limProcessMlmAssocCnf(pMac, pMsgBuf); |
| 153 | break; |
| 154 | case LIM_MLM_START_CNF: |
| 155 | limProcessMlmStartCnf(pMac, pMsgBuf); |
| 156 | break; |
| 157 | case LIM_MLM_JOIN_CNF: |
| 158 | limProcessMlmJoinCnf(pMac, pMsgBuf); |
| 159 | break; |
| 160 | case LIM_MLM_ASSOC_IND: |
| 161 | limProcessMlmAssocInd(pMac, pMsgBuf); |
| 162 | break; |
| 163 | case LIM_MLM_REASSOC_CNF: |
| 164 | limProcessMlmReassocCnf(pMac, pMsgBuf); |
| 165 | break; |
| 166 | case LIM_MLM_REASSOC_IND: |
| 167 | limProcessMlmReassocInd(pMac, pMsgBuf); |
| 168 | break; |
| 169 | case LIM_MLM_DISASSOC_CNF: |
| 170 | limProcessMlmDisassocCnf(pMac, pMsgBuf); |
| 171 | break; |
| 172 | case LIM_MLM_DISASSOC_IND: |
| 173 | limProcessMlmDisassocInd(pMac, pMsgBuf); |
| 174 | break; |
| 175 | case LIM_MLM_PURGE_STA_IND: |
| 176 | limProcessMlmPurgeStaInd(pMac, pMsgBuf); |
| 177 | break; |
| 178 | case LIM_MLM_DEAUTH_CNF: |
| 179 | limProcessMlmDeauthCnf(pMac, pMsgBuf); |
| 180 | break; |
| 181 | case LIM_MLM_DEAUTH_IND: |
| 182 | limProcessMlmDeauthInd(pMac, pMsgBuf); |
| 183 | break; |
| 184 | case LIM_MLM_SETKEYS_CNF: |
| 185 | limProcessMlmSetKeysCnf(pMac, pMsgBuf); |
| 186 | break; |
| 187 | case LIM_MLM_REMOVEKEY_CNF: |
| 188 | limProcessMlmRemoveKeyCnf(pMac, pMsgBuf); |
| 189 | break; |
| 190 | case LIM_MLM_TSPEC_CNF: |
| 191 | break; |
| 192 | case LIM_MLM_ADDBA_CNF: |
| 193 | limProcessMlmAddBACnf( pMac, pMsgBuf ); |
| 194 | break; |
| 195 | case LIM_MLM_DELBA_CNF: |
| 196 | limProcessMlmDelBACnf( pMac, pMsgBuf ); |
| 197 | break; |
| 198 | default: |
| 199 | break; |
| 200 | } // switch (msgType) |
| 201 | return; |
| 202 | } /*** end limProcessMlmRspMessages() ***/ |
| 203 | |
| 204 | /** |
| 205 | * limProcessMlmScanCnf() |
| 206 | * |
| 207 | *FUNCTION: |
| 208 | * This function is called to processes MLM_SCAN_CNF |
| 209 | * message from MLM State machine. |
| 210 | * |
| 211 | *LOGIC: |
| 212 | * |
| 213 | *ASSUMPTIONS: |
| 214 | * |
| 215 | *NOTE: |
| 216 | * |
| 217 | * @param pMac Pointer to Global MAC structure |
| 218 | * @param pMsgBuf A pointer to the MLM message buffer |
| 219 | * |
| 220 | * @return None |
| 221 | */ |
| 222 | void |
| 223 | limProcessMlmScanCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 224 | { |
| 225 | switch(pMac->lim.gLimSmeState) |
| 226 | { |
| 227 | case eLIM_SME_WT_SCAN_STATE: |
| 228 | //case eLIM_SME_LINK_EST_WT_SCAN_STATE: //TO SUPPORT BT-AMP |
| 229 | //case eLIM_SME_NORMAL_CHANNEL_SCAN_STATE: //TO SUPPORT BT-AMP |
| 230 | pMac->lim.gLimSmeState = pMac->lim.gLimPrevSmeState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 231 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, NO_SESSION, pMac->lim.gLimSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 232 | pMac->lim.gLimSystemInScanLearnMode = 0; |
| 233 | break; |
| 234 | default: |
| 235 | /** |
| 236 | * Should not have received scan confirm |
| 237 | * from MLM in other states. |
| 238 | * Log error |
| 239 | */ |
| 240 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 241 | FL("received unexpected MLM_SCAN_CNF in state %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | pMac->lim.gLimSmeState);) |
| 243 | return; |
| 244 | } |
| 245 | |
| 246 | /// Process received scan confirm |
| 247 | /// Increment length of cached scan results |
| 248 | pMac->lim.gLimSmeScanResultLength += |
| 249 | ((tLimMlmScanCnf *) pMsgBuf)->scanResultLength; |
| 250 | if ((pMac->lim.gLimRspReqd) || pMac->lim.gLimReportBackgroundScanResults) |
| 251 | { |
| 252 | tANI_U16 scanRspLen = 0; |
| 253 | /// Need to send response to Host |
| 254 | pMac->lim.gLimRspReqd = false; |
| 255 | if ((((tLimMlmScanCnf *) pMsgBuf)->resultCode == |
| 256 | eSIR_SME_SUCCESS) || |
| 257 | pMac->lim.gLimSmeScanResultLength) |
| 258 | { |
| 259 | scanRspLen = sizeof(tSirSmeScanRsp) + |
| 260 | pMac->lim.gLimSmeScanResultLength - |
| 261 | sizeof(tSirBssDescription); |
| 262 | } |
| 263 | else |
| 264 | { |
| 265 | scanRspLen = sizeof(tSirSmeScanRsp); |
| 266 | } |
| 267 | if(pMac->lim.gLimReportBackgroundScanResults) |
| 268 | { |
| 269 | pMac->lim.gLimBackgroundScanTerminate = TRUE; |
| 270 | } |
| 271 | if (pMac->lim.gLimSmeScanResultLength == 0) |
| 272 | { |
| 273 | limSendSmeScanRsp(pMac, scanRspLen, eSIR_SME_SUCCESS, pMac->lim.gSmeSessionId, pMac->lim.gTransactionId); |
| 274 | } |
| 275 | else |
| 276 | { |
| 277 | limSendSmeScanRsp(pMac, scanRspLen, |
| 278 | eSIR_SME_SUCCESS,pMac->lim.gSmeSessionId, pMac->lim.gTransactionId); |
| 279 | } |
| 280 | } // if (pMac->lim.gLimRspReqd) |
| 281 | //check to see whether we need to run bgScan timer |
| 282 | if(pMac->lim.gLimBackgroundScanTerminate == FALSE) |
| 283 | { |
| 284 | if (tx_timer_activate( |
| 285 | &pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS) |
| 286 | { |
| 287 | /// Could not activate background scan timer. |
| 288 | // Log error |
| 289 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 290 | FL("could not activate background scan timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 291 | pMac->lim.gLimBackgroundScanStarted = FALSE; |
| 292 | } |
| 293 | else |
| 294 | { |
| 295 | pMac->lim.gLimBackgroundScanStarted = TRUE; |
| 296 | } |
| 297 | } |
| 298 | } /*** end limProcessMlmScanCnf() ***/ |
| 299 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 300 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 301 | |
| 302 | /** |
| 303 | * limProcessMlmOemDataReqCnf() |
| 304 | * |
| 305 | *FUNCTION: |
| 306 | * This function is called to processes LIM_MLM_OEM_DATA_REQ_CNF |
| 307 | * message from MLM State machine. |
| 308 | * |
| 309 | *LOGIC: |
| 310 | * |
| 311 | *ASSUMPTIONS: |
| 312 | * |
| 313 | *NOTE: |
| 314 | * |
| 315 | * @param pMac Pointer to Global MAC structure |
| 316 | * @param pMsgBuf A pointer to the MLM message buffer |
| 317 | * |
| 318 | * @return None |
| 319 | */ |
| 320 | |
| 321 | void limProcessMlmOemDataReqCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 322 | { |
| 323 | tLimMlmOemDataRsp* measRsp; |
| 324 | |
| 325 | tSirResultCodes resultCode = eSIR_SME_SUCCESS; |
| 326 | |
| 327 | measRsp = (tLimMlmOemDataRsp*)(pMsgBuf); |
| 328 | |
| 329 | //Now send the meas confirm message to the sme |
| 330 | limSendSmeOemDataRsp(pMac, (tANI_U32*)measRsp, resultCode); |
| 331 | |
| 332 | //Dont free the memory here. It will be freed up by the callee |
| 333 | |
| 334 | return; |
| 335 | } |
| 336 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 337 | |
| 338 | /** |
| 339 | * limProcessMlmStartCnf() |
| 340 | * |
| 341 | *FUNCTION: |
| 342 | * This function is called to processes MLM_START_CNF |
| 343 | * message from MLM State machine. |
| 344 | * |
| 345 | *LOGIC: |
| 346 | * |
| 347 | *ASSUMPTIONS: |
| 348 | * |
| 349 | *NOTE: |
| 350 | * |
| 351 | * @param pMac Pointer to Global MAC structure |
| 352 | * @param pMsgBuf A pointer to the MLM message buffer |
| 353 | * |
| 354 | * @return None |
| 355 | */ |
| 356 | void |
| 357 | limProcessMlmStartCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 358 | { |
| 359 | tpPESession psessionEntry = NULL; |
| 360 | tLimMlmStartCnf *pLimMlmStartCnf; |
| 361 | tANI_U8 smesessionId; |
| 362 | tANI_U16 smetransactionId; |
| 363 | |
| 364 | if(pMsgBuf == NULL) |
| 365 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 366 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 367 | return; |
| 368 | } |
| 369 | pLimMlmStartCnf = (tLimMlmStartCnf*)pMsgBuf; |
| 370 | if((psessionEntry = peFindSessionBySessionId(pMac,pLimMlmStartCnf->sessionId))==NULL) |
| 371 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 372 | PELOGE(limLog(pMac, LOGE,FL("Session does Not exist with given sessionId "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 373 | return; |
| 374 | } |
| 375 | smesessionId = psessionEntry->smeSessionId; |
| 376 | smetransactionId = psessionEntry->transactionId; |
| 377 | |
| 378 | if (psessionEntry->limSmeState != eLIM_SME_WT_START_BSS_STATE) |
| 379 | { |
| 380 | /** |
| 381 | * Should not have received Start confirm from MLM |
| 382 | * in other states. |
| 383 | * Log error |
| 384 | */ |
| 385 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 386 | FL("received unexpected MLM_START_CNF in state %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 387 | psessionEntry->limSmeState);) |
| 388 | return; |
| 389 | } |
| 390 | if (((tLimMlmStartCnf *) pMsgBuf)->resultCode == |
| 391 | eSIR_SME_SUCCESS) |
| 392 | { |
| 393 | |
| 394 | /** |
| 395 | * Update global SME state so that Beacon Generation |
| 396 | * module starts writing Beacon frames into TFP's |
| 397 | * Beacon file register. |
| 398 | */ |
| 399 | psessionEntry->limSmeState = eLIM_SME_NORMAL_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 400 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 401 | if(psessionEntry->bssType == eSIR_BTAMP_STA_MODE) |
| 402 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 403 | limLog(pMac, LOG1, FL("*** Started BSS in BT_AMP STA SIDE***")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 404 | } |
| 405 | else if(psessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 406 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 407 | limLog(pMac, LOG1, FL("*** Started BSS in BT_AMP AP SIDE***")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 408 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 409 | else if(psessionEntry->bssType == eSIR_INFRA_AP_MODE) |
| 410 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 411 | limLog(pMac, LOG1, FL("*** Started BSS in INFRA AP SIDE***")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 412 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 413 | else |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 414 | PELOG1(limLog(pMac, LOG1, FL("*** Started BSS ***"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 415 | } |
| 416 | else |
| 417 | { |
| 418 | /// Start BSS is a failure |
| 419 | peDeleteSession(pMac,psessionEntry); |
| 420 | psessionEntry = NULL; |
| 421 | } |
| 422 | /// Send response to Host |
| 423 | limSendSmeStartBssRsp(pMac, eWNI_SME_START_BSS_RSP, |
| 424 | ((tLimMlmStartCnf *) pMsgBuf)->resultCode,psessionEntry, |
| 425 | smesessionId,smetransactionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 426 | if (((tLimMlmStartCnf *) pMsgBuf)->resultCode == eSIR_SME_SUCCESS) |
| 427 | { |
| 428 | //Configure beacon and send beacons to HAL |
| 429 | limSendBeaconInd(pMac, psessionEntry); |
| 430 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 431 | } |
| 432 | |
| 433 | /*** end limProcessMlmStartCnf() ***/ |
| 434 | |
| 435 | /** |
| 436 | * limProcessMlmJoinCnf() |
| 437 | * |
| 438 | *FUNCTION: |
| 439 | * This function is called to processes MLM_JOIN_CNF |
| 440 | * message from MLM State machine. |
| 441 | * |
| 442 | *LOGIC: |
| 443 | * |
| 444 | *ASSUMPTIONS: |
| 445 | * |
| 446 | *NOTE: |
| 447 | * |
| 448 | * @param pMac Pointer to Global MAC structure |
| 449 | * @param pMsgBuf A pointer to the MLM message buffer |
| 450 | * |
| 451 | * @return None |
| 452 | */ |
| 453 | void |
| 454 | limProcessMlmJoinCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 455 | { |
| 456 | tSirResultCodes resultCode; |
| 457 | tLimMlmJoinCnf *pLimMlmJoinCnf; |
| 458 | tpPESession psessionEntry; |
| 459 | pLimMlmJoinCnf = (tLimMlmJoinCnf*)pMsgBuf; |
| 460 | if( (psessionEntry = peFindSessionBySessionId(pMac,pLimMlmJoinCnf->sessionId))== NULL) |
| 461 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 462 | PELOGE(limLog(pMac, LOGE,FL("Session does not exist for given sessionId"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 463 | return; |
| 464 | } |
| 465 | |
| 466 | if (psessionEntry->limSmeState!= eLIM_SME_WT_JOIN_STATE) |
| 467 | { |
| 468 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 469 | FL("received unexpected MLM_JOIN_CNF in state %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 470 | psessionEntry->limSmeState);) |
| 471 | return; |
| 472 | } |
| 473 | |
| 474 | resultCode = ((tLimMlmJoinCnf *) pMsgBuf)->resultCode ; |
| 475 | /// Process Join confirm from MLM |
| 476 | if (resultCode == eSIR_SME_SUCCESS) |
| 477 | { |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 478 | PELOG1(limLog(pMac, LOG1, FL("*** Joined ESS ***"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 479 | //Setup hardware upfront |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 480 | //Done: 7-27-2009. JIM_FIX_ME sessionize the following function |
| 481 | if(limStaSendAddBssPreAssoc( pMac, false, psessionEntry) == eSIR_SUCCESS) |
| 482 | return; |
| 483 | else |
| 484 | resultCode = eSIR_SME_REFUSED; |
| 485 | } |
| 486 | { |
| 487 | /// Join failure |
| 488 | psessionEntry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 489 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 490 | /// Send Join response to Host |
| 491 | limHandleSmeJoinResult(pMac, resultCode, ((tLimMlmJoinCnf *) pMsgBuf)->protStatusCode, psessionEntry ); |
| 492 | } |
| 493 | } /*** end limProcessMlmJoinCnf() ***/ |
| 494 | |
| 495 | /** |
| 496 | * limProcessMlmAuthCnf() |
| 497 | * |
| 498 | *FUNCTION: |
| 499 | * This function is called to processes MLM_AUTH_CNF |
| 500 | * message from MLM State machine. |
| 501 | * |
| 502 | *LOGIC: |
| 503 | * |
| 504 | *ASSUMPTIONS: |
| 505 | * |
| 506 | *NOTE: |
| 507 | * |
| 508 | * @param pMac Pointer to Global MAC structure |
| 509 | * @param pMsgBuf A pointer to the MLM message buffer |
| 510 | * |
| 511 | * @return None |
| 512 | */ |
| 513 | void |
| 514 | limProcessMlmAuthCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 515 | { |
| 516 | tANI_U16 caps; |
| 517 | tANI_U32 val; |
| 518 | tAniAuthType cfgAuthType, authMode; |
| 519 | tLimMlmAuthReq *pMlmAuthReq; |
| 520 | tLimMlmAssocReq *pMlmAssocReq; |
| 521 | tLimMlmAuthCnf *pMlmAuthCnf; |
| 522 | tpPESession psessionEntry; |
| 523 | tANI_U32 teleBcnEn = 0; |
| 524 | // tANI_U8 sessionId; |
| 525 | |
| 526 | if(pMsgBuf == NULL) |
| 527 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 528 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 529 | return; |
| 530 | } |
| 531 | pMlmAuthCnf = (tLimMlmAuthCnf*)pMsgBuf; |
| 532 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmAuthCnf->sessionId))== NULL) |
| 533 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 534 | PELOGE(limLog(pMac, LOGE, FL("session does not exist for given sessionId"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 535 | return; |
| 536 | } |
| 537 | |
| 538 | if (((psessionEntry->limSmeState != eLIM_SME_WT_AUTH_STATE) && |
| 539 | (psessionEntry->limSmeState != eLIM_SME_WT_PRE_AUTH_STATE)) || |
| 540 | (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) |
| 541 | { |
| 542 | /** |
| 543 | * Should not have received AUTH confirm |
| 544 | * from MLM in other states or on AP. |
| 545 | * Log error |
| 546 | */ |
| 547 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 548 | FL("received unexpected MLM_AUTH_CNF in state %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 549 | psessionEntry->limSmeState);) |
| 550 | return; |
| 551 | } |
| 552 | /// Process AUTH confirm from MLM |
| 553 | if (((tLimMlmAuthCnf *) pMsgBuf)->resultCode != eSIR_SME_SUCCESS) |
| 554 | { |
| 555 | if (psessionEntry->limSmeState == eLIM_SME_WT_AUTH_STATE) |
| 556 | { |
| 557 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATION_TYPE, |
| 558 | (tANI_U32 *) &cfgAuthType) != eSIR_SUCCESS) |
| 559 | { |
| 560 | /** |
| 561 | * Could not get AuthType value from CFG. |
| 562 | * Log error. |
| 563 | */ |
| 564 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 565 | FL("could not retrieve AuthType value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 566 | } |
| 567 | } |
| 568 | else |
| 569 | cfgAuthType = pMac->lim.gLimPreAuthType; |
| 570 | |
| 571 | if ((cfgAuthType == eSIR_AUTO_SWITCH) && |
| 572 | (((tLimMlmAuthCnf *) pMsgBuf)->authType == eSIR_OPEN_SYSTEM) |
| 573 | && (eSIR_MAC_AUTH_ALGO_NOT_SUPPORTED_STATUS == ((tLimMlmAuthCnf *) pMsgBuf)->protStatusCode)) |
| 574 | { |
| 575 | /** |
| 576 | * When Open authentication fails with reason code "13" and |
| 577 | * authType set to 'auto switch', Try with Shared Authentication |
| 578 | */ |
| 579 | authMode = eSIR_SHARED_KEY; |
| 580 | // Trigger MAC based Authentication |
| 581 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMlmAuthReq, sizeof(tLimMlmAuthReq))) |
| 582 | { |
| 583 | // Log error |
| 584 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 585 | FL("call to palAllocateMemory failed for mlmAuthReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 586 | return; |
| 587 | } |
| 588 | palZeroMemory( pMac->hHdd, (tANI_U8 *) pMlmAuthReq, sizeof(tLimMlmAuthReq)); |
| 589 | val = sizeof(tSirMacAddr); |
| 590 | if (psessionEntry->limSmeState == eLIM_SME_WT_AUTH_STATE) |
| 591 | { |
| 592 | sirCopyMacAddr(pMlmAuthReq->peerMacAddr,psessionEntry->bssId); |
| 593 | } |
| 594 | else |
| 595 | palCopyMemory( pMac->hHdd, (tANI_U8 *) &pMlmAuthReq->peerMacAddr, |
| 596 | (tANI_U8 *) &pMac->lim.gLimPreAuthPeerAddr, |
| 597 | sizeof(tSirMacAddr)); |
| 598 | pMlmAuthReq->authType = authMode; |
| 599 | /* Update PE session Id*/ |
| 600 | pMlmAuthReq->sessionId = pMlmAuthCnf->sessionId; |
| 601 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, |
| 602 | (tANI_U32 *) &pMlmAuthReq->authFailureTimeout) |
| 603 | != eSIR_SUCCESS) |
| 604 | { |
| 605 | /** |
| 606 | * Could not get AuthFailureTimeout value from CFG. |
| 607 | * Log error. |
| 608 | */ |
| 609 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 610 | FL("could not retrieve AuthFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 611 | } |
| 612 | limPostMlmMessage(pMac, |
| 613 | LIM_MLM_AUTH_REQ, |
| 614 | (tANI_U32 *) pMlmAuthReq); |
| 615 | return; |
| 616 | } |
| 617 | else |
| 618 | { |
| 619 | // MAC based authentication failure |
| 620 | if (psessionEntry->limSmeState == eLIM_SME_WT_AUTH_STATE) |
| 621 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 622 | PELOGE(limLog(pMac, LOGE, FL("Auth Failure occurred."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 623 | psessionEntry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 624 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 625 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 626 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
| 627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 628 | /** |
| 629 | * Need to send Join response with |
| 630 | * auth failure to Host. |
| 631 | */ |
| 632 | limHandleSmeJoinResult(pMac, |
| 633 | ((tLimMlmAuthCnf *) pMsgBuf)->resultCode, ((tLimMlmAuthCnf *) pMsgBuf)->protStatusCode,psessionEntry); |
| 634 | } |
| 635 | else |
| 636 | { |
| 637 | /** |
| 638 | * Pre-authentication failure. |
| 639 | * Send Pre-auth failure response to host |
| 640 | */ |
| 641 | psessionEntry->limSmeState = psessionEntry->limPrevSmeState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 642 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 643 | limSendSmeAuthRsp( |
| 644 | pMac, |
| 645 | ((tLimMlmAuthCnf *) pMsgBuf)->resultCode, |
| 646 | ((tLimMlmAuthCnf *) pMsgBuf)->peerMacAddr, |
| 647 | ((tLimMlmAuthCnf *) pMsgBuf)->authType, |
| 648 | ((tLimMlmAuthCnf *) pMsgBuf)->protStatusCode,psessionEntry,psessionEntry->smeSessionId,psessionEntry->transactionId); |
| 649 | } |
| 650 | } // end if (cfgAuthType == eAUTO_SWITCH) |
| 651 | } // if (((tLimMlmAuthCnf *) pMsgBuf)->resultCode != ... |
| 652 | else |
| 653 | { |
| 654 | if (psessionEntry->limSmeState == eLIM_SME_WT_AUTH_STATE) |
| 655 | { |
| 656 | /** |
| 657 | * Successful MAC based authentication |
| 658 | * Trigger Association with BSS |
| 659 | */ |
| 660 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 661 | FL("*** Authenticated with BSS ***"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 662 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMlmAssocReq, sizeof(tLimMlmAssocReq))) |
| 663 | { |
| 664 | // Log error |
| 665 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 666 | FL("call to palAllocateMemory failed for mlmAssocReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 667 | return; |
| 668 | } |
| 669 | val = sizeof(tSirMacAddr); |
| 670 | #if 0 |
| 671 | if (cfgGetStr(pMac, WNI_CFG_BSSID, |
| 672 | pMlmAssocReq->peerMacAddr, |
| 673 | &val) != eSIR_SUCCESS) |
| 674 | { |
| 675 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 676 | limLog(pMac, LOGP, FL("could not retrieve BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 677 | } |
| 678 | #endif //SUPPORT BT-AMP |
| 679 | sirCopyMacAddr(pMlmAssocReq->peerMacAddr,psessionEntry->bssId); |
| 680 | if (wlan_cfgGetInt(pMac, WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT, |
| 681 | (tANI_U32 *) &pMlmAssocReq->assocFailureTimeout) |
| 682 | != eSIR_SUCCESS) |
| 683 | { |
| 684 | /** |
| 685 | * Could not get AssocFailureTimeout value |
| 686 | * from CFG. Log error. |
| 687 | */ |
| 688 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 689 | FL("could not retrieve AssocFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 690 | } |
| 691 | if (cfgGetCapabilityInfo(pMac, &caps,psessionEntry) != eSIR_SUCCESS) |
| 692 | { |
| 693 | /** |
| 694 | * Could not get Capabilities value |
| 695 | * from CFG. Log error. |
| 696 | */ |
| 697 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 698 | FL("could not retrieve Capabilities value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 699 | } |
| 700 | /*Clear spectrum management bit if AP doesn't support it*/ |
| 701 | if(!(psessionEntry->pLimJoinReq->bssDescription.capabilityInfo & LIM_SPECTRUM_MANAGEMENT_BIT_MASK)) |
| 702 | { |
| 703 | /*AP doesn't support spectrum management clear spectrum management bit*/ |
| 704 | caps &= (~LIM_SPECTRUM_MANAGEMENT_BIT_MASK); |
| 705 | } |
| 706 | |
| 707 | pMlmAssocReq->capabilityInfo = caps; |
| 708 | PELOG3(limLog(pMac, LOG3, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 709 | FL("Capabilities to be used in AssocReq=0x%X, privacy bit=%x shortSlotTime %x"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 710 | caps, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 711 | ((tpSirMacCapabilityInfo) &pMlmAssocReq->capabilityInfo)->privacy, |
| 712 | ((tpSirMacCapabilityInfo) &pMlmAssocReq->capabilityInfo)->shortSlotTime);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 713 | |
| 714 | /* If telescopic beaconing is enabled, set listen interval to |
| 715 | WNI_CFG_TELE_BCN_MAX_LI */ |
| 716 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_WAKEUP_EN, &teleBcnEn) != |
| 717 | eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 718 | limLog(pMac, LOGP, FL("Couldn't get WNI_CFG_TELE_BCN_WAKEUP_EN")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 719 | |
| 720 | val = WNI_CFG_LISTEN_INTERVAL_STADEF; |
| 721 | |
| 722 | if(teleBcnEn) |
| 723 | { |
| 724 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_MAX_LI, &val) != |
| 725 | eSIR_SUCCESS) |
| 726 | { |
| 727 | /** |
| 728 | * Could not get ListenInterval value |
| 729 | * from CFG. Log error. |
| 730 | */ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 731 | limLog(pMac, LOGP, FL("could not retrieve ListenInterval")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 732 | } |
| 733 | } |
| 734 | else |
| 735 | { |
| 736 | if (wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &val) != eSIR_SUCCESS) |
| 737 | { |
| 738 | /** |
| 739 | * Could not get ListenInterval value |
| 740 | * from CFG. Log error. |
| 741 | */ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 742 | limLog(pMac, LOGP, FL("could not retrieve ListenInterval")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 743 | } |
| 744 | } |
| 745 | |
| 746 | pMlmAssocReq->listenInterval = (tANI_U16)val; |
| 747 | /* Update PE session ID*/ |
| 748 | pMlmAssocReq->sessionId = psessionEntry->peSessionId; |
| 749 | psessionEntry->limPrevSmeState = psessionEntry->limSmeState; |
| 750 | psessionEntry->limSmeState = eLIM_SME_WT_ASSOC_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 751 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 752 | limPostMlmMessage(pMac, |
| 753 | LIM_MLM_ASSOC_REQ, |
| 754 | (tANI_U32 *) pMlmAssocReq); |
| 755 | } |
| 756 | else |
| 757 | { |
| 758 | /** |
| 759 | * Successful Pre-authentication. |
| 760 | * Send Pre-auth response to host |
| 761 | */ |
| 762 | psessionEntry->limSmeState = psessionEntry->limPrevSmeState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 763 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 764 | limSendSmeAuthRsp( |
| 765 | pMac, |
| 766 | ((tLimMlmAuthCnf *) pMsgBuf)->resultCode, |
| 767 | ((tLimMlmAuthCnf *) pMsgBuf)->peerMacAddr, |
| 768 | ((tLimMlmAuthCnf *) pMsgBuf)->authType, |
| 769 | ((tLimMlmAuthCnf *) pMsgBuf)->protStatusCode,psessionEntry,psessionEntry->smeSessionId,psessionEntry->transactionId); |
| 770 | } |
| 771 | } // end if (((tLimMlmAuthCnf *) pMsgBuf)->resultCode != ... |
| 772 | } /*** end limProcessMlmAuthCnf() ***/ |
| 773 | |
| 774 | /** |
| 775 | * limProcessMlmAssocCnf() |
| 776 | * |
| 777 | *FUNCTION: |
| 778 | * This function is called to processes MLM_ASSOC_CNF |
| 779 | * message from MLM State machine. |
| 780 | * |
| 781 | *LOGIC: |
| 782 | * |
| 783 | *ASSUMPTIONS: |
| 784 | * |
| 785 | *NOTE: |
| 786 | * |
| 787 | * @param pMac Pointer to Global MAC structure |
| 788 | * @param pMsgBuf A pointer to the MLM message buffer |
| 789 | * |
| 790 | * @return None |
| 791 | */ |
| 792 | void |
| 793 | limProcessMlmAssocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 794 | { |
| 795 | tpPESession psessionEntry; |
| 796 | tLimMlmAssocCnf *pLimMlmAssocCnf; |
| 797 | |
| 798 | if(pMsgBuf == NULL) |
| 799 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 800 | limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 801 | return; |
| 802 | } |
| 803 | pLimMlmAssocCnf = (tLimMlmAssocCnf*)pMsgBuf; |
| 804 | if((psessionEntry = peFindSessionBySessionId(pMac,pLimMlmAssocCnf->sessionId)) == NULL) |
| 805 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 806 | PELOGE(limLog(pMac, LOGE,FL("Session does not exist for given sessionId"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 807 | return; |
| 808 | } |
| 809 | if (psessionEntry->limSmeState != eLIM_SME_WT_ASSOC_STATE || |
| 810 | psessionEntry->limSystemRole == eLIM_AP_ROLE || psessionEntry ->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
| 811 | { |
| 812 | /** |
| 813 | * Should not have received Assocication confirm |
| 814 | * from MLM in other states OR on AP. |
| 815 | * Log error |
| 816 | */ |
| 817 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 818 | FL("received unexpected MLM_ASSOC_CNF in state %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 819 | psessionEntry->limSmeState);) |
| 820 | return; |
| 821 | } |
| 822 | if (((tLimMlmAssocCnf *) pMsgBuf)->resultCode != eSIR_SME_SUCCESS) |
| 823 | { |
| 824 | // Association failure |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 825 | PELOG1(limLog(pMac, LOG1, FL("*** Association failure ***"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 826 | psessionEntry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 827 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, pMac->lim.gLimSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 828 | /** |
| 829 | * Need to send Join response with |
| 830 | * Association failure to Host. |
| 831 | */ |
| 832 | limHandleSmeJoinResult(pMac, |
| 833 | ((tLimMlmAssocCnf *) pMsgBuf)->resultCode, |
| 834 | ((tLimMlmAssocCnf *) pMsgBuf)->protStatusCode,psessionEntry); |
| 835 | } // if (((tLimMlmAssocCnf *) pMsgBuf)->resultCode != ... |
| 836 | else |
| 837 | { |
| 838 | // Successful Association |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 839 | PELOG1(limLog(pMac, LOG1, FL("*** Associated with BSS ***"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 840 | psessionEntry->limSmeState = eLIM_SME_LINK_EST_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 841 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 842 | /** |
| 843 | * Need to send Join response with |
| 844 | * Association success to Host. |
| 845 | */ |
| 846 | limHandleSmeJoinResult(pMac, |
| 847 | ((tLimMlmAssocCnf *) pMsgBuf)->resultCode, |
| 848 | ((tLimMlmAssocCnf *) pMsgBuf)->protStatusCode,psessionEntry); |
| 849 | } // end if (((tLimMlmAssocCnf *) pMsgBuf)->resultCode != .... |
| 850 | } /*** end limProcessMlmAssocCnf() ***/ |
| 851 | |
| 852 | /** |
| 853 | * limProcessMlmReassocCnf() |
| 854 | * |
| 855 | *FUNCTION: |
| 856 | * This function is called to processes MLM_REASSOC_CNF |
| 857 | * message from MLM State machine. |
| 858 | * |
| 859 | *LOGIC: |
| 860 | * |
| 861 | *ASSUMPTIONS: |
| 862 | * |
| 863 | *NOTE: |
| 864 | * |
| 865 | * @param pMac Pointer to Global MAC structure |
| 866 | * @param pMsgBuf A pointer to the MLM message buffer |
| 867 | * |
| 868 | * @return None |
| 869 | */ |
| 870 | void |
| 871 | limProcessMlmReassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 872 | { |
| 873 | tpPESession psessionEntry; |
| 874 | tLimMlmReassocCnf *pLimMlmReassocCnf; |
| 875 | |
| 876 | if(pMsgBuf == NULL) |
| 877 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 878 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 879 | return; |
| 880 | } |
| 881 | pLimMlmReassocCnf = (tLimMlmReassocCnf*) pMsgBuf; |
| 882 | if((psessionEntry = peFindSessionBySessionId(pMac,pLimMlmReassocCnf->sessionId))==NULL) |
| 883 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 884 | PELOGE(limLog(pMac, LOGE, FL("session Does not exist for given session Id"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 885 | return; |
| 886 | } |
| 887 | if ((psessionEntry->limSmeState != eLIM_SME_WT_REASSOC_STATE) || |
| 888 | (psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) |
| 889 | { |
| 890 | /** |
| 891 | * Should not have received Reassocication confirm |
| 892 | * from MLM in other states OR on AP. |
| 893 | * Log error |
| 894 | */ |
| 895 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 896 | FL("Rcv unexpected MLM_REASSOC_CNF in role %d, sme state 0x%X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 897 | psessionEntry->limSystemRole, psessionEntry->limSmeState);) |
| 898 | return; |
| 899 | } |
| 900 | if (psessionEntry->pLimReAssocReq) { |
| 901 | palFreeMemory( pMac->hHdd, psessionEntry->pLimReAssocReq); |
| 902 | psessionEntry->pLimReAssocReq = NULL; |
| 903 | } |
| 904 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 905 | PELOGE(limLog(pMac, LOGE, FL("Rcv MLM_REASSOC_CNF with result code %d"), pLimMlmReassocCnf->resultCode);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 906 | if (pLimMlmReassocCnf->resultCode == eSIR_SME_SUCCESS) { |
| 907 | // Successful Reassociation |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 908 | PELOG1(limLog(pMac, LOG1, FL("*** Reassociated with new BSS ***"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 909 | |
| 910 | psessionEntry->limSmeState = eLIM_SME_LINK_EST_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 911 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 912 | |
| 913 | /** |
| 914 | * Need to send Reassoc response with |
| 915 | * Reassociation success to Host. |
| 916 | */ |
| 917 | limSendSmeJoinReassocRsp( |
| 918 | pMac, eWNI_SME_REASSOC_RSP, |
| 919 | pLimMlmReassocCnf->resultCode, pLimMlmReassocCnf->protStatusCode,psessionEntry, |
| 920 | psessionEntry->smeSessionId,psessionEntry->transactionId); |
| 921 | }else if (pLimMlmReassocCnf->resultCode == eSIR_SME_REASSOC_REFUSED) { |
| 922 | /** Reassociation failure With the New AP |
| 923 | * but we still have the link with the Older AP |
| 924 | */ |
| 925 | psessionEntry->limSmeState = eLIM_SME_LINK_EST_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 926 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 927 | |
| 928 | /** |
| 929 | * Need to send Reassoc response with |
| 930 | * Association failure to Host. |
| 931 | */ |
| 932 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_REASSOC_RSP, |
| 933 | pLimMlmReassocCnf->resultCode, pLimMlmReassocCnf->protStatusCode,psessionEntry, |
| 934 | psessionEntry->smeSessionId,psessionEntry->transactionId); |
| 935 | }else { |
| 936 | // Reassociation failure |
| 937 | psessionEntry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 938 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 939 | /** |
| 940 | * Need to send Reassoc response with |
| 941 | * Association failure to Host. |
| 942 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 943 | limHandleSmeReaasocResult(pMac, pLimMlmReassocCnf->resultCode, pLimMlmReassocCnf->protStatusCode, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 944 | } |
| 945 | } /*** end limProcessMlmReassocCnf() ***/ |
| 946 | |
| 947 | /** |
| 948 | * limProcessMlmReassocInd() |
| 949 | * |
| 950 | *FUNCTION: |
| 951 | * This function is called to processes MLM_REASSOC_IND |
| 952 | * message from MLM State machine. |
| 953 | * |
| 954 | *LOGIC: |
| 955 | * |
| 956 | *ASSUMPTIONS: |
| 957 | * |
| 958 | *NOTE: |
| 959 | * |
| 960 | * @param pMac Pointer to Global MAC structure |
| 961 | * @param pMsgBuf A pointer to the MLM message buffer |
| 962 | * |
| 963 | * @return None |
| 964 | */ |
| 965 | void |
| 966 | limProcessMlmReassocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 967 | { |
| 968 | tANI_U32 len; |
| 969 | tSirMsgQ msgQ; |
| 970 | tSirSmeReassocInd *pSirSmeReassocInd; |
| 971 | tpDphHashNode pStaDs=0; |
| 972 | tpPESession psessionEntry; |
| 973 | tANI_U8 sessionId; |
| 974 | if(pMsgBuf == NULL) |
| 975 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 976 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 977 | return; |
| 978 | } |
| 979 | if((psessionEntry = peFindSessionByBssid(pMac,((tpLimMlmReassocInd)pMsgBuf)->peerMacAddr, &sessionId))== NULL) |
| 980 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 981 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 982 | return; |
| 983 | } |
| 984 | /// Inform Host of STA reassociation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 985 | len = sizeof(tSirSmeReassocInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 986 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeReassocInd, len)) |
| 987 | { |
| 988 | // Log error |
| 989 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 990 | FL("call to palAllocateMemory failed for eWNI_SME_REASSOC_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 991 | return; |
| 992 | |
| 993 | } |
| 994 | sirStoreU16N((tANI_U8 *) &pSirSmeReassocInd->messageType, |
| 995 | eWNI_SME_REASSOC_IND); |
| 996 | limReassocIndSerDes(pMac, (tpLimMlmReassocInd) pMsgBuf, |
| 997 | (tANI_U8 *) &(pSirSmeReassocInd->length), psessionEntry); |
| 998 | |
| 999 | // Required for indicating the frames to upper layer |
| 1000 | pSirSmeReassocInd->assocReqLength = ((tpLimMlmReassocInd) pMsgBuf)->assocReqLength; |
| 1001 | pSirSmeReassocInd->assocReqPtr = ((tpLimMlmReassocInd) pMsgBuf)->assocReqPtr; |
| 1002 | pSirSmeReassocInd->beaconPtr = psessionEntry->beacon; |
| 1003 | pSirSmeReassocInd->beaconLength = psessionEntry->bcnLen; |
| 1004 | |
| 1005 | msgQ.type = eWNI_SME_REASSOC_IND; |
| 1006 | msgQ.bodyptr = pSirSmeReassocInd; |
| 1007 | msgQ.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1008 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1009 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1010 | limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_IND_EVENT, psessionEntry, 0, 0); |
| 1011 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1012 | pStaDs = dphGetHashEntry(pMac, ((tpLimMlmReassocInd) pMsgBuf)->aid, &psessionEntry->dph.dphHashTable); |
| 1013 | if (! pStaDs) |
| 1014 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1015 | limLog( pMac, LOGP, FL("MLM ReAssocInd: Station context no longer valid (aid %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1016 | ((tpLimMlmReassocInd) pMsgBuf)->aid); |
| 1017 | palFreeMemory(pMac->hHdd, pSirSmeReassocInd); |
| 1018 | return; |
| 1019 | } |
| 1020 | |
| 1021 | limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); |
| 1022 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1023 | FL("Create CNF_WAIT_TIMER after received LIM_MLM_REASSOC_IND"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1024 | /* |
| 1025 | ** turn on a timer to detect the loss of REASSOC CNF |
| 1026 | **/ |
| 1027 | limActivateCnfTimer(pMac, |
| 1028 | (tANI_U16) ((tpLimMlmReassocInd) pMsgBuf)->aid, psessionEntry); |
| 1029 | } /*** end limProcessMlmReassocInd() ***/ |
| 1030 | |
| 1031 | /** |
| 1032 | * limProcessMlmAuthInd() |
| 1033 | * |
| 1034 | *FUNCTION: |
| 1035 | * This function is called to processes MLM_AUTH_IND |
| 1036 | * message from MLM State machine. |
| 1037 | * |
| 1038 | *LOGIC: |
| 1039 | * |
| 1040 | *ASSUMPTIONS: |
| 1041 | * |
| 1042 | *NOTE: |
| 1043 | * |
| 1044 | * @param pMac Pointer to Global MAC structure |
| 1045 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1046 | * |
| 1047 | * @return None |
| 1048 | */ |
| 1049 | void |
| 1050 | limProcessMlmAuthInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1051 | { |
| 1052 | tSirMsgQ msgQ; |
| 1053 | tSirSmeAuthInd *pSirSmeAuthInd; |
| 1054 | |
| 1055 | if(pMsgBuf == NULL) |
| 1056 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1057 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1058 | return; |
| 1059 | } |
| 1060 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeAuthInd, sizeof(tSirSmeAuthInd))) |
| 1061 | { |
| 1062 | // Log error |
| 1063 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1064 | FL("call to palAllocateMemory failed for eWNI_SME_AUTH_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1065 | } |
| 1066 | limCopyU16((tANI_U8 *) &pSirSmeAuthInd->messageType, eWNI_SME_AUTH_IND); |
| 1067 | limAuthIndSerDes(pMac, (tpLimMlmAuthInd) pMsgBuf, |
| 1068 | (tANI_U8 *) &(pSirSmeAuthInd->length)); |
| 1069 | msgQ.type = eWNI_SME_AUTH_IND; |
| 1070 | msgQ.bodyptr = pSirSmeAuthInd; |
| 1071 | msgQ.bodyval = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1072 | MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1073 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1074 | limDiagEventReport(pMac, WLAN_PE_DIAG_AUTH_IND_EVENT, NULL, 0, 0); |
| 1075 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1076 | limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); |
| 1077 | } /*** end limProcessMlmAuthInd() ***/ |
| 1078 | |
| 1079 | |
| 1080 | |
| 1081 | |
| 1082 | void |
| 1083 | limFillAssocIndParams(tpAniSirGlobal pMac, tpLimMlmAssocInd pAssocInd, |
| 1084 | tSirSmeAssocInd *pSirSmeAssocInd, |
| 1085 | tpPESession psessionEntry) |
| 1086 | { |
| 1087 | pSirSmeAssocInd->length = sizeof(tSirSmeAssocInd); |
| 1088 | pSirSmeAssocInd->sessionId = psessionEntry->smeSessionId; |
| 1089 | |
| 1090 | // Required for indicating the frames to upper layer |
| 1091 | pSirSmeAssocInd->assocReqLength = pAssocInd->assocReqLength; |
| 1092 | pSirSmeAssocInd->assocReqPtr = pAssocInd->assocReqPtr; |
| 1093 | |
| 1094 | pSirSmeAssocInd->beaconPtr = psessionEntry->beacon; |
| 1095 | pSirSmeAssocInd->beaconLength = psessionEntry->bcnLen; |
| 1096 | |
| 1097 | // Fill in peerMacAddr |
| 1098 | palCopyMemory( pMac->hHdd, pSirSmeAssocInd->peerMacAddr, pAssocInd->peerMacAddr, sizeof(tSirMacAddr)); |
| 1099 | // Fill in aid |
| 1100 | pSirSmeAssocInd->aid = pAssocInd->aid; |
| 1101 | // Fill in bssId |
| 1102 | palCopyMemory( pMac->hHdd, pSirSmeAssocInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr)); |
| 1103 | // Fill in staId |
| 1104 | //pSirSmeAssocInd->staId = psessionEntry->staId; |
| 1105 | // Fill in authType |
| 1106 | pSirSmeAssocInd->authType = pAssocInd->authType; |
| 1107 | // Fill in ssId |
| 1108 | palCopyMemory( pMac->hHdd, (tANI_U8*)&pSirSmeAssocInd->ssId, |
| 1109 | (tANI_U8 *) &(pAssocInd->ssId), pAssocInd->ssId.length + 1); |
| 1110 | pSirSmeAssocInd->rsnIE.length = pAssocInd->rsnIE.length; |
| 1111 | palCopyMemory( pMac->hHdd, (tANI_U8*) &pSirSmeAssocInd->rsnIE.rsnIEdata, |
| 1112 | (tANI_U8 *) &(pAssocInd->rsnIE.rsnIEdata), |
| 1113 | pAssocInd->rsnIE.length); |
| 1114 | |
| 1115 | pSirSmeAssocInd->addIE.length = pAssocInd->addIE.length; |
| 1116 | palCopyMemory( pMac->hHdd, (tANI_U8*) &pSirSmeAssocInd->addIE.addIEdata, |
| 1117 | (tANI_U8 *) &(pAssocInd->addIE.addIEdata), |
| 1118 | pAssocInd->addIE.length); |
| 1119 | |
| 1120 | // Copy the new TITAN capabilities |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1121 | pSirSmeAssocInd->spectrumMgtIndicator = pAssocInd->spectrumMgtIndicator; |
| 1122 | if (pAssocInd->spectrumMgtIndicator == eSIR_TRUE) |
| 1123 | { |
| 1124 | pSirSmeAssocInd->powerCap.minTxPower = pAssocInd->powerCap.minTxPower; |
| 1125 | pSirSmeAssocInd->powerCap.maxTxPower = pAssocInd->powerCap.maxTxPower; |
| 1126 | pSirSmeAssocInd->supportedChannels.numChnl = pAssocInd->supportedChannels.numChnl; |
| 1127 | palCopyMemory( pMac->hHdd, (tANI_U8*) &pSirSmeAssocInd->supportedChannels.channelList, |
| 1128 | (tANI_U8 *) &(pAssocInd->supportedChannels.channelList), |
| 1129 | pAssocInd->supportedChannels.numChnl); |
| 1130 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1131 | // Fill in WmmInfo |
| 1132 | pSirSmeAssocInd->wmmEnabledSta = pAssocInd->WmmStaInfoPresent; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1133 | } /*** end limAssocIndSerDes() ***/ |
| 1134 | |
| 1135 | |
| 1136 | |
| 1137 | /** |
| 1138 | * limProcessMlmAssocInd() |
| 1139 | * |
| 1140 | *FUNCTION: |
| 1141 | * This function is called to processes MLM_ASSOC_IND |
| 1142 | * message from MLM State machine. |
| 1143 | * |
| 1144 | *LOGIC: |
| 1145 | * |
| 1146 | *ASSUMPTIONS: |
| 1147 | * |
| 1148 | *NOTE: |
| 1149 | * |
| 1150 | * @param pMac Pointer to Global MAC structure |
| 1151 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1152 | * |
| 1153 | * @return None |
| 1154 | */ |
| 1155 | void |
| 1156 | limProcessMlmAssocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1157 | { |
| 1158 | tANI_U32 len; |
| 1159 | tSirMsgQ msgQ; |
| 1160 | tSirSmeAssocInd *pSirSmeAssocInd; |
| 1161 | tpDphHashNode pStaDs=0; |
| 1162 | tpPESession psessionEntry; |
| 1163 | if(pMsgBuf == NULL) |
| 1164 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1165 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1166 | return; |
| 1167 | } |
| 1168 | if((psessionEntry = peFindSessionBySessionId(pMac,((tpLimMlmAssocInd) pMsgBuf)->sessionId))== NULL) |
| 1169 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1170 | limLog( pMac, LOGE, FL( "Session Does not exist for given sessionId" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1171 | return; |
| 1172 | } |
| 1173 | /// Inform Host of STA association |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1174 | len = sizeof(tSirSmeAssocInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1175 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pSirSmeAssocInd, len)) |
| 1176 | { |
| 1177 | // Log error |
| 1178 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1179 | FL("call to palAllocateMemory failed for eWNI_SME_ASSOC_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1180 | return; |
| 1181 | } |
| 1182 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1183 | pSirSmeAssocInd->messageType = eWNI_SME_ASSOC_IND; |
| 1184 | limFillAssocIndParams(pMac, (tpLimMlmAssocInd) pMsgBuf, pSirSmeAssocInd, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1185 | msgQ.type = eWNI_SME_ASSOC_IND; |
| 1186 | msgQ.bodyptr = pSirSmeAssocInd; |
| 1187 | msgQ.bodyval = 0; |
| 1188 | pStaDs = dphGetHashEntry(pMac, |
| 1189 | ((tpLimMlmAssocInd) pMsgBuf)->aid, &psessionEntry->dph.dphHashTable); |
| 1190 | if (! pStaDs) |
| 1191 | { // good time to panic... |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1192 | limLog(pMac, LOGE, FL("MLM AssocInd: Station context no longer valid (aid %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1193 | ((tpLimMlmAssocInd) pMsgBuf)->aid); |
| 1194 | palFreeMemory(pMac->hHdd, pSirSmeAssocInd); |
| 1195 | |
| 1196 | return; |
| 1197 | } |
| 1198 | pSirSmeAssocInd->staId = pStaDs->staIndex; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1199 | pSirSmeAssocInd->reassocReq = pStaDs->mlmStaContext.subType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1200 | MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1201 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1202 | limDiagEventReport(pMac, WLAN_PE_DIAG_ASSOC_IND_EVENT, psessionEntry, 0, 0); |
| 1203 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1204 | limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); |
| 1205 | |
| 1206 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1207 | FL("Create CNF_WAIT_TIMER after received LIM_MLM_ASSOC_IND"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1208 | /* |
| 1209 | ** turn on a timer to detect the loss of ASSOC CNF |
| 1210 | **/ |
| 1211 | limActivateCnfTimer(pMac, (tANI_U16) ((tpLimMlmAssocInd) pMsgBuf)->aid, psessionEntry); |
| 1212 | |
| 1213 | // Enable this Compile flag to test the BT-AMP -AP assoc sequence |
| 1214 | #ifdef TEST_BTAMP_AP |
| 1215 | //tANI_U32 *pMsgBuf; |
| 1216 | { |
| 1217 | tpSirSmeAssocCnf pSmeAssoccnf; |
| 1218 | if(!palAllocateMemory(pMac->hHdd,(void **)&pSmeAssoccnf,sizeof(tSirSmeAssocCnf))) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1219 | PELOGE(limLog(pMac, LOGE, FL("palAllocateMemory failed for pSmeAssoccnf "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1220 | pSmeAssoccnf->messageType = eWNI_SME_ASSOC_CNF; |
| 1221 | pSmeAssoccnf->length = sizeof(tSirSmeAssocCnf); |
| 1222 | palCopyMemory( pMac->hHdd,pSmeAssoccnf->peerMacAddr,((tpLimMlmAssocInd)pMsgBuf)->peerMacAddr,6); |
| 1223 | pSmeAssoccnf->statusCode = eSIR_SME_SUCCESS; |
| 1224 | pSmeAssoccnf->aid = ((tpLimMlmAssocInd)pMsgBuf)->aid; |
| 1225 | palCopyMemory( pMac->hHdd, pSmeAssoccnf->alternateBssId,pSmeAssoccnf->peerMacAddr,sizeof(tSirMacAddr)); |
| 1226 | pSmeAssoccnf->alternateChannelId = 6; |
| 1227 | palCopyMemory( pMac->hHdd,pSmeAssoccnf->bssId,psessionEntry->selfMacAddr,6); |
| 1228 | pMsgBuf = (tANI_U32)pSmeAssoccnf; |
| 1229 | __limProcessSmeAssocCnfNew(pMac, eWNI_SME_ASSOC_CNF, pMsgBuf); |
| 1230 | palFreeMemory(pMac->hHdd,pSmeAssoccnf); |
| 1231 | } |
| 1232 | #endif |
| 1233 | |
| 1234 | |
| 1235 | } /*** end limProcessMlmAssocInd() ***/ |
| 1236 | |
| 1237 | |
| 1238 | |
| 1239 | |
| 1240 | /** |
| 1241 | * limProcessMlmDisassocInd() |
| 1242 | * |
| 1243 | *FUNCTION: |
| 1244 | * This function is called to processes MLM_DISASSOC_IND |
| 1245 | * message from MLM State machine. |
| 1246 | * |
| 1247 | *LOGIC: |
| 1248 | * |
| 1249 | *ASSUMPTIONS: |
| 1250 | * |
| 1251 | *NOTE: |
| 1252 | * |
| 1253 | * @param pMac Pointer to Global MAC structure |
| 1254 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1255 | * |
| 1256 | * @return None |
| 1257 | */ |
| 1258 | void |
| 1259 | limProcessMlmDisassocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1260 | { |
| 1261 | tLimMlmDisassocInd *pMlmDisassocInd; |
| 1262 | tpPESession psessionEntry; |
| 1263 | pMlmDisassocInd = (tLimMlmDisassocInd *) pMsgBuf; |
| 1264 | if( (psessionEntry = peFindSessionBySessionId(pMac,pMlmDisassocInd->sessionId) )== NULL) |
| 1265 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1266 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1267 | return; |
| 1268 | } |
| 1269 | switch (psessionEntry->limSystemRole) |
| 1270 | { |
| 1271 | case eLIM_STA_IN_IBSS_ROLE: |
| 1272 | break; |
| 1273 | case eLIM_STA_ROLE: |
| 1274 | case eLIM_BT_AMP_STA_ROLE: |
| 1275 | psessionEntry->limSmeState = eLIM_SME_WT_DISASSOC_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1276 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1277 | break; |
| 1278 | default: // eLIM_AP_ROLE //eLIM_BT_AMP_AP_ROLE |
| 1279 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1280 | FL("*** Peer staId=%d Disassociated ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1281 | pMlmDisassocInd->aid);) |
| 1282 | // Send SME_DISASOC_IND after Polaris cleanup |
| 1283 | // (after receiving LIM_MLM_PURGE_STA_IND) |
| 1284 | break; |
| 1285 | } // end switch (psessionEntry->limSystemRole) |
| 1286 | } /*** end limProcessMlmDisassocInd() ***/ |
| 1287 | |
| 1288 | /** |
| 1289 | * limProcessMlmDisassocCnf() |
| 1290 | * |
| 1291 | *FUNCTION: |
| 1292 | * This function is called to processes MLM_DISASSOC_CNF |
| 1293 | * message from MLM State machine. |
| 1294 | * |
| 1295 | *LOGIC: |
| 1296 | * |
| 1297 | *ASSUMPTIONS: |
| 1298 | * |
| 1299 | *NOTE: |
| 1300 | * |
| 1301 | * @param pMac Pointer to Global MAC structure |
| 1302 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1303 | * |
| 1304 | * @return None |
| 1305 | */ |
| 1306 | void |
| 1307 | limProcessMlmDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1308 | { |
| 1309 | tSirResultCodes resultCode; |
| 1310 | tLimMlmDisassocCnf *pMlmDisassocCnf; |
| 1311 | tpPESession psessionEntry; |
| 1312 | pMlmDisassocCnf = (tLimMlmDisassocCnf *) pMsgBuf; |
| 1313 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmDisassocCnf->sessionId))== NULL) |
| 1314 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1315 | PELOGE(limLog(pMac, LOGE,FL("session Does not exist for given session Id"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1316 | return; |
| 1317 | } |
| 1318 | resultCode = (tSirResultCodes) |
| 1319 | (pMlmDisassocCnf->disassocTrigger == |
| 1320 | eLIM_LINK_MONITORING_DISASSOC) ? |
| 1321 | eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE : |
| 1322 | pMlmDisassocCnf->resultCode; |
| 1323 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 1324 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1325 | // Disassociate Confirm from MLM |
| 1326 | if ( (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && |
| 1327 | (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) ) |
| 1328 | { |
| 1329 | /** |
| 1330 | * Should not have received |
| 1331 | * Disassocate confirm |
| 1332 | * from MLM in other states. |
| 1333 | * Log error |
| 1334 | */ |
| 1335 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1336 | FL("received unexpected MLM_DISASSOC_CNF in state %X"),psessionEntry->limSmeState);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1337 | return; |
| 1338 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1339 | if (pMac->lim.gLimRspReqd) |
| 1340 | pMac->lim.gLimRspReqd = false; |
| 1341 | if (pMlmDisassocCnf->disassocTrigger == |
| 1342 | eLIM_PROMISCUOUS_MODE_DISASSOC) |
| 1343 | { |
| 1344 | if (pMlmDisassocCnf->resultCode != eSIR_SME_SUCCESS) |
| 1345 | psessionEntry->limSmeState = psessionEntry->limPrevSmeState; |
| 1346 | else |
| 1347 | psessionEntry->limSmeState = eLIM_SME_OFFLINE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1348 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1349 | // Send Promiscuous mode response to host |
| 1350 | limSendSmePromiscuousModeRsp(pMac); |
| 1351 | } |
| 1352 | else |
| 1353 | { |
| 1354 | if (pMlmDisassocCnf->resultCode != eSIR_SME_SUCCESS) |
| 1355 | psessionEntry->limSmeState = psessionEntry->limPrevSmeState; |
| 1356 | else |
| 1357 | psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1358 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1359 | limSendSmeDisassocNtf(pMac, pMlmDisassocCnf->peerMacAddr, |
| 1360 | resultCode, |
| 1361 | pMlmDisassocCnf->disassocTrigger, |
| 1362 | pMlmDisassocCnf->aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 1363 | } |
| 1364 | } |
| 1365 | else if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 1366 | { |
| 1367 | limSendSmeDisassocNtf(pMac, pMlmDisassocCnf->peerMacAddr, |
| 1368 | resultCode, |
| 1369 | pMlmDisassocCnf->disassocTrigger, |
| 1370 | pMlmDisassocCnf->aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 1371 | } |
| 1372 | } /*** end limProcessMlmDisassocCnf() ***/ |
| 1373 | |
| 1374 | /** |
| 1375 | * limProcessMlmDeauthInd() |
| 1376 | * |
| 1377 | *FUNCTION: |
| 1378 | * This function is called to processes MLM_DEAUTH_IND |
| 1379 | * message from MLM State machine. |
| 1380 | * |
| 1381 | *LOGIC: |
| 1382 | * |
| 1383 | *ASSUMPTIONS: |
| 1384 | * |
| 1385 | *NOTE: |
| 1386 | * |
| 1387 | * @param pMac Pointer to Global MAC structure |
| 1388 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1389 | * |
| 1390 | * @return None |
| 1391 | */ |
| 1392 | void |
| 1393 | limProcessMlmDeauthInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1394 | { |
| 1395 | tLimMlmDeauthInd *pMlmDeauthInd; |
| 1396 | tpPESession psessionEntry; |
| 1397 | tANI_U8 sessionId; |
| 1398 | pMlmDeauthInd = (tLimMlmDeauthInd *) pMsgBuf; |
| 1399 | if((psessionEntry = peFindSessionByBssid(pMac,pMlmDeauthInd->peerMacAddr,&sessionId))== NULL) |
| 1400 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1401 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1402 | return; |
| 1403 | } |
| 1404 | switch (psessionEntry->limSystemRole) |
| 1405 | { |
| 1406 | case eLIM_STA_IN_IBSS_ROLE: |
| 1407 | break; |
| 1408 | case eLIM_STA_ROLE: |
| 1409 | case eLIM_BT_AMP_STA_ROLE: |
| 1410 | psessionEntry->limSmeState = eLIM_SME_WT_DEAUTH_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1411 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1412 | |
| 1413 | default: // eLIM_AP_ROLE |
| 1414 | { |
| 1415 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1416 | FL("*** Received Deauthentication from staId=%d ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1417 | pMlmDeauthInd->aid);) |
| 1418 | } |
| 1419 | // Send SME_DEAUTH_IND after Polaris cleanup |
| 1420 | // (after receiving LIM_MLM_PURGE_STA_IND) |
| 1421 | break; |
| 1422 | } // end switch (psessionEntry->limSystemRole) |
| 1423 | } /*** end limProcessMlmDeauthInd() ***/ |
| 1424 | |
| 1425 | /** |
| 1426 | * limProcessMlmDeauthCnf() |
| 1427 | * |
| 1428 | *FUNCTION: |
| 1429 | * This function is called to processes MLM_DEAUTH_CNF |
| 1430 | * message from MLM State machine. |
| 1431 | * |
| 1432 | *LOGIC: |
| 1433 | * |
| 1434 | *ASSUMPTIONS: |
| 1435 | * |
| 1436 | *NOTE: |
| 1437 | * |
| 1438 | * @param pMac Pointer to Global MAC structure |
| 1439 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1440 | * |
| 1441 | * @return None |
| 1442 | */ |
| 1443 | void |
| 1444 | limProcessMlmDeauthCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1445 | { |
| 1446 | tANI_U16 aid; |
| 1447 | tSirResultCodes resultCode; |
| 1448 | tLimMlmDeauthCnf *pMlmDeauthCnf; |
| 1449 | tpPESession psessionEntry; |
| 1450 | |
| 1451 | if(pMsgBuf == NULL) |
| 1452 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1453 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1454 | return; |
| 1455 | } |
| 1456 | pMlmDeauthCnf = (tLimMlmDeauthCnf *) pMsgBuf; |
| 1457 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmDeauthCnf->sessionId))==NULL) |
| 1458 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1459 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given session Id "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1460 | return; |
| 1461 | } |
| 1462 | |
| 1463 | resultCode = (tSirResultCodes) |
| 1464 | (pMlmDeauthCnf->deauthTrigger == |
| 1465 | eLIM_LINK_MONITORING_DEAUTH) ? |
| 1466 | eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE : |
| 1467 | pMlmDeauthCnf->resultCode; |
| 1468 | aid = (psessionEntry->limSystemRole == eLIM_AP_ROLE) ? |
| 1469 | pMlmDeauthCnf->aid : 1; |
| 1470 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 1471 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1472 | // Deauth Confirm from MLM |
| 1473 | if (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) |
| 1474 | { |
| 1475 | /** |
| 1476 | * Should not have received Deauth confirm |
| 1477 | * from MLM in other states. |
| 1478 | * Log error |
| 1479 | */ |
| 1480 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1481 | FL("received unexpected MLM_DEAUTH_CNF in state %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1482 | psessionEntry->limSmeState);) |
| 1483 | return; |
| 1484 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1485 | if (pMlmDeauthCnf->resultCode == eSIR_SME_SUCCESS) |
| 1486 | { |
| 1487 | psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; |
| 1488 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1489 | FL("*** Deauthenticated with BSS ***"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1490 | } |
| 1491 | else |
| 1492 | psessionEntry->limSmeState = psessionEntry->limPrevSmeState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1493 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1494 | |
| 1495 | if (pMac->lim.gLimRspReqd) |
| 1496 | pMac->lim.gLimRspReqd = false; |
| 1497 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1498 | // On STA or on BASIC AP, send SME_DEAUTH_RSP to host |
| 1499 | limSendSmeDeauthNtf(pMac, pMlmDeauthCnf->peerMacAddr, |
| 1500 | resultCode, |
| 1501 | pMlmDeauthCnf->deauthTrigger, |
| 1502 | aid,psessionEntry->smeSessionId,psessionEntry->transactionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1503 | } /*** end limProcessMlmDeauthCnf() ***/ |
| 1504 | |
| 1505 | /** |
| 1506 | * limProcessMlmPurgeStaInd() |
| 1507 | * |
| 1508 | *FUNCTION: |
| 1509 | * This function is called to processes MLM_PURGE_STA_IND |
| 1510 | * message from MLM State machine. |
| 1511 | * |
| 1512 | *LOGIC: |
| 1513 | * |
| 1514 | *ASSUMPTIONS: |
| 1515 | * |
| 1516 | *NOTE: |
| 1517 | * |
| 1518 | * @param pMac Pointer to Global MAC structure |
| 1519 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1520 | * |
| 1521 | * @return None |
| 1522 | */ |
| 1523 | void |
| 1524 | limProcessMlmPurgeStaInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1525 | { |
| 1526 | tSirResultCodes resultCode; |
| 1527 | tpLimMlmPurgeStaInd pMlmPurgeStaInd; |
| 1528 | tpPESession psessionEntry; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1529 | if(pMsgBuf == NULL) |
| 1530 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1531 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1532 | return; |
| 1533 | } |
| 1534 | pMlmPurgeStaInd = (tpLimMlmPurgeStaInd) pMsgBuf; |
| 1535 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmPurgeStaInd->sessionId))==NULL) |
| 1536 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1537 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given bssId"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1538 | return; |
| 1539 | } |
| 1540 | // Purge STA indication from MLM |
| 1541 | resultCode = (tSirResultCodes) pMlmPurgeStaInd->reasonCode; |
| 1542 | switch (psessionEntry->limSystemRole) |
| 1543 | { |
| 1544 | case eLIM_STA_IN_IBSS_ROLE: |
| 1545 | break; |
| 1546 | case eLIM_STA_ROLE: |
| 1547 | case eLIM_BT_AMP_STA_ROLE: |
| 1548 | default: // eLIM_AP_ROLE |
| 1549 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) && |
| 1550 | (psessionEntry->limSmeState != |
| 1551 | eLIM_SME_WT_DISASSOC_STATE) && |
| 1552 | (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) |
| 1553 | { |
| 1554 | /** |
| 1555 | * Should not have received |
| 1556 | * Purge STA indication |
| 1557 | * from MLM in other states. |
| 1558 | * Log error |
| 1559 | */ |
| 1560 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1561 | FL("received unexpected MLM_PURGE_STA_IND in state %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1562 | psessionEntry->limSmeState);) |
| 1563 | break; |
| 1564 | } |
| 1565 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1566 | FL("*** Polaris cleanup completed for staId=%d ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1567 | pMlmPurgeStaInd->aid);) |
| 1568 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 1569 | { |
| 1570 | psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1571 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1572 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1573 | } |
| 1574 | if (pMlmPurgeStaInd->purgeTrigger == eLIM_PEER_ENTITY_DEAUTH) |
| 1575 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1576 | limSendSmeDeauthNtf(pMac, |
| 1577 | pMlmPurgeStaInd->peerMacAddr, |
| 1578 | resultCode, |
| 1579 | pMlmPurgeStaInd->purgeTrigger, |
| 1580 | pMlmPurgeStaInd->aid,psessionEntry->smeSessionId,psessionEntry->transactionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1581 | } |
| 1582 | else |
| 1583 | limSendSmeDisassocNtf(pMac, |
| 1584 | pMlmPurgeStaInd->peerMacAddr, |
| 1585 | resultCode, |
| 1586 | pMlmPurgeStaInd->purgeTrigger, |
| 1587 | pMlmPurgeStaInd->aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 1588 | } // end switch (psessionEntry->limSystemRole) |
| 1589 | } /*** end limProcessMlmPurgeStaInd() ***/ |
| 1590 | |
| 1591 | /** |
| 1592 | * limProcessMlmSetKeysCnf() |
| 1593 | * |
| 1594 | *FUNCTION: |
| 1595 | * This function is called to processes MLM_SETKEYS_CNF |
| 1596 | * message from MLM State machine. |
| 1597 | * |
| 1598 | *LOGIC: |
| 1599 | * |
| 1600 | *ASSUMPTIONS: |
| 1601 | * |
| 1602 | *NOTE: |
| 1603 | * |
| 1604 | * @param pMac Pointer to Global MAC structure |
| 1605 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1606 | * |
| 1607 | * @return None |
| 1608 | */ |
| 1609 | void |
| 1610 | limProcessMlmSetKeysCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1611 | { |
| 1612 | // Prepare and send SME_SETCONTEXT_RSP message |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1613 | tLimMlmSetKeysCnf *pMlmSetKeysCnf; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1614 | tpPESession psessionEntry; |
| 1615 | |
| 1616 | if(pMsgBuf == NULL) |
| 1617 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1618 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1619 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1620 | } |
| 1621 | pMlmSetKeysCnf = (tLimMlmSetKeysCnf *) pMsgBuf; |
| 1622 | if ((psessionEntry = peFindSessionBySessionId(pMac, pMlmSetKeysCnf->sessionId))== NULL) |
| 1623 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1624 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1625 | return; |
| 1626 | } |
| 1627 | limLog( pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1628 | FL("Received MLM_SETKEYS_CNF with resultCode = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1629 | pMlmSetKeysCnf->resultCode ); |
| 1630 | limSendSmeSetContextRsp(pMac, |
| 1631 | pMlmSetKeysCnf->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1632 | 1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1633 | (tSirResultCodes) pMlmSetKeysCnf->resultCode,psessionEntry,psessionEntry->smeSessionId, |
| 1634 | psessionEntry->transactionId); |
| 1635 | } /*** end limProcessMlmSetKeysCnf() ***/ |
| 1636 | /** |
| 1637 | * limProcessMlmRemoveKeyCnf() |
| 1638 | * |
| 1639 | *FUNCTION: |
| 1640 | * This function is called to processes MLM_REMOVEKEY_CNF |
| 1641 | * message from MLM State machine. |
| 1642 | * |
| 1643 | *LOGIC: |
| 1644 | * |
| 1645 | *ASSUMPTIONS: |
| 1646 | * |
| 1647 | *NOTE: |
| 1648 | * |
| 1649 | * @param pMac Pointer to Global MAC structure |
| 1650 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1651 | * |
| 1652 | * @return None |
| 1653 | */ |
| 1654 | void |
| 1655 | limProcessMlmRemoveKeyCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1656 | { |
| 1657 | // Prepare and send SME_REMOVECONTEXT_RSP message |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1658 | tLimMlmRemoveKeyCnf *pMlmRemoveKeyCnf; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1659 | tpPESession psessionEntry; |
| 1660 | |
| 1661 | if(pMsgBuf == NULL) |
| 1662 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1663 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1664 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1665 | } |
| 1666 | pMlmRemoveKeyCnf = (tLimMlmRemoveKeyCnf *) pMsgBuf; |
| 1667 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmRemoveKeyCnf->sessionId))== NULL) |
| 1668 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1669 | PELOGE(limLog(pMac, LOGE,FL("session Does not exist for given session Id"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1670 | return; |
| 1671 | } |
| 1672 | limLog( pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1673 | FL("Received MLM_REMOVEKEYS_CNF with resultCode = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1674 | pMlmRemoveKeyCnf->resultCode ); |
| 1675 | limSendSmeRemoveKeyRsp(pMac, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1676 | pMlmRemoveKeyCnf->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1677 | (tSirResultCodes) pMlmRemoveKeyCnf->resultCode,psessionEntry, |
| 1678 | psessionEntry->smeSessionId,psessionEntry->transactionId); |
| 1679 | } /*** end limProcessMlmRemoveKeyCnf() ***/ |
| 1680 | |
| 1681 | |
| 1682 | /** |
| 1683 | * limHandleSmeJoinResult() |
| 1684 | * |
| 1685 | *FUNCTION: |
| 1686 | * This function is called to process join/auth/assoc failures |
| 1687 | * upon receiving MLM_JOIN/AUTH/ASSOC_CNF with a failure code or |
| 1688 | * MLM_ASSOC_CNF with a success code in case of STA role and |
| 1689 | * MLM_JOIN_CNF with success in case of STA in IBSS role. |
| 1690 | * |
| 1691 | *LOGIC: |
| 1692 | * |
| 1693 | *ASSUMPTIONS: |
| 1694 | * |
| 1695 | *NOTE: |
| 1696 | * |
| 1697 | * @param pMac Pointer to Global MAC structure |
| 1698 | * @param resultCode Failure code to be sent |
| 1699 | * |
| 1700 | * |
| 1701 | * @return None |
| 1702 | */ |
| 1703 | static void |
| 1704 | limHandleSmeJoinResult(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U16 protStatusCode, tpPESession psessionEntry) |
| 1705 | { |
| 1706 | tpDphHashNode pStaDs = NULL; |
| 1707 | tANI_U8 smesessionId; |
| 1708 | tANI_U16 smetransactionId; |
| 1709 | |
| 1710 | /* Newly Added on oct 11 th*/ |
| 1711 | if(psessionEntry == NULL) |
| 1712 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1713 | PELOGE(limLog(pMac, LOGE,FL("psessionEntry is NULL "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1714 | return; |
| 1715 | } |
| 1716 | smesessionId = psessionEntry->smeSessionId; |
| 1717 | smetransactionId = psessionEntry->transactionId; |
| 1718 | /* When associations is failed , delete the session created and pass NULL to limsendsmeJoinReassocRsp() */ |
| 1719 | if(resultCode != eSIR_SME_SUCCESS) |
| 1720 | { |
| 1721 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 1722 | if (pStaDs != NULL) |
| 1723 | { |
| 1724 | pStaDs->mlmStaContext.disassocReason = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1725 | pStaDs->mlmStaContext.cleanupTrigger = eLIM_JOIN_FAILURE; |
| 1726 | pStaDs->mlmStaContext.resultCode = resultCode; |
| 1727 | pStaDs->mlmStaContext.protStatusCode = protStatusCode; |
| 1728 | //Done: 7-27-2009. JIM_FIX_ME: at the end of limCleanupRxPath, make sure PE is sending eWNI_SME_JOIN_RSP to SME |
| 1729 | limCleanupRxPath(pMac, pStaDs, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1730 | palFreeMemory( pMac->hHdd, psessionEntry->pLimJoinReq); |
| 1731 | psessionEntry->pLimJoinReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1732 | return; |
| 1733 | } |
| 1734 | } |
| 1735 | |
| 1736 | palFreeMemory( pMac->hHdd, psessionEntry->pLimJoinReq); |
| 1737 | psessionEntry->pLimJoinReq = NULL; |
| 1738 | //Delete teh session if JOIN failure occurred. |
| 1739 | if(resultCode != eSIR_SME_SUCCESS) |
| 1740 | { |
| 1741 | if(NULL != psessionEntry) |
| 1742 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1743 | if(limSetLinkState(pMac, eSIR_LINK_IDLE_STATE,psessionEntry->bssId, |
| 1744 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1745 | PELOGE(limLog(pMac, LOGE, FL("Failed to set the LinkState."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1746 | peDeleteSession(pMac,psessionEntry); |
| 1747 | psessionEntry = NULL; |
| 1748 | } |
| 1749 | } |
| 1750 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_JOIN_RSP, resultCode, protStatusCode,psessionEntry, |
| 1751 | smesessionId, smetransactionId); |
| 1752 | } /*** end limHandleSmeJoinResult() ***/ |
| 1753 | |
| 1754 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1755 | * limHandleSmeReaasocResult() |
| 1756 | * |
| 1757 | *FUNCTION: |
| 1758 | * This function is called to process reassoc failures |
| 1759 | * upon receiving REASSOC_CNF with a failure code or |
| 1760 | * MLM_REASSOC_CNF with a success code in case of STA role |
| 1761 | * |
| 1762 | *LOGIC: |
| 1763 | * |
| 1764 | *ASSUMPTIONS: |
| 1765 | * |
| 1766 | *NOTE: |
| 1767 | * |
| 1768 | * @param pMac Pointer to Global MAC structure |
| 1769 | * @param resultCode Failure code to be sent |
| 1770 | * |
| 1771 | * |
| 1772 | * @return None |
| 1773 | */ |
| 1774 | static void |
| 1775 | limHandleSmeReaasocResult(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U16 protStatusCode, tpPESession psessionEntry) |
| 1776 | { |
| 1777 | tpDphHashNode pStaDs = NULL; |
| 1778 | tANI_U8 smesessionId; |
| 1779 | tANI_U16 smetransactionId; |
| 1780 | |
| 1781 | if(psessionEntry == NULL) |
| 1782 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1783 | PELOGE(limLog(pMac, LOGE,FL("psessionEntry is NULL "));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1784 | return; |
| 1785 | } |
| 1786 | smesessionId = psessionEntry->smeSessionId; |
| 1787 | smetransactionId = psessionEntry->transactionId; |
| 1788 | /* When associations is failed , delete the session created and pass NULL to limsendsmeJoinReassocRsp() */ |
| 1789 | if(resultCode != eSIR_SME_SUCCESS) |
| 1790 | { |
| 1791 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 1792 | if (pStaDs != NULL) |
| 1793 | { |
| 1794 | pStaDs->mlmStaContext.disassocReason = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1795 | pStaDs->mlmStaContext.cleanupTrigger = eLIM_JOIN_FAILURE; |
| 1796 | pStaDs->mlmStaContext.resultCode = resultCode; |
| 1797 | pStaDs->mlmStaContext.protStatusCode = protStatusCode; |
| 1798 | limCleanupRxPath(pMac, pStaDs, psessionEntry); |
| 1799 | return; |
| 1800 | } |
| 1801 | } |
| 1802 | |
| 1803 | //Delete teh session if REASSOC failure occurred. |
| 1804 | if(resultCode != eSIR_SME_SUCCESS) |
| 1805 | { |
| 1806 | if(NULL != psessionEntry) |
| 1807 | { |
| 1808 | peDeleteSession(pMac,psessionEntry); |
| 1809 | psessionEntry = NULL; |
| 1810 | } |
| 1811 | } |
| 1812 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_REASSOC_RSP, resultCode, protStatusCode,psessionEntry, |
| 1813 | smesessionId, smetransactionId); |
| 1814 | } /*** end limHandleSmeReassocResult() ***/ |
| 1815 | |
| 1816 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1817 | * limProcessMlmAddStaRsp() |
| 1818 | * |
| 1819 | *FUNCTION: |
| 1820 | * This function is called to process a WDA_ADD_STA_RSP from HAL. |
| 1821 | * Upon receipt of this message from HAL, MLME - |
| 1822 | * > Determines the "state" in which this message was received |
| 1823 | * > Forwards it to the appropriate callback |
| 1824 | * |
| 1825 | *ASSUMPTIONS: |
| 1826 | * |
| 1827 | *NOTE: |
| 1828 | * |
| 1829 | * @param pMac Pointer to Global MAC structure |
| 1830 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 1831 | * |
| 1832 | * @return None |
| 1833 | */ |
| 1834 | void limProcessMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry ) |
| 1835 | { |
| 1836 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 1837 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 1838 | //the deffered flag. |
| 1839 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1840 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1841 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1842 | ) |
| 1843 | { |
| 1844 | limProcessBtAmpApMlmAddStaRsp(pMac, limMsgQ,psessionEntry); |
| 1845 | return; |
| 1846 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1847 | limProcessStaMlmAddStaRsp(pMac, limMsgQ,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1848 | } |
| 1849 | void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession psessionEntry) |
| 1850 | { |
| 1851 | tLimMlmAssocCnf mlmAssocCnf; |
| 1852 | tpDphHashNode pStaDs; |
| 1853 | tANI_U32 mesgType = LIM_MLM_ASSOC_CNF; |
| 1854 | tpAddStaParams pAddStaParams = (tpAddStaParams) limMsgQ->bodyptr; |
| 1855 | |
| 1856 | if(NULL == pAddStaParams ) |
| 1857 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1858 | limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1859 | return; |
| 1860 | } |
| 1861 | if( eHAL_STATUS_SUCCESS == pAddStaParams->status ) |
| 1862 | { |
| 1863 | if( eLIM_MLM_WT_ADD_STA_RSP_STATE != psessionEntry->limMlmState) |
| 1864 | { |
| 1865 | //TODO: any response to be sent out here ? |
| 1866 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1867 | FL( "Received unexpected WDA_ADD_STA_RSP in state %X" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1868 | psessionEntry->limMlmState); |
| 1869 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 1870 | goto end; |
| 1871 | } |
| 1872 | if (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) |
| 1873 | mesgType = LIM_MLM_REASSOC_CNF; |
| 1874 | // |
| 1875 | // Update the DPH Hash Entry for this STA |
| 1876 | // with proper state info |
| 1877 | // |
| 1878 | pStaDs = dphGetHashEntry( pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 1879 | if( NULL != pStaDs) |
| 1880 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
| 1881 | else |
| 1882 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1883 | FL( "Unable to get the DPH Hash Entry for AID - %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1884 | DPH_STA_HASH_INDEX_PEER); |
| 1885 | psessionEntry->limMlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1886 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1887 | /* |
| 1888 | * Storing the self StaIndex(Generated by HAL) in session context, |
| 1889 | * instead of storing it in DPH Hash entry for Self STA. |
| 1890 | * DPH entry for the self STA stores the sta index for the BSS entry |
| 1891 | * to which the STA is associated. |
| 1892 | */ |
| 1893 | psessionEntry->staId = pAddStaParams->staIdx; |
| 1894 | //if the AssocRsp frame is not acknowledged, then keep alive timer will take care of the state |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1895 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 1896 | if(!IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) |
| 1897 | #endif |
| 1898 | { |
| 1899 | limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 1900 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1901 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_KEEPALIVE_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1902 | |
| 1903 | //assign the sessionId to the timer Object |
| 1904 | pMac->lim.limTimers.gLimKeepaliveTimer.sessionId = psessionEntry->peSessionId; |
| 1905 | if (tx_timer_activate(&pMac->lim.limTimers.gLimKeepaliveTimer) != TX_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1906 | limLog(pMac, LOGP, FL("Cannot activate keepalive timer.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1907 | #ifdef WLAN_DEBUG |
| 1908 | pMac->lim.gLimNumLinkEsts++; |
| 1909 | #endif |
Hoonki Lee | 8c9e99f | 2013-04-18 22:59:11 -0700 | [diff] [blame] | 1910 | #ifdef FEATURE_WLAN_TDLS |
| 1911 | /* initialize TDLS peer related data */ |
| 1912 | limInitTdlsData(pMac,psessionEntry); |
| 1913 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1914 | // Return Assoc confirm to SME with success |
| 1915 | // FIXME_GEN4 - Need the correct ASSOC RSP code to |
| 1916 | // be passed in here.... |
| 1917 | //mlmAssocCnf.resultCode = (tSirResultCodes) assoc.statusCode; |
| 1918 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_SUCCESS; |
| 1919 | } |
| 1920 | else |
| 1921 | { |
Gopichand Nakkala | d786fa3 | 2013-03-20 23:48:19 +0530 | [diff] [blame] | 1922 | limLog( pMac, LOGE, FL( "ADD_STA failed!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1923 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 1924 | } |
| 1925 | end: |
| 1926 | if( 0 != limMsgQ->bodyptr ) |
| 1927 | { |
| 1928 | palFreeMemory( pMac->hHdd, (void *) pAddStaParams ); |
| 1929 | } |
| 1930 | /* Updating PE session Id*/ |
| 1931 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 1932 | limPostSmeMessage( pMac, mesgType, (tANI_U32 *) &mlmAssocCnf ); |
| 1933 | return; |
| 1934 | } |
| 1935 | void limProcessMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 1936 | { |
| 1937 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 1938 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 1939 | //the deffered flag. |
| 1940 | // tpPESession psessionEntry; |
| 1941 | // tpDeleteBssParams pDeleteBssParams =( tpDeleteBssParams)limMsgQ->bodyptr; |
| 1942 | // if((psessionEntry = peFindSessionBySessionId(pMac,pDeleteBssParams->sessionId)) == NULL) |
| 1943 | // { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1944 | // limLog( pMac, LOGE, FL( "Session deos not exist with given sessionId" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1945 | // return; |
| 1946 | // } |
| 1947 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1948 | |
| 1949 | if (((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) || |
| 1950 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1951 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1952 | ) && |
| 1953 | (psessionEntry->statypeForBss == STA_ENTRY_SELF)) |
| 1954 | { |
| 1955 | limProcessBtAmpApMlmDelBssRsp(pMac, limMsgQ,psessionEntry); |
| 1956 | return; |
| 1957 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1958 | limProcessStaMlmDelBssRsp(pMac, limMsgQ,psessionEntry); |
Madan Mohan Koyyalamudi | 01cba04 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 1959 | |
| 1960 | if(!limIsInMCC(pMac)) |
| 1961 | { |
| 1962 | WDA_TrafficStatsTimerActivate(FALSE); |
| 1963 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1964 | |
| 1965 | #ifdef WLAN_FEATURE_11W |
| 1966 | if (psessionEntry->limRmfEnabled) |
| 1967 | { |
| 1968 | if ( eSIR_SUCCESS != limSendExcludeUnencryptInd(pMac, TRUE, psessionEntry) ) |
| 1969 | { |
| 1970 | limLog( pMac, LOGE, |
| 1971 | FL( "Could not send down Exclude Unencrypted Indication!" ), |
| 1972 | psessionEntry->limMlmState ); |
| 1973 | } |
| 1974 | } |
| 1975 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1976 | } |
| 1977 | |
| 1978 | void limProcessStaMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 1979 | { |
| 1980 | tpDeleteBssParams pDelBssParams = (tpDeleteBssParams) limMsgQ->bodyptr; |
| 1981 | tpDphHashNode pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 1982 | tSirResultCodes statusCode = eSIR_SME_SUCCESS; |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 1983 | |
| 1984 | if (NULL == pDelBssParams) |
| 1985 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1986 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 1987 | goto end; |
| 1988 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1989 | if( eHAL_STATUS_SUCCESS == pDelBssParams->status ) |
| 1990 | { |
| 1991 | PELOGW(limLog( pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1992 | FL( "STA received the DEL_BSS_RSP for BSSID: %X."),pDelBssParams->bssIdx);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1993 | if (limSetLinkState(pMac, eSIR_LINK_IDLE_STATE, psessionEntry->bssId, |
| 1994 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) |
| 1995 | |
| 1996 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1997 | PELOGE(limLog( pMac, LOGE, FL( "Failure in setting link state to IDLE"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1998 | statusCode = eSIR_SME_REFUSED; |
| 1999 | goto end; |
| 2000 | } |
| 2001 | if(pStaDs == NULL) |
| 2002 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2003 | limLog( pMac, LOGE, FL( "DPH Entry for STA 1 missing.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2004 | statusCode = eSIR_SME_REFUSED; |
| 2005 | goto end; |
| 2006 | } |
| 2007 | if( eLIM_MLM_WT_DEL_BSS_RSP_STATE != pStaDs->mlmStaContext.mlmState) |
| 2008 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2009 | PELOGE(limLog( pMac, LOGE, FL( "Received unexpected WDA_DEL_BSS_RSP in state %X" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2010 | pStaDs->mlmStaContext.mlmState);) |
| 2011 | statusCode = eSIR_SME_REFUSED; |
| 2012 | goto end; |
| 2013 | } |
| 2014 | PELOG1(limLog( pMac, LOG1, FL("STA AssocID %d MAC "), pStaDs->assocId ); |
| 2015 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
| 2016 | } |
| 2017 | else |
| 2018 | { |
Gopichand Nakkala | d786fa3 | 2013-03-20 23:48:19 +0530 | [diff] [blame] | 2019 | limLog( pMac, LOGE, FL( "DEL BSS failed!" ) ); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2020 | palFreeMemory( pMac->hHdd, (void *) pDelBssParams ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2021 | return; |
| 2022 | } |
| 2023 | end: |
| 2024 | if( 0 != limMsgQ->bodyptr ) |
| 2025 | { |
| 2026 | palFreeMemory( pMac->hHdd, (void *) pDelBssParams ); |
| 2027 | } |
| 2028 | if(pStaDs == NULL) |
| 2029 | return; |
| 2030 | if ( ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && |
| 2031 | (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE && |
| 2032 | psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) && |
| 2033 | pStaDs->mlmStaContext.cleanupTrigger != eLIM_JOIN_FAILURE) |
| 2034 | { |
| 2035 | /** The Case where the DelBss is invoked from |
| 2036 | * context of other than normal DisAssoc / Deauth OR |
| 2037 | * as part of Join Failure. |
| 2038 | */ |
| 2039 | limHandleDelBssInReAssocContext(pMac, pStaDs,psessionEntry); |
| 2040 | return; |
| 2041 | } |
| 2042 | limPrepareAndSendDelStaCnf(pMac, pStaDs, statusCode,psessionEntry); |
| 2043 | return; |
| 2044 | } |
| 2045 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2046 | void limProcessBtAmpApMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2047 | { |
| 2048 | tSirResultCodes rc = eSIR_SME_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2049 | tSirRetStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2050 | tpDeleteBssParams pDelBss = (tpDeleteBssParams) limMsgQ->bodyptr; |
| 2051 | tSirMacAddr nullBssid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; |
| 2052 | |
| 2053 | if(psessionEntry == NULL) |
| 2054 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2055 | limLog(pMac, LOGE,FL("Session entry passed is NULL")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2056 | if(pDelBss != NULL) |
| 2057 | palFreeMemory( pMac->hHdd, (void *) pDelBss ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2058 | return; |
| 2059 | } |
| 2060 | |
| 2061 | if (pDelBss == NULL) |
| 2062 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2063 | PELOGE(limLog(pMac, LOGE, FL("BSS: DEL_BSS_RSP with no body!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2064 | rc = eSIR_SME_REFUSED; |
| 2065 | goto end; |
| 2066 | } |
| 2067 | pMac->lim.gLimMlmState = eLIM_MLM_IDLE_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 2068 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, NO_SESSION, pMac->lim.gLimMlmState)); |
| 2069 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2070 | if( eLIM_MLM_WT_DEL_BSS_RSP_STATE != psessionEntry->limMlmState) |
| 2071 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2072 | limLog( pMac, LOGE, |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2073 | FL( "Received unexpected WDA_DEL_BSS_RSP in state %X" ), |
| 2074 | psessionEntry->limMlmState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2075 | rc = eSIR_SME_REFUSED; |
| 2076 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2077 | } |
| 2078 | if (pDelBss->status != eHAL_STATUS_SUCCESS) |
| 2079 | { |
| 2080 | limLog(pMac, LOGE, FL("BSS: DEL_BSS_RSP error (%x) Bss %d "), |
| 2081 | pDelBss->status, pDelBss->bssIdx); |
| 2082 | rc = eSIR_SME_STOP_BSS_FAILURE; |
| 2083 | goto end; |
| 2084 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2085 | status = limSetLinkState(pMac, eSIR_LINK_IDLE_STATE, nullBssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2086 | psessionEntry->selfMacAddr, NULL, NULL); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2087 | if (status != eSIR_SUCCESS) |
| 2088 | { |
| 2089 | rc = eSIR_SME_REFUSED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2090 | goto end; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2091 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2092 | /** Softmac may send all the buffered packets right after resuming the transmission hence |
| 2093 | * to occupy the medium during non channel occupancy period. So resume the transmission after |
| 2094 | * HAL gives back the response. |
| 2095 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2096 | #if 0 //TODO: How to handle this per session |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2097 | if (LIM_IS_RADAR_DETECTED(pMac)) |
| 2098 | { |
| 2099 | limFrameTransmissionControl(pMac, eLIM_TX_BSS_BUT_BEACON, eLIM_RESUME_TX); |
| 2100 | LIM_SET_RADAR_DETECTED(pMac, eANI_BOOLEAN_FALSE); |
| 2101 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2102 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2103 | dphHashTableClassInit(pMac, &psessionEntry->dph.dphHashTable);//TBD-RAJESH is it needed ? |
| 2104 | limDeletePreAuthList(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2105 | //Initialize number of associated stations during cleanup |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 2106 | psessionEntry->gLimNumOfCurrentSTAs = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2107 | end: |
| 2108 | limSendSmeRsp(pMac, eWNI_SME_STOP_BSS_RSP, rc, psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 2109 | peDeleteSession(pMac, psessionEntry); |
| 2110 | |
| 2111 | if(pDelBss != NULL) |
| 2112 | palFreeMemory( pMac->hHdd, (void *) pDelBss ); |
| 2113 | } |
| 2114 | |
| 2115 | void limProcessMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 2116 | { |
| 2117 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 2118 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 2119 | //the deffered flag. |
| 2120 | |
| 2121 | tpPESession psessionEntry; |
| 2122 | tpDeleteStaParams pDeleteStaParams; |
| 2123 | pDeleteStaParams = (tpDeleteStaParams)limMsgQ->bodyptr; |
| 2124 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2125 | |
| 2126 | if(NULL == pDeleteStaParams || |
| 2127 | NULL == (psessionEntry = peFindSessionBySessionId(pMac, pDeleteStaParams->sessionId))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2128 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2129 | limLog(pMac, LOGP,FL("Session Does not exist or invalid body pointer in message")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2130 | if(pDeleteStaParams != NULL) |
| 2131 | palFreeMemory( pMac->hHdd, (void *) pDeleteStaParams ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2132 | return; |
| 2133 | } |
| 2134 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2135 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2136 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2137 | ) |
| 2138 | { |
| 2139 | limProcessBtAmpApMlmDelStaRsp(pMac,limMsgQ,psessionEntry); |
| 2140 | return; |
| 2141 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2142 | limProcessStaMlmDelStaRsp(pMac, limMsgQ,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2143 | } |
| 2144 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2145 | void limProcessBtAmpApMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2146 | { |
| 2147 | tpDeleteStaParams pDelStaParams = (tpDeleteStaParams) limMsgQ->bodyptr; |
| 2148 | tpDphHashNode pStaDs; |
| 2149 | tSirResultCodes statusCode = eSIR_SME_SUCCESS; |
| 2150 | if(limMsgQ->bodyptr == NULL) |
| 2151 | { |
| 2152 | return; |
| 2153 | } |
| 2154 | |
| 2155 | pStaDs = dphGetHashEntry(pMac, pDelStaParams->assocId, &psessionEntry->dph.dphHashTable); |
| 2156 | if(pStaDs == NULL) |
| 2157 | { |
| 2158 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2159 | FL( "DPH Entry for STA %X missing."), pDelStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2160 | statusCode = eSIR_SME_REFUSED; |
| 2161 | palFreeMemory( pMac->hHdd, (void *) pDelStaParams ); |
| 2162 | |
| 2163 | return; |
| 2164 | } |
| 2165 | if( eHAL_STATUS_SUCCESS == pDelStaParams->status ) |
| 2166 | { |
| 2167 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2168 | FL( "AP received the DEL_STA_RSP for assocID: %X."), pDelStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2169 | |
| 2170 | if(( eLIM_MLM_WT_DEL_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState) && |
| 2171 | ( eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState)) |
| 2172 | { |
| 2173 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2174 | FL( "Received unexpected WDA_DEL_STA_RSP in state %s for staId %d assocId %d " ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2175 | limMlmStateStr(pStaDs->mlmStaContext.mlmState), pStaDs->staIndex, pStaDs->assocId); |
| 2176 | statusCode = eSIR_SME_REFUSED; |
| 2177 | goto end; |
| 2178 | } |
| 2179 | |
| 2180 | limLog( pMac, LOG1, |
| 2181 | FL("Deleted STA AssocID %d staId %d MAC "), |
| 2182 | pStaDs->assocId, pStaDs->staIndex); |
| 2183 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); |
| 2184 | if(eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE == pStaDs->mlmStaContext.mlmState) |
| 2185 | { |
| 2186 | palFreeMemory( pMac->hHdd, (void *) pDelStaParams ); |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2187 | if (limAddSta(pMac, pStaDs, false, psessionEntry) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2188 | { |
| 2189 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2190 | FL("could not Add STA with assocId=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2191 | pStaDs->assocId);) |
| 2192 | // delete the TS if it has already been added. |
| 2193 | // send the response with error status. |
| 2194 | if(pStaDs->qos.addtsPresent) |
| 2195 | { |
| 2196 | tpLimTspecInfo pTspecInfo; |
| 2197 | if(eSIR_SUCCESS == limTspecFindByAssocId(pMac, pStaDs->assocId, |
| 2198 | &pStaDs->qos.addts.tspec, &pMac->lim.tspecInfo[0], &pTspecInfo)) |
| 2199 | { |
| 2200 | limAdmitControlDeleteTS(pMac, pStaDs->assocId, &pStaDs->qos.addts.tspec.tsinfo, |
| 2201 | NULL, &pTspecInfo->idx); |
| 2202 | } |
| 2203 | } |
| 2204 | limRejectAssociation(pMac, |
| 2205 | pStaDs->staAddr, |
| 2206 | pStaDs->mlmStaContext.subType, |
| 2207 | true, pStaDs->mlmStaContext.authType, |
| 2208 | pStaDs->assocId, true, |
| 2209 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 2210 | psessionEntry); |
| 2211 | } |
| 2212 | return; |
| 2213 | } |
| 2214 | } |
| 2215 | else |
| 2216 | { |
| 2217 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2218 | FL( "DEL STA failed!" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2219 | statusCode = eSIR_SME_REFUSED; |
| 2220 | } |
| 2221 | end: |
| 2222 | palFreeMemory( pMac->hHdd, (void *) pDelStaParams ); |
| 2223 | if(eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState) |
| 2224 | { |
| 2225 | limPrepareAndSendDelStaCnf(pMac, pStaDs, statusCode,psessionEntry); |
| 2226 | } |
| 2227 | return; |
| 2228 | } |
| 2229 | |
| 2230 | void limProcessStaMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2231 | { |
| 2232 | tSirResultCodes statusCode = eSIR_SME_SUCCESS; |
| 2233 | tpDeleteStaParams pDelStaParams = (tpDeleteStaParams) limMsgQ->bodyptr; |
| 2234 | tpDphHashNode pStaDs = NULL; |
| 2235 | if(NULL == pDelStaParams ) |
| 2236 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2237 | limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2238 | goto end; |
| 2239 | } |
| 2240 | if( eHAL_STATUS_SUCCESS == pDelStaParams->status ) |
| 2241 | { |
| 2242 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 2243 | if (pStaDs == NULL) |
| 2244 | { |
| 2245 | //TODO: any response to be sent out here ? |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2246 | limLog( pMac, LOGE, FL( "DPH Entry for STA %X missing."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2247 | pDelStaParams->assocId); |
| 2248 | statusCode = eSIR_SME_REFUSED; |
| 2249 | goto end; |
| 2250 | } |
| 2251 | if( eLIM_MLM_WT_DEL_STA_RSP_STATE != psessionEntry->limMlmState) |
| 2252 | { |
| 2253 | //TODO: any response to be sent out here ? |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2254 | limLog( pMac, LOGE, FL( "Received unexpected WDA_DELETE_STA_RSP in state %s" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2255 | limMlmStateStr(psessionEntry->limMlmState)); |
| 2256 | statusCode = eSIR_SME_REFUSED; |
| 2257 | goto end; |
| 2258 | } |
| 2259 | PELOG1(limLog( pMac, LOG1, FL("STA AssocID %d MAC "), pStaDs->assocId ); |
| 2260 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2261 | limLog( pMac, LOGW, FL( "DEL_STA_RSP received for assocID: %X"), pDelStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2262 | //we must complete all cleanup related to delSta before calling limDelBSS. |
| 2263 | if( 0 != limMsgQ->bodyptr ) |
| 2264 | { |
| 2265 | palFreeMemory( pMac->hHdd, (void *) pDelStaParams ); |
| 2266 | } |
| 2267 | statusCode = (tSirResultCodes) limDelBss(pMac, pStaDs, 0,psessionEntry); |
| 2268 | return; |
| 2269 | } |
| 2270 | else |
| 2271 | { |
Gopichand Nakkala | cc8cf8e | 2013-04-25 06:03:10 -0700 | [diff] [blame^] | 2272 | limLog( pMac, LOGE, FL( "DEL_STA failed for sta Id %d" ), pDelStaParams->staIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2273 | statusCode = eSIR_SME_REFUSED; |
| 2274 | } |
| 2275 | end: |
| 2276 | if( 0 != limMsgQ->bodyptr ) |
| 2277 | { |
| 2278 | palFreeMemory( pMac->hHdd, (void *) pDelStaParams ); |
| 2279 | } |
| 2280 | return; |
| 2281 | } |
| 2282 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2283 | void limProcessBtAmpApMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2284 | { |
| 2285 | tpAddStaParams pAddStaParams = (tpAddStaParams) limMsgQ->bodyptr; |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2286 | tpDphHashNode pStaDs = NULL; |
| 2287 | |
| 2288 | if (NULL == pAddStaParams) |
| 2289 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2290 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2291 | goto end; |
| 2292 | } |
| 2293 | |
| 2294 | pStaDs = dphGetHashEntry(pMac, pAddStaParams->assocId, &psessionEntry->dph.dphHashTable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2295 | if(pStaDs == NULL) |
| 2296 | { |
| 2297 | //TODO: any response to be sent out here ? |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2298 | limLog( pMac, LOGE, FL( "DPH Entry for STA %X missing."), pAddStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2299 | goto end; |
| 2300 | } |
| 2301 | // |
| 2302 | // TODO & FIXME_GEN4 |
| 2303 | // Need to inspect tSirMsgQ.reserved for a valid Dialog token! |
| 2304 | // |
| 2305 | //TODO: any check for pMac->lim.gLimMlmState ? |
| 2306 | if( eLIM_MLM_WT_ADD_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState) |
| 2307 | { |
| 2308 | //TODO: any response to be sent out here ? |
| 2309 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2310 | FL( "Received unexpected WDA_ADD_STA_RSP in state %X" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2311 | pStaDs->mlmStaContext.mlmState); |
| 2312 | goto end; |
| 2313 | } |
| 2314 | if(eHAL_STATUS_SUCCESS != pAddStaParams->status) |
| 2315 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2316 | PELOGE(limLog(pMac, LOGE, FL("Error! rcvd delSta rsp from HAL with status %d"),pAddStaParams->status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2317 | limRejectAssociation(pMac, pStaDs->staAddr, |
| 2318 | pStaDs->mlmStaContext.subType, |
| 2319 | true, pStaDs->mlmStaContext.authType, |
| 2320 | pStaDs->assocId, true, |
| 2321 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 2322 | psessionEntry); |
| 2323 | goto end; |
| 2324 | } |
| 2325 | pStaDs->bssId = pAddStaParams->bssIdx; |
| 2326 | pStaDs->staIndex = pAddStaParams->staIdx; |
| 2327 | //if the AssocRsp frame is not acknowledged, then keep alive timer will take care of the state |
| 2328 | pStaDs->valid = 1; |
| 2329 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_ASSOC_CNF_STATE; |
| 2330 | limLog( pMac, LOG1, |
| 2331 | FL("STA AssocID %d staId %d MAC "), |
| 2332 | pStaDs->assocId, |
| 2333 | pStaDs->staIndex); |
| 2334 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); |
| 2335 | |
| 2336 | /* For BTAMP-AP, the flow sequence shall be: |
| 2337 | * 1) PE sends eWNI_SME_ASSOC_IND to SME |
| 2338 | * 2) PE receives eWNI_SME_ASSOC_CNF from SME |
| 2339 | * 3) BTAMP-AP sends Re/Association Response to BTAMP-STA |
| 2340 | */ |
| 2341 | limSendMlmAssocInd(pMac, pStaDs, psessionEntry); |
| 2342 | // fall though to reclaim the original Add STA Response message |
| 2343 | end: |
| 2344 | if( 0 != limMsgQ->bodyptr ) |
| 2345 | { |
| 2346 | palFreeMemory( pMac->hHdd, (void *) pAddStaParams ); |
| 2347 | } |
| 2348 | return; |
| 2349 | } |
| 2350 | |
| 2351 | /** |
| 2352 | * limProcessApMlmAddBssRsp() |
| 2353 | * |
| 2354 | *FUNCTION: |
| 2355 | * This function is called to process a WDA_ADD_BSS_RSP from HAL. |
| 2356 | * Upon receipt of this message from HAL, MLME - |
| 2357 | * > Validates the result of WDA_ADD_BSS_REQ |
| 2358 | * > Init other remaining LIM variables |
| 2359 | * > Init the AID pool, for that BSSID |
| 2360 | * > Init the Pre-AUTH list, for that BSSID |
| 2361 | * > Create LIM timers, specific to that BSSID |
| 2362 | * > Init DPH related parameters that are specific to that BSSID |
| 2363 | * > TODO - When do we do the actual change channel? |
| 2364 | * |
| 2365 | *LOGIC: |
| 2366 | * SME sends eWNI_SME_START_BSS_REQ to LIM |
| 2367 | * LIM sends LIM_MLM_START_REQ to MLME |
| 2368 | * MLME sends WDA_ADD_BSS_REQ to HAL |
| 2369 | * HAL responds with WDA_ADD_BSS_RSP to MLME |
| 2370 | * MLME responds with LIM_MLM_START_CNF to LIM |
| 2371 | * LIM responds with eWNI_SME_START_BSS_RSP to SME |
| 2372 | * |
| 2373 | *ASSUMPTIONS: |
| 2374 | * tSirMsgQ.body is allocated by MLME during limProcessMlmStartReq |
| 2375 | * tSirMsgQ.body will now be freed by this routine |
| 2376 | * |
| 2377 | *NOTE: |
| 2378 | * |
| 2379 | * @param pMac Pointer to Global MAC structure |
| 2380 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 2381 | * |
| 2382 | * @return None |
| 2383 | */ |
| 2384 | static void |
| 2385 | limProcessApMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ) |
| 2386 | { |
| 2387 | tLimMlmStartCnf mlmStartCnf; |
| 2388 | tANI_U32 val; |
| 2389 | tpPESession psessionEntry; |
| 2390 | // tANI_U8 sessionId; |
| 2391 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 2392 | if(NULL == pAddBssParams ) |
| 2393 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2394 | limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2395 | goto end; |
| 2396 | } |
| 2397 | //TBD: free the memory before returning, do it for all places where lookup fails. |
| 2398 | if((psessionEntry = peFindSessionBySessionId(pMac,pAddBssParams->sessionId))== NULL) |
| 2399 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2400 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2401 | if( NULL != pAddBssParams ) |
| 2402 | palFreeMemory( pMac->hHdd, (void *) pAddBssParams ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2403 | return; |
| 2404 | } |
| 2405 | /* Update PE session Id*/ |
| 2406 | mlmStartCnf.sessionId = pAddBssParams->sessionId; |
| 2407 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 2408 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2409 | PELOG2(limLog(pMac, LOG2, FL("WDA_ADD_BSS_RSP returned with eHAL_STATUS_SUCCESS"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2410 | if (limSetLinkState(pMac, eSIR_LINK_AP_STATE,psessionEntry->bssId, |
| 2411 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 2412 | goto end; |
| 2413 | // Set MLME state |
| 2414 | psessionEntry->limMlmState = eLIM_MLM_BSS_STARTED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2415 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2416 | if( eSIR_IBSS_MODE == pAddBssParams->bssType ) |
| 2417 | { |
| 2418 | /** IBSS is 'active' when we receive |
| 2419 | * Beacon frames from other STAs that are part of same IBSS. |
| 2420 | * Mark internal state as inactive until then. |
| 2421 | */ |
| 2422 | psessionEntry->limIbssActive = false; |
| 2423 | psessionEntry->statypeForBss = STA_ENTRY_PEER; //to know session created for self/peer |
| 2424 | limResetHBPktCount( psessionEntry ); |
| 2425 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2426 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2427 | if (limActivateHearBeatTimer(pMac) != TX_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2428 | limLog(pMac, LOGP, FL("could not activate Heartbeat timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2429 | } |
| 2430 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 2431 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2432 | psessionEntry->limSystemRole = eLIM_STA_IN_IBSS_ROLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2433 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2434 | if ( eSIR_INFRA_AP_MODE == pAddBssParams->bssType ) |
| 2435 | psessionEntry->limSystemRole = eLIM_AP_ROLE; |
| 2436 | else |
| 2437 | psessionEntry->limSystemRole = eLIM_STA_IN_IBSS_ROLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2438 | schEdcaProfileUpdate(pMac, psessionEntry); |
| 2439 | limInitPreAuthList(pMac); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 2440 | limInitPeerIdxpool(pMac,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2441 | // Create timers used by LIM |
| 2442 | if (!pMac->lim.gLimTimersCreated) |
| 2443 | limCreateTimers(pMac); |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 2444 | |
| 2445 | // Start OLBC timer |
| 2446 | if (tx_timer_activate(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer) != TX_SUCCESS) |
| 2447 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2448 | limLog(pMac, LOGE, FL("tx_timer_activate failed")); |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 2449 | } |
| 2450 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2451 | /* Update the lim global gLimTriggerBackgroundScanDuringQuietBss */ |
| 2452 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_TRIG_STA_BK_SCAN, &val )) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2453 | limLog( pMac, LOGP, FL("Failed to get WNI_CFG_TRIG_STA_BK_SCAN!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2454 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = (val) ? 1 : 0; |
| 2455 | // Apply previously set configuration at HW |
| 2456 | limApplyConfiguration(pMac,psessionEntry); |
| 2457 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 2458 | mlmStartCnf.resultCode = eSIR_SME_SUCCESS; |
| 2459 | } |
| 2460 | else |
| 2461 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2462 | limLog( pMac, LOGE, FL( "WDA_ADD_BSS_REQ failed with status %d" ),pAddBssParams->status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2463 | mlmStartCnf.resultCode = eSIR_SME_HAL_SEND_MESSAGE_FAIL; |
| 2464 | } |
| 2465 | limPostSmeMessage( pMac, LIM_MLM_START_CNF, (tANI_U32 *) &mlmStartCnf ); |
| 2466 | end: |
| 2467 | if( 0 != limMsgQ->bodyptr ) |
| 2468 | palFreeMemory( pMac->hHdd, (void *) pAddBssParams ); |
| 2469 | } |
| 2470 | |
| 2471 | |
| 2472 | /** |
| 2473 | * limProcessIbssMlmAddBssRsp() |
| 2474 | * |
| 2475 | *FUNCTION: |
| 2476 | * This function is called to process a WDA_ADD_BSS_RSP from HAL. |
| 2477 | * Upon receipt of this message from HAL, MLME - |
| 2478 | * > Validates the result of WDA_ADD_BSS_REQ |
| 2479 | * > Init other remaining LIM variables |
| 2480 | * > Init the AID pool, for that BSSID |
| 2481 | * > Init the Pre-AUTH list, for that BSSID |
| 2482 | * > Create LIM timers, specific to that BSSID |
| 2483 | * > Init DPH related parameters that are specific to that BSSID |
| 2484 | * > TODO - When do we do the actual change channel? |
| 2485 | * |
| 2486 | *LOGIC: |
| 2487 | * SME sends eWNI_SME_START_BSS_REQ to LIM |
| 2488 | * LIM sends LIM_MLM_START_REQ to MLME |
| 2489 | * MLME sends WDA_ADD_BSS_REQ to HAL |
| 2490 | * HAL responds with WDA_ADD_BSS_RSP to MLME |
| 2491 | * MLME responds with LIM_MLM_START_CNF to LIM |
| 2492 | * LIM responds with eWNI_SME_START_BSS_RSP to SME |
| 2493 | * |
| 2494 | *ASSUMPTIONS: |
| 2495 | * tSirMsgQ.body is allocated by MLME during limProcessMlmStartReq |
| 2496 | * tSirMsgQ.body will now be freed by this routine |
| 2497 | * |
| 2498 | *NOTE: |
| 2499 | * |
| 2500 | * @param pMac Pointer to Global MAC structure |
| 2501 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 2502 | * |
| 2503 | * @return None |
| 2504 | */ |
| 2505 | static void |
| 2506 | limProcessIbssMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession psessionEntry) |
| 2507 | { |
| 2508 | tLimMlmStartCnf mlmStartCnf; |
| 2509 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 2510 | tANI_U32 val; |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2511 | |
| 2512 | if (NULL == pAddBssParams) |
| 2513 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2514 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2515 | goto end; |
| 2516 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2517 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 2518 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2519 | PELOG1(limLog(pMac, LOG1, FL("WDA_ADD_BSS_RSP returned with eHAL_STATUS_SUCCESS"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2520 | if (limSetLinkState(pMac, eSIR_LINK_IBSS_STATE,psessionEntry->bssId, |
| 2521 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 2522 | goto end; |
| 2523 | // Set MLME state |
| 2524 | psessionEntry->limMlmState = eLIM_MLM_BSS_STARTED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2525 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2526 | /** IBSS is 'active' when we receive |
| 2527 | * Beacon frames from other STAs that are part of same IBSS. |
| 2528 | * Mark internal state as inactive until then. |
| 2529 | */ |
| 2530 | psessionEntry->limIbssActive = false; |
| 2531 | limResetHBPktCount( psessionEntry ); |
| 2532 | /* Timer related functions are not modified for BT-AMP : To be Done */ |
| 2533 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2534 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_HEART_BEAT_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2535 | if (limActivateHearBeatTimer(pMac) != TX_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2536 | limLog(pMac, LOGP, FL("could not activate Heartbeat timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2537 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 2538 | psessionEntry->limSystemRole = eLIM_STA_IN_IBSS_ROLE; |
| 2539 | psessionEntry->statypeForBss = STA_ENTRY_SELF; |
| 2540 | schEdcaProfileUpdate(pMac, psessionEntry); |
| 2541 | //TBD-RAJESH limInitPreauthList should re removed for IBSS also ????? |
| 2542 | //limInitPreAuthList(pMac); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 2543 | limInitPeerIdxpool(pMac,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2544 | // Create timers used by LIM |
| 2545 | #ifdef FIXME_GEN6 //following code may not be required, as limCreateTimers is now invoked from limInitialize (peStart) |
| 2546 | if (!pMac->lim.gLimTimersCreated) |
| 2547 | limCreateTimers(pMac); |
| 2548 | #endif |
| 2549 | /* Update the lim global gLimTriggerBackgroundScanDuringQuietBss */ |
| 2550 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_TRIG_STA_BK_SCAN, &val )) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2551 | limLog( pMac, LOGP, FL("Failed to get WNI_CFG_TRIG_STA_BK_SCAN!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2552 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = (val) ? 1 : 0; |
| 2553 | // Apply previously set configuration at HW |
| 2554 | limApplyConfiguration(pMac,psessionEntry); |
| 2555 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 2556 | mlmStartCnf.resultCode = eSIR_SME_SUCCESS; |
| 2557 | //If ADD BSS was issued as part of IBSS coalescing, don't send the message to SME, as that is internal to LIM |
| 2558 | if(true == pMac->lim.gLimIbssCoalescingHappened) |
| 2559 | { |
| 2560 | limIbssAddBssRspWhenCoalescing(pMac, limMsgQ->bodyptr, psessionEntry); |
| 2561 | goto end; |
| 2562 | } |
| 2563 | } |
| 2564 | else |
| 2565 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2566 | limLog( pMac, LOGE, FL( "WDA_ADD_BSS_REQ failed with status %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2567 | pAddBssParams->status ); |
| 2568 | mlmStartCnf.resultCode = eSIR_SME_HAL_SEND_MESSAGE_FAIL; |
| 2569 | } |
| 2570 | //Send this message to SME, when ADD_BSS is initiated by SME |
| 2571 | //If ADD_BSS is done as part of coalescing, this won't happen. |
| 2572 | /* Update PE session Id*/ |
| 2573 | mlmStartCnf.sessionId =psessionEntry->peSessionId; |
| 2574 | limPostSmeMessage( pMac, LIM_MLM_START_CNF, (tANI_U32 *) &mlmStartCnf ); |
| 2575 | end: |
| 2576 | if( 0 != limMsgQ->bodyptr ) |
| 2577 | palFreeMemory( pMac->hHdd, (void *) pAddBssParams ); |
| 2578 | } |
| 2579 | |
| 2580 | static void |
| 2581 | limProcessStaMlmAddBssRspPreAssoc( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession psessionEntry ) |
| 2582 | { |
| 2583 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 2584 | tAniAuthType cfgAuthType, authMode; |
| 2585 | tLimMlmAuthReq *pMlmAuthReq; |
| 2586 | tpDphHashNode pStaDs = NULL; |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2587 | |
| 2588 | if (NULL == pAddBssParams) |
| 2589 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2590 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2591 | goto joinFailure; |
| 2592 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2593 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 2594 | { |
| 2595 | if ((pStaDs = dphAddHashEntry(pMac, pAddBssParams->staContext.staMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable)) == NULL) |
| 2596 | { |
| 2597 | // Could not add hash table entry |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2598 | PELOGE(limLog(pMac, LOGE, FL("could not add hash entry at DPH for "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2599 | limPrintMacAddr(pMac, pAddBssParams->staContext.staMac, LOGE); |
| 2600 | goto joinFailure; |
| 2601 | } |
| 2602 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 2603 | //Success, handle below |
| 2604 | pStaDs->bssId = pAddBssParams->bssIdx; |
| 2605 | //STA Index(genr by HAL) for the BSS entry is stored here |
| 2606 | pStaDs->staIndex = pAddBssParams->staContext.staIdx; |
| 2607 | // Trigger Authentication with AP |
| 2608 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATION_TYPE, |
| 2609 | (tANI_U32 *) &cfgAuthType) != eSIR_SUCCESS) |
| 2610 | { |
| 2611 | /** |
| 2612 | * Could not get AuthType from CFG. |
| 2613 | * Log error. |
| 2614 | */ |
| 2615 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2616 | FL("could not retrieve AuthType")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2617 | } |
| 2618 | if (cfgAuthType == eSIR_AUTO_SWITCH) |
| 2619 | authMode = eSIR_OPEN_SYSTEM; // Try Open Authentication first |
| 2620 | else |
| 2621 | authMode = cfgAuthType; |
| 2622 | |
| 2623 | // Trigger MAC based Authentication |
| 2624 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMlmAuthReq, sizeof(tLimMlmAuthReq))) |
| 2625 | { |
| 2626 | // Log error |
| 2627 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2628 | FL("call to palAllocateMemory failed for mlmAuthReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2629 | return; |
| 2630 | } |
| 2631 | #if 0 |
| 2632 | val = sizeof(tSirMacAddr); |
| 2633 | if (wlan_cfgGetStr(pMac, WNI_CFG_BSSID, |
| 2634 | pMlmAuthReq->peerMacAddr, |
| 2635 | &val) != eSIR_SUCCESS) |
| 2636 | { |
| 2637 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2638 | limLog(pMac, LOGP, FL("could not retrieve BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2639 | } |
| 2640 | #endif //TO SUPPORT BT-AMP |
| 2641 | sirCopyMacAddr(pMlmAuthReq->peerMacAddr,psessionEntry->bssId); |
| 2642 | |
| 2643 | pMlmAuthReq->authType = authMode; |
| 2644 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, |
| 2645 | (tANI_U32 *) &pMlmAuthReq->authFailureTimeout) |
| 2646 | != eSIR_SUCCESS) |
| 2647 | { |
| 2648 | /** |
| 2649 | * Could not get AuthFailureTimeout |
| 2650 | * value from CFG. Log error. |
| 2651 | */ |
| 2652 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2653 | FL("could not retrieve AuthFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2654 | } |
| 2655 | // SUNIT_FIX_ME: Set BOTH? Assume not. Please verify here and below. |
| 2656 | //pMac->lim.gLimMlmState = eLIM_MLM_JOINED_STATE; |
| 2657 | psessionEntry->limMlmState = eLIM_MLM_JOINED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2658 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_JOINED_STATE)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2659 | pMlmAuthReq->sessionId = psessionEntry->peSessionId; |
| 2660 | psessionEntry->limPrevSmeState = psessionEntry->limSmeState; |
| 2661 | psessionEntry->limSmeState = eLIM_SME_WT_AUTH_STATE; |
| 2662 | // remember staId in case of assoc timeout/failure handling |
| 2663 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 2664 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2665 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2666 | limPostMlmMessage(pMac, |
| 2667 | LIM_MLM_AUTH_REQ, |
| 2668 | (tANI_U32 *) pMlmAuthReq); |
| 2669 | return; |
| 2670 | } |
| 2671 | |
| 2672 | joinFailure: |
| 2673 | { |
| 2674 | psessionEntry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2675 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2676 | |
| 2677 | /// Send Join response to Host |
| 2678 | limHandleSmeJoinResult(pMac, eSIR_SME_REFUSED, eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 2679 | |
| 2680 | } |
| 2681 | |
| 2682 | } |
| 2683 | |
| 2684 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2685 | /*------------------------------------------------------------------------------------------ |
| 2686 | * |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2687 | * Function to handle callback after setting link state to post assoc. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2688 | * |
| 2689 | * |
| 2690 | *------------------------------------------------------------------------------------------ |
| 2691 | */ |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2692 | void limSetLinkStateForPostAssocCallback(tpAniSirGlobal pMac, void *msgParam ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2693 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2694 | tLimMlmReassocCnf mlmReassocCnf; // keep sme |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2695 | tSetLinkCbackParams * pCbackParams = (tSetLinkCbackParams *)msgParam; |
| 2696 | tpPESession psessionEntry = NULL; |
| 2697 | tpAddBssParams pAddBssParams = NULL; |
| 2698 | tpDphHashNode pStaDs = NULL; |
| 2699 | tpAddStaParams pAddStaParams = NULL; |
| 2700 | tLimMlmReassocReq * pMlmReassocReq = NULL; |
| 2701 | tANI_U32 listenInterval = WNI_CFG_LISTEN_INTERVAL_STADEF; |
| 2702 | |
| 2703 | /* Sanity Checks */ |
| 2704 | if (pCbackParams == NULL) |
| 2705 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2706 | PELOGE(limLog(pMac, LOGE, FL("Invalid parameters"));) |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2707 | goto end; |
| 2708 | } |
| 2709 | |
| 2710 | pAddBssParams = (tpAddBssParams)(pCbackParams->cbackDataPtr); |
| 2711 | |
| 2712 | if (pAddBssParams == NULL) |
| 2713 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2714 | PELOGE(limLog(pMac, LOGE, FL("Invalid parameters"));) |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2715 | goto end; |
| 2716 | } |
| 2717 | |
| 2718 | if((psessionEntry = peFindSessionBySessionId(pMac,pAddBssParams->sessionId))== NULL) |
| 2719 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2720 | limLog( pMac, LOGE, FL( "Session Does not exist for given sessionId" )); |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2721 | goto end; |
| 2722 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2723 | |
| 2724 | pMlmReassocReq = (tLimMlmReassocReq *)(psessionEntry->pLimMlmReassocReq); |
| 2725 | |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 2726 | limPrintMacAddr(pMac, pAddBssParams->bssId, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2727 | |
| 2728 | if ((pStaDs = dphAddHashEntry(pMac, pAddBssParams->bssId, DPH_STA_HASH_INDEX_PEER, |
| 2729 | &psessionEntry->dph.dphHashTable)) == NULL) |
| 2730 | { |
| 2731 | // Could not add hash table entry |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2732 | PELOGE(limLog(pMac, LOGE, FL("could not add hash entry at DPH for "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2733 | limPrintMacAddr(pMac, pAddBssParams->staContext.staMac, LOGE); |
| 2734 | goto end; |
| 2735 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2736 | // Prepare and send Reassociation request frame |
| 2737 | // start reassoc timer. |
| 2738 | pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; |
| 2739 | /// Start reassociation failure timer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2740 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_REASSOC_FAIL_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2741 | if (tx_timer_activate(&pMac->lim.limTimers.gLimReassocFailureTimer) |
| 2742 | != TX_SUCCESS) |
| 2743 | { |
| 2744 | /// Could not start reassoc failure timer. |
| 2745 | // Log error |
| 2746 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2747 | FL("could not start Reassociation failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2748 | // Return Reassoc confirm with |
| 2749 | // Resources Unavailable |
| 2750 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 2751 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 2752 | goto end; |
| 2753 | } |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 2754 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 2755 | pMac->lim.pSessionEntry = psessionEntry; |
| 2756 | if(NULL == pMac->lim.pSessionEntry->pLimMlmReassocRetryReq) |
| 2757 | { |
| 2758 | /* Take a copy of reassoc request for retrying */ |
| 2759 | if ( !HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd, (void **)&pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, sizeof(tLimMlmReassocReq))) ) goto end; |
| 2760 | palZeroMemory(pMac->hHdd, pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, sizeof(tLimMlmReassocReq)); |
| 2761 | palCopyMemory( pMac->hHdd,pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, psessionEntry->pLimMlmReassocReq, sizeof(tLimMlmReassocReq)); |
| 2762 | } |
| 2763 | pMac->lim.reAssocRetryAttempt = 0; |
| 2764 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2765 | limSendReassocReqWithFTIEsMgmtFrame(pMac, psessionEntry->pLimMlmReassocReq, psessionEntry); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 2766 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2767 | psessionEntry->limPrevMlmState = psessionEntry->limMlmState; |
| 2768 | psessionEntry->limMlmState = eLIM_MLM_WT_FT_REASSOC_RSP_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 2769 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_FT_REASSOC_RSP_STATE)); |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 2770 | PELOGE(limLog(pMac, LOG1, FL("Set the mlm state to %d session=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2771 | psessionEntry->limMlmState, psessionEntry->peSessionId);) |
| 2772 | |
| 2773 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 2774 | |
| 2775 | //Success, handle below |
| 2776 | pStaDs->bssId = pAddBssParams->bssIdx; |
| 2777 | //STA Index(genr by HAL) for the BSS entry is stored here |
| 2778 | pStaDs->staIndex = pAddBssParams->staContext.staIdx; |
| 2779 | pStaDs->ucUcastSig = pAddBssParams->staContext.ucUcastSig; |
| 2780 | pStaDs->ucBcastSig = pAddBssParams->staContext.ucBcastSig; |
| 2781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2782 | #if defined WLAN_FEATURE_VOWIFI |
| 2783 | rrmCacheMgmtTxPower( pMac, pAddBssParams->txMgmtPower, psessionEntry ); |
| 2784 | #endif |
| 2785 | |
| 2786 | if( eHAL_STATUS_SUCCESS != |
| 2787 | palAllocateMemory( pMac->hHdd, (void **) &pAddStaParams, sizeof( tAddStaParams ))) |
| 2788 | { |
Jeff Johnson | 19ba888 | 2013-04-03 17:02:37 -0700 | [diff] [blame] | 2789 | limLog( pMac, LOGP, FL( "Unable to PAL allocate memory during ADD_STA" )); |
| 2790 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2791 | } |
| 2792 | palZeroMemory( pMac->hHdd, (tANI_U8 *) pAddStaParams, sizeof(tAddStaParams)); |
| 2793 | |
| 2794 | /// Add STA context at MAC HW (BMU, RHP & TFP) |
| 2795 | palCopyMemory( pMac->hHdd, (tANI_U8 *) pAddStaParams->staMac, |
| 2796 | (tANI_U8 *) psessionEntry->selfMacAddr, sizeof(tSirMacAddr)); |
| 2797 | |
| 2798 | palCopyMemory( pMac->hHdd, (tANI_U8 *) pAddStaParams->bssId, |
| 2799 | psessionEntry->bssId, sizeof(tSirMacAddr)); |
| 2800 | |
| 2801 | // Update this when we get reassoc rsp , with success. |
| 2802 | // pAddStaParams->assocId = psessionEntry->limAID; |
| 2803 | |
| 2804 | pAddStaParams->staType = STA_ENTRY_SELF; |
| 2805 | pAddStaParams->status = eHAL_STATUS_SUCCESS; |
| 2806 | pAddStaParams->respReqd = 1; |
| 2807 | |
| 2808 | /* Update PE session ID */ |
| 2809 | pAddStaParams->sessionId = psessionEntry->peSessionId; |
| 2810 | |
| 2811 | // This will indicate HAL to "allocate" a new STA index |
| 2812 | pAddStaParams->staIdx = HAL_STA_INVALID_IDX; |
| 2813 | pAddStaParams->updateSta = FALSE; |
| 2814 | |
| 2815 | pAddStaParams->shortPreambleSupported = (tANI_U8)psessionEntry->beaconParams.fShortPreamble; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2816 | #ifdef WLAN_FEATURE_11AC |
| 2817 | limPopulateOwnRateSet(pMac, &pAddStaParams->supportedRates, NULL, false,psessionEntry, NULL); |
| 2818 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2819 | limPopulateOwnRateSet(pMac, &pAddStaParams->supportedRates, NULL, false,psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2820 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2821 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2822 | if( psessionEntry->htCapability) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2823 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2824 | pAddStaParams->htCapable = psessionEntry->htCapability; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2825 | #ifdef DISABLE_GF_FOR_INTEROP |
| 2826 | /* |
| 2827 | * To resolve the interop problem with Broadcom AP, |
| 2828 | * where TQ STA could not pass traffic with GF enabled, |
| 2829 | * TQ STA will do Greenfield only with TQ AP, for |
| 2830 | * everybody else it will be turned off. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2831 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2832 | if( (psessionEntry->pLimJoinReq != NULL) && (!psessionEntry->pLimJoinReq->bssDescription.aniIndicator)) |
| 2833 | { |
| 2834 | limLog( pMac, LOGE, FL(" Turning off Greenfield, when adding self entry")); |
| 2835 | pAddStaParams->greenFieldCapable = WNI_CFG_GREENFIELD_CAPABILITY_DISABLE; |
| 2836 | } |
| 2837 | else |
| 2838 | #endif |
| 2839 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2840 | pAddStaParams->greenFieldCapable = limGetHTCapability( pMac, eHT_GREENFIELD, psessionEntry); |
| 2841 | pAddStaParams->txChannelWidthSet = limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, psessionEntry); |
| 2842 | pAddStaParams->mimoPS = limGetHTCapability( pMac, eHT_MIMO_POWER_SAVE, psessionEntry ); |
| 2843 | pAddStaParams->rifsMode = limGetHTCapability( pMac, eHT_RIFS_MODE, psessionEntry ); |
| 2844 | pAddStaParams->lsigTxopProtection = limGetHTCapability( pMac, eHT_LSIG_TXOP_PROTECTION, psessionEntry ); |
| 2845 | pAddStaParams->delBASupport = limGetHTCapability( pMac, eHT_DELAYED_BA, psessionEntry ); |
| 2846 | pAddStaParams->maxAmpduDensity = limGetHTCapability( pMac, eHT_MPDU_DENSITY, psessionEntry ); |
| 2847 | pAddStaParams->maxAmpduSize = limGetHTCapability(pMac, eHT_MAX_RX_AMPDU_FACTOR, psessionEntry); |
| 2848 | pAddStaParams->maxAmsduSize = limGetHTCapability( pMac, eHT_MAX_AMSDU_LENGTH, psessionEntry ); |
| 2849 | pAddStaParams->fDsssCckMode40Mhz = limGetHTCapability( pMac, eHT_DSSS_CCK_MODE_40MHZ, psessionEntry); |
| 2850 | pAddStaParams->fShortGI20Mhz = limGetHTCapability( pMac, eHT_SHORT_GI_20MHZ, psessionEntry); |
| 2851 | pAddStaParams->fShortGI40Mhz = limGetHTCapability( pMac, eHT_SHORT_GI_40MHZ, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2852 | } |
| 2853 | |
| 2854 | if (wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &listenInterval) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2855 | limLog(pMac, LOGP, FL("Couldn't get LISTEN_INTERVAL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2856 | pAddStaParams->listenInterval = (tANI_U16)listenInterval; |
| 2857 | |
| 2858 | limFillSupportedRatesInfo(pMac, NULL, &pAddStaParams->supportedRates,psessionEntry); |
| 2859 | |
| 2860 | // Lets save this for when we receive the Reassoc Rsp |
| 2861 | pMac->ft.ftPEContext.pAddStaReq = pAddStaParams; |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2862 | |
| 2863 | if (pCbackParams != NULL) |
| 2864 | { |
| 2865 | if (pCbackParams->cbackDataPtr != NULL) |
| 2866 | { |
| 2867 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pCbackParams->cbackDataPtr); |
| 2868 | } |
| 2869 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pCbackParams); |
| 2870 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2871 | return; |
| 2872 | |
| 2873 | end: |
| 2874 | // Free up buffer allocated for reassocReq |
| 2875 | if (pMlmReassocReq != NULL) |
| 2876 | { |
| 2877 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pMlmReassocReq); |
| 2878 | } |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2879 | |
| 2880 | if (pCbackParams != NULL) |
| 2881 | { |
| 2882 | if (pCbackParams->cbackDataPtr != NULL) |
| 2883 | { |
| 2884 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pCbackParams->cbackDataPtr); |
| 2885 | } |
| 2886 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pCbackParams); |
| 2887 | } |
| 2888 | |
| 2889 | mlmReassocCnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; |
| 2890 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Gopichand Nakkala | 94273ab | 2013-03-25 14:47:39 +0530 | [diff] [blame] | 2891 | /* Update PE session Id*/ |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 2892 | if (psessionEntry != NULL) |
| 2893 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
Jeff Johnson | 19ba888 | 2013-04-03 17:02:37 -0700 | [diff] [blame] | 2894 | else |
| 2895 | mlmReassocCnf.sessionId = 0; |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2896 | |
| 2897 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 2898 | } |
| 2899 | /*------------------------------------------------------------------------------------------ |
| 2900 | * |
| 2901 | * Function to handle WDA_ADD_BSS_RSP, in FT reassoc state. |
| 2902 | * |
| 2903 | * |
| 2904 | *------------------------------------------------------------------------------------------ |
| 2905 | */ |
| 2906 | static inline void |
| 2907 | limProcessStaMlmAddBssRspFT(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession psessionEntry) |
| 2908 | { |
| 2909 | tSetLinkCbackParams * pCbackParam = NULL; |
| 2910 | tAddBssParams * pAddBssCbackInfo = NULL; |
| 2911 | tLimMlmReassocCnf mlmReassocCnf; |
| 2912 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 2913 | |
| 2914 | if ( eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE != psessionEntry->limMlmState ) |
| 2915 | { |
| 2916 | goto end; |
| 2917 | } |
| 2918 | |
| 2919 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **) &pCbackParam, sizeof( tSetLinkCbackParams ))) |
| 2920 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2921 | PELOGE(limLog(pMac, LOGE, FL("Could not allocate memory for LinkState callback params"));) |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2922 | goto end; |
| 2923 | } |
| 2924 | |
| 2925 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **) &pAddBssCbackInfo, sizeof( tAddBssParams ))) |
| 2926 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2927 | PELOGE(limLog(pMac, LOGE, FL("Could not allocate memory for Add BSS info callback param"));) |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2928 | goto end; |
| 2929 | } |
| 2930 | |
| 2931 | vos_mem_copy(pAddBssCbackInfo, pAddBssParams, sizeof(tAddBssParams)); |
| 2932 | |
| 2933 | pCbackParam->cbackDataPtr = (void*)pAddBssCbackInfo; |
| 2934 | |
| 2935 | // Set the filter state to post assoc and send out re-assoc request OTA only after response is received |
| 2936 | if (limSetLinkState(pMac, eSIR_LINK_POSTASSOC_STATE, |
| 2937 | pAddBssParams->bssId, psessionEntry->selfMacAddr, |
| 2938 | (tpSetLinkStateCallback)limSetLinkStateForPostAssocCallback, |
| 2939 | (void *)pCbackParam) != eSIR_SUCCESS) |
| 2940 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2941 | PELOGE(limLog(pMac, LOGE, FL("Failed to set the LinkState"));) |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2942 | goto end; |
| 2943 | } |
| 2944 | |
| 2945 | return; |
| 2946 | |
| 2947 | end: |
| 2948 | |
| 2949 | if (pCbackParam != NULL) |
| 2950 | { |
| 2951 | if (pCbackParam->cbackDataPtr != NULL) |
| 2952 | { |
| 2953 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pCbackParam->cbackDataPtr); |
| 2954 | } |
| 2955 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pCbackParam); |
| 2956 | } |
| 2957 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2958 | mlmReassocCnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; |
| 2959 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 2960 | /* Update PE sessio Id*/ |
| 2961 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 2962 | |
| 2963 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 2964 | } |
| 2965 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 2966 | |
| 2967 | |
| 2968 | /** |
| 2969 | * limProcessStaMlmAddBssRsp() |
| 2970 | * |
| 2971 | *FUNCTION: |
| 2972 | * This function is called to process a WDA_ADD_BSS_RSP from HAL. |
| 2973 | * Upon receipt of this message from HAL, MLME - |
| 2974 | * > Validates the result of WDA_ADD_BSS_REQ |
| 2975 | * > Now, send an ADD_STA to HAL and ADD the "local" STA itself |
| 2976 | * |
| 2977 | *LOGIC: |
| 2978 | * MLME had sent WDA_ADD_BSS_REQ to HAL |
| 2979 | * HAL responded with WDA_ADD_BSS_RSP to MLME |
| 2980 | * MLME now sends WDA_ADD_STA_REQ to HAL |
| 2981 | * |
| 2982 | *ASSUMPTIONS: |
| 2983 | * tSirMsgQ.body is allocated by MLME during limProcessMlmJoinReq |
| 2984 | * tSirMsgQ.body will now be freed by this routine |
| 2985 | * |
| 2986 | *NOTE: |
| 2987 | * |
| 2988 | * @param pMac Pointer to Global MAC structure |
| 2989 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 2990 | * |
| 2991 | * @return None |
| 2992 | */ |
| 2993 | static void |
| 2994 | limProcessStaMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2995 | { |
| 2996 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 2997 | tLimMlmAssocCnf mlmAssocCnf; |
| 2998 | tANI_U32 mesgType = LIM_MLM_ASSOC_CNF; |
| 2999 | tANI_U32 subType = LIM_ASSOC; |
| 3000 | tpDphHashNode pStaDs = NULL; |
| 3001 | tANI_U16 staIdx = HAL_STA_INVALID_IDX; |
| 3002 | tANI_U8 updateSta = false; |
| 3003 | mlmAssocCnf.resultCode = eSIR_SME_SUCCESS; |
| 3004 | |
| 3005 | if(eLIM_MLM_WT_ADD_BSS_RSP_PREASSOC_STATE == psessionEntry->limMlmState) |
| 3006 | { |
| 3007 | //Done: 7-28-2009. JIM_FIX_ME: sessionize the following function |
| 3008 | limProcessStaMlmAddBssRspPreAssoc(pMac, limMsgQ, psessionEntry); |
| 3009 | goto end; |
| 3010 | } |
| 3011 | if( eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE == psessionEntry->limMlmState ) |
| 3012 | { |
| 3013 | mesgType = LIM_MLM_REASSOC_CNF; |
| 3014 | subType = LIM_REASSOC; |
| 3015 | //If Reassoc is happening for the same BSS, then use the existing StaId and indicate to HAL |
| 3016 | //to update the existing STA entry. |
| 3017 | //If Reassoc is happening for the new BSS, then old BSS and STA entry would have been already deleted |
| 3018 | //before PE tries to add BSS for the new BSS, so set the updateSta to false and pass INVALID STA Index. |
| 3019 | if (sirCompareMacAddr( psessionEntry->bssId, psessionEntry->limReAssocbssId)) |
| 3020 | { |
| 3021 | staIdx = psessionEntry->staId; |
| 3022 | updateSta = true; |
| 3023 | } |
| 3024 | } |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 3025 | |
Madan Mohan Koyyalamudi | 830ed80 | 2012-11-29 11:38:12 -0800 | [diff] [blame] | 3026 | if(pAddBssParams == 0) |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 3027 | goto end; |
| 3028 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3029 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 3030 | { |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 3031 | #if defined(WLAN_FEATURE_VOWIFI_11R) || defined(FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3032 | if( eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE == psessionEntry->limMlmState ) |
| 3033 | { |
| 3034 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 3035 | PELOGE(limLog(pMac, LOG1, FL("Mlm=%d %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3036 | psessionEntry->limMlmState, |
| 3037 | eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE);) |
| 3038 | #endif |
| 3039 | limProcessStaMlmAddBssRspFT( pMac, limMsgQ, psessionEntry); |
| 3040 | goto end; |
| 3041 | } |
| 3042 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 3043 | |
| 3044 | // Set MLME state |
| 3045 | psessionEntry->limMlmState = eLIM_MLM_WT_ADD_STA_RSP_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3046 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3047 | psessionEntry->statypeForBss = STA_ENTRY_PEER; //to know the session started for self or for peer oct6th |
| 3048 | // Now, send WDA_ADD_STA_REQ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3049 | limLog( pMac, LOGW, FL( "On STA: ADD_BSS was successful" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3050 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 3051 | if (pStaDs == NULL) |
| 3052 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3053 | PELOGE(limLog(pMac, LOGE, FL("could not Add Self Entry for the station"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3054 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 3055 | } |
| 3056 | else |
| 3057 | { |
| 3058 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 3059 | //Success, handle below |
| 3060 | pStaDs->bssId = pAddBssParams->bssIdx; |
| 3061 | //STA Index(genr by HAL) for the BSS entry is stored here |
| 3062 | pStaDs->staIndex = pAddBssParams->staContext.staIdx; |
| 3063 | pStaDs->ucUcastSig = pAddBssParams->staContext.ucUcastSig; |
| 3064 | pStaDs->ucBcastSig = pAddBssParams->staContext.ucBcastSig; |
| 3065 | // Downgrade the EDCA parameters if needed |
| 3066 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 3067 | // Send the active EDCA parameters to HAL |
| 3068 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) { |
| 3069 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 3070 | } else { |
| 3071 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 3072 | } |
| 3073 | #if defined WLAN_FEATURE_VOWIFI |
| 3074 | rrmCacheMgmtTxPower( pMac, pAddBssParams->txMgmtPower, psessionEntry ); |
| 3075 | #endif |
| 3076 | |
| 3077 | if (subType == LIM_REASSOC) |
| 3078 | limDeactivateAndChangeTimer(pMac, eLIM_KEEPALIVE_TIMER); |
| 3079 | if (limAddStaSelf(pMac,staIdx, updateSta, psessionEntry) != eSIR_SUCCESS) |
| 3080 | { |
| 3081 | // Add STA context at HW |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3082 | PELOGE(limLog(pMac, LOGE, FL("could not Add Self Entry for the station"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3083 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 3084 | } |
| 3085 | } |
| 3086 | } |
| 3087 | else |
| 3088 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3089 | limLog( pMac, LOGP, FL( "ADD_BSS failed!" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3090 | // Return Assoc confirm to SME with failure |
| 3091 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 3092 | } |
| 3093 | |
| 3094 | if(mlmAssocCnf.resultCode != eSIR_SME_SUCCESS) |
| 3095 | { |
| 3096 | /* Update PE session Id*/ |
| 3097 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 3098 | limPostSmeMessage( pMac, mesgType, (tANI_U32 *) &mlmAssocCnf ); |
| 3099 | } |
| 3100 | end: |
| 3101 | if( 0 != limMsgQ->bodyptr ) |
| 3102 | palFreeMemory( pMac->hHdd,(void *) pAddBssParams ); |
| 3103 | } |
| 3104 | |
| 3105 | |
| 3106 | |
| 3107 | /** |
| 3108 | * limProcessMlmAddBssRsp() |
| 3109 | * |
| 3110 | *FUNCTION: |
| 3111 | * This function is called to process a WDA_ADD_BSS_RSP from HAL. |
| 3112 | * Upon receipt of this message from HAL, MLME - |
| 3113 | * > Determines the "state" in which this message was received |
| 3114 | * > Forwards it to the appropriate callback |
| 3115 | * |
| 3116 | *LOGIC: |
| 3117 | * WDA_ADD_BSS_RSP can be received by MLME while the LIM is |
| 3118 | * in the following two states: |
| 3119 | * 1) As AP, LIM state = eLIM_SME_WT_START_BSS_STATE |
| 3120 | * 2) As STA, LIM state = eLIM_SME_WT_JOIN_STATE |
| 3121 | * Based on these two states, this API will determine where to |
| 3122 | * route the message to |
| 3123 | * |
| 3124 | *ASSUMPTIONS: |
| 3125 | * |
| 3126 | *NOTE: |
| 3127 | * |
| 3128 | * @param pMac Pointer to Global MAC structure |
| 3129 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 3130 | * |
| 3131 | * @return None |
| 3132 | */ |
| 3133 | void limProcessMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 3134 | { |
| 3135 | tLimMlmStartCnf mlmStartCnf; |
| 3136 | tpPESession psessionEntry; |
| 3137 | tpAddBssParams pAddBssParams = (tpAddBssParams) (limMsgQ->bodyptr); |
| 3138 | |
| 3139 | if(NULL == pAddBssParams ) |
| 3140 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3141 | limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3142 | return; |
| 3143 | } |
| 3144 | |
| 3145 | // |
| 3146 | // TODO & FIXME_GEN4 |
| 3147 | // Need to inspect tSirMsgQ.reserved for a valid Dialog token! |
| 3148 | // |
| 3149 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 3150 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 3151 | //the deffered flag. |
| 3152 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3153 | // Validate SME/LIM state |
| 3154 | // Validate MLME state |
| 3155 | if((psessionEntry = peFindSessionBySessionId(pMac,pAddBssParams->sessionId))== NULL) |
| 3156 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3157 | limLog( pMac, LOGE, FL( "Session Does not exist for given sessionId" )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3158 | if( NULL != pAddBssParams ) |
| 3159 | palFreeMemory( pMac->hHdd, (void *) pAddBssParams ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3160 | return; |
| 3161 | } |
| 3162 | /* update PE session Id*/ |
| 3163 | mlmStartCnf.sessionId = psessionEntry->peSessionId; |
| 3164 | if( eSIR_IBSS_MODE == psessionEntry->bssType ) |
| 3165 | limProcessIbssMlmAddBssRsp( pMac, limMsgQ, psessionEntry ); |
| 3166 | else |
| 3167 | { |
| 3168 | if( eLIM_SME_WT_START_BSS_STATE == psessionEntry->limSmeState ) |
| 3169 | { |
| 3170 | if( eLIM_MLM_WT_ADD_BSS_RSP_STATE != psessionEntry->limMlmState ) |
| 3171 | { |
| 3172 | // Mesg received from HAL in Invalid state! |
| 3173 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3174 | FL( "Received unexpected WDA_ADD_BSS_RSP in state %X" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3175 | psessionEntry->limMlmState ); |
| 3176 | mlmStartCnf.resultCode = eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED; |
| 3177 | if( 0 != limMsgQ->bodyptr ) |
| 3178 | palFreeMemory( pMac->hHdd, (void *) pAddBssParams ); |
| 3179 | limPostSmeMessage( pMac, LIM_MLM_START_CNF, (tANI_U32 *) &mlmStartCnf ); |
| 3180 | } |
| 3181 | else if ((psessionEntry->bssType == eSIR_BTAMP_AP_MODE)||(psessionEntry->bssType == eSIR_BTAMP_STA_MODE)) |
| 3182 | { |
| 3183 | limProcessBtampAddBssRsp(pMac,limMsgQ,psessionEntry); |
| 3184 | } |
| 3185 | else |
| 3186 | limProcessApMlmAddBssRsp( pMac,limMsgQ); |
| 3187 | } |
| 3188 | else |
| 3189 | /* Called while processing assoc response */ |
| 3190 | limProcessStaMlmAddBssRsp( pMac, limMsgQ,psessionEntry); |
| 3191 | } |
Madan Mohan Koyyalamudi | 01cba04 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 3192 | |
| 3193 | if(limIsInMCC(pMac)) |
| 3194 | { |
| 3195 | WDA_TrafficStatsTimerActivate(TRUE); |
| 3196 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3197 | |
| 3198 | #ifdef WLAN_FEATURE_11W |
| 3199 | if (psessionEntry->limRmfEnabled) |
| 3200 | { |
| 3201 | if ( eSIR_SUCCESS != limSendExcludeUnencryptInd(pMac, FALSE, psessionEntry) ) |
| 3202 | { |
| 3203 | limLog( pMac, LOGE, |
| 3204 | FL( "Could not send down Exclude Unencrypted Indication!" ), |
| 3205 | psessionEntry->limMlmState ); |
| 3206 | } |
| 3207 | } |
| 3208 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3209 | } |
| 3210 | /** |
| 3211 | * limProcessMlmSetKeyRsp() |
| 3212 | * |
| 3213 | *FUNCTION: |
| 3214 | * This function is called to process the following two |
| 3215 | * messages from HAL: |
| 3216 | * 1) WDA_SET_BSSKEY_RSP |
| 3217 | * 2) WDA_SET_STAKEY_RSP |
| 3218 | * 3) WDA_SET_STA_BCASTKEY_RSP |
| 3219 | * Upon receipt of this message from HAL, |
| 3220 | * MLME - |
| 3221 | * > Determines the "state" in which this message was received |
| 3222 | * > Forwards it to the appropriate callback |
| 3223 | * |
| 3224 | *LOGIC: |
| 3225 | * WDA_SET_BSSKEY_RSP/WDA_SET_STAKEY_RSP can be |
| 3226 | * received by MLME while in the following state: |
| 3227 | * MLME state = eLIM_MLM_WT_SET_BSS_KEY_STATE --OR-- |
| 3228 | * MLME state = eLIM_MLM_WT_SET_STA_KEY_STATE --OR-- |
| 3229 | * MLME state = eLIM_MLM_WT_SET_STA_BCASTKEY_STATE |
| 3230 | * Based on this state, this API will determine where to |
| 3231 | * route the message to |
| 3232 | * |
| 3233 | *ASSUMPTIONS: |
| 3234 | * ONLY the MLME state is being taken into account for now. |
| 3235 | * This is because, it appears that the handling of the |
| 3236 | * SETKEYS REQ is handled symmetrically on both the AP & STA |
| 3237 | * |
| 3238 | *NOTE: |
| 3239 | * |
| 3240 | * @param pMac Pointer to Global MAC structure |
| 3241 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 3242 | * |
| 3243 | * @return None |
| 3244 | */ |
| 3245 | void limProcessMlmSetStaKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 3246 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3247 | tANI_U8 respReqd = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3248 | tLimMlmSetKeysCnf mlmSetKeysCnf; |
| 3249 | tANI_U8 sessionId = 0; |
| 3250 | tpPESession psessionEntry; |
| 3251 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3252 | palZeroMemory( pMac->hHdd, (void *)&mlmSetKeysCnf, sizeof( tLimMlmSetKeysCnf )); |
| 3253 | //BTAMP |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3254 | if( NULL == limMsgQ->bodyptr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3255 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3256 | PELOGE(limLog(pMac, LOGE,FL("limMsgQ bodyptr is NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3257 | return; |
| 3258 | } |
| 3259 | sessionId = ((tpSetStaKeyParams) limMsgQ->bodyptr)->sessionId; |
| 3260 | if((psessionEntry = peFindSessionBySessionId(pMac, sessionId))== NULL) |
| 3261 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3262 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3263 | palFreeMemory( pMac->hHdd, (void *) limMsgQ->bodyptr ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3264 | return; |
| 3265 | } |
| 3266 | if( eLIM_MLM_WT_SET_STA_KEY_STATE != psessionEntry->limMlmState ) |
| 3267 | { |
| 3268 | // Mesg received from HAL in Invalid state! |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3269 | limLog( pMac, LOGW, FL( "Received unexpected [Mesg Id - %d] in state %X" ), limMsgQ->type, psessionEntry->limMlmState ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3270 | // There's not much that MLME can do at this stage... |
| 3271 | respReqd = 0; |
| 3272 | } |
| 3273 | else |
| 3274 | mlmSetKeysCnf.resultCode = (tANI_U16) (((tpSetStaKeyParams) limMsgQ->bodyptr)->status); |
| 3275 | |
| 3276 | palFreeMemory( pMac->hHdd, (void *) limMsgQ->bodyptr ); |
| 3277 | // Restore MLME state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3278 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3279 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3280 | if( respReqd ) |
| 3281 | { |
| 3282 | tpLimMlmSetKeysReq lpLimMlmSetKeysReq = (tpLimMlmSetKeysReq) pMac->lim.gpLimMlmSetKeysReq; |
| 3283 | // Prepare and Send LIM_MLM_SETKEYS_CNF |
| 3284 | if( NULL != lpLimMlmSetKeysReq ) |
| 3285 | { |
| 3286 | palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmSetKeysCnf.peerMacAddr, (tANI_U8 *) lpLimMlmSetKeysReq->peerMacAddr, sizeof(tSirMacAddr) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3287 | // Free the buffer cached for the global pMac->lim.gpLimMlmSetKeysReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3288 | palFreeMemory(pMac->hHdd, (tANI_U8 *) pMac->lim.gpLimMlmSetKeysReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3289 | pMac->lim.gpLimMlmSetKeysReq = NULL; |
| 3290 | } |
| 3291 | mlmSetKeysCnf.sessionId = sessionId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3292 | limPostSmeMessage(pMac, LIM_MLM_SETKEYS_CNF, (tANI_U32 *) &mlmSetKeysCnf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3293 | } |
| 3294 | } |
| 3295 | void limProcessMlmSetBssKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 3296 | { |
| 3297 | tANI_U8 respReqd = 1; |
| 3298 | tLimMlmSetKeysCnf mlmSetKeysCnf; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3299 | tANI_U16 resultCode; |
| 3300 | tANI_U8 sessionId = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3301 | tpPESession psessionEntry; |
| 3302 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3303 | palZeroMemory( pMac->hHdd, (void *)&mlmSetKeysCnf, sizeof( tLimMlmSetKeysCnf )); |
| 3304 | //BTAMP |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3305 | if( NULL == limMsgQ->bodyptr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3306 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3307 | PELOGE(limLog(pMac, LOGE,FL("limMsgQ bodyptr is null"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3308 | return; |
| 3309 | } |
| 3310 | sessionId = ((tpSetBssKeyParams) limMsgQ->bodyptr)->sessionId; |
| 3311 | if((psessionEntry = peFindSessionBySessionId(pMac, sessionId))== NULL) |
| 3312 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3313 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3314 | palFreeMemory( pMac->hHdd, (void *) limMsgQ->bodyptr ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3315 | return; |
| 3316 | } |
| 3317 | if( eLIM_MLM_WT_SET_BSS_KEY_STATE == psessionEntry->limMlmState ) |
| 3318 | resultCode = (tANI_U16) (((tpSetBssKeyParams) limMsgQ->bodyptr)->status); |
| 3319 | else |
| 3320 | resultCode = (tANI_U16) (((tpSetStaKeyParams) limMsgQ->bodyptr)->status); //BCAST key also uses tpSetStaKeyParams. Done this way for readabilty. |
| 3321 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3322 | // |
| 3323 | // TODO & FIXME_GEN4 |
| 3324 | // Need to inspect tSirMsgQ.reserved for a valid Dialog token! |
| 3325 | // |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3326 | // Validate SME/LIM state - Read the above "ASSUMPTIONS" |
| 3327 | //if( eLIM_SME_LINK_EST_STATE == pMac->lim.gLimSmeState ) |
| 3328 | //{ |
| 3329 | // Validate MLME state |
| 3330 | if( eLIM_MLM_WT_SET_BSS_KEY_STATE != psessionEntry->limMlmState && |
| 3331 | eLIM_MLM_WT_SET_STA_BCASTKEY_STATE != psessionEntry->limMlmState ) |
| 3332 | { |
| 3333 | // Mesg received from HAL in Invalid state! |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3334 | limLog( pMac, LOGW, FL( "Received unexpected [Mesg Id - %d] in state %X" ), limMsgQ->type, psessionEntry->limMlmState ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3335 | // There's not much that MLME can do at this stage... |
| 3336 | respReqd = 0; |
| 3337 | } |
| 3338 | else |
| 3339 | mlmSetKeysCnf.resultCode = resultCode; |
| 3340 | |
| 3341 | palFreeMemory( pMac->hHdd, (void *) limMsgQ->bodyptr ); |
| 3342 | // Restore MLME state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3343 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
| 3344 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3345 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3346 | if( respReqd ) |
| 3347 | { |
| 3348 | tpLimMlmSetKeysReq lpLimMlmSetKeysReq = (tpLimMlmSetKeysReq) pMac->lim.gpLimMlmSetKeysReq; |
| 3349 | mlmSetKeysCnf.sessionId = sessionId; |
| 3350 | |
| 3351 | // Prepare and Send LIM_MLM_SETKEYS_CNF |
| 3352 | if( NULL != lpLimMlmSetKeysReq ) |
| 3353 | { |
| 3354 | palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmSetKeysCnf.peerMacAddr, (tANI_U8 *) lpLimMlmSetKeysReq->peerMacAddr, sizeof(tSirMacAddr) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3355 | // Free the buffer cached for the global pMac->lim.gpLimMlmSetKeysReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3356 | palFreeMemory(pMac->hHdd, (tANI_U8 *) pMac->lim.gpLimMlmSetKeysReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3357 | pMac->lim.gpLimMlmSetKeysReq = NULL; |
| 3358 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3359 | limPostSmeMessage(pMac, LIM_MLM_SETKEYS_CNF, (tANI_U32 *) &mlmSetKeysCnf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3360 | } |
| 3361 | } |
| 3362 | /** |
| 3363 | * limProcessMlmRemoveKeyRsp() |
| 3364 | * |
| 3365 | *FUNCTION: |
| 3366 | * |
| 3367 | *LOGIC: |
| 3368 | * |
| 3369 | *ASSUMPTIONS: |
| 3370 | * |
| 3371 | *NOTE: |
| 3372 | * |
| 3373 | * @param pMac Pointer to Global MAC structure |
| 3374 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 3375 | * |
| 3376 | * @return None |
| 3377 | */ |
| 3378 | void limProcessMlmRemoveKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 3379 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3380 | tANI_U8 respReqd = 1; |
| 3381 | tLimMlmRemoveKeyCnf mlmRemoveCnf; |
| 3382 | tANI_U16 resultCode; |
| 3383 | tANI_U8 sessionId = 0; |
| 3384 | tpPESession psessionEntry; |
| 3385 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3386 | palZeroMemory( pMac->hHdd, (void *) &mlmRemoveCnf, sizeof( tLimMlmRemoveKeyCnf )); |
| 3387 | |
| 3388 | if( NULL == limMsgQ->bodyptr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3389 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3390 | PELOGE(limLog(pMac, LOGE,FL("limMsgQ bodyptr is NULL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3391 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3392 | } |
| 3393 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3394 | if (limMsgQ->type == WDA_REMOVE_STAKEY_RSP) |
| 3395 | sessionId = ((tpRemoveStaKeyParams) limMsgQ->bodyptr)->sessionId; |
| 3396 | else if (limMsgQ->type == WDA_REMOVE_BSSKEY_RSP) |
| 3397 | sessionId = ((tpRemoveBssKeyParams) limMsgQ->bodyptr)->sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3398 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3399 | if((psessionEntry = peFindSessionBySessionId(pMac, sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3400 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3401 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3402 | return; |
| 3403 | } |
| 3404 | |
| 3405 | if( eLIM_MLM_WT_REMOVE_BSS_KEY_STATE == psessionEntry->limMlmState ) |
| 3406 | resultCode = (tANI_U16) (((tpRemoveBssKeyParams) limMsgQ->bodyptr)->status); |
| 3407 | else |
| 3408 | resultCode = (tANI_U16) (((tpRemoveStaKeyParams) limMsgQ->bodyptr)->status); |
| 3409 | |
| 3410 | // Validate MLME state |
| 3411 | if( eLIM_MLM_WT_REMOVE_BSS_KEY_STATE != psessionEntry->limMlmState && |
| 3412 | eLIM_MLM_WT_REMOVE_STA_KEY_STATE != psessionEntry->limMlmState ) |
| 3413 | { |
| 3414 | // Mesg received from HAL in Invalid state! |
| 3415 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3416 | FL("Received unexpected [Mesg Id - %d] in state %X"), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3417 | limMsgQ->type, |
| 3418 | psessionEntry->limMlmState ); |
| 3419 | respReqd = 0; |
| 3420 | } |
| 3421 | else |
| 3422 | mlmRemoveCnf.resultCode = resultCode; |
| 3423 | |
| 3424 | // |
| 3425 | // TODO & FIXME_GEN4 |
| 3426 | // Need to inspect tSirMsgQ.reserved for a valid Dialog token! |
| 3427 | // |
| 3428 | |
| 3429 | palFreeMemory( pMac->hHdd, (void *) limMsgQ->bodyptr ); |
| 3430 | |
| 3431 | // Restore MLME state |
| 3432 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
| 3433 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
| 3434 | |
| 3435 | if( respReqd ) |
| 3436 | { |
| 3437 | tpLimMlmRemoveKeyReq lpLimMlmRemoveKeyReq = (tpLimMlmRemoveKeyReq) pMac->lim.gpLimMlmRemoveKeyReq; |
| 3438 | mlmRemoveCnf.sessionId = sessionId; |
| 3439 | |
| 3440 | // Prepare and Send LIM_MLM_REMOVEKEY_CNF |
| 3441 | if( NULL != lpLimMlmRemoveKeyReq ) |
| 3442 | { |
| 3443 | palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmRemoveCnf.peerMacAddr, (tANI_U8 *) lpLimMlmRemoveKeyReq->peerMacAddr, |
| 3444 | sizeof( tSirMacAddr )); |
| 3445 | // Free the buffer cached for the global pMac->lim.gpLimMlmRemoveKeyReq |
| 3446 | palFreeMemory(pMac->hHdd, (tANI_U8 *) pMac->lim.gpLimMlmRemoveKeyReq); |
| 3447 | pMac->lim.gpLimMlmRemoveKeyReq = NULL; |
| 3448 | } |
| 3449 | limPostSmeMessage( pMac, LIM_MLM_REMOVEKEY_CNF, (tANI_U32 *) &mlmRemoveCnf ); |
| 3450 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3451 | } |
| 3452 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3453 | |
| 3454 | /** --------------------------------------------------------------------- |
| 3455 | \fn limProcessInitScanRsp |
| 3456 | \brief This function is called when LIM receives WDA_INIT_SCAN_RSP |
| 3457 | \ message from HAL. If status code is failure, then |
| 3458 | \ update the gLimNumOfConsecutiveBkgndScanFailure count. |
| 3459 | \param tpAniSirGlobal pMac |
| 3460 | \param tANI_U32 body |
| 3461 | \return none |
| 3462 | \ ----------------------------------------------------------------------- */ |
| 3463 | void limProcessInitScanRsp(tpAniSirGlobal pMac, void *body) |
| 3464 | { |
| 3465 | tpInitScanParams pInitScanParam; |
| 3466 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3467 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3468 | pInitScanParam = (tpInitScanParams) body; |
| 3469 | status = pInitScanParam->status; |
| 3470 | palFreeMemory( pMac->hHdd, (char *)body); |
| 3471 | |
| 3472 | //Only abort scan if the we are scanning. |
| 3473 | if( pMac->lim.abortScan && |
| 3474 | (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) ) |
| 3475 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3476 | limLog( pMac, LOGW, FL(" finish scan") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3477 | pMac->lim.abortScan = 0; |
| 3478 | limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); |
| 3479 | limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); |
| 3480 | //Set the resume channel to Any valid channel (invalid). |
| 3481 | //This will instruct HAL to set it to any previous valid channel. |
| 3482 | peSetResumeChannel(pMac, 0, 0); |
| 3483 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 3484 | } |
| 3485 | switch(pMac->lim.gLimHalScanState) |
| 3486 | { |
| 3487 | case eLIM_HAL_INIT_SCAN_WAIT_STATE: |
| 3488 | if (status != (tANI_U32) eHAL_STATUS_SUCCESS) |
| 3489 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3490 | PELOGW(limLog(pMac, LOGW, FL("InitScanRsp with failed status= %d"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3491 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 3492 | pMac->lim.gLimNumOfConsecutiveBkgndScanFailure += 1; |
| 3493 | /* |
| 3494 | * On Windows eSIR_SME_HAL_SCAN_INIT_FAILED message to CSR may trigger |
| 3495 | * another Scan request in the same context (happens when 11d is enabled |
| 3496 | * and first scan request with 11d channels fails for whatever reason, then CSR issues next init |
| 3497 | * scan in the same context but with bigger channel list), so the state needs to be |
| 3498 | * changed before this response message is sent. |
| 3499 | */ |
| 3500 | limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3501 | return; |
| 3502 | } |
| 3503 | else if (status == eHAL_STATUS_SUCCESS) |
| 3504 | { |
| 3505 | /* since we have successfully triggered a background scan, |
| 3506 | * reset the "consecutive bkgnd scan failure" count to 0 |
| 3507 | */ |
| 3508 | pMac->lim.gLimNumOfConsecutiveBkgndScanFailure = 0; |
| 3509 | pMac->lim.gLimNumOfBackgroundScanSuccess += 1; |
| 3510 | } |
| 3511 | limContinueChannelScan(pMac); |
| 3512 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3513 | //WLAN_SUSPEND_LINK Related |
| 3514 | case eLIM_HAL_SUSPEND_LINK_WAIT_STATE: |
| 3515 | if( pMac->lim.gpLimSuspendCallback ) |
| 3516 | { |
| 3517 | if( status == eHAL_STATUS_SUCCESS ) |
| 3518 | pMac->lim.gLimHalScanState = eLIM_HAL_SUSPEND_LINK_STATE; |
| 3519 | else |
| 3520 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 3521 | |
| 3522 | pMac->lim.gpLimSuspendCallback( pMac, status, pMac->lim.gpLimSuspendData ); |
| 3523 | pMac->lim.gpLimSuspendCallback = NULL; |
| 3524 | pMac->lim.gpLimSuspendData = NULL; |
| 3525 | } |
| 3526 | else |
| 3527 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3528 | limLog( pMac, LOGP, "No suspend link callback set but station is in suspend state"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3529 | return; |
| 3530 | } |
| 3531 | break; |
| 3532 | //end WLAN_SUSPEND_LINK Related |
| 3533 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3534 | limLog(pMac, LOGW, FL("limProcessInitScanRsp: Rcvd InitScanRsp not in WAIT State, state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3535 | pMac->lim.gLimHalScanState); |
| 3536 | break; |
| 3537 | } |
| 3538 | return; |
| 3539 | } |
| 3540 | /** |
| 3541 | * limProcessSwitchChannelReAssocReq() |
| 3542 | * |
| 3543 | *FUNCTION: |
| 3544 | * This function is called to send the reassoc req mgmt frame after the |
| 3545 | * switchChannelRsp message is received from HAL. |
| 3546 | * |
| 3547 | *LOGIC: |
| 3548 | * |
| 3549 | *ASSUMPTIONS: |
| 3550 | * NA |
| 3551 | * |
| 3552 | *NOTE: |
| 3553 | * NA |
| 3554 | * |
| 3555 | * @param pMac - Pointer to Global MAC structure. |
| 3556 | * @param psessionEntry - session related information. |
| 3557 | * @param status - channel switch success/failure. |
| 3558 | * |
| 3559 | * @return None |
| 3560 | */ |
| 3561 | static void limProcessSwitchChannelReAssocReq(tpAniSirGlobal pMac, tpPESession psessionEntry, eHalStatus status) |
| 3562 | { |
| 3563 | tLimMlmReassocCnf mlmReassocCnf; |
| 3564 | tLimMlmReassocReq *pMlmReassocReq; |
| 3565 | pMlmReassocReq = (tLimMlmReassocReq *)(psessionEntry->pLimMlmReassocReq); |
| 3566 | if(pMlmReassocReq == NULL) |
| 3567 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3568 | limLog(pMac, LOGP, FL("pLimMlmReassocReq does not exist for given switchChanSession")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3569 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3570 | goto end; |
| 3571 | } |
| 3572 | |
| 3573 | if(status != eHAL_STATUS_SUCCESS) |
| 3574 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3575 | PELOGE(limLog(pMac, LOGE, FL("Change channel failed!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3576 | mlmReassocCnf.resultCode = eSIR_SME_CHANNEL_SWITCH_FAIL; |
| 3577 | goto end; |
| 3578 | } |
| 3579 | /// Start reassociation failure timer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3580 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_REASSOC_FAIL_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3581 | if (tx_timer_activate(&pMac->lim.limTimers.gLimReassocFailureTimer) |
| 3582 | != TX_SUCCESS) |
| 3583 | { |
| 3584 | /// Could not start reassoc failure timer. |
| 3585 | // Log error |
| 3586 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3587 | FL("could not start Reassociation failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3588 | // Return Reassoc confirm with |
| 3589 | // Resources Unavailable |
| 3590 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3591 | goto end; |
| 3592 | } |
| 3593 | /// Prepare and send Reassociation request frame |
| 3594 | limSendReassocReqMgmtFrame(pMac, pMlmReassocReq, psessionEntry); |
| 3595 | return; |
| 3596 | end: |
| 3597 | // Free up buffer allocated for reassocReq |
| 3598 | if(pMlmReassocReq != NULL) |
| 3599 | { |
| 3600 | /* Update PE session Id*/ |
| 3601 | mlmReassocCnf.sessionId = pMlmReassocReq->sessionId; |
| 3602 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pMlmReassocReq); |
| 3603 | } |
| 3604 | else |
| 3605 | { |
| 3606 | mlmReassocCnf.sessionId = 0; |
| 3607 | } |
| 3608 | |
| 3609 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 3610 | /* Update PE sessio Id*/ |
| 3611 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 3612 | |
| 3613 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 3614 | } |
| 3615 | /** |
| 3616 | * limProcessSwitchChannelJoinReq() |
| 3617 | * |
| 3618 | *FUNCTION: |
| 3619 | * This function is called to send the probe req mgmt frame after the |
| 3620 | * switchChannelRsp message is received from HAL. |
| 3621 | * |
| 3622 | *LOGIC: |
| 3623 | * |
| 3624 | *ASSUMPTIONS: |
| 3625 | * NA |
| 3626 | * |
| 3627 | *NOTE: |
| 3628 | * NA |
| 3629 | * |
| 3630 | * @param pMac - Pointer to Global MAC structure. |
| 3631 | * @param psessionEntry - session related information. |
| 3632 | * @param status - channel switch success/failure. |
| 3633 | * |
| 3634 | * @return None |
| 3635 | */ |
| 3636 | static void limProcessSwitchChannelJoinReq(tpAniSirGlobal pMac, tpPESession psessionEntry, eHalStatus status) |
| 3637 | { |
| 3638 | tANI_U32 val; |
| 3639 | tSirMacSSid ssId; |
| 3640 | tLimMlmJoinCnf mlmJoinCnf; |
| 3641 | if(status != eHAL_STATUS_SUCCESS) |
| 3642 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3643 | PELOGE(limLog(pMac, LOGE, FL("Change channel failed!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3644 | goto error; |
| 3645 | } |
| 3646 | |
| 3647 | if ( (NULL == psessionEntry ) || (NULL == psessionEntry->pLimMlmJoinReq) ) |
| 3648 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3649 | PELOGE(limLog(pMac, LOGE, FL("invalid pointer!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3650 | goto error; |
| 3651 | } |
| 3652 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3653 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3654 | /* eSIR_BTAMP_AP_MODE stroed as bss type in session Table when join req is received, is to be veified */ |
| 3655 | if(psessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 3656 | { |
| 3657 | if (limSetLinkState(pMac, eSIR_LINK_BTAMP_PREASSOC_STATE, psessionEntry->bssId, |
| 3658 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 3659 | goto error; |
| 3660 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3661 | |
| 3662 | /* Update the lim global gLimTriggerBackgroundScanDuringQuietBss */ |
| 3663 | if(wlan_cfgGetInt(pMac, WNI_CFG_TRIG_STA_BK_SCAN, &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3664 | limLog(pMac, LOGP, FL("failed to get WNI_CFG_TRIG_STA_BK_SCAN cfg value!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3665 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = (val) ? 1 : 0; |
| 3666 | // Apply previously set configuration at HW |
| 3667 | limApplyConfiguration(pMac, psessionEntry); |
| 3668 | /// Wait for Beacon to announce join success |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3669 | palCopyMemory( pMac->hHdd, ssId.ssId, |
| 3670 | psessionEntry->ssId.ssId, |
| 3671 | psessionEntry->ssId.length); |
| 3672 | ssId.length = psessionEntry->ssId.length; |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 3673 | |
| 3674 | limDeactivateAndChangeTimer(pMac, eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER); |
| 3675 | |
| 3676 | //assign appropriate sessionId to the timer object |
| 3677 | pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer.sessionId = psessionEntry->peSessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3678 | // include additional IE if there is |
| 3679 | limSendProbeReqMgmtFrame( pMac, &ssId, |
| 3680 | psessionEntry->pLimMlmJoinReq->bssDescription.bssId, psessionEntry->currentOperChannel/*chanNum*/, |
| 3681 | psessionEntry->selfMacAddr, psessionEntry->dot11mode, |
| 3682 | psessionEntry->pLimJoinReq->addIEScan.length, psessionEntry->pLimJoinReq->addIEScan.addIEdata); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3683 | |
| 3684 | // Sending mgmt frame is a blocking call activate Join failure timer now |
| 3685 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_JOIN_FAIL_TIMER)); |
| 3686 | if (tx_timer_activate(&pMac->lim.limTimers.gLimJoinFailureTimer) != TX_SUCCESS) |
| 3687 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3688 | limLog(pMac, LOGP, FL("could not activate Join failure timer")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3689 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
| 3690 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, pMac->lim.gLimMlmState)); |
| 3691 | //memory is freed up below. |
| 3692 | psessionEntry->pLimMlmJoinReq = NULL; |
| 3693 | goto error; |
| 3694 | } |
| 3695 | |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 3696 | if( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) |
| 3697 | { |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 3698 | // Activate Join Periodic Probe Req timer |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 3699 | if (tx_timer_activate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer) != TX_SUCCESS) |
| 3700 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3701 | limLog(pMac, LOGP, FL("could not activate Periodic Join req failure timer")); |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 3702 | goto error; |
| 3703 | } |
| 3704 | } |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 3705 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3706 | return; |
| 3707 | error: |
| 3708 | if(NULL != psessionEntry) |
| 3709 | { |
| 3710 | palFreeMemory( pMac->hHdd, (tANI_U8 *) (psessionEntry->pLimMlmJoinReq)); |
| 3711 | psessionEntry->pLimMlmJoinReq = NULL; |
| 3712 | mlmJoinCnf.sessionId = psessionEntry->peSessionId; |
| 3713 | } |
| 3714 | else |
| 3715 | { |
| 3716 | mlmJoinCnf.sessionId = 0; |
| 3717 | } |
| 3718 | mlmJoinCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3719 | mlmJoinCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 3720 | limPostSmeMessage(pMac, LIM_MLM_JOIN_CNF, (tANI_U32 *) &mlmJoinCnf); |
| 3721 | } |
| 3722 | |
| 3723 | /** |
| 3724 | * limProcessSwitchChannelRsp() |
| 3725 | * |
| 3726 | *FUNCTION: |
| 3727 | * This function is called to process switchChannelRsp message from HAL. |
| 3728 | * |
| 3729 | *LOGIC: |
| 3730 | * |
| 3731 | *ASSUMPTIONS: |
| 3732 | * NA |
| 3733 | * |
| 3734 | *NOTE: |
| 3735 | * NA |
| 3736 | * |
| 3737 | * @param pMac - Pointer to Global MAC structure |
| 3738 | * @param body - message body. |
| 3739 | * |
| 3740 | * @return None |
| 3741 | */ |
| 3742 | void limProcessSwitchChannelRsp(tpAniSirGlobal pMac, void *body) |
| 3743 | { |
| 3744 | tpSwitchChannelParams pChnlParams = NULL; |
| 3745 | eHalStatus status; |
| 3746 | tANI_U16 channelChangeReasonCode; |
| 3747 | tANI_U8 peSessionId; |
| 3748 | tpPESession psessionEntry; |
| 3749 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 3750 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 3751 | //the deffered flag. |
| 3752 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3753 | pChnlParams = (tpSwitchChannelParams) body; |
| 3754 | status = pChnlParams->status; |
| 3755 | peSessionId = pChnlParams->peSessionId; |
| 3756 | if((psessionEntry = peFindSessionBySessionId(pMac, peSessionId))== NULL) |
| 3757 | { |
| 3758 | palFreeMemory( pMac->hHdd, (tANI_U8 *)body); |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3759 | limLog(pMac, LOGP, FL("session does not exist for given sessionId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3760 | return; |
| 3761 | } |
| 3762 | #if defined WLAN_FEATURE_VOWIFI |
| 3763 | //HAL fills in the tx power used for mgmt frames in this field. |
| 3764 | //Store this value to use in TPC report IE. |
| 3765 | rrmCacheMgmtTxPower( pMac, pChnlParams->txMgmtPower, psessionEntry ); |
| 3766 | #endif |
| 3767 | palFreeMemory( pMac->hHdd, (tANI_U8 *)body); |
| 3768 | channelChangeReasonCode = psessionEntry->channelChangeReasonCode; |
| 3769 | // initialize it back to invalid id |
| 3770 | psessionEntry->channelChangeReasonCode = 0xBAD; |
| 3771 | switch(channelChangeReasonCode) |
| 3772 | { |
| 3773 | case LIM_SWITCH_CHANNEL_REASSOC: |
| 3774 | limProcessSwitchChannelReAssocReq(pMac, psessionEntry, status); |
| 3775 | break; |
| 3776 | case LIM_SWITCH_CHANNEL_JOIN: |
| 3777 | limProcessSwitchChannelJoinReq(pMac, psessionEntry, status); |
| 3778 | break; |
| 3779 | |
| 3780 | case LIM_SWITCH_CHANNEL_OPERATION: |
| 3781 | /* |
| 3782 | * The above code should also use the callback. |
| 3783 | * mechanism below, there is scope for cleanup here. |
| 3784 | * THat way all this response handler does is call the call back |
| 3785 | * We can get rid of the reason code here. |
| 3786 | */ |
| 3787 | if (pMac->lim.gpchangeChannelCallback) |
| 3788 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3789 | PELOG1(limLog( pMac, LOG1, "Channel changed hence invoke registered call back");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3790 | pMac->lim.gpchangeChannelCallback(pMac, status, pMac->lim.gpchangeChannelData, psessionEntry); |
| 3791 | } |
| 3792 | break; |
| 3793 | default: |
| 3794 | break; |
| 3795 | } |
| 3796 | } |
| 3797 | /** |
| 3798 | * limProcessStartScanRsp() |
| 3799 | * |
| 3800 | *FUNCTION: |
| 3801 | * This function is called to process startScanRsp message from HAL. If scan/learn was successful |
| 3802 | * then it will start scan/learn on the next channel. |
| 3803 | * |
| 3804 | *LOGIC: |
| 3805 | * |
| 3806 | *ASSUMPTIONS: |
| 3807 | * NA |
| 3808 | * |
| 3809 | *NOTE: |
| 3810 | * NA |
| 3811 | * |
| 3812 | * @param pMac - Pointer to Global MAC structure |
| 3813 | * @param body - message body. |
| 3814 | * |
| 3815 | * @return None |
| 3816 | */ |
| 3817 | |
| 3818 | void limProcessStartScanRsp(tpAniSirGlobal pMac, void *body) |
| 3819 | { |
| 3820 | tpStartScanParams pStartScanParam; |
| 3821 | eHalStatus status; |
| 3822 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3823 | pStartScanParam = (tpStartScanParams) body; |
| 3824 | status = pStartScanParam->status; |
| 3825 | #if defined WLAN_FEATURE_VOWIFI |
| 3826 | //HAL fills in the tx power used for mgmt frames in this field. |
| 3827 | //Store this value to use in TPC report IE. |
| 3828 | rrmCacheMgmtTxPower( pMac, pStartScanParam->txMgmtPower, NULL ); |
| 3829 | //Store start TSF of scan start. This will be stored in BSS params. |
| 3830 | rrmUpdateStartTSF( pMac, pStartScanParam->startTSF ); |
| 3831 | #endif |
| 3832 | palFreeMemory( pMac->hHdd, (tANI_U8 *)body); |
| 3833 | if( pMac->lim.abortScan ) |
| 3834 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3835 | limLog( pMac, LOGW, FL(" finish scan") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3836 | pMac->lim.abortScan = 0; |
| 3837 | limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); |
| 3838 | limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); |
| 3839 | //Set the resume channel to Any valid channel (invalid). |
| 3840 | //This will instruct HAL to set it to any previous valid channel. |
| 3841 | peSetResumeChannel(pMac, 0, 0); |
| 3842 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 3843 | } |
| 3844 | switch(pMac->lim.gLimHalScanState) |
| 3845 | { |
| 3846 | case eLIM_HAL_START_SCAN_WAIT_STATE: |
| 3847 | if (status != (tANI_U32) eHAL_STATUS_SUCCESS) |
| 3848 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3849 | PELOGW(limLog(pMac, LOGW, FL("StartScanRsp with failed status= %d"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3850 | // |
| 3851 | // FIXME - With this, LIM will try and recover state, but |
| 3852 | // eWNI_SME_SCAN_CNF maybe reporting an incorrect |
| 3853 | // status back to the SME |
| 3854 | // |
| 3855 | //Set the resume channel to Any valid channel (invalid). |
| 3856 | //This will instruct HAL to set it to any previous valid channel. |
| 3857 | peSetResumeChannel(pMac, 0, 0); |
| 3858 | limSendHalFinishScanReq( pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE ); |
| 3859 | //limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); |
| 3860 | } |
| 3861 | else |
| 3862 | { |
| 3863 | pMac->lim.gLimHalScanState = eLIM_HAL_SCANNING_STATE; |
| 3864 | limContinuePostChannelScan(pMac); |
| 3865 | } |
| 3866 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3867 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3868 | limLog(pMac, LOGW, FL("Rcvd StartScanRsp not in WAIT State, state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3869 | pMac->lim.gLimHalScanState); |
| 3870 | break; |
| 3871 | } |
| 3872 | return; |
| 3873 | } |
| 3874 | void limProcessEndScanRsp(tpAniSirGlobal pMac, void *body) |
| 3875 | { |
| 3876 | tpEndScanParams pEndScanParam; |
| 3877 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3878 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3879 | pEndScanParam = (tpEndScanParams) body; |
| 3880 | status = pEndScanParam->status; |
| 3881 | palFreeMemory( pMac->hHdd, (char *)body); |
| 3882 | switch(pMac->lim.gLimHalScanState) |
| 3883 | { |
| 3884 | case eLIM_HAL_END_SCAN_WAIT_STATE: |
| 3885 | if (status != (tANI_U32) eHAL_STATUS_SUCCESS) |
| 3886 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3887 | PELOGW(limLog(pMac, LOGW, FL("EndScanRsp with failed status= %d"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3888 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 3889 | limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); |
| 3890 | } |
| 3891 | else |
| 3892 | { |
Madan Mohan Koyyalamudi | c5992c9 | 2012-11-15 16:40:57 -0800 | [diff] [blame] | 3893 | pMac->lim.gLimCurrentScanChannelId++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3894 | limContinueChannelScan(pMac); |
| 3895 | } |
| 3896 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3897 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3898 | limLog(pMac, LOGW, FL("Rcvd endScanRsp not in WAIT State, state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3899 | pMac->lim.gLimHalScanState); |
| 3900 | break; |
| 3901 | } |
| 3902 | return; |
| 3903 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3904 | /** |
| 3905 | * limStopTxAndSwitch() |
| 3906 | * |
| 3907 | *FUNCTION: |
| 3908 | * Start channel switch on all sessions that is in channel switch state. |
| 3909 | * |
| 3910 | * @param pMac - pointer to global adapter context |
| 3911 | * |
| 3912 | * @return None |
| 3913 | * |
| 3914 | */ |
| 3915 | static void |
| 3916 | limStopTxAndSwitch (tpAniSirGlobal pMac) |
| 3917 | { |
| 3918 | tANI_U8 i; |
| 3919 | |
| 3920 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 3921 | { |
| 3922 | if(pMac->lim.gpSession[i].valid && |
| 3923 | pMac->lim.gpSession[i].gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) |
| 3924 | { |
| 3925 | limStopTxAndSwitchChannel(pMac, i); |
| 3926 | } |
| 3927 | } |
| 3928 | return; |
| 3929 | } |
| 3930 | /** |
| 3931 | * limStartQuietOnSession() |
| 3932 | * |
| 3933 | *FUNCTION: |
| 3934 | * This function is called to start quiet timer after finish scan if there is |
| 3935 | * qeuieting on any session. |
| 3936 | * |
| 3937 | *LOGIC: |
| 3938 | * |
| 3939 | *ASSUMPTIONS: |
| 3940 | * NA |
| 3941 | * |
| 3942 | *NOTE: |
| 3943 | * NA |
| 3944 | * |
| 3945 | * @param pMac - Pointer to Global MAC structure |
| 3946 | * |
| 3947 | * @return None |
| 3948 | */ |
| 3949 | static void |
| 3950 | limStartQuietOnSession (tpAniSirGlobal pMac) |
| 3951 | { |
| 3952 | tANI_U8 i; |
| 3953 | |
| 3954 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 3955 | { |
| 3956 | if(pMac->lim.gpSession[i].valid && |
| 3957 | pMac->lim.gpSession[i].gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN) |
| 3958 | { |
| 3959 | limStartQuietTimer(pMac, i); |
| 3960 | } |
| 3961 | } |
| 3962 | return; |
| 3963 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3964 | void limProcessFinishScanRsp(tpAniSirGlobal pMac, void *body) |
| 3965 | { |
| 3966 | tpFinishScanParams pFinishScanParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3967 | eHalStatus status; |
| 3968 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3969 | pFinishScanParam = (tpFinishScanParams) body; |
| 3970 | status = pFinishScanParam->status; |
| 3971 | palFreeMemory( pMac->hHdd, (char *)body); |
| 3972 | switch(pMac->lim.gLimHalScanState) |
| 3973 | { |
| 3974 | case eLIM_HAL_FINISH_SCAN_WAIT_STATE: |
| 3975 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 3976 | limCompleteMlmScan(pMac, eSIR_SME_SUCCESS); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3977 | if (limIsChanSwitchRunning(pMac)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3978 | { |
| 3979 | /** Right time to stop tx and start the timer for channel switch */ |
| 3980 | /* Sending Session ID 0, may not be correct, since SCAN is global there should not |
| 3981 | * be any associated session id |
| 3982 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3983 | limStopTxAndSwitch(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3984 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3985 | else if (limIsQuietBegin(pMac)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3986 | { |
| 3987 | /** Start the quieting */ |
| 3988 | /* Sending Session ID 0, may not be correct, since SCAN is global there should not |
| 3989 | * be any associated session id |
| 3990 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3991 | limStartQuietOnSession(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3992 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3993 | if (status != (tANI_U32) eHAL_STATUS_SUCCESS) |
| 3994 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3995 | PELOGW(limLog(pMac, LOGW, FL("EndScanRsp with failed status= %d"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3996 | } |
| 3997 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3998 | //WLAN_SUSPEND_LINK Related |
| 3999 | case eLIM_HAL_RESUME_LINK_WAIT_STATE: |
| 4000 | if( pMac->lim.gpLimResumeCallback ) |
| 4001 | { |
| 4002 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 4003 | pMac->lim.gpLimResumeCallback( pMac, status, pMac->lim.gpLimResumeData ); |
| 4004 | pMac->lim.gpLimResumeCallback = NULL; |
| 4005 | pMac->lim.gpLimResumeData = NULL; |
| 4006 | pMac->lim.gLimSystemInScanLearnMode = 0; |
| 4007 | } |
| 4008 | else |
| 4009 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4010 | limLog( pMac, LOGP, "No Resume link callback set but station is in suspend state"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4011 | return; |
| 4012 | } |
| 4013 | break; |
| 4014 | //end WLAN_SUSPEND_LINK Related |
| 4015 | |
| 4016 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4017 | limLog(pMac, LOGW, FL("Rcvd FinishScanRsp not in WAIT State, state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4018 | pMac->lim.gLimHalScanState); |
| 4019 | break; |
| 4020 | } |
| 4021 | return; |
| 4022 | } |
| 4023 | /** |
| 4024 | * @function : limProcessMlmHalAddBARsp |
| 4025 | * |
| 4026 | * @brief: Process WDA_ADDBA_RSP coming from HAL |
| 4027 | * |
| 4028 | * |
| 4029 | * @param pMac The global tpAniSirGlobal object |
| 4030 | * |
| 4031 | * @param tSirMsgQ The MsgQ header containing the response buffer |
| 4032 | * |
| 4033 | * @return none |
| 4034 | */ |
| 4035 | void limProcessMlmHalAddBARsp( tpAniSirGlobal pMac, |
| 4036 | tpSirMsgQ limMsgQ ) |
| 4037 | { |
| 4038 | // Send LIM_MLM_ADDBA_CNF to LIM |
| 4039 | tpLimMlmAddBACnf pMlmAddBACnf; |
| 4040 | tpPESession psessionEntry; |
| 4041 | tpAddBAParams pAddBAParams = (tpAddBAParams) limMsgQ->bodyptr; |
| 4042 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 4043 | limDiagEventReport(pMac, WLAN_PE_DIAG_HAL_ADDBA_RSP_EVENT, psessionEntry, 0, 0); |
| 4044 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 4045 | //now LIM can process any defer message. |
| 4046 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 4047 | if (pAddBAParams == NULL) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4048 | PELOGE(limLog(pMac, LOGE,FL("NULL ADD BA Response from HAL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4049 | return; |
| 4050 | } |
| 4051 | if((psessionEntry = peFindSessionBySessionId(pMac, pAddBAParams->sessionId))==NULL) |
| 4052 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4053 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionID: %d"),pAddBAParams->sessionId );) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4054 | palFreeMemory(pMac->hHdd, (void*)limMsgQ->bodyptr); |
| 4055 | return; |
| 4056 | } |
| 4057 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 4058 | limDiagEventReport(pMac, WLAN_PE_DIAG_HAL_ADDBA_RSP_EVENT, psessionEntry, 0, 0); |
| 4059 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 4060 | |
| 4061 | // Allocate for LIM_MLM_ADDBA_CNF |
| 4062 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, |
| 4063 | (void **) &pMlmAddBACnf, sizeof( tLimMlmAddBACnf ))) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4064 | limLog( pMac, LOGP, FL(" palAllocateMemory failed with error code %d")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4065 | palFreeMemory(pMac->hHdd, (void*)limMsgQ->bodyptr); |
| 4066 | return; |
| 4067 | } |
| 4068 | palZeroMemory( pMac->hHdd, (void *) pMlmAddBACnf, sizeof( tLimMlmAddBACnf )); |
| 4069 | // Copy the peer MAC |
| 4070 | palCopyMemory( pMac->hHdd, pMlmAddBACnf->peerMacAddr, pAddBAParams->peerMacAddr, |
| 4071 | sizeof( tSirMacAddr )); |
| 4072 | // Copy other ADDBA Rsp parameters |
| 4073 | pMlmAddBACnf->baDialogToken = pAddBAParams->baDialogToken; |
| 4074 | pMlmAddBACnf->baTID = pAddBAParams->baTID; |
| 4075 | pMlmAddBACnf->baPolicy = pAddBAParams->baPolicy; |
| 4076 | pMlmAddBACnf->baBufferSize = pAddBAParams->baBufferSize; |
| 4077 | pMlmAddBACnf->baTimeout = pAddBAParams->baTimeout; |
| 4078 | pMlmAddBACnf->baDirection = pAddBAParams->baDirection; |
| 4079 | pMlmAddBACnf->sessionId = psessionEntry->peSessionId; |
| 4080 | if(eHAL_STATUS_SUCCESS == pAddBAParams->status) |
| 4081 | pMlmAddBACnf->addBAResultCode = eSIR_MAC_SUCCESS_STATUS; |
| 4082 | else |
| 4083 | pMlmAddBACnf->addBAResultCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 4084 | palFreeMemory(pMac->hHdd, (void*)limMsgQ->bodyptr); |
| 4085 | // Send ADDBA CNF to LIM |
| 4086 | limPostSmeMessage( pMac, LIM_MLM_ADDBA_CNF, (tANI_U32 *) pMlmAddBACnf ); |
| 4087 | } |
| 4088 | /** |
| 4089 | * \brief Process LIM_MLM_ADDBA_CNF |
| 4090 | * |
| 4091 | * \sa limProcessMlmAddBACnf |
| 4092 | * |
| 4093 | * \param pMac The global tpAniSirGlobal object |
| 4094 | * |
| 4095 | * \param tSirMsgQ The MsgQ header containing the response buffer |
| 4096 | * |
| 4097 | * \return none |
| 4098 | */ |
| 4099 | void limProcessMlmAddBACnf( tpAniSirGlobal pMac, |
| 4100 | tANI_U32 *pMsgBuf ) |
| 4101 | { |
| 4102 | tpLimMlmAddBACnf pMlmAddBACnf; |
| 4103 | tpDphHashNode pSta; |
| 4104 | tANI_U16 aid; |
| 4105 | tLimBAState curBaState; |
| 4106 | tpPESession psessionEntry = NULL; |
| 4107 | if(pMsgBuf == NULL) |
| 4108 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4109 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4110 | return; |
| 4111 | } |
| 4112 | pMlmAddBACnf = (tpLimMlmAddBACnf) pMsgBuf; |
| 4113 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmAddBACnf->sessionId))== NULL) |
| 4114 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4115 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4116 | palFreeMemory( pMac->hHdd, (void *) pMsgBuf ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4117 | return; |
| 4118 | } |
| 4119 | // First, extract the DPH entry |
| 4120 | pSta = dphLookupHashEntry( pMac, pMlmAddBACnf->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 4121 | if( NULL == pSta ) |
| 4122 | { |
| 4123 | PELOGE(limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4124 | FL( "STA context not found - ignoring ADDBA CNF from HAL" ));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4125 | palFreeMemory( pMac->hHdd, (void *) pMsgBuf ); |
| 4126 | return; |
| 4127 | } |
| 4128 | LIM_GET_STA_BA_STATE(pSta, pMlmAddBACnf->baTID, &curBaState); |
| 4129 | // Need to validate SME state |
| 4130 | if( eLIM_BA_STATE_WT_ADD_RSP != curBaState) |
| 4131 | { |
| 4132 | PELOGE(limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4133 | FL( "Received unexpected ADDBA CNF when STA BA state is %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4134 | curBaState );) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4135 | palFreeMemory( pMac->hHdd, (void *) pMsgBuf ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4136 | return; |
| 4137 | } |
| 4138 | // Restore STA BA state |
| 4139 | LIM_SET_STA_BA_STATE(pSta, pMlmAddBACnf->baTID, eLIM_BA_STATE_IDLE); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 4140 | if( eSIR_MAC_SUCCESS_STATUS == pMlmAddBACnf->addBAResultCode ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4141 | { |
| 4142 | // Update LIM internal cache... |
| 4143 | if( eBA_RECIPIENT == pMlmAddBACnf->baDirection ) |
| 4144 | { |
| 4145 | pSta->tcCfg[pMlmAddBACnf->baTID].fUseBARx = 1; |
| 4146 | pSta->tcCfg[pMlmAddBACnf->baTID].fRxCompBA = 1; |
| 4147 | pSta->tcCfg[pMlmAddBACnf->baTID].fRxBApolicy = pMlmAddBACnf->baPolicy; |
| 4148 | pSta->tcCfg[pMlmAddBACnf->baTID].rxBufSize = pMlmAddBACnf->baBufferSize; |
| 4149 | pSta->tcCfg[pMlmAddBACnf->baTID].tuRxBAWaitTimeout = pMlmAddBACnf->baTimeout; |
Shailender Karmuchi | 2a74d4c | 2013-03-24 23:25:27 -0700 | [diff] [blame] | 4150 | // Package LIM_MLM_ADDBA_RSP to MLME, with proper |
| 4151 | // status code. MLME will then send an ADDBA RSP |
| 4152 | // over the air to the peer MAC entity |
| 4153 | if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac, |
| 4154 | pMlmAddBACnf->peerMacAddr, |
| 4155 | pMlmAddBACnf->addBAResultCode, |
| 4156 | pMlmAddBACnf->baDialogToken, |
| 4157 | (tANI_U8) pMlmAddBACnf->baTID, |
| 4158 | (tANI_U8) pMlmAddBACnf->baPolicy, |
| 4159 | pMlmAddBACnf->baBufferSize, |
| 4160 | pMlmAddBACnf->baTimeout,psessionEntry)) |
| 4161 | { |
| 4162 | PELOGW(limLog( pMac, LOGW, |
| 4163 | FL( "Failed to post LIM_MLM_ADDBA_RSP to " )); |
| 4164 | limPrintMacAddr( pMac, pMlmAddBACnf->peerMacAddr, LOGW );) |
| 4165 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4166 | } |
| 4167 | else |
| 4168 | { |
| 4169 | pSta->tcCfg[pMlmAddBACnf->baTID].fUseBATx = 1; |
| 4170 | pSta->tcCfg[pMlmAddBACnf->baTID].fTxCompBA = 1; |
| 4171 | pSta->tcCfg[pMlmAddBACnf->baTID].fTxBApolicy = pMlmAddBACnf->baPolicy; |
| 4172 | pSta->tcCfg[pMlmAddBACnf->baTID].txBufSize = pMlmAddBACnf->baBufferSize; |
| 4173 | pSta->tcCfg[pMlmAddBACnf->baTID].tuTxBAWaitTimeout = pMlmAddBACnf->baTimeout; |
| 4174 | } |
| 4175 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4176 | // Free the memory allocated for LIM_MLM_ADDBA_CNF |
| 4177 | palFreeMemory( pMac->hHdd, (void *) pMsgBuf ); |
| 4178 | } |
| 4179 | /** |
| 4180 | * \brief Process LIM_MLM_DELBA_CNF |
| 4181 | * |
| 4182 | * \sa limProcessMlmDelBACnf |
| 4183 | * |
| 4184 | * \param pMac The global tpAniSirGlobal object |
| 4185 | * |
| 4186 | * \param tSirMsgQ The MsgQ header containing the response buffer |
| 4187 | * |
| 4188 | * \return none |
| 4189 | */ |
| 4190 | void limProcessMlmDelBACnf( tpAniSirGlobal pMac, |
| 4191 | tANI_U32 *pMsgBuf ) |
| 4192 | { |
| 4193 | tpLimMlmDelBACnf pMlmDelBACnf; |
| 4194 | tpDphHashNode pSta; |
| 4195 | tANI_U16 aid; |
| 4196 | // tANI_U8 sessionId; |
| 4197 | tLimBAState curBaState; |
| 4198 | tpPESession psessionEntry; |
| 4199 | |
| 4200 | if(pMsgBuf == NULL) |
| 4201 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4202 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4203 | return; |
| 4204 | } |
| 4205 | pMlmDelBACnf = (tpLimMlmDelBACnf) pMsgBuf; |
| 4206 | if((psessionEntry = peFindSessionBySessionId(pMac, pMlmDelBACnf->sessionId))== NULL) |
| 4207 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4208 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4209 | palFreeMemory( pMac->hHdd, (void *) pMsgBuf ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4210 | return; |
| 4211 | } |
| 4212 | // First, extract the DPH entry |
| 4213 | pSta = dphLookupHashEntry( pMac, pMlmDelBACnf->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable ); |
| 4214 | if( NULL == pSta ) |
| 4215 | { |
| 4216 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4217 | FL( "STA context not found - ignoring DELBA CNF from HAL" )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4218 | palFreeMemory( pMac->hHdd, (void *) pMsgBuf ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4219 | return; |
| 4220 | } |
| 4221 | if(NULL == pMlmDelBACnf) |
| 4222 | { |
| 4223 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4224 | FL( "pMlmDelBACnf is NULL - ignoring DELBA CNF from HAL" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4225 | return; |
| 4226 | } |
| 4227 | // Need to validate baState |
| 4228 | LIM_GET_STA_BA_STATE(pSta, pMlmDelBACnf->baTID, &curBaState); |
| 4229 | if( eLIM_BA_STATE_WT_DEL_RSP != curBaState ) |
| 4230 | { |
| 4231 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4232 | FL( "Received unexpected DELBA CNF when STA BA state is %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4233 | curBaState ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4234 | palFreeMemory( pMac->hHdd, (void *) pMsgBuf ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4235 | return; |
| 4236 | } |
| 4237 | // Restore STA BA state |
| 4238 | LIM_SET_STA_BA_STATE(pSta, pMlmDelBACnf->baTID, eLIM_BA_STATE_IDLE); |
| 4239 | // Free the memory allocated for LIM_MLM_DELBA_CNF |
| 4240 | palFreeMemory( pMac->hHdd, (void *) pMsgBuf ); |
| 4241 | } |
| 4242 | /** |
| 4243 | * \brief Process SIR_LIM_DEL_BA_IND |
| 4244 | * |
| 4245 | * \sa limProcessMlmHalBADeleteInd |
| 4246 | * |
| 4247 | * \param pMac The global tpAniSirGlobal object |
| 4248 | * |
| 4249 | * \param tSirMsgQ The MsgQ header containing the indication buffer |
| 4250 | * |
| 4251 | * \return none |
| 4252 | */ |
| 4253 | void limProcessMlmHalBADeleteInd( tpAniSirGlobal pMac, |
| 4254 | tpSirMsgQ limMsgQ ) |
| 4255 | { |
| 4256 | tSirRetStatus status = eSIR_SUCCESS; |
| 4257 | tpBADeleteParams pBADeleteParams; |
| 4258 | tpDphHashNode pSta; |
| 4259 | tANI_U16 aid; |
| 4260 | tLimBAState curBaState; |
| 4261 | tpPESession psessionEntry; |
| 4262 | tANI_U8 sessionId; |
| 4263 | |
| 4264 | pBADeleteParams = (tpBADeleteParams) limMsgQ->bodyptr; |
| 4265 | |
| 4266 | if((psessionEntry = peFindSessionByBssid(pMac,pBADeleteParams->bssId,&sessionId))== NULL) |
| 4267 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4268 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4269 | palFreeMemory( pMac->hHdd, (void *) limMsgQ->bodyptr ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4270 | return; |
| 4271 | } |
| 4272 | // First, extract the DPH entry |
| 4273 | pSta = dphLookupHashEntry( pMac, pBADeleteParams->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable ); |
| 4274 | if( NULL == pSta ) |
| 4275 | { |
| 4276 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4277 | FL( "STA context not found - ignoring BA Delete IND from HAL" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4278 | goto returnAfterCleanup; |
| 4279 | } |
| 4280 | |
| 4281 | // Need to validate BA state |
| 4282 | LIM_GET_STA_BA_STATE(pSta, pBADeleteParams->baTID, &curBaState); |
| 4283 | if( eLIM_BA_STATE_IDLE != curBaState ) |
| 4284 | { |
| 4285 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4286 | FL( "Received unexpected BA Delete IND when STA BA state is %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4287 | curBaState ); |
| 4288 | goto returnAfterCleanup; |
| 4289 | } |
| 4290 | |
| 4291 | // Validate if a BA is active for the requested TID |
| 4292 | // AND in that desired direction |
| 4293 | if( eBA_INITIATOR == pBADeleteParams->baDirection ) |
| 4294 | { |
| 4295 | if( 0 == pSta->tcCfg[pBADeleteParams->baTID].fUseBATx ) |
| 4296 | status = eSIR_FAILURE; |
| 4297 | } |
| 4298 | else |
| 4299 | { |
| 4300 | if( 0 == pSta->tcCfg[pBADeleteParams->baTID].fUseBARx ) |
| 4301 | status = eSIR_FAILURE; |
| 4302 | } |
| 4303 | if( eSIR_FAILURE == status ) |
| 4304 | { |
| 4305 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4306 | FL("Received an INVALID DELBA Delete Ind for TID %d..."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4307 | pBADeleteParams->baTID ); |
| 4308 | } |
| 4309 | else |
| 4310 | { |
| 4311 | // Post DELBA REQ to MLME... |
| 4312 | if( eSIR_SUCCESS != |
| 4313 | (status = limPostMlmDelBAReq( pMac, |
| 4314 | pSta, |
| 4315 | pBADeleteParams->baDirection, |
| 4316 | pBADeleteParams->baTID, |
| 4317 | eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry ))) |
| 4318 | { |
| 4319 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4320 | FL( "Attempt to post LIM_MLM_DELBA_REQ failed with status %d" ), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4321 | } |
| 4322 | else |
| 4323 | { |
| 4324 | limLog( pMac, LOGE, |
| 4325 | FL( "BA Delete - Reason 0x%08x. Attempting to delete BA session for TID %d with peer STA " ), |
| 4326 | pBADeleteParams->reasonCode, pBADeleteParams->baTID ); |
| 4327 | limPrintMacAddr( pMac, pSta->staAddr, LOGE ); |
| 4328 | } |
| 4329 | } |
| 4330 | returnAfterCleanup: |
| 4331 | // Free the memory allocated for SIR_LIM_DEL_BA_IND |
| 4332 | palFreeMemory( pMac->hHdd, (void *) limMsgQ->bodyptr ); |
| 4333 | } |
| 4334 | /** |
| 4335 | * @function : limProcessSetMimoRsp() |
| 4336 | * |
| 4337 | * @brief : This function is called upon receiving the WDA_SET_MIMOPS_RSP from the HAL |
| 4338 | * after Processing the Req from the SME (PMC) |
| 4339 | * |
| 4340 | * LOGIC: |
| 4341 | * |
| 4342 | * ASSUMPTIONS: |
| 4343 | * NA |
| 4344 | * |
| 4345 | * NOTE: |
| 4346 | * NA |
| 4347 | * |
| 4348 | * @param pMac - Pointer to Global MAC structure |
| 4349 | * @param limMsg - Lim Message structure object with the MimoPSparam in body |
| 4350 | * @return None |
| 4351 | */ |
| 4352 | |
| 4353 | void |
| 4354 | limProcessSetMimoRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 4355 | { |
| 4356 | #if 0 |
| 4357 | tSirRetStatus retStatus; |
| 4358 | tpSetMIMOPS pMIMO_PSParams; |
| 4359 | |
| 4360 | |
| 4361 | do { |
| 4362 | |
| 4363 | pMIMO_PSParams = (tpSetMIMOPS)limMsg->bodyptr; |
| 4364 | if( NULL == pMIMO_PSParams ) { |
| 4365 | PELOGE(limLog(pMac, LOGE, "Received the WDA_SET_MIMOPS_RSP with NULL as the PS param");) |
| 4366 | return; |
| 4367 | } |
| 4368 | |
| 4369 | /** If Updation of the HAL Fail's*/ |
| 4370 | if (pMIMO_PSParams->status != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4371 | limLog(pMac, LOGP, FL("Update HAL / SW Mac for MIMO State has Failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4372 | break; |
| 4373 | } |
| 4374 | |
| 4375 | if ((pMac->lim.gLimSystemRole != eSYSTEM_STA_ROLE) || |
| 4376 | (pMac->lim.gLimSmeState != eLIM_SME_LINK_EST_STATE) ) |
| 4377 | break; |
| 4378 | |
| 4379 | pMac->lim.gLimMlmState = pMac->lim.gLimPrevMlmState; |
| 4380 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, 0, pMac->lim.gLimMlmState)); |
| 4381 | |
| 4382 | /** In the Case of Exiting out of the Powersave (changing from Dynamic/Static mode to SM Enabled) |
| 4383 | * send the action Frame to Peer to update the PS State of the STA , for the case of Entering PowerSave |
| 4384 | * the Action Frame is being sent at first before setting the internal structures |
| 4385 | */ |
| 4386 | if (!isEnteringMimoPS(pMac->lim.gHTMIMOPSState, pMIMO_PSParams->htMIMOPSState)) { |
| 4387 | tSirMacAddr macAddr; |
| 4388 | |
| 4389 | /** Obtain the AP's Mac Address */ |
| 4390 | palCopyMemory(pMac -> hHdd, (tANI_U8 *)macAddr, pMac->lim.gLimBssid, sizeof(tSirMacAddr)); |
| 4391 | |
| 4392 | /** Send Action Frame with the corresponding mode */ |
| 4393 | retStatus = limSendSMPowerStateFrame(pMac, macAddr, pMIMO_PSParams->htMIMOPSState); |
| 4394 | if (retStatus != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4395 | PELOGE(limLog(pMac, LOGE, FL("Sending Action Frame has failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4396 | break; |
| 4397 | } |
| 4398 | } |
| 4399 | PELOG1(limLog(pMac, LOG1, FL("The Setting up of LimGlobals is successful for MIMOPS"));) |
| 4400 | }while(0); |
| 4401 | |
| 4402 | palFreeMemory( pMac->hHdd, (void *) pMIMO_PSParams ); |
| 4403 | #endif |
| 4404 | } |
| 4405 | /** |
| 4406 | * @function : limHandleDelBssInReAssocContext |
| 4407 | * @brief : While Processing the ReAssociation Response Frame in STA, |
| 4408 | * a. immediately after receiving the Reassoc Response the RxCleanUp is |
| 4409 | * being issued and the end of DelBSS the new BSS is being added. |
| 4410 | * |
| 4411 | * b .If an AP rejects the ReAssociation (Disassoc / Deauth) with some context |
| 4412 | * change, We need to update CSR with ReAssocCNF Response with the |
| 4413 | * ReAssoc Fail and the reason Code, that is also being handled in the DELBSS |
| 4414 | * context only |
| 4415 | * |
| 4416 | * @param : pMac - tpAniSirGlobal |
| 4417 | * pStaDs - Station Descriptor |
| 4418 | * |
| 4419 | * @return : none |
| 4420 | */ |
| 4421 | static void |
| 4422 | limHandleDelBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionEntry) |
| 4423 | { |
| 4424 | tLimMlmReassocCnf mlmReassocCnf; |
| 4425 | /** Skipped the DeleteDPH Hash Entry as we need it for the new BSS*/ |
| 4426 | /** Set the MlmState to IDLE*/ |
| 4427 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4428 | /* Update PE session Id*/ |
| 4429 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 4430 | switch (psessionEntry->limMlmState) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4431 | case eLIM_SME_WT_REASSOC_STATE : |
| 4432 | { |
| 4433 | tpSirAssocRsp assocRsp; |
| 4434 | tpDphHashNode pStaDs; |
| 4435 | tSirRetStatus retStatus = eSIR_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4436 | tSchBeaconStruct beaconStruct; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4437 | /** Delete the older STA Table entry */ |
| 4438 | limDeleteDphHashEntry(pMac, psessionEntry->bssId, DPH_STA_HASH_INDEX_PEER, psessionEntry); |
| 4439 | /** |
| 4440 | * Add an entry for AP to hash table |
| 4441 | * maintained by DPH module |
| 4442 | */ |
| 4443 | if ((pStaDs = dphAddHashEntry(pMac, psessionEntry->limReAssocbssId, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable)) == NULL) |
| 4444 | { |
| 4445 | // Could not add hash table entry |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4446 | PELOGE(limLog(pMac, LOGE, FL("could not add hash entry at DPH for "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4447 | limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE); |
| 4448 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4449 | mlmReassocCnf.protStatusCode = eSIR_SME_SUCCESS; |
| 4450 | goto Error; |
| 4451 | } |
| 4452 | /** While Processing the ReAssoc Response Frame the ReAssocRsp Frame |
| 4453 | * is being stored to be used here for sending ADDBSS |
| 4454 | */ |
| 4455 | assocRsp = (tpSirAssocRsp)psessionEntry->limAssocResponseData; |
| 4456 | limUpdateAssocStaDatas(pMac, pStaDs, assocRsp,psessionEntry); |
| 4457 | limUpdateReAssocGlobals(pMac, assocRsp,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4458 | limExtractApCapabilities( pMac, |
| 4459 | (tANI_U8 *) psessionEntry->pLimReAssocReq->bssDescription.ieFields, |
| 4460 | limGetIElenFromBssDescription( &psessionEntry->pLimReAssocReq->bssDescription ), |
| 4461 | &beaconStruct ); |
| 4462 | if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
| 4463 | limDecideStaProtectionOnAssoc(pMac, &beaconStruct, psessionEntry); |
| 4464 | if(beaconStruct.erpPresent) { |
| 4465 | if (beaconStruct.erpIEInfo.barkerPreambleMode) |
| 4466 | psessionEntry->beaconParams.fShortPreamble = 0; |
| 4467 | else |
| 4468 | psessionEntry->beaconParams.fShortPreamble = 1; |
| 4469 | } |
| 4470 | //updateBss flag is false, as in this case, PE is first deleting the existing BSS and then adding a new one. |
| 4471 | if (eSIR_SUCCESS != limStaSendAddBss( pMac, assocRsp, &beaconStruct, |
| 4472 | &psessionEntry->pLimReAssocReq->bssDescription, false, psessionEntry)) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4473 | limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4474 | retStatus = eSIR_FAILURE; |
| 4475 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4476 | if (retStatus != eSIR_SUCCESS) |
| 4477 | { |
| 4478 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4479 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 4480 | palFreeMemory(pMac->hHdd, assocRsp); |
| 4481 | pMac->lim.gLimAssocResponseData = NULL; |
| 4482 | goto Error; |
| 4483 | } |
| 4484 | palFreeMemory(pMac->hHdd, assocRsp); |
| 4485 | psessionEntry->limAssocResponseData = NULL; |
| 4486 | } |
| 4487 | break; |
| 4488 | case eLIM_SME_WT_REASSOC_LINK_FAIL_STATE: |
| 4489 | { |
| 4490 | /** Case wherein the DisAssoc / Deauth |
| 4491 | * being sent as response to ReAssoc Req*/ |
| 4492 | /** Send the Reason code as the same received in Disassoc / Deauth Frame*/ |
| 4493 | mlmReassocCnf.resultCode = pStaDs->mlmStaContext.disassocReason; |
| 4494 | mlmReassocCnf.protStatusCode = pStaDs->mlmStaContext.cleanupTrigger; |
| 4495 | /** Set the SME State back to WT_Reassoc State*/ |
| 4496 | psessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4497 | limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId,psessionEntry); |
| 4498 | if((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| |
| 4499 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 4500 | { |
| 4501 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4502 | } |
| 4503 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 4504 | } |
| 4505 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4506 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4507 | PELOGE(limLog(pMac, LOGE, FL("DelBss is being invoked in the wrong system Role /unhandled SME State"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4508 | mlmReassocCnf.resultCode = eSIR_SME_REFUSED; |
| 4509 | mlmReassocCnf.protStatusCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 4510 | goto Error; |
| 4511 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4512 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4513 | Error: |
| 4514 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 4515 | } |
| 4516 | |
| 4517 | /* Added For BT -AMP Support */ |
| 4518 | static void |
| 4519 | limProcessBtampAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession psessionEntry) |
| 4520 | { |
| 4521 | tLimMlmStartCnf mlmStartCnf; |
| 4522 | tANI_U32 val; |
| 4523 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 4524 | |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 4525 | if (NULL == pAddBssParams) |
| 4526 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4527 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 4528 | goto end; |
| 4529 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4530 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 4531 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4532 | limLog(pMac, LOG2, FL("WDA_ADD_BSS_RSP returned with eHAL_STATUS_SUCCESS")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4533 | if (psessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 4534 | { |
| 4535 | if (limSetLinkState(pMac, eSIR_LINK_BTAMP_AP_STATE, psessionEntry->bssId, |
| 4536 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 4537 | goto end; |
| 4538 | } else if (psessionEntry->bssType == eSIR_BTAMP_STA_MODE) { |
| 4539 | if (limSetLinkState(pMac, eSIR_LINK_SCAN_STATE, psessionEntry->bssId, |
| 4540 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 4541 | goto end; |
| 4542 | } |
| 4543 | |
| 4544 | // Set MLME state |
| 4545 | psessionEntry->limMlmState= eLIM_MLM_BSS_STARTED_STATE; |
| 4546 | psessionEntry->statypeForBss = STA_ENTRY_SELF; // to know session started for peer or for self |
| 4547 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 4548 | schEdcaProfileUpdate(pMac, psessionEntry); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 4549 | limInitPeerIdxpool(pMac,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4550 | // Create timers used by LIM |
| 4551 | if (!pMac->lim.gLimTimersCreated) |
| 4552 | limCreateTimers(pMac); |
| 4553 | /* Update the lim global gLimTriggerBackgroundScanDuringQuietBss */ |
| 4554 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_TRIG_STA_BK_SCAN, &val )) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4555 | limLog( pMac, LOGP, FL("Failed to get WNI_CFG_TRIG_STA_BK_SCAN!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4556 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = (val) ? 1 : 0; |
| 4557 | // Apply previously set configuration at HW |
| 4558 | limApplyConfiguration(pMac,psessionEntry); |
| 4559 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 4560 | mlmStartCnf.resultCode = eSIR_SME_SUCCESS; |
| 4561 | } |
| 4562 | else |
| 4563 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4564 | limLog( pMac, LOGE, FL( "WDA_ADD_BSS_REQ failed with status %d" ),pAddBssParams->status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4565 | mlmStartCnf.resultCode = eSIR_SME_HAL_SEND_MESSAGE_FAIL; |
| 4566 | } |
| 4567 | mlmStartCnf.sessionId = psessionEntry->peSessionId; |
| 4568 | limPostSmeMessage( pMac, LIM_MLM_START_CNF, (tANI_U32 *) &mlmStartCnf ); |
| 4569 | end: |
| 4570 | if( 0 != limMsgQ->bodyptr ) |
| 4571 | palFreeMemory( pMac->hHdd, (void *) pAddBssParams ); |
| 4572 | } |
| 4573 | |
| 4574 | /** |
| 4575 | * @function : limHandleAddBssInReAssocContext |
| 4576 | * @brief : While Processing the ReAssociation Response Frame in STA, |
| 4577 | * a. immediately after receiving the Reassoc Response the RxCleanUp is |
| 4578 | * being issued and the end of DelBSS the new BSS is being added. |
| 4579 | * |
| 4580 | * b .If an AP rejects the ReAssociation (Disassoc / Deauth) with some context |
| 4581 | * change, We need to update CSR with ReAssocCNF Response with the |
| 4582 | * ReAssoc Fail and the reason Code, that is also being handled in the DELBSS |
| 4583 | * context only |
| 4584 | * |
| 4585 | * @param : pMac - tpAniSirGlobal |
| 4586 | * pStaDs - Station Descriptor |
| 4587 | * |
| 4588 | * @return : none |
| 4589 | */ |
| 4590 | void |
| 4591 | limHandleAddBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry) |
| 4592 | { |
| 4593 | tLimMlmReassocCnf mlmReassocCnf; |
| 4594 | /** Skipped the DeleteDPH Hash Entry as we need it for the new BSS*/ |
| 4595 | /** Set the MlmState to IDLE*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4596 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
| 4597 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4598 | switch (psessionEntry->limSmeState) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4599 | case eLIM_SME_WT_REASSOC_STATE : { |
| 4600 | tpSirAssocRsp assocRsp; |
| 4601 | tpDphHashNode pStaDs; |
| 4602 | tSirRetStatus retStatus = eSIR_SUCCESS; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 4603 | tSchBeaconStruct *pBeaconStruct; |
| 4604 | if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd, |
| 4605 | (void **)&pBeaconStruct, sizeof(tSchBeaconStruct))) |
| 4606 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4607 | limLog(pMac, LOGE, FL("Unable to PAL allocate memory in limHandleAddBssInReAssocContext") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 4608 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4609 | mlmReassocCnf.protStatusCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4610 | goto Error; |
| 4611 | } |
| 4612 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4613 | // Get the AP entry from DPH hash table |
| 4614 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 4615 | if (pStaDs == NULL ) |
| 4616 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4617 | PELOGE(limLog(pMac, LOGE, FL("Fail to get STA PEER entry from hash"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4618 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4619 | mlmReassocCnf.protStatusCode = eSIR_SME_SUCCESS; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 4620 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4621 | goto Error; |
| 4622 | } |
| 4623 | /** While Processing the ReAssoc Response Frame the ReAssocRsp Frame |
| 4624 | * is being stored to be used here for sending ADDBSS |
| 4625 | */ |
| 4626 | assocRsp = (tpSirAssocRsp)psessionEntry->limAssocResponseData; |
| 4627 | limUpdateAssocStaDatas(pMac, pStaDs, assocRsp, psessionEntry); |
| 4628 | limUpdateReAssocGlobals(pMac, assocRsp, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4629 | limExtractApCapabilities( pMac, |
| 4630 | (tANI_U8 *) psessionEntry->pLimReAssocReq->bssDescription.ieFields, |
| 4631 | limGetIElenFromBssDescription( &psessionEntry->pLimReAssocReq->bssDescription ), |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 4632 | pBeaconStruct ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4633 | if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 4634 | limDecideStaProtectionOnAssoc(pMac, pBeaconStruct, psessionEntry); |
| 4635 | |
| 4636 | if(pBeaconStruct->erpPresent) |
| 4637 | { |
| 4638 | if (pBeaconStruct->erpIEInfo.barkerPreambleMode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4639 | psessionEntry->beaconParams.fShortPreamble = 0; |
| 4640 | else |
| 4641 | psessionEntry->beaconParams.fShortPreamble = 1; |
| 4642 | } |
| 4643 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 4644 | if (eSIR_SUCCESS != limStaSendAddBss( pMac, assocRsp, pBeaconStruct, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4645 | &psessionEntry->pLimReAssocReq->bssDescription, true, psessionEntry)) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4646 | limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4647 | retStatus = eSIR_FAILURE; |
| 4648 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4649 | if (retStatus != eSIR_SUCCESS) |
| 4650 | { |
| 4651 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4652 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 4653 | palFreeMemory(pMac->hHdd, assocRsp); |
| 4654 | pMac->lim.gLimAssocResponseData = NULL; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 4655 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4656 | goto Error; |
| 4657 | } |
| 4658 | palFreeMemory(pMac->hHdd, assocRsp); |
| 4659 | psessionEntry->limAssocResponseData = NULL; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 4660 | palFreeMemory(pMac->hHdd, pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4661 | } |
| 4662 | break; |
| 4663 | case eLIM_SME_WT_REASSOC_LINK_FAIL_STATE: { /** Case wherein the DisAssoc / Deauth |
| 4664 | * being sent as response to ReAssoc Req*/ |
| 4665 | /** Send the Reason code as the same received in Disassoc / Deauth Frame*/ |
| 4666 | mlmReassocCnf.resultCode = pStaDs->mlmStaContext.disassocReason; |
| 4667 | mlmReassocCnf.protStatusCode = pStaDs->mlmStaContext.cleanupTrigger; |
| 4668 | /** Set the SME State back to WT_Reassoc State*/ |
| 4669 | psessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
| 4670 | limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, psessionEntry); |
| 4671 | if(psessionEntry->limSystemRole == eLIM_STA_ROLE) |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 4672 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4673 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 4674 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
| 4675 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4676 | |
| 4677 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 4678 | } |
| 4679 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4680 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4681 | PELOGE(limLog(pMac, LOGE, FL("DelBss is being invoked in the wrong system Role /unhandled SME State"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4682 | mlmReassocCnf.resultCode = eSIR_SME_REFUSED; |
| 4683 | mlmReassocCnf.protStatusCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 4684 | goto Error; |
| 4685 | } |
| 4686 | return; |
| 4687 | Error: |
| 4688 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 4689 | } |
| 4690 | |
| 4691 | #if 0 |
| 4692 | static void |
| 4693 | limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf) |
| 4694 | { |
| 4695 | tSirSmeAssocCnf assocCnf; |
| 4696 | tpDphHashNode pStaDs; |
| 4697 | tpPESession psessionEntry; |
| 4698 | tANI_U8 sessionId; |
| 4699 | |
| 4700 | if(pMsgBuf == NULL) |
| 4701 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4702 | limLog(pMac, LOGE, FL("pMsgBuf is NULL ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4703 | goto end; |
| 4704 | } |
| 4705 | if ((limAssocCnfSerDes(pMac, &assocCnf, (tANI_U8 *) pMsgBuf) == eSIR_FAILURE) || |
| 4706 | !__limIsSmeAssocCnfValid(&assocCnf)) |
| 4707 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4708 | limLog(pMac, LOGE, FL("Received invalid SME_RE(ASSOC)_CNF message ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4709 | goto end; |
| 4710 | } |
| 4711 | if((psessionEntry = peFindSessionByBssid(pMac, assocCnf.bssId, &sessionId))== NULL) |
| 4712 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4713 | limLog(pMac, LOGE, FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4714 | goto end; |
| 4715 | } |
| 4716 | if ( ((psessionEntry->limSystemRole != eLIM_AP_ROLE) && (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) || |
| 4717 | ((psessionEntry->limSmeState != eLIM_SME_NORMAL_STATE) && (psessionEntry->limSmeState != eLIM_SME_NORMAL_CHANNEL_SCAN_STATE))) |
| 4718 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4719 | limLog(pMac, LOGE, FL("Received unexpected message %X in state %X, in role %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4720 | msgType, psessionEntry->limSmeState , psessionEntry->limSystemRole); |
| 4721 | goto end; |
| 4722 | } |
| 4723 | pStaDs = dphGetHashEntry(pMac, assocCnf.aid, &psessionEntry->dph.dphHashTable); |
| 4724 | if (pStaDs == NULL) |
| 4725 | { |
| 4726 | limLog(pMac, LOG1, |
| 4727 | FL("Received invalid message %X due to no STA context, for aid %d, peer "), |
| 4728 | msgType, assocCnf.aid); |
| 4729 | limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1); |
| 4730 | /* |
| 4731 | ** send a DISASSOC_IND message to WSM to make sure |
| 4732 | ** the state in WSM and LIM is the same |
| 4733 | **/ |
| 4734 | limSendSmeDisassocNtf( pMac, assocCnf.peerMacAddr, eSIR_SME_STA_NOT_ASSOCIATED, |
| 4735 | eLIM_PEER_ENTITY_DISASSOC, assocCnf.aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 4736 | goto end; |
| 4737 | } |
| 4738 | if ((pStaDs && |
| 4739 | (( !palEqualMemory( pMac->hHdd,(tANI_U8 *) pStaDs->staAddr, |
| 4740 | (tANI_U8 *) assocCnf.peerMacAddr, |
| 4741 | sizeof(tSirMacAddr)) ) || |
| 4742 | (pStaDs->mlmStaContext.mlmState != eLIM_MLM_WT_ASSOC_CNF_STATE) || |
| 4743 | ((pStaDs->mlmStaContext.subType == LIM_ASSOC) && |
| 4744 | (msgType != eWNI_SME_ASSOC_CNF)) || |
| 4745 | ((pStaDs->mlmStaContext.subType == LIM_REASSOC) && |
| 4746 | (msgType != eWNI_SME_REASSOC_CNF))))) |
| 4747 | { |
| 4748 | limLog(pMac, LOG1, |
| 4749 | FL("Received invalid message %X due to peerMacAddr mismatched or not in eLIM_MLM_WT_ASSOC_CNF_STATE state, for aid %d, peer "), |
| 4750 | msgType, assocCnf.aid); |
| 4751 | limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1); |
| 4752 | goto end; |
| 4753 | } |
| 4754 | /* |
| 4755 | ** Deactivate/delet CNF_WAIT timer since ASSOC_CNF |
| 4756 | ** has been received |
| 4757 | **/ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4758 | limLog(pMac, LOG1, FL("Received SME_ASSOC_CNF. Delete Timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4759 | limDeactivateAndChangePerStaIdTimer(pMac, eLIM_CNF_WAIT_TIMER, pStaDs->assocId); |
| 4760 | if (assocCnf.statusCode == eSIR_SME_SUCCESS) |
| 4761 | { |
| 4762 | /* In BTAMP-AP, PE already finished the WDA_ADD_STA sequence |
| 4763 | * when it had received Assoc Request frame. Now, PE just needs to send |
| 4764 | * Association Response frame to the requesting BTAMP-STA. |
| 4765 | */ |
| 4766 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4767 | limLog(pMac, LOG1, FL("sending Assoc Rsp frame to STA (assoc id=%d) "), pStaDs->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4768 | limSendAssocRspMgmtFrame( pMac, eSIR_SUCCESS, pStaDs->assocId, pStaDs->staAddr, |
| 4769 | pStaDs->mlmStaContext.subType, pStaDs, psessionEntry); |
| 4770 | goto end; |
| 4771 | } // (assocCnf.statusCode == eSIR_SME_SUCCESS) |
| 4772 | else |
| 4773 | { |
| 4774 | // SME_ASSOC_CNF status is non-success, so STA is not allowed to be associated |
| 4775 | limRejectAssociation(pMac, pStaDs->staAddr, |
| 4776 | pStaDs->mlmStaContext.subType, |
| 4777 | true, pStaDs->mlmStaContext.authType, |
| 4778 | pStaDs->assocId, true, |
| 4779 | assocCnf.statusCode, psessionEntry); |
| 4780 | return; |
| 4781 | } |
| 4782 | end: |
| 4783 | if ( psessionEntry->parsedAssocReq[pStaDs->assocId] != NULL ) |
| 4784 | { |
| 4785 | if ( ((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame) |
| 4786 | { |
| 4787 | palFreeMemory(pMac->hHdd,((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame); |
| 4788 | ((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame = NULL; |
| 4789 | } |
| 4790 | |
| 4791 | palFreeMemory(pMac->hHdd, psessionEntry->parsedAssocReq[pStaDs->assocId]); |
| 4792 | psessionEntry->parsedAssocReq[pStaDs->assocId] = NULL; |
| 4793 | } |
| 4794 | } /*** end __limProcessSmeAssocCnfNew() ***/ |
| 4795 | #endif |
| 4796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4797 | void |
| 4798 | limSendBeaconInd(tpAniSirGlobal pMac, tpPESession psessionEntry){ |
| 4799 | tBeaconGenParams *pBeaconGenParams = NULL; |
| 4800 | tSirMsgQ limMsg; |
| 4801 | /** Allocate the Memory for Beacon Pre Message and for Stations in PoweSave*/ |
| 4802 | if(psessionEntry == NULL ){ |
| 4803 | PELOGE( limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4804 | FL( "Error:Unable to get the PESessionEntry" ));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4805 | return; |
| 4806 | } |
| 4807 | if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, |
| 4808 | (void **) &pBeaconGenParams, (sizeof(*pBeaconGenParams)))) |
| 4809 | { |
| 4810 | PELOGE( limLog( pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4811 | FL( "Unable to PAL allocate memory during sending beaconPreMessage" ));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4812 | return; |
| 4813 | } |
| 4814 | palZeroMemory( pMac->hHdd, pBeaconGenParams, sizeof(*pBeaconGenParams)); |
| 4815 | palCopyMemory( pMac->hHdd, (void *) pBeaconGenParams->bssId, |
| 4816 | (void *)psessionEntry->bssId, |
| 4817 | SIR_MAC_ADDR_LENGTH ); |
| 4818 | limMsg.bodyptr = pBeaconGenParams; |
| 4819 | schProcessPreBeaconInd(pMac, &limMsg); |
| 4820 | return; |
| 4821 | } |