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