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