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