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; |
| 1269 | tSirMsgQ msgQ; |
| 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); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1297 | msgQ.type = eWNI_SME_ASSOC_IND; |
| 1298 | msgQ.bodyptr = pSirSmeAssocInd; |
| 1299 | msgQ.bodyval = 0; |
| 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, |
| 1313 | msgQ.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 |
| 1317 | limSysProcessMmhMsgApi(pMac, &msgQ, ePROT); |
| 1318 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1319 | limLog(pMac, LOG1, |
| 1320 | FL("Create CNF_WAIT_TIMER after received LIM_MLM_ASSOC_IND")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1321 | /* |
| 1322 | ** turn on a timer to detect the loss of ASSOC CNF |
| 1323 | **/ |
| 1324 | limActivateCnfTimer(pMac, (tANI_U16) ((tpLimMlmAssocInd) pMsgBuf)->aid, psessionEntry); |
| 1325 | |
| 1326 | // Enable this Compile flag to test the BT-AMP -AP assoc sequence |
| 1327 | #ifdef TEST_BTAMP_AP |
| 1328 | //tANI_U32 *pMsgBuf; |
| 1329 | { |
| 1330 | tpSirSmeAssocCnf pSmeAssoccnf; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1331 | pSmeAssoccnf = vos_mem_malloc(sizeof(tSirSmeAssocCnf)); |
| 1332 | if ( NULL == pSmeAssoccnf ) |
| 1333 | PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed for pSmeAssoccnf "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1334 | pSmeAssoccnf->messageType = eWNI_SME_ASSOC_CNF; |
| 1335 | pSmeAssoccnf->length = sizeof(tSirSmeAssocCnf); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1336 | vos_mem_copy(pSmeAssoccnf->peerMacAddr, |
| 1337 | ((tpLimMlmAssocInd)pMsgBuf)->peerMacAddr, 6); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1338 | pSmeAssoccnf->statusCode = eSIR_SME_SUCCESS; |
| 1339 | pSmeAssoccnf->aid = ((tpLimMlmAssocInd)pMsgBuf)->aid; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1340 | vos_mem_copy(pSmeAssoccnf->alternateBssId, |
| 1341 | pSmeAssoccnf->peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1342 | pSmeAssoccnf->alternateChannelId = 6; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1343 | vos_mem_copy(pSmeAssoccnf->bssId, psessionEntry->selfMacAddr, 6); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1344 | pMsgBuf = (tANI_U32)pSmeAssoccnf; |
| 1345 | __limProcessSmeAssocCnfNew(pMac, eWNI_SME_ASSOC_CNF, pMsgBuf); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1346 | vos_mem_free(pSmeAssoccnf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1347 | } |
| 1348 | #endif |
| 1349 | |
| 1350 | |
| 1351 | } /*** end limProcessMlmAssocInd() ***/ |
| 1352 | |
| 1353 | |
| 1354 | |
| 1355 | |
| 1356 | /** |
| 1357 | * limProcessMlmDisassocInd() |
| 1358 | * |
| 1359 | *FUNCTION: |
| 1360 | * This function is called to processes MLM_DISASSOC_IND |
| 1361 | * message from MLM State machine. |
| 1362 | * |
| 1363 | *LOGIC: |
| 1364 | * |
| 1365 | *ASSUMPTIONS: |
| 1366 | * |
| 1367 | *NOTE: |
| 1368 | * |
| 1369 | * @param pMac Pointer to Global MAC structure |
| 1370 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1371 | * |
| 1372 | * @return None |
| 1373 | */ |
| 1374 | void |
| 1375 | limProcessMlmDisassocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1376 | { |
| 1377 | tLimMlmDisassocInd *pMlmDisassocInd; |
| 1378 | tpPESession psessionEntry; |
| 1379 | pMlmDisassocInd = (tLimMlmDisassocInd *) pMsgBuf; |
| 1380 | if( (psessionEntry = peFindSessionBySessionId(pMac,pMlmDisassocInd->sessionId) )== NULL) |
| 1381 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1382 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1383 | return; |
| 1384 | } |
| 1385 | switch (psessionEntry->limSystemRole) |
| 1386 | { |
| 1387 | case eLIM_STA_IN_IBSS_ROLE: |
| 1388 | break; |
| 1389 | case eLIM_STA_ROLE: |
| 1390 | case eLIM_BT_AMP_STA_ROLE: |
| 1391 | psessionEntry->limSmeState = eLIM_SME_WT_DISASSOC_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1392 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1393 | break; |
| 1394 | default: // eLIM_AP_ROLE //eLIM_BT_AMP_AP_ROLE |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1395 | limLog(pMac, LOG1, |
| 1396 | FL("*** Peer staId = %d Disassociated ***"), |
| 1397 | pMlmDisassocInd->aid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1398 | // Send SME_DISASOC_IND after Polaris cleanup |
| 1399 | // (after receiving LIM_MLM_PURGE_STA_IND) |
| 1400 | break; |
| 1401 | } // end switch (psessionEntry->limSystemRole) |
| 1402 | } /*** end limProcessMlmDisassocInd() ***/ |
| 1403 | |
| 1404 | /** |
| 1405 | * limProcessMlmDisassocCnf() |
| 1406 | * |
| 1407 | *FUNCTION: |
| 1408 | * This function is called to processes MLM_DISASSOC_CNF |
| 1409 | * message from MLM State machine. |
| 1410 | * |
| 1411 | *LOGIC: |
| 1412 | * |
| 1413 | *ASSUMPTIONS: |
| 1414 | * |
| 1415 | *NOTE: |
| 1416 | * |
| 1417 | * @param pMac Pointer to Global MAC structure |
| 1418 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1419 | * |
| 1420 | * @return None |
| 1421 | */ |
| 1422 | void |
| 1423 | limProcessMlmDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1424 | { |
| 1425 | tSirResultCodes resultCode; |
| 1426 | tLimMlmDisassocCnf *pMlmDisassocCnf; |
| 1427 | tpPESession psessionEntry; |
| 1428 | pMlmDisassocCnf = (tLimMlmDisassocCnf *) pMsgBuf; |
| 1429 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmDisassocCnf->sessionId))== NULL) |
| 1430 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1431 | 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] | 1432 | return; |
| 1433 | } |
| 1434 | resultCode = (tSirResultCodes) |
| 1435 | (pMlmDisassocCnf->disassocTrigger == |
| 1436 | eLIM_LINK_MONITORING_DISASSOC) ? |
| 1437 | eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE : |
| 1438 | pMlmDisassocCnf->resultCode; |
| 1439 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 1440 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1441 | // Disassociate Confirm from MLM |
| 1442 | if ( (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && |
| 1443 | (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) ) |
| 1444 | { |
| 1445 | /** |
| 1446 | * Should not have received |
| 1447 | * Disassocate confirm |
| 1448 | * from MLM in other states. |
| 1449 | * Log error |
| 1450 | */ |
| 1451 | PELOGE(limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 1452 | FL("received unexpected MLM_DISASSOC_CNF in state %d"),psessionEntry->limSmeState);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1453 | return; |
| 1454 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1455 | if (pMac->lim.gLimRspReqd) |
| 1456 | pMac->lim.gLimRspReqd = false; |
| 1457 | if (pMlmDisassocCnf->disassocTrigger == |
| 1458 | eLIM_PROMISCUOUS_MODE_DISASSOC) |
| 1459 | { |
| 1460 | if (pMlmDisassocCnf->resultCode != eSIR_SME_SUCCESS) |
| 1461 | psessionEntry->limSmeState = psessionEntry->limPrevSmeState; |
| 1462 | else |
| 1463 | psessionEntry->limSmeState = eLIM_SME_OFFLINE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1464 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1465 | // Send Promiscuous mode response to host |
| 1466 | limSendSmePromiscuousModeRsp(pMac); |
| 1467 | } |
| 1468 | else |
| 1469 | { |
| 1470 | if (pMlmDisassocCnf->resultCode != eSIR_SME_SUCCESS) |
| 1471 | psessionEntry->limSmeState = psessionEntry->limPrevSmeState; |
| 1472 | else |
| 1473 | psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1474 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1475 | limSendSmeDisassocNtf(pMac, pMlmDisassocCnf->peerMacAddr, |
| 1476 | resultCode, |
| 1477 | pMlmDisassocCnf->disassocTrigger, |
| 1478 | pMlmDisassocCnf->aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 1479 | } |
| 1480 | } |
| 1481 | else if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) |
| 1482 | { |
| 1483 | limSendSmeDisassocNtf(pMac, pMlmDisassocCnf->peerMacAddr, |
| 1484 | resultCode, |
| 1485 | pMlmDisassocCnf->disassocTrigger, |
| 1486 | pMlmDisassocCnf->aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 1487 | } |
| 1488 | } /*** end limProcessMlmDisassocCnf() ***/ |
| 1489 | |
| 1490 | /** |
| 1491 | * limProcessMlmDeauthInd() |
| 1492 | * |
| 1493 | *FUNCTION: |
| 1494 | * This function is called to processes MLM_DEAUTH_IND |
| 1495 | * message from MLM State machine. |
| 1496 | * |
| 1497 | *LOGIC: |
| 1498 | * |
| 1499 | *ASSUMPTIONS: |
| 1500 | * |
| 1501 | *NOTE: |
| 1502 | * |
| 1503 | * @param pMac Pointer to Global MAC structure |
| 1504 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1505 | * |
| 1506 | * @return None |
| 1507 | */ |
| 1508 | void |
| 1509 | limProcessMlmDeauthInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1510 | { |
| 1511 | tLimMlmDeauthInd *pMlmDeauthInd; |
| 1512 | tpPESession psessionEntry; |
| 1513 | tANI_U8 sessionId; |
| 1514 | pMlmDeauthInd = (tLimMlmDeauthInd *) pMsgBuf; |
| 1515 | if((psessionEntry = peFindSessionByBssid(pMac,pMlmDeauthInd->peerMacAddr,&sessionId))== NULL) |
| 1516 | { |
Mukul Sharma | caf4aca | 2015-04-17 20:01:40 +0530 | [diff] [blame] | 1517 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for Addr:" MAC_ADDRESS_STR), |
| 1518 | MAC_ADDR_ARRAY(pMlmDeauthInd->peerMacAddr));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1519 | return; |
| 1520 | } |
| 1521 | switch (psessionEntry->limSystemRole) |
| 1522 | { |
| 1523 | case eLIM_STA_IN_IBSS_ROLE: |
| 1524 | break; |
| 1525 | case eLIM_STA_ROLE: |
| 1526 | case eLIM_BT_AMP_STA_ROLE: |
| 1527 | psessionEntry->limSmeState = eLIM_SME_WT_DEAUTH_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1528 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1529 | |
| 1530 | default: // eLIM_AP_ROLE |
| 1531 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1532 | limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1533 | FL("*** Received Deauthentication from staId=%d ***"), |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1534 | pMlmDeauthInd->aid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1535 | } |
| 1536 | // Send SME_DEAUTH_IND after Polaris cleanup |
| 1537 | // (after receiving LIM_MLM_PURGE_STA_IND) |
| 1538 | break; |
| 1539 | } // end switch (psessionEntry->limSystemRole) |
| 1540 | } /*** end limProcessMlmDeauthInd() ***/ |
| 1541 | |
| 1542 | /** |
| 1543 | * limProcessMlmDeauthCnf() |
| 1544 | * |
| 1545 | *FUNCTION: |
| 1546 | * This function is called to processes MLM_DEAUTH_CNF |
| 1547 | * message from MLM State machine. |
| 1548 | * |
| 1549 | *LOGIC: |
| 1550 | * |
| 1551 | *ASSUMPTIONS: |
| 1552 | * |
| 1553 | *NOTE: |
| 1554 | * |
| 1555 | * @param pMac Pointer to Global MAC structure |
| 1556 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1557 | * |
| 1558 | * @return None |
| 1559 | */ |
| 1560 | void |
| 1561 | limProcessMlmDeauthCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1562 | { |
| 1563 | tANI_U16 aid; |
| 1564 | tSirResultCodes resultCode; |
| 1565 | tLimMlmDeauthCnf *pMlmDeauthCnf; |
| 1566 | tpPESession psessionEntry; |
| 1567 | |
| 1568 | if(pMsgBuf == NULL) |
| 1569 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1570 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1571 | return; |
| 1572 | } |
| 1573 | pMlmDeauthCnf = (tLimMlmDeauthCnf *) pMsgBuf; |
| 1574 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmDeauthCnf->sessionId))==NULL) |
| 1575 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1576 | 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] | 1577 | return; |
| 1578 | } |
| 1579 | |
| 1580 | resultCode = (tSirResultCodes) |
| 1581 | (pMlmDeauthCnf->deauthTrigger == |
| 1582 | eLIM_LINK_MONITORING_DEAUTH) ? |
| 1583 | eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE : |
| 1584 | pMlmDeauthCnf->resultCode; |
| 1585 | aid = (psessionEntry->limSystemRole == eLIM_AP_ROLE) ? |
| 1586 | pMlmDeauthCnf->aid : 1; |
| 1587 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 1588 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1589 | // Deauth Confirm from MLM |
Padma, Santhosh Kumar | 05600d3 | 2015-07-24 13:00:57 +0530 | [diff] [blame] | 1590 | if ((psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && |
| 1591 | (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1592 | { |
| 1593 | /** |
| 1594 | * Should not have received Deauth confirm |
| 1595 | * from MLM in other states. |
| 1596 | * Log error |
| 1597 | */ |
| 1598 | PELOGE(limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 1599 | FL("received unexpected MLM_DEAUTH_CNF in state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1600 | psessionEntry->limSmeState);) |
| 1601 | return; |
| 1602 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1603 | if (pMlmDeauthCnf->resultCode == eSIR_SME_SUCCESS) |
| 1604 | { |
| 1605 | psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1606 | limLog(pMac, LOG1, |
| 1607 | FL("*** Deauthenticated with BSS ***")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1608 | } |
| 1609 | else |
| 1610 | psessionEntry->limSmeState = psessionEntry->limPrevSmeState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1611 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1612 | |
| 1613 | if (pMac->lim.gLimRspReqd) |
| 1614 | pMac->lim.gLimRspReqd = false; |
| 1615 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1616 | // On STA or on BASIC AP, send SME_DEAUTH_RSP to host |
| 1617 | limSendSmeDeauthNtf(pMac, pMlmDeauthCnf->peerMacAddr, |
| 1618 | resultCode, |
| 1619 | pMlmDeauthCnf->deauthTrigger, |
| 1620 | aid,psessionEntry->smeSessionId,psessionEntry->transactionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1621 | } /*** end limProcessMlmDeauthCnf() ***/ |
| 1622 | |
| 1623 | /** |
| 1624 | * limProcessMlmPurgeStaInd() |
| 1625 | * |
| 1626 | *FUNCTION: |
| 1627 | * This function is called to processes MLM_PURGE_STA_IND |
| 1628 | * message from MLM State machine. |
| 1629 | * |
| 1630 | *LOGIC: |
| 1631 | * |
| 1632 | *ASSUMPTIONS: |
| 1633 | * |
| 1634 | *NOTE: |
| 1635 | * |
| 1636 | * @param pMac Pointer to Global MAC structure |
| 1637 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1638 | * |
| 1639 | * @return None |
| 1640 | */ |
| 1641 | void |
| 1642 | limProcessMlmPurgeStaInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1643 | { |
| 1644 | tSirResultCodes resultCode; |
| 1645 | tpLimMlmPurgeStaInd pMlmPurgeStaInd; |
| 1646 | tpPESession psessionEntry; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1647 | if(pMsgBuf == NULL) |
| 1648 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1649 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1650 | return; |
| 1651 | } |
| 1652 | pMlmPurgeStaInd = (tpLimMlmPurgeStaInd) pMsgBuf; |
| 1653 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmPurgeStaInd->sessionId))==NULL) |
| 1654 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1655 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given bssId"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1656 | return; |
| 1657 | } |
| 1658 | // Purge STA indication from MLM |
| 1659 | resultCode = (tSirResultCodes) pMlmPurgeStaInd->reasonCode; |
| 1660 | switch (psessionEntry->limSystemRole) |
| 1661 | { |
| 1662 | case eLIM_STA_IN_IBSS_ROLE: |
| 1663 | break; |
| 1664 | case eLIM_STA_ROLE: |
| 1665 | case eLIM_BT_AMP_STA_ROLE: |
| 1666 | default: // eLIM_AP_ROLE |
| 1667 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) && |
| 1668 | (psessionEntry->limSmeState != |
| 1669 | eLIM_SME_WT_DISASSOC_STATE) && |
| 1670 | (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) |
| 1671 | { |
| 1672 | /** |
| 1673 | * Should not have received |
| 1674 | * Purge STA indication |
| 1675 | * from MLM in other states. |
| 1676 | * Log error |
| 1677 | */ |
| 1678 | PELOGE(limLog(pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 1679 | FL("received unexpected MLM_PURGE_STA_IND in state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1680 | psessionEntry->limSmeState);) |
| 1681 | break; |
| 1682 | } |
| 1683 | PELOG1(limLog(pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1684 | FL("*** Polaris cleanup completed for staId=%d ***"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1685 | pMlmPurgeStaInd->aid);) |
| 1686 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 1687 | { |
| 1688 | psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1689 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1690 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1691 | } |
| 1692 | if (pMlmPurgeStaInd->purgeTrigger == eLIM_PEER_ENTITY_DEAUTH) |
| 1693 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1694 | limSendSmeDeauthNtf(pMac, |
| 1695 | pMlmPurgeStaInd->peerMacAddr, |
| 1696 | resultCode, |
| 1697 | pMlmPurgeStaInd->purgeTrigger, |
| 1698 | pMlmPurgeStaInd->aid,psessionEntry->smeSessionId,psessionEntry->transactionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1699 | } |
| 1700 | else |
| 1701 | limSendSmeDisassocNtf(pMac, |
| 1702 | pMlmPurgeStaInd->peerMacAddr, |
| 1703 | resultCode, |
| 1704 | pMlmPurgeStaInd->purgeTrigger, |
| 1705 | pMlmPurgeStaInd->aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 1706 | } // end switch (psessionEntry->limSystemRole) |
| 1707 | } /*** end limProcessMlmPurgeStaInd() ***/ |
| 1708 | |
| 1709 | /** |
| 1710 | * limProcessMlmSetKeysCnf() |
| 1711 | * |
| 1712 | *FUNCTION: |
| 1713 | * This function is called to processes MLM_SETKEYS_CNF |
| 1714 | * message from MLM State machine. |
| 1715 | * |
| 1716 | *LOGIC: |
| 1717 | * |
| 1718 | *ASSUMPTIONS: |
| 1719 | * |
| 1720 | *NOTE: |
| 1721 | * |
| 1722 | * @param pMac Pointer to Global MAC structure |
| 1723 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1724 | * |
| 1725 | * @return None |
| 1726 | */ |
| 1727 | void |
| 1728 | limProcessMlmSetKeysCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1729 | { |
| 1730 | // Prepare and send SME_SETCONTEXT_RSP message |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1731 | tLimMlmSetKeysCnf *pMlmSetKeysCnf; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1732 | tpPESession psessionEntry; |
Abhishek Singh | 683d786 | 2014-11-05 17:34:31 +0530 | [diff] [blame] | 1733 | tANI_U16 aid; |
| 1734 | tpDphHashNode pStaDs; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1735 | |
| 1736 | if(pMsgBuf == NULL) |
| 1737 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1738 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1739 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1740 | } |
| 1741 | pMlmSetKeysCnf = (tLimMlmSetKeysCnf *) pMsgBuf; |
| 1742 | if ((psessionEntry = peFindSessionBySessionId(pMac, pMlmSetKeysCnf->sessionId))== NULL) |
| 1743 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1744 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1745 | return; |
| 1746 | } |
Abhishek Singh | 28266f0 | 2014-11-05 17:22:19 +0530 | [diff] [blame] | 1747 | psessionEntry->isKeyInstalled = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1748 | limLog( pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1749 | FL("Received MLM_SETKEYS_CNF with resultCode = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1750 | pMlmSetKeysCnf->resultCode ); |
Abhishek Singh | 28266f0 | 2014-11-05 17:22:19 +0530 | [diff] [blame] | 1751 | /* if the status is success keys are installed in the |
| 1752 | * Firmware so we can set the protection bit |
| 1753 | */ |
Abhishek Singh | 683d786 | 2014-11-05 17:34:31 +0530 | [diff] [blame] | 1754 | if (eSIR_SME_SUCCESS == pMlmSetKeysCnf->resultCode) { |
Abhishek Singh | 28266f0 | 2014-11-05 17:22:19 +0530 | [diff] [blame] | 1755 | psessionEntry->isKeyInstalled = 1; |
Abhishek Singh | 683d786 | 2014-11-05 17:34:31 +0530 | [diff] [blame] | 1756 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 1757 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) { |
| 1758 | pStaDs = dphLookupHashEntry(pMac, pMlmSetKeysCnf->peerMacAddr, &aid, |
| 1759 | &psessionEntry->dph.dphHashTable); |
| 1760 | if (pStaDs != NULL) |
| 1761 | pStaDs->isKeyInstalled = 1; |
| 1762 | } |
| 1763 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1764 | limSendSmeSetContextRsp(pMac, |
| 1765 | pMlmSetKeysCnf->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1766 | 1, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1767 | (tSirResultCodes) pMlmSetKeysCnf->resultCode,psessionEntry,psessionEntry->smeSessionId, |
| 1768 | psessionEntry->transactionId); |
| 1769 | } /*** end limProcessMlmSetKeysCnf() ***/ |
| 1770 | /** |
| 1771 | * limProcessMlmRemoveKeyCnf() |
| 1772 | * |
| 1773 | *FUNCTION: |
| 1774 | * This function is called to processes MLM_REMOVEKEY_CNF |
| 1775 | * message from MLM State machine. |
| 1776 | * |
| 1777 | *LOGIC: |
| 1778 | * |
| 1779 | *ASSUMPTIONS: |
| 1780 | * |
| 1781 | *NOTE: |
| 1782 | * |
| 1783 | * @param pMac Pointer to Global MAC structure |
| 1784 | * @param pMsgBuf A pointer to the MLM message buffer |
| 1785 | * |
| 1786 | * @return None |
| 1787 | */ |
| 1788 | void |
| 1789 | limProcessMlmRemoveKeyCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) |
| 1790 | { |
| 1791 | // Prepare and send SME_REMOVECONTEXT_RSP message |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1792 | tLimMlmRemoveKeyCnf *pMlmRemoveKeyCnf; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1793 | tpPESession psessionEntry; |
| 1794 | |
| 1795 | if(pMsgBuf == NULL) |
| 1796 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1797 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1798 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1799 | } |
| 1800 | pMlmRemoveKeyCnf = (tLimMlmRemoveKeyCnf *) pMsgBuf; |
| 1801 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmRemoveKeyCnf->sessionId))== NULL) |
| 1802 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1803 | 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] | 1804 | return; |
| 1805 | } |
| 1806 | limLog( pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1807 | FL("Received MLM_REMOVEKEYS_CNF with resultCode = %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1808 | pMlmRemoveKeyCnf->resultCode ); |
| 1809 | limSendSmeRemoveKeyRsp(pMac, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1810 | pMlmRemoveKeyCnf->peerMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1811 | (tSirResultCodes) pMlmRemoveKeyCnf->resultCode,psessionEntry, |
| 1812 | psessionEntry->smeSessionId,psessionEntry->transactionId); |
| 1813 | } /*** end limProcessMlmRemoveKeyCnf() ***/ |
| 1814 | |
| 1815 | |
| 1816 | /** |
| 1817 | * limHandleSmeJoinResult() |
| 1818 | * |
| 1819 | *FUNCTION: |
| 1820 | * This function is called to process join/auth/assoc failures |
| 1821 | * upon receiving MLM_JOIN/AUTH/ASSOC_CNF with a failure code or |
| 1822 | * MLM_ASSOC_CNF with a success code in case of STA role and |
| 1823 | * MLM_JOIN_CNF with success in case of STA in IBSS role. |
| 1824 | * |
| 1825 | *LOGIC: |
| 1826 | * |
| 1827 | *ASSUMPTIONS: |
| 1828 | * |
| 1829 | *NOTE: |
| 1830 | * |
| 1831 | * @param pMac Pointer to Global MAC structure |
| 1832 | * @param resultCode Failure code to be sent |
| 1833 | * |
| 1834 | * |
| 1835 | * @return None |
| 1836 | */ |
| 1837 | static void |
| 1838 | limHandleSmeJoinResult(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U16 protStatusCode, tpPESession psessionEntry) |
| 1839 | { |
| 1840 | tpDphHashNode pStaDs = NULL; |
| 1841 | tANI_U8 smesessionId; |
| 1842 | tANI_U16 smetransactionId; |
| 1843 | |
| 1844 | /* Newly Added on oct 11 th*/ |
| 1845 | if(psessionEntry == NULL) |
| 1846 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1847 | PELOGE(limLog(pMac, LOGE,FL("psessionEntry is NULL "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1848 | return; |
| 1849 | } |
| 1850 | smesessionId = psessionEntry->smeSessionId; |
| 1851 | smetransactionId = psessionEntry->transactionId; |
| 1852 | /* When associations is failed , delete the session created and pass NULL to limsendsmeJoinReassocRsp() */ |
| 1853 | if(resultCode != eSIR_SME_SUCCESS) |
| 1854 | { |
| 1855 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 1856 | if (pStaDs != NULL) |
| 1857 | { |
| 1858 | pStaDs->mlmStaContext.disassocReason = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1859 | pStaDs->mlmStaContext.cleanupTrigger = eLIM_JOIN_FAILURE; |
| 1860 | pStaDs->mlmStaContext.resultCode = resultCode; |
| 1861 | pStaDs->mlmStaContext.protStatusCode = protStatusCode; |
| 1862 | //Done: 7-27-2009. JIM_FIX_ME: at the end of limCleanupRxPath, make sure PE is sending eWNI_SME_JOIN_RSP to SME |
| 1863 | limCleanupRxPath(pMac, pStaDs, psessionEntry); |
Abhishek Singh | de7f051 | 2015-10-23 14:31:15 +0530 | [diff] [blame] | 1864 | /* Cleanup if add bss failed */ |
| 1865 | if(psessionEntry->addBssfailed) |
| 1866 | { |
| 1867 | dphDeleteHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, |
| 1868 | &psessionEntry->dph.dphHashTable); |
| 1869 | goto error; |
| 1870 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1871 | vos_mem_free(psessionEntry->pLimJoinReq); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1872 | psessionEntry->pLimJoinReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1873 | return; |
| 1874 | } |
| 1875 | } |
| 1876 | |
Abhishek Singh | de7f051 | 2015-10-23 14:31:15 +0530 | [diff] [blame] | 1877 | error: |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1878 | vos_mem_free(psessionEntry->pLimJoinReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1879 | psessionEntry->pLimJoinReq = NULL; |
| 1880 | //Delete teh session if JOIN failure occurred. |
| 1881 | if(resultCode != eSIR_SME_SUCCESS) |
| 1882 | { |
| 1883 | if(NULL != psessionEntry) |
| 1884 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1885 | if(limSetLinkState(pMac, eSIR_LINK_IDLE_STATE,psessionEntry->bssId, |
| 1886 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1887 | PELOGE(limLog(pMac, LOGE, FL("Failed to set the LinkState."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1888 | peDeleteSession(pMac,psessionEntry); |
| 1889 | psessionEntry = NULL; |
| 1890 | } |
| 1891 | } |
| 1892 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_JOIN_RSP, resultCode, protStatusCode,psessionEntry, |
| 1893 | smesessionId, smetransactionId); |
| 1894 | } /*** end limHandleSmeJoinResult() ***/ |
| 1895 | |
| 1896 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1897 | * limHandleSmeReaasocResult() |
| 1898 | * |
| 1899 | *FUNCTION: |
| 1900 | * This function is called to process reassoc failures |
| 1901 | * upon receiving REASSOC_CNF with a failure code or |
| 1902 | * MLM_REASSOC_CNF with a success code in case of STA role |
| 1903 | * |
| 1904 | *LOGIC: |
| 1905 | * |
| 1906 | *ASSUMPTIONS: |
| 1907 | * |
| 1908 | *NOTE: |
| 1909 | * |
| 1910 | * @param pMac Pointer to Global MAC structure |
| 1911 | * @param resultCode Failure code to be sent |
| 1912 | * |
| 1913 | * |
| 1914 | * @return None |
| 1915 | */ |
| 1916 | static void |
| 1917 | limHandleSmeReaasocResult(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U16 protStatusCode, tpPESession psessionEntry) |
| 1918 | { |
| 1919 | tpDphHashNode pStaDs = NULL; |
| 1920 | tANI_U8 smesessionId; |
| 1921 | tANI_U16 smetransactionId; |
| 1922 | |
| 1923 | if(psessionEntry == NULL) |
| 1924 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1925 | PELOGE(limLog(pMac, LOGE,FL("psessionEntry is NULL "));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1926 | return; |
| 1927 | } |
| 1928 | smesessionId = psessionEntry->smeSessionId; |
| 1929 | smetransactionId = psessionEntry->transactionId; |
| 1930 | /* When associations is failed , delete the session created and pass NULL to limsendsmeJoinReassocRsp() */ |
| 1931 | if(resultCode != eSIR_SME_SUCCESS) |
| 1932 | { |
| 1933 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 1934 | if (pStaDs != NULL) |
| 1935 | { |
| 1936 | pStaDs->mlmStaContext.disassocReason = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1937 | pStaDs->mlmStaContext.cleanupTrigger = eLIM_JOIN_FAILURE; |
| 1938 | pStaDs->mlmStaContext.resultCode = resultCode; |
| 1939 | pStaDs->mlmStaContext.protStatusCode = protStatusCode; |
| 1940 | limCleanupRxPath(pMac, pStaDs, psessionEntry); |
Abhishek Singh | de7f051 | 2015-10-23 14:31:15 +0530 | [diff] [blame] | 1941 | /* Cleanup if add bss failed */ |
| 1942 | if(psessionEntry->addBssfailed) |
| 1943 | { |
| 1944 | dphDeleteHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, |
| 1945 | &psessionEntry->dph.dphHashTable); |
| 1946 | goto error; |
| 1947 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1948 | return; |
| 1949 | } |
| 1950 | } |
Abhishek Singh | de7f051 | 2015-10-23 14:31:15 +0530 | [diff] [blame] | 1951 | error: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1952 | //Delete teh session if REASSOC failure occurred. |
| 1953 | if(resultCode != eSIR_SME_SUCCESS) |
| 1954 | { |
| 1955 | if(NULL != psessionEntry) |
| 1956 | { |
| 1957 | peDeleteSession(pMac,psessionEntry); |
| 1958 | psessionEntry = NULL; |
| 1959 | } |
| 1960 | } |
| 1961 | limSendSmeJoinReassocRsp(pMac, eWNI_SME_REASSOC_RSP, resultCode, protStatusCode,psessionEntry, |
| 1962 | smesessionId, smetransactionId); |
| 1963 | } /*** end limHandleSmeReassocResult() ***/ |
| 1964 | |
| 1965 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1966 | * limProcessMlmAddStaRsp() |
| 1967 | * |
| 1968 | *FUNCTION: |
| 1969 | * This function is called to process a WDA_ADD_STA_RSP from HAL. |
| 1970 | * Upon receipt of this message from HAL, MLME - |
| 1971 | * > Determines the "state" in which this message was received |
| 1972 | * > Forwards it to the appropriate callback |
| 1973 | * |
| 1974 | *ASSUMPTIONS: |
| 1975 | * |
| 1976 | *NOTE: |
| 1977 | * |
| 1978 | * @param pMac Pointer to Global MAC structure |
| 1979 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 1980 | * |
| 1981 | * @return None |
| 1982 | */ |
| 1983 | void limProcessMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry ) |
| 1984 | { |
| 1985 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 1986 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 1987 | //the deffered flag. |
| 1988 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1989 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1990 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1991 | ) |
| 1992 | { |
| 1993 | limProcessBtAmpApMlmAddStaRsp(pMac, limMsgQ,psessionEntry); |
| 1994 | return; |
| 1995 | } |
Padma, Santhosh Kumar | 7cdb524 | 2017-01-11 19:19:08 +0530 | [diff] [blame] | 1996 | #ifdef WLAN_FEATURE_LFR_MBB |
| 1997 | if (pMac->ft.ftSmeContext.is_preauth_lfr_mbb) { |
| 1998 | lim_process_sta_mlm_add_sta_rsp_mbb(pMac, limMsgQ, psessionEntry); |
| 1999 | return; |
| 2000 | } |
| 2001 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2002 | limProcessStaMlmAddStaRsp(pMac, limMsgQ,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2003 | } |
| 2004 | void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession psessionEntry) |
| 2005 | { |
| 2006 | tLimMlmAssocCnf mlmAssocCnf; |
| 2007 | tpDphHashNode pStaDs; |
| 2008 | tANI_U32 mesgType = LIM_MLM_ASSOC_CNF; |
| 2009 | tpAddStaParams pAddStaParams = (tpAddStaParams) limMsgQ->bodyptr; |
| 2010 | |
| 2011 | if(NULL == pAddStaParams ) |
| 2012 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2013 | limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2014 | return; |
| 2015 | } |
Mukul Sharma | ef9d3ec | 2014-07-22 00:16:09 +0530 | [diff] [blame] | 2016 | |
Madan Mohan Koyyalamudi | 58c8779 | 2013-08-30 02:51:14 +0530 | [diff] [blame] | 2017 | if (true == psessionEntry->fDeauthReceived) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2018 | { |
Madan Mohan Koyyalamudi | 58c8779 | 2013-08-30 02:51:14 +0530 | [diff] [blame] | 2019 | PELOGE(limLog(pMac, LOGE, |
| 2020 | FL("Received Deauth frame in ADD_STA_RESP state"));) |
c_hpothu | a9dc89c | 2014-03-22 19:22:31 +0530 | [diff] [blame] | 2021 | |
| 2022 | if (eHAL_STATUS_SUCCESS == pAddStaParams->status) |
| 2023 | { |
| 2024 | PELOGE(limLog(pMac, LOGE, |
| 2025 | FL("ADD_STA success, send update result code with" |
| 2026 | "eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA staIdx: %d" |
| 2027 | "limMlmState: %d"), pAddStaParams->staIdx, |
| 2028 | psessionEntry->limMlmState);) |
Mukul Sharma | ef9d3ec | 2014-07-22 00:16:09 +0530 | [diff] [blame] | 2029 | if(psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) |
| 2030 | mesgType = LIM_MLM_REASSOC_CNF; |
| 2031 | //We are sending result code eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA |
| 2032 | //which will trigger proper cleanup (DEL_STA/DEL_BSS both required) in |
| 2033 | //either assoc cnf or reassoc cnf handler. |
c_hpothu | a9dc89c | 2014-03-22 19:22:31 +0530 | [diff] [blame] | 2034 | mlmAssocCnf.resultCode = |
| 2035 | (tSirResultCodes) eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA; |
Abhishek Singh | c0fccd2 | 2015-10-19 16:44:00 +0530 | [diff] [blame] | 2036 | mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
c_hpothu | a9dc89c | 2014-03-22 19:22:31 +0530 | [diff] [blame] | 2037 | psessionEntry->staId = pAddStaParams->staIdx; |
| 2038 | goto end; |
| 2039 | } |
Madan Mohan Koyyalamudi | 58c8779 | 2013-08-30 02:51:14 +0530 | [diff] [blame] | 2040 | } |
| 2041 | |
| 2042 | if ( eHAL_STATUS_SUCCESS == pAddStaParams->status ) |
| 2043 | { |
| 2044 | if ( eLIM_MLM_WT_ADD_STA_RSP_STATE != psessionEntry->limMlmState) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2045 | { |
| 2046 | //TODO: any response to be sent out here ? |
| 2047 | limLog( pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2048 | FL( "Received unexpected WDA_ADD_STA_RSP in state %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2049 | psessionEntry->limMlmState); |
| 2050 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 2051 | goto end; |
| 2052 | } |
Mukul Sharma | ef9d3ec | 2014-07-22 00:16:09 +0530 | [diff] [blame] | 2053 | |
| 2054 | if(psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) |
| 2055 | mesgType = LIM_MLM_REASSOC_CNF; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2056 | // |
| 2057 | // Update the DPH Hash Entry for this STA |
| 2058 | // with proper state info |
| 2059 | // |
| 2060 | pStaDs = dphGetHashEntry( pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 2061 | if( NULL != pStaDs) |
| 2062 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
| 2063 | else |
| 2064 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2065 | FL( "Unable to get the DPH Hash Entry for AID - %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2066 | DPH_STA_HASH_INDEX_PEER); |
| 2067 | psessionEntry->limMlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2068 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2069 | /* |
| 2070 | * Storing the self StaIndex(Generated by HAL) in session context, |
| 2071 | * instead of storing it in DPH Hash entry for Self STA. |
| 2072 | * DPH entry for the self STA stores the sta index for the BSS entry |
| 2073 | * to which the STA is associated. |
| 2074 | */ |
| 2075 | psessionEntry->staId = pAddStaParams->staIdx; |
| 2076 | //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] | 2077 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 2078 | if(!IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) |
| 2079 | #endif |
| 2080 | { |
| 2081 | limReactivateHeartBeatTimer(pMac, psessionEntry); |
| 2082 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2083 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_KEEPALIVE_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2084 | |
| 2085 | //assign the sessionId to the timer Object |
| 2086 | pMac->lim.limTimers.gLimKeepaliveTimer.sessionId = psessionEntry->peSessionId; |
| 2087 | if (tx_timer_activate(&pMac->lim.limTimers.gLimKeepaliveTimer) != TX_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2088 | limLog(pMac, LOGP, FL("Cannot activate keepalive timer.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2089 | #ifdef WLAN_DEBUG |
| 2090 | pMac->lim.gLimNumLinkEsts++; |
| 2091 | #endif |
Hoonki Lee | 8c9e99f | 2013-04-18 22:59:11 -0700 | [diff] [blame] | 2092 | #ifdef FEATURE_WLAN_TDLS |
| 2093 | /* initialize TDLS peer related data */ |
| 2094 | limInitTdlsData(pMac,psessionEntry); |
| 2095 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2096 | // Return Assoc confirm to SME with success |
| 2097 | // FIXME_GEN4 - Need the correct ASSOC RSP code to |
| 2098 | // be passed in here.... |
| 2099 | //mlmAssocCnf.resultCode = (tSirResultCodes) assoc.statusCode; |
| 2100 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_SUCCESS; |
| 2101 | } |
| 2102 | else |
| 2103 | { |
Gopichand Nakkala | d786fa3 | 2013-03-20 23:48:19 +0530 | [diff] [blame] | 2104 | limLog( pMac, LOGE, FL( "ADD_STA failed!")); |
Abhishek Singh | 82a7a5b | 2014-10-07 13:05:12 +0530 | [diff] [blame] | 2105 | if(psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) |
Sreelakshmi Konamki | b3f2b7e | 2015-12-21 11:45:35 +0530 | [diff] [blame] | 2106 | { |
Abhishek Singh | 82a7a5b | 2014-10-07 13:05:12 +0530 | [diff] [blame] | 2107 | mesgType = LIM_MLM_REASSOC_CNF; |
Sreelakshmi Konamki | b3f2b7e | 2015-12-21 11:45:35 +0530 | [diff] [blame] | 2108 | mlmAssocCnf.resultCode = (tSirResultCodes)eSIR_SME_FT_REASSOC_FAILURE; |
| 2109 | } |
| 2110 | else |
| 2111 | { |
| 2112 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 2113 | } |
Abhishek Singh | c0fccd2 | 2015-10-19 16:44:00 +0530 | [diff] [blame] | 2114 | mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2115 | } |
| 2116 | end: |
| 2117 | if( 0 != limMsgQ->bodyptr ) |
| 2118 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2119 | vos_mem_free(pAddStaParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2120 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2121 | } |
| 2122 | /* Updating PE session Id*/ |
| 2123 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 2124 | limPostSmeMessage( pMac, mesgType, (tANI_U32 *) &mlmAssocCnf ); |
Madan Mohan Koyyalamudi | 58c8779 | 2013-08-30 02:51:14 +0530 | [diff] [blame] | 2125 | if (true == psessionEntry->fDeauthReceived) |
| 2126 | { |
| 2127 | psessionEntry->fDeauthReceived = false; |
| 2128 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2129 | return; |
| 2130 | } |
| 2131 | void limProcessMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2132 | { |
| 2133 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 2134 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 2135 | //the deffered flag. |
| 2136 | // tpPESession psessionEntry; |
| 2137 | // tpDeleteBssParams pDeleteBssParams =( tpDeleteBssParams)limMsgQ->bodyptr; |
| 2138 | // if((psessionEntry = peFindSessionBySessionId(pMac,pDeleteBssParams->sessionId)) == NULL) |
| 2139 | // { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2140 | // limLog( pMac, LOGE, FL( "Session deos not exist with given sessionId" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2141 | // return; |
| 2142 | // } |
| 2143 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2144 | |
| 2145 | if (((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) || |
| 2146 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2147 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2148 | ) && |
| 2149 | (psessionEntry->statypeForBss == STA_ENTRY_SELF)) |
| 2150 | { |
| 2151 | limProcessBtAmpApMlmDelBssRsp(pMac, limMsgQ,psessionEntry); |
| 2152 | return; |
| 2153 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2154 | limProcessStaMlmDelBssRsp(pMac, limMsgQ,psessionEntry); |
Madan Mohan Koyyalamudi | 01cba04 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 2155 | |
| 2156 | if(!limIsInMCC(pMac)) |
| 2157 | { |
| 2158 | WDA_TrafficStatsTimerActivate(FALSE); |
| 2159 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2160 | |
| 2161 | #ifdef WLAN_FEATURE_11W |
| 2162 | if (psessionEntry->limRmfEnabled) |
| 2163 | { |
| 2164 | if ( eSIR_SUCCESS != limSendExcludeUnencryptInd(pMac, TRUE, psessionEntry) ) |
| 2165 | { |
| 2166 | limLog( pMac, LOGE, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 2167 | FL( "Could not send down Exclude Unencrypted Indication!" ) ); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2168 | } |
| 2169 | } |
| 2170 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2171 | } |
| 2172 | |
| 2173 | void limProcessStaMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2174 | { |
| 2175 | tpDeleteBssParams pDelBssParams = (tpDeleteBssParams) limMsgQ->bodyptr; |
| 2176 | tpDphHashNode pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 2177 | tSirResultCodes statusCode = eSIR_SME_SUCCESS; |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2178 | |
Padma, Santhosh Kumar | 9f72955 | 2017-01-09 14:06:30 +0530 | [diff] [blame] | 2179 | #ifdef WLAN_FEATURE_LFR_MBB |
| 2180 | if (pMac->ft.ftSmeContext.is_preauth_lfr_mbb) { |
| 2181 | lim_process_sta_mlm_del_bss_rsp_mbb(pMac, limMsgQ, psessionEntry); |
| 2182 | return; |
| 2183 | } |
| 2184 | #endif |
| 2185 | |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2186 | if (NULL == pDelBssParams) |
| 2187 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2188 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2189 | goto end; |
| 2190 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2191 | if( eHAL_STATUS_SUCCESS == pDelBssParams->status ) |
| 2192 | { |
| 2193 | PELOGW(limLog( pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2194 | FL( "STA received the DEL_BSS_RSP for BSSID: %X."),pDelBssParams->bssIdx);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2195 | if (limSetLinkState(pMac, eSIR_LINK_IDLE_STATE, psessionEntry->bssId, |
| 2196 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) |
| 2197 | |
| 2198 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2199 | PELOGE(limLog( pMac, LOGE, FL( "Failure in setting link state to IDLE"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2200 | statusCode = eSIR_SME_REFUSED; |
| 2201 | goto end; |
| 2202 | } |
| 2203 | if(pStaDs == NULL) |
| 2204 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2205 | limLog( pMac, LOGE, FL( "DPH Entry for STA 1 missing.")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2206 | statusCode = eSIR_SME_REFUSED; |
| 2207 | goto end; |
| 2208 | } |
| 2209 | if( eLIM_MLM_WT_DEL_BSS_RSP_STATE != pStaDs->mlmStaContext.mlmState) |
| 2210 | { |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2211 | 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] | 2212 | pStaDs->mlmStaContext.mlmState);) |
| 2213 | statusCode = eSIR_SME_REFUSED; |
| 2214 | goto end; |
| 2215 | } |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2216 | limLog( pMac, LOG1, FL("STA AssocID %d MAC "), pStaDs->assocId ); |
| 2217 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2218 | } |
| 2219 | else |
| 2220 | { |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2221 | /* If DelBSS response is failure, go ahead and |
| 2222 | * post response to SME |
| 2223 | */ |
| 2224 | limLog( pMac, LOGE, FL( "DEL BSS failed! Status:%d" ), |
| 2225 | pDelBssParams->status ); |
| 2226 | statusCode = eSIR_SME_REFUSED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2227 | } |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2228 | |
| 2229 | end: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2230 | if( 0 != limMsgQ->bodyptr ) |
| 2231 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2232 | vos_mem_free(pDelBssParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2233 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2234 | } |
| 2235 | if(pStaDs == NULL) |
| 2236 | return; |
| 2237 | if ( ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && |
| 2238 | (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE && |
| 2239 | psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) && |
| 2240 | pStaDs->mlmStaContext.cleanupTrigger != eLIM_JOIN_FAILURE) |
| 2241 | { |
| 2242 | /** The Case where the DelBss is invoked from |
| 2243 | * context of other than normal DisAssoc / Deauth OR |
| 2244 | * as part of Join Failure. |
| 2245 | */ |
| 2246 | limHandleDelBssInReAssocContext(pMac, pStaDs,psessionEntry); |
| 2247 | return; |
| 2248 | } |
| 2249 | limPrepareAndSendDelStaCnf(pMac, pStaDs, statusCode,psessionEntry); |
| 2250 | return; |
| 2251 | } |
| 2252 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2253 | void limProcessBtAmpApMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2254 | { |
| 2255 | tSirResultCodes rc = eSIR_SME_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2256 | tSirRetStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2257 | tpDeleteBssParams pDelBss = (tpDeleteBssParams) limMsgQ->bodyptr; |
| 2258 | tSirMacAddr nullBssid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; |
| 2259 | |
| 2260 | if(psessionEntry == NULL) |
| 2261 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2262 | limLog(pMac, LOGE,FL("Session entry passed is NULL")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2263 | if(pDelBss != NULL) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2264 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2265 | vos_mem_free(pDelBss); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2266 | limMsgQ->bodyptr = NULL; |
| 2267 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2268 | return; |
| 2269 | } |
| 2270 | |
| 2271 | if (pDelBss == NULL) |
| 2272 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2273 | PELOGE(limLog(pMac, LOGE, FL("BSS: DEL_BSS_RSP with no body!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2274 | rc = eSIR_SME_REFUSED; |
| 2275 | goto end; |
| 2276 | } |
| 2277 | pMac->lim.gLimMlmState = eLIM_MLM_IDLE_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 2278 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, NO_SESSION, pMac->lim.gLimMlmState)); |
| 2279 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2280 | if( eLIM_MLM_WT_DEL_BSS_RSP_STATE != psessionEntry->limMlmState) |
| 2281 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2282 | limLog( pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2283 | FL( "Received unexpected WDA_DEL_BSS_RSP in state %d" ), |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2284 | psessionEntry->limMlmState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2285 | rc = eSIR_SME_REFUSED; |
| 2286 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2287 | } |
| 2288 | if (pDelBss->status != eHAL_STATUS_SUCCESS) |
| 2289 | { |
| 2290 | limLog(pMac, LOGE, FL("BSS: DEL_BSS_RSP error (%x) Bss %d "), |
| 2291 | pDelBss->status, pDelBss->bssIdx); |
| 2292 | rc = eSIR_SME_STOP_BSS_FAILURE; |
| 2293 | goto end; |
| 2294 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2295 | status = limSetLinkState(pMac, eSIR_LINK_IDLE_STATE, nullBssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2296 | psessionEntry->selfMacAddr, NULL, NULL); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2297 | if (status != eSIR_SUCCESS) |
| 2298 | { |
| 2299 | rc = eSIR_SME_REFUSED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2300 | goto end; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 2301 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2302 | /** Softmac may send all the buffered packets right after resuming the transmission hence |
| 2303 | * to occupy the medium during non channel occupancy period. So resume the transmission after |
| 2304 | * HAL gives back the response. |
| 2305 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2306 | #if 0 //TODO: How to handle this per session |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2307 | if (LIM_IS_RADAR_DETECTED(pMac)) |
| 2308 | { |
| 2309 | limFrameTransmissionControl(pMac, eLIM_TX_BSS_BUT_BEACON, eLIM_RESUME_TX); |
| 2310 | LIM_SET_RADAR_DETECTED(pMac, eANI_BOOLEAN_FALSE); |
| 2311 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2312 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2313 | dphHashTableClassInit(pMac, &psessionEntry->dph.dphHashTable);//TBD-RAJESH is it needed ? |
| 2314 | limDeletePreAuthList(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2315 | //Initialize number of associated stations during cleanup |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 2316 | psessionEntry->gLimNumOfCurrentSTAs = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2317 | end: |
| 2318 | limSendSmeRsp(pMac, eWNI_SME_STOP_BSS_RSP, rc, psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 2319 | peDeleteSession(pMac, psessionEntry); |
| 2320 | |
| 2321 | if(pDelBss != NULL) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2322 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2323 | vos_mem_free(pDelBss); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2324 | limMsgQ->bodyptr = NULL; |
| 2325 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2326 | } |
| 2327 | |
| 2328 | void limProcessMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 2329 | { |
| 2330 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 2331 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 2332 | //the deffered flag. |
| 2333 | |
| 2334 | tpPESession psessionEntry; |
| 2335 | tpDeleteStaParams pDeleteStaParams; |
| 2336 | pDeleteStaParams = (tpDeleteStaParams)limMsgQ->bodyptr; |
| 2337 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2338 | |
| 2339 | if(NULL == pDeleteStaParams || |
| 2340 | NULL == (psessionEntry = peFindSessionBySessionId(pMac, pDeleteStaParams->sessionId))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2341 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2342 | 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] | 2343 | if(pDeleteStaParams != NULL) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2344 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2345 | vos_mem_free(pDeleteStaParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2346 | limMsgQ->bodyptr = NULL; |
| 2347 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2348 | return; |
| 2349 | } |
| 2350 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2351 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2352 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2353 | ) |
| 2354 | { |
| 2355 | limProcessBtAmpApMlmDelStaRsp(pMac,limMsgQ,psessionEntry); |
| 2356 | return; |
| 2357 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2358 | limProcessStaMlmDelStaRsp(pMac, limMsgQ,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2359 | } |
| 2360 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2361 | void limProcessBtAmpApMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2362 | { |
| 2363 | tpDeleteStaParams pDelStaParams = (tpDeleteStaParams) limMsgQ->bodyptr; |
| 2364 | tpDphHashNode pStaDs; |
| 2365 | tSirResultCodes statusCode = eSIR_SME_SUCCESS; |
| 2366 | if(limMsgQ->bodyptr == NULL) |
| 2367 | { |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 2368 | limLog( pMac, LOGE, |
| 2369 | FL( "limMsgQ->bodyptry NULL")); |
| 2370 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2371 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2372 | pStaDs = dphGetHashEntry(pMac, pDelStaParams->assocId, &psessionEntry->dph.dphHashTable); |
| 2373 | if(pStaDs == NULL) |
| 2374 | { |
| 2375 | limLog( pMac, LOGE, |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 2376 | FL( "DPH Entry for STA %d missing."), pDelStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2377 | statusCode = eSIR_SME_REFUSED; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2378 | vos_mem_free(pDelStaParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2379 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2380 | |
| 2381 | return; |
| 2382 | } |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 2383 | limLog( pMac, LOG1, |
| 2384 | FL( "Received del Sta Rsp in StaD MlmState : %d"), |
| 2385 | pStaDs->mlmStaContext.mlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2386 | if( eHAL_STATUS_SUCCESS == pDelStaParams->status ) |
| 2387 | { |
| 2388 | limLog( pMac, LOGW, |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 2389 | FL( "AP received the DEL_STA_RSP for assocID: %d."), pDelStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2390 | |
| 2391 | if(( eLIM_MLM_WT_DEL_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState) && |
| 2392 | ( eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState)) |
| 2393 | { |
| 2394 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2395 | 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] | 2396 | limMlmStateStr(pStaDs->mlmStaContext.mlmState), pStaDs->staIndex, pStaDs->assocId); |
| 2397 | statusCode = eSIR_SME_REFUSED; |
| 2398 | goto end; |
| 2399 | } |
| 2400 | |
| 2401 | limLog( pMac, LOG1, |
| 2402 | FL("Deleted STA AssocID %d staId %d MAC "), |
| 2403 | pStaDs->assocId, pStaDs->staIndex); |
| 2404 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); |
| 2405 | if(eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE == pStaDs->mlmStaContext.mlmState) |
| 2406 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2407 | vos_mem_free(pDelStaParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2408 | limMsgQ->bodyptr = NULL; |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 2409 | if (limAddSta(pMac, pStaDs, false, psessionEntry) != eSIR_SUCCESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2410 | { |
| 2411 | PELOGE(limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2412 | FL("could not Add STA with assocId=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2413 | pStaDs->assocId);) |
| 2414 | // delete the TS if it has already been added. |
| 2415 | // send the response with error status. |
| 2416 | if(pStaDs->qos.addtsPresent) |
| 2417 | { |
| 2418 | tpLimTspecInfo pTspecInfo; |
| 2419 | if(eSIR_SUCCESS == limTspecFindByAssocId(pMac, pStaDs->assocId, |
| 2420 | &pStaDs->qos.addts.tspec, &pMac->lim.tspecInfo[0], &pTspecInfo)) |
| 2421 | { |
| 2422 | limAdmitControlDeleteTS(pMac, pStaDs->assocId, &pStaDs->qos.addts.tspec.tsinfo, |
| 2423 | NULL, &pTspecInfo->idx); |
| 2424 | } |
| 2425 | } |
| 2426 | limRejectAssociation(pMac, |
| 2427 | pStaDs->staAddr, |
| 2428 | pStaDs->mlmStaContext.subType, |
| 2429 | true, pStaDs->mlmStaContext.authType, |
| 2430 | pStaDs->assocId, true, |
| 2431 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 2432 | psessionEntry); |
| 2433 | } |
| 2434 | return; |
| 2435 | } |
| 2436 | } |
| 2437 | else |
| 2438 | { |
| 2439 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2440 | FL( "DEL STA failed!" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2441 | statusCode = eSIR_SME_REFUSED; |
| 2442 | } |
| 2443 | end: |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2444 | vos_mem_free(pDelStaParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2445 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2446 | if(eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState) |
| 2447 | { |
| 2448 | limPrepareAndSendDelStaCnf(pMac, pStaDs, statusCode,psessionEntry); |
| 2449 | } |
| 2450 | return; |
| 2451 | } |
| 2452 | |
| 2453 | void limProcessStaMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2454 | { |
| 2455 | tSirResultCodes statusCode = eSIR_SME_SUCCESS; |
| 2456 | tpDeleteStaParams pDelStaParams = (tpDeleteStaParams) limMsgQ->bodyptr; |
| 2457 | tpDphHashNode pStaDs = NULL; |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2458 | |
Padma, Santhosh Kumar | 9f72955 | 2017-01-09 14:06:30 +0530 | [diff] [blame] | 2459 | #ifdef WLAN_FEATURE_LFR_MBB |
| 2460 | if (pMac->ft.ftSmeContext.is_preauth_lfr_mbb) { |
| 2461 | lim_process_sta_mlm_del_sta_rsp_mbb(pMac, limMsgQ, psessionEntry); |
| 2462 | return; |
| 2463 | } |
| 2464 | #endif |
| 2465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2466 | if(NULL == pDelStaParams ) |
| 2467 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2468 | limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2469 | goto end; |
| 2470 | } |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2471 | |
| 2472 | limLog(pMac, LOG1, FL("Del STA RSP received. Status:%d AssocID:%d"), |
| 2473 | pDelStaParams->status, pDelStaParams->assocId); |
| 2474 | |
| 2475 | if (eHAL_STATUS_SUCCESS != pDelStaParams->status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2476 | { |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2477 | limLog(pMac, LOGE, FL("Del STA failed! Status:%d, still proceeding" |
| 2478 | "with Del BSS"), pDelStaParams->status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2479 | } |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2480 | |
| 2481 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 2482 | |
| 2483 | if (pStaDs == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2484 | { |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2485 | //TODO: any response to be sent out here ? |
| 2486 | limLog( pMac, LOGE, FL( "DPH Entry for STA %X missing."), |
| 2487 | pDelStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2488 | statusCode = eSIR_SME_REFUSED; |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2489 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2490 | } |
Kanchanapally, Vidyullatha | 8bfa41d | 2015-03-18 15:43:41 +0530 | [diff] [blame] | 2491 | |
| 2492 | if (eLIM_MLM_WT_DEL_STA_RSP_STATE != psessionEntry->limMlmState) |
| 2493 | { |
| 2494 | //TODO: any response to be sent out here ? |
| 2495 | limLog( pMac, LOGE, FL( "Received unexpected WDA_DELETE_STA_RSP in state %s" ), |
| 2496 | limMlmStateStr(psessionEntry->limMlmState)); |
| 2497 | statusCode = eSIR_SME_REFUSED; |
| 2498 | goto end; |
| 2499 | } |
| 2500 | |
| 2501 | limLog( pMac, LOG1, FL("STA AssocID %d MAC "), pStaDs->assocId ); |
| 2502 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); |
| 2503 | |
| 2504 | //we must complete all cleanup related to delSta before calling limDelBSS. |
| 2505 | if (0 != limMsgQ->bodyptr ) |
| 2506 | { |
| 2507 | vos_mem_free(pDelStaParams); |
| 2508 | limMsgQ->bodyptr = NULL; |
| 2509 | } |
| 2510 | |
| 2511 | // Proceed to do DelBSS even if DelSta resulted in failure |
| 2512 | statusCode = (tSirResultCodes) limDelBss(pMac, pStaDs, 0,psessionEntry); |
| 2513 | return; |
| 2514 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2515 | end: |
| 2516 | if( 0 != limMsgQ->bodyptr ) |
| 2517 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2518 | vos_mem_free(pDelStaParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2519 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2520 | } |
| 2521 | return; |
| 2522 | } |
| 2523 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2524 | void limProcessBtAmpApMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 2525 | { |
| 2526 | tpAddStaParams pAddStaParams = (tpAddStaParams) limMsgQ->bodyptr; |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2527 | tpDphHashNode pStaDs = NULL; |
| 2528 | |
| 2529 | if (NULL == pAddStaParams) |
| 2530 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2531 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2532 | goto end; |
| 2533 | } |
| 2534 | |
| 2535 | pStaDs = dphGetHashEntry(pMac, pAddStaParams->assocId, &psessionEntry->dph.dphHashTable); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2536 | if(pStaDs == NULL) |
| 2537 | { |
| 2538 | //TODO: any response to be sent out here ? |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2539 | limLog( pMac, LOGE, FL( "DPH Entry for STA %X missing."), pAddStaParams->assocId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2540 | goto end; |
| 2541 | } |
| 2542 | // |
| 2543 | // TODO & FIXME_GEN4 |
| 2544 | // Need to inspect tSirMsgQ.reserved for a valid Dialog token! |
| 2545 | // |
| 2546 | //TODO: any check for pMac->lim.gLimMlmState ? |
| 2547 | if( eLIM_MLM_WT_ADD_STA_RSP_STATE != pStaDs->mlmStaContext.mlmState) |
| 2548 | { |
| 2549 | //TODO: any response to be sent out here ? |
| 2550 | limLog( pMac, LOGE, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 2551 | FL( "Received unexpected WDA_ADD_STA_RSP in state %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2552 | pStaDs->mlmStaContext.mlmState); |
| 2553 | goto end; |
| 2554 | } |
| 2555 | if(eHAL_STATUS_SUCCESS != pAddStaParams->status) |
| 2556 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2557 | 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] | 2558 | limRejectAssociation(pMac, pStaDs->staAddr, |
| 2559 | pStaDs->mlmStaContext.subType, |
| 2560 | true, pStaDs->mlmStaContext.authType, |
| 2561 | pStaDs->assocId, true, |
| 2562 | (tSirResultCodes) eSIR_MAC_UNSPEC_FAILURE_STATUS, |
| 2563 | psessionEntry); |
| 2564 | goto end; |
| 2565 | } |
| 2566 | pStaDs->bssId = pAddStaParams->bssIdx; |
| 2567 | pStaDs->staIndex = pAddStaParams->staIdx; |
| 2568 | //if the AssocRsp frame is not acknowledged, then keep alive timer will take care of the state |
| 2569 | pStaDs->valid = 1; |
| 2570 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_ASSOC_CNF_STATE; |
| 2571 | limLog( pMac, LOG1, |
Sachin Ahuja | 2fea3d1 | 2014-12-18 17:31:31 +0530 | [diff] [blame] | 2572 | FL("AddStaRsp Success.STA AssocID %d staId %d MAC "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2573 | pStaDs->assocId, |
| 2574 | pStaDs->staIndex); |
| 2575 | limPrintMacAddr(pMac, pStaDs->staAddr, LOG1); |
| 2576 | |
| 2577 | /* For BTAMP-AP, the flow sequence shall be: |
| 2578 | * 1) PE sends eWNI_SME_ASSOC_IND to SME |
| 2579 | * 2) PE receives eWNI_SME_ASSOC_CNF from SME |
| 2580 | * 3) BTAMP-AP sends Re/Association Response to BTAMP-STA |
| 2581 | */ |
| 2582 | limSendMlmAssocInd(pMac, pStaDs, psessionEntry); |
| 2583 | // fall though to reclaim the original Add STA Response message |
| 2584 | end: |
| 2585 | if( 0 != limMsgQ->bodyptr ) |
| 2586 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2587 | vos_mem_free(pAddStaParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2588 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2589 | } |
| 2590 | return; |
| 2591 | } |
| 2592 | |
| 2593 | /** |
| 2594 | * limProcessApMlmAddBssRsp() |
| 2595 | * |
| 2596 | *FUNCTION: |
| 2597 | * This function is called to process a WDA_ADD_BSS_RSP from HAL. |
| 2598 | * Upon receipt of this message from HAL, MLME - |
| 2599 | * > Validates the result of WDA_ADD_BSS_REQ |
| 2600 | * > Init other remaining LIM variables |
| 2601 | * > Init the AID pool, for that BSSID |
| 2602 | * > Init the Pre-AUTH list, for that BSSID |
| 2603 | * > Create LIM timers, specific to that BSSID |
| 2604 | * > Init DPH related parameters that are specific to that BSSID |
| 2605 | * > TODO - When do we do the actual change channel? |
| 2606 | * |
| 2607 | *LOGIC: |
| 2608 | * SME sends eWNI_SME_START_BSS_REQ to LIM |
| 2609 | * LIM sends LIM_MLM_START_REQ to MLME |
| 2610 | * MLME sends WDA_ADD_BSS_REQ to HAL |
| 2611 | * HAL responds with WDA_ADD_BSS_RSP to MLME |
| 2612 | * MLME responds with LIM_MLM_START_CNF to LIM |
| 2613 | * LIM responds with eWNI_SME_START_BSS_RSP to SME |
| 2614 | * |
| 2615 | *ASSUMPTIONS: |
| 2616 | * tSirMsgQ.body is allocated by MLME during limProcessMlmStartReq |
| 2617 | * tSirMsgQ.body will now be freed by this routine |
| 2618 | * |
| 2619 | *NOTE: |
| 2620 | * |
| 2621 | * @param pMac Pointer to Global MAC structure |
| 2622 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 2623 | * |
| 2624 | * @return None |
| 2625 | */ |
| 2626 | static void |
| 2627 | limProcessApMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ) |
| 2628 | { |
| 2629 | tLimMlmStartCnf mlmStartCnf; |
| 2630 | tANI_U32 val; |
| 2631 | tpPESession psessionEntry; |
| 2632 | // tANI_U8 sessionId; |
| 2633 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 2634 | if(NULL == pAddBssParams ) |
| 2635 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2636 | limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2637 | goto end; |
| 2638 | } |
| 2639 | //TBD: free the memory before returning, do it for all places where lookup fails. |
| 2640 | if((psessionEntry = peFindSessionBySessionId(pMac,pAddBssParams->sessionId))== NULL) |
| 2641 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2642 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2643 | if( NULL != pAddBssParams ) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2644 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 2645 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2646 | vos_mem_free(pAddBssParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2647 | limMsgQ->bodyptr = NULL; |
| 2648 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2649 | return; |
| 2650 | } |
| 2651 | /* Update PE session Id*/ |
| 2652 | mlmStartCnf.sessionId = pAddBssParams->sessionId; |
| 2653 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 2654 | { |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 2655 | 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] | 2656 | if (limSetLinkState(pMac, eSIR_LINK_AP_STATE,psessionEntry->bssId, |
| 2657 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 2658 | goto end; |
| 2659 | // Set MLME state |
| 2660 | psessionEntry->limMlmState = eLIM_MLM_BSS_STARTED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2661 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2662 | if( eSIR_IBSS_MODE == pAddBssParams->bssType ) |
| 2663 | { |
| 2664 | /** IBSS is 'active' when we receive |
| 2665 | * Beacon frames from other STAs that are part of same IBSS. |
| 2666 | * Mark internal state as inactive until then. |
| 2667 | */ |
| 2668 | psessionEntry->limIbssActive = false; |
| 2669 | psessionEntry->statypeForBss = STA_ENTRY_PEER; //to know session created for self/peer |
| 2670 | limResetHBPktCount( psessionEntry ); |
| 2671 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2672 | 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] | 2673 | if (limActivateHearBeatTimer(pMac, psessionEntry) != TX_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2674 | limLog(pMac, LOGP, FL("could not activate Heartbeat timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2675 | } |
| 2676 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 2677 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2678 | psessionEntry->limSystemRole = eLIM_STA_IN_IBSS_ROLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2679 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2680 | if ( eSIR_INFRA_AP_MODE == pAddBssParams->bssType ) |
| 2681 | psessionEntry->limSystemRole = eLIM_AP_ROLE; |
| 2682 | else |
| 2683 | psessionEntry->limSystemRole = eLIM_STA_IN_IBSS_ROLE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2684 | schEdcaProfileUpdate(pMac, psessionEntry); |
| 2685 | limInitPreAuthList(pMac); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 2686 | limInitPeerIdxpool(pMac,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2687 | // Create timers used by LIM |
| 2688 | if (!pMac->lim.gLimTimersCreated) |
| 2689 | limCreateTimers(pMac); |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 2690 | |
| 2691 | // Start OLBC timer |
| 2692 | if (tx_timer_activate(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer) != TX_SUCCESS) |
| 2693 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2694 | limLog(pMac, LOGE, FL("tx_timer_activate failed")); |
Madan Mohan Koyyalamudi | 788b4ee | 2012-09-25 10:42:09 -0700 | [diff] [blame] | 2695 | } |
| 2696 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2697 | /* Update the lim global gLimTriggerBackgroundScanDuringQuietBss */ |
| 2698 | 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] | 2699 | 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] | 2700 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = (val) ? 1 : 0; |
| 2701 | // Apply previously set configuration at HW |
| 2702 | limApplyConfiguration(pMac,psessionEntry); |
| 2703 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 2704 | mlmStartCnf.resultCode = eSIR_SME_SUCCESS; |
| 2705 | } |
| 2706 | else |
| 2707 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2708 | 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] | 2709 | mlmStartCnf.resultCode = eSIR_SME_HAL_SEND_MESSAGE_FAIL; |
| 2710 | } |
| 2711 | limPostSmeMessage( pMac, LIM_MLM_START_CNF, (tANI_U32 *) &mlmStartCnf ); |
| 2712 | end: |
| 2713 | if( 0 != limMsgQ->bodyptr ) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2714 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 2715 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2716 | vos_mem_free(pAddBssParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2717 | limMsgQ->bodyptr = NULL; |
| 2718 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2719 | } |
| 2720 | |
| 2721 | |
| 2722 | /** |
| 2723 | * limProcessIbssMlmAddBssRsp() |
| 2724 | * |
| 2725 | *FUNCTION: |
| 2726 | * This function is called to process a WDA_ADD_BSS_RSP from HAL. |
| 2727 | * Upon receipt of this message from HAL, MLME - |
| 2728 | * > Validates the result of WDA_ADD_BSS_REQ |
| 2729 | * > Init other remaining LIM variables |
| 2730 | * > Init the AID pool, for that BSSID |
| 2731 | * > Init the Pre-AUTH list, for that BSSID |
| 2732 | * > Create LIM timers, specific to that BSSID |
| 2733 | * > Init DPH related parameters that are specific to that BSSID |
| 2734 | * > TODO - When do we do the actual change channel? |
| 2735 | * |
| 2736 | *LOGIC: |
| 2737 | * SME sends eWNI_SME_START_BSS_REQ to LIM |
| 2738 | * LIM sends LIM_MLM_START_REQ to MLME |
| 2739 | * MLME sends WDA_ADD_BSS_REQ to HAL |
| 2740 | * HAL responds with WDA_ADD_BSS_RSP to MLME |
| 2741 | * MLME responds with LIM_MLM_START_CNF to LIM |
| 2742 | * LIM responds with eWNI_SME_START_BSS_RSP to SME |
| 2743 | * |
| 2744 | *ASSUMPTIONS: |
| 2745 | * tSirMsgQ.body is allocated by MLME during limProcessMlmStartReq |
| 2746 | * tSirMsgQ.body will now be freed by this routine |
| 2747 | * |
| 2748 | *NOTE: |
| 2749 | * |
| 2750 | * @param pMac Pointer to Global MAC structure |
| 2751 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 2752 | * |
| 2753 | * @return None |
| 2754 | */ |
| 2755 | static void |
| 2756 | limProcessIbssMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession psessionEntry) |
| 2757 | { |
| 2758 | tLimMlmStartCnf mlmStartCnf; |
| 2759 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 2760 | tANI_U32 val; |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2761 | |
| 2762 | if (NULL == pAddBssParams) |
| 2763 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2764 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2765 | goto end; |
| 2766 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2767 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 2768 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2769 | 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] | 2770 | if (limSetLinkState(pMac, eSIR_LINK_IBSS_STATE,psessionEntry->bssId, |
| 2771 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 2772 | goto end; |
| 2773 | // Set MLME state |
| 2774 | psessionEntry->limMlmState = eLIM_MLM_BSS_STARTED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2775 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2776 | /** IBSS is 'active' when we receive |
| 2777 | * Beacon frames from other STAs that are part of same IBSS. |
| 2778 | * Mark internal state as inactive until then. |
| 2779 | */ |
| 2780 | psessionEntry->limIbssActive = false; |
| 2781 | limResetHBPktCount( psessionEntry ); |
| 2782 | /* Timer related functions are not modified for BT-AMP : To be Done */ |
| 2783 | limHeartBeatDeactivateAndChangeTimer(pMac, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2784 | 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] | 2785 | if (limActivateHearBeatTimer(pMac, psessionEntry) != TX_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2786 | limLog(pMac, LOGP, FL("could not activate Heartbeat timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2787 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 2788 | psessionEntry->limSystemRole = eLIM_STA_IN_IBSS_ROLE; |
| 2789 | psessionEntry->statypeForBss = STA_ENTRY_SELF; |
| 2790 | schEdcaProfileUpdate(pMac, psessionEntry); |
| 2791 | //TBD-RAJESH limInitPreauthList should re removed for IBSS also ????? |
| 2792 | //limInitPreAuthList(pMac); |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 2793 | if (0 == psessionEntry->freePeerIdxHead) |
| 2794 | limInitPeerIdxpool(pMac,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2795 | // Create timers used by LIM |
| 2796 | #ifdef FIXME_GEN6 //following code may not be required, as limCreateTimers is now invoked from limInitialize (peStart) |
| 2797 | if (!pMac->lim.gLimTimersCreated) |
| 2798 | limCreateTimers(pMac); |
| 2799 | #endif |
| 2800 | /* Update the lim global gLimTriggerBackgroundScanDuringQuietBss */ |
| 2801 | 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] | 2802 | 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] | 2803 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = (val) ? 1 : 0; |
| 2804 | // Apply previously set configuration at HW |
| 2805 | limApplyConfiguration(pMac,psessionEntry); |
| 2806 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 2807 | mlmStartCnf.resultCode = eSIR_SME_SUCCESS; |
| 2808 | //If ADD BSS was issued as part of IBSS coalescing, don't send the message to SME, as that is internal to LIM |
| 2809 | if(true == pMac->lim.gLimIbssCoalescingHappened) |
| 2810 | { |
| 2811 | limIbssAddBssRspWhenCoalescing(pMac, limMsgQ->bodyptr, psessionEntry); |
| 2812 | goto end; |
| 2813 | } |
| 2814 | } |
| 2815 | else |
| 2816 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2817 | limLog( pMac, LOGE, FL( "WDA_ADD_BSS_REQ failed with status %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2818 | pAddBssParams->status ); |
| 2819 | mlmStartCnf.resultCode = eSIR_SME_HAL_SEND_MESSAGE_FAIL; |
| 2820 | } |
| 2821 | //Send this message to SME, when ADD_BSS is initiated by SME |
| 2822 | //If ADD_BSS is done as part of coalescing, this won't happen. |
| 2823 | /* Update PE session Id*/ |
| 2824 | mlmStartCnf.sessionId =psessionEntry->peSessionId; |
| 2825 | limPostSmeMessage( pMac, LIM_MLM_START_CNF, (tANI_U32 *) &mlmStartCnf ); |
| 2826 | end: |
| 2827 | if( 0 != limMsgQ->bodyptr ) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2828 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 2829 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2830 | vos_mem_free(pAddBssParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2831 | limMsgQ->bodyptr = NULL; |
| 2832 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2833 | } |
| 2834 | |
| 2835 | static void |
| 2836 | limProcessStaMlmAddBssRspPreAssoc( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession psessionEntry ) |
| 2837 | { |
| 2838 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 2839 | tAniAuthType cfgAuthType, authMode; |
| 2840 | tLimMlmAuthReq *pMlmAuthReq; |
| 2841 | tpDphHashNode pStaDs = NULL; |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2842 | |
| 2843 | if (NULL == pAddBssParams) |
| 2844 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2845 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 2846 | goto joinFailure; |
| 2847 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2848 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 2849 | { |
| 2850 | if ((pStaDs = dphAddHashEntry(pMac, pAddBssParams->staContext.staMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable)) == NULL) |
| 2851 | { |
| 2852 | // Could not add hash table entry |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2853 | 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] | 2854 | limPrintMacAddr(pMac, pAddBssParams->staContext.staMac, LOGE); |
| 2855 | goto joinFailure; |
| 2856 | } |
| 2857 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 2858 | //Success, handle below |
| 2859 | pStaDs->bssId = pAddBssParams->bssIdx; |
| 2860 | //STA Index(genr by HAL) for the BSS entry is stored here |
| 2861 | pStaDs->staIndex = pAddBssParams->staContext.staIdx; |
| 2862 | // Trigger Authentication with AP |
| 2863 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATION_TYPE, |
| 2864 | (tANI_U32 *) &cfgAuthType) != eSIR_SUCCESS) |
| 2865 | { |
| 2866 | /** |
| 2867 | * Could not get AuthType from CFG. |
| 2868 | * Log error. |
| 2869 | */ |
| 2870 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2871 | FL("could not retrieve AuthType")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2872 | } |
| 2873 | if (cfgAuthType == eSIR_AUTO_SWITCH) |
Hu Wang | 0650dbc | 2015-12-07 13:44:57 +0800 | [diff] [blame] | 2874 | authMode = eSIR_SHARED_KEY; // Try Shared Authentication first |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2875 | else |
| 2876 | authMode = cfgAuthType; |
| 2877 | |
| 2878 | // Trigger MAC based Authentication |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2879 | pMlmAuthReq = vos_mem_malloc(sizeof(tLimMlmAuthReq)); |
| 2880 | if ( NULL == pMlmAuthReq ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2881 | { |
| 2882 | // Log error |
| 2883 | limLog(pMac, LOGP, |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2884 | FL("call to AllocateMemory failed for mlmAuthReq")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2885 | return; |
| 2886 | } |
| 2887 | #if 0 |
| 2888 | val = sizeof(tSirMacAddr); |
| 2889 | if (wlan_cfgGetStr(pMac, WNI_CFG_BSSID, |
| 2890 | pMlmAuthReq->peerMacAddr, |
| 2891 | &val) != eSIR_SUCCESS) |
| 2892 | { |
| 2893 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2894 | limLog(pMac, LOGP, FL("could not retrieve BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2895 | } |
| 2896 | #endif //TO SUPPORT BT-AMP |
| 2897 | sirCopyMacAddr(pMlmAuthReq->peerMacAddr,psessionEntry->bssId); |
| 2898 | |
| 2899 | pMlmAuthReq->authType = authMode; |
| 2900 | if (wlan_cfgGetInt(pMac, WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT, |
| 2901 | (tANI_U32 *) &pMlmAuthReq->authFailureTimeout) |
| 2902 | != eSIR_SUCCESS) |
| 2903 | { |
| 2904 | /** |
| 2905 | * Could not get AuthFailureTimeout |
| 2906 | * value from CFG. Log error. |
| 2907 | */ |
| 2908 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2909 | FL("could not retrieve AuthFailureTimeout value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2910 | } |
| 2911 | // SUNIT_FIX_ME: Set BOTH? Assume not. Please verify here and below. |
| 2912 | //pMac->lim.gLimMlmState = eLIM_MLM_JOINED_STATE; |
| 2913 | psessionEntry->limMlmState = eLIM_MLM_JOINED_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2914 | 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] | 2915 | pMlmAuthReq->sessionId = psessionEntry->peSessionId; |
| 2916 | psessionEntry->limPrevSmeState = psessionEntry->limSmeState; |
| 2917 | psessionEntry->limSmeState = eLIM_SME_WT_AUTH_STATE; |
| 2918 | // remember staId in case of assoc timeout/failure handling |
| 2919 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 2920 | |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 2921 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, |
| 2922 | psessionEntry->peSessionId, psessionEntry->limSmeState)); |
| 2923 | limLog(pMac,LOG1,"SessionId:%d limPostMlmMessage LIM_MLM_AUTH_REQ" |
| 2924 | "with limSmeState:%d",psessionEntry->peSessionId, |
| 2925 | psessionEntry->limSmeState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2926 | limPostMlmMessage(pMac, |
| 2927 | LIM_MLM_AUTH_REQ, |
| 2928 | (tANI_U32 *) pMlmAuthReq); |
| 2929 | return; |
| 2930 | } |
| 2931 | |
| 2932 | joinFailure: |
| 2933 | { |
| 2934 | psessionEntry->limSmeState = eLIM_SME_JOIN_FAILURE_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2935 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2936 | |
| 2937 | /// Send Join response to Host |
| 2938 | limHandleSmeJoinResult(pMac, eSIR_SME_REFUSED, eSIR_MAC_UNSPEC_FAILURE_STATUS, psessionEntry); |
| 2939 | |
| 2940 | } |
| 2941 | |
| 2942 | } |
| 2943 | |
| 2944 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2945 | /*------------------------------------------------------------------------------------------ |
| 2946 | * |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 2947 | * Function to handle WDA_ADD_BSS_RSP, in FT reassoc state. |
| 2948 | * Function to Send ReAssociation Request. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2949 | * |
| 2950 | * |
| 2951 | *------------------------------------------------------------------------------------------ |
| 2952 | */ |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 2953 | static inline void |
| 2954 | limProcessStaMlmAddBssRspFT(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2955 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2956 | tLimMlmReassocCnf mlmReassocCnf; // keep sme |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2957 | tpDphHashNode pStaDs = NULL; |
| 2958 | tpAddStaParams pAddStaParams = NULL; |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2959 | tANI_U32 listenInterval = WNI_CFG_LISTEN_INTERVAL_STADEF; |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 2960 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
Varun Reddy Yeturu | ee871e3 | 2014-02-20 14:20:51 -0800 | [diff] [blame] | 2961 | tANI_U32 selfStaDot11Mode = 0; |
Sachin Ahuja | 07a4301 | 2015-01-30 17:04:38 +0530 | [diff] [blame] | 2962 | #ifdef FEATURE_WLAN_ESE |
| 2963 | tLimMlmReassocReq *pMlmReassocReq; |
| 2964 | tANI_U32 val = 0; |
| 2965 | #endif |
Varun Reddy Yeturu | ee871e3 | 2014-02-20 14:20:51 -0800 | [diff] [blame] | 2966 | |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2967 | /* Sanity Checks */ |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2968 | |
| 2969 | if (pAddBssParams == NULL) |
| 2970 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2971 | PELOGE(limLog(pMac, LOGE, FL("Invalid parameters"));) |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2972 | goto end; |
| 2973 | } |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2974 | if((psessionEntry = peFindSessionBySessionId(pMac,pAddBssParams->sessionId))== NULL) |
| 2975 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2976 | limLog( pMac, LOGE, FL( "Session Does not exist for given sessionId" )); |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 2977 | goto end; |
| 2978 | } |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 2979 | if ( eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE != psessionEntry->limMlmState ) |
| 2980 | { |
| 2981 | goto end; |
| 2982 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2983 | |
| 2984 | if ((pStaDs = dphAddHashEntry(pMac, pAddBssParams->bssId, DPH_STA_HASH_INDEX_PEER, |
| 2985 | &psessionEntry->dph.dphHashTable)) == NULL) |
| 2986 | { |
| 2987 | // Could not add hash table entry |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2988 | 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] | 2989 | limPrintMacAddr(pMac, pAddBssParams->staContext.staMac, LOGE); |
| 2990 | goto end; |
| 2991 | } |
Girish Gowli | 1c2fc80 | 2015-01-19 16:18:07 +0530 | [diff] [blame] | 2992 | if (pMac->roam.configParam.roamDelayStatsEnabled) |
| 2993 | { |
| 2994 | vos_record_roam_event(e_LIM_ADD_BS_RSP, NULL, 0); |
| 2995 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2996 | // Prepare and send Reassociation request frame |
| 2997 | // start reassoc timer. |
Sachin Ahuja | 07a4301 | 2015-01-30 17:04:38 +0530 | [diff] [blame] | 2998 | |
| 2999 | |
| 3000 | #ifdef FEATURE_WLAN_ESE |
| 3001 | /* |
| 3002 | * In case of Ese Reassociation, change the reassoc timer |
| 3003 | * value. |
| 3004 | */ |
| 3005 | pMlmReassocReq = (tLimMlmReassocReq *)(psessionEntry->pLimMlmReassocReq); |
| 3006 | if (pMlmReassocReq == NULL) |
| 3007 | { |
| 3008 | limLog(pMac, LOGE, |
| 3009 | FL("Invalid pMlmReassocReq")); |
| 3010 | goto end; |
| 3011 | } |
| 3012 | val = pMlmReassocReq->reassocFailureTimeout; |
| 3013 | if (psessionEntry->isESEconnection) |
| 3014 | { |
| 3015 | val = val/LIM_MAX_REASSOC_RETRY_LIMIT; |
| 3016 | } |
| 3017 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != |
| 3018 | TX_SUCCESS) |
| 3019 | { |
| 3020 | limLog(pMac, LOGP, |
| 3021 | FL("unable to deactivate Reassoc failure timer")); |
| 3022 | } |
| 3023 | val = SYS_MS_TO_TICKS(val); |
| 3024 | if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, |
| 3025 | val, 0) != TX_SUCCESS) |
| 3026 | { |
| 3027 | limLog(pMac, LOGP, |
| 3028 | FL("unable to change Reassociation failure timer")); |
| 3029 | } |
| 3030 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3031 | pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; |
| 3032 | /// Start reassociation failure timer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3033 | 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] | 3034 | if (tx_timer_activate(&pMac->lim.limTimers.gLimReassocFailureTimer) |
| 3035 | != TX_SUCCESS) |
| 3036 | { |
| 3037 | /// Could not start reassoc failure timer. |
| 3038 | // Log error |
| 3039 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3040 | FL("could not start Reassociation failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3041 | // Return Reassoc confirm with |
| 3042 | // Resources Unavailable |
| 3043 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3044 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 3045 | goto end; |
| 3046 | } |
Mihir Shete | 63561c8 | 2014-08-23 16:58:07 +0530 | [diff] [blame] | 3047 | // remember staId |
| 3048 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 3049 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3050 | #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] | 3051 | pMac->lim.pSessionEntry = psessionEntry; |
| 3052 | if(NULL == pMac->lim.pSessionEntry->pLimMlmReassocRetryReq) |
| 3053 | { |
| 3054 | /* Take a copy of reassoc request for retrying */ |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3055 | pMac->lim.pSessionEntry->pLimMlmReassocRetryReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); |
| 3056 | if ( NULL == pMac->lim.pSessionEntry->pLimMlmReassocRetryReq ) goto end; |
| 3057 | vos_mem_set(pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, sizeof(tLimMlmReassocReq), 0); |
| 3058 | vos_mem_copy(pMac->lim.pSessionEntry->pLimMlmReassocRetryReq, |
| 3059 | psessionEntry->pLimMlmReassocReq, |
| 3060 | sizeof(tLimMlmReassocReq)); |
Madan Mohan Koyyalamudi | 61bc566 | 2012-11-02 14:33:10 -0700 | [diff] [blame] | 3061 | } |
| 3062 | pMac->lim.reAssocRetryAttempt = 0; |
| 3063 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3064 | limSendReassocReqWithFTIEsMgmtFrame(pMac, psessionEntry->pLimMlmReassocReq, psessionEntry); |
Girish Gowli | 1c2fc80 | 2015-01-19 16:18:07 +0530 | [diff] [blame] | 3065 | if (pMac->roam.configParam.roamDelayStatsEnabled) |
| 3066 | { |
| 3067 | vos_record_roam_event(e_LIM_SEND_REASSOC_REQ, NULL, 0); |
| 3068 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3069 | psessionEntry->limPrevMlmState = psessionEntry->limMlmState; |
| 3070 | psessionEntry->limMlmState = eLIM_MLM_WT_FT_REASSOC_RSP_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 3071 | 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] | 3072 | 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] | 3073 | psessionEntry->limMlmState, psessionEntry->peSessionId);) |
| 3074 | |
| 3075 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 3076 | |
| 3077 | //Success, handle below |
| 3078 | pStaDs->bssId = pAddBssParams->bssIdx; |
| 3079 | //STA Index(genr by HAL) for the BSS entry is stored here |
| 3080 | pStaDs->staIndex = pAddBssParams->staContext.staIdx; |
| 3081 | pStaDs->ucUcastSig = pAddBssParams->staContext.ucUcastSig; |
| 3082 | pStaDs->ucBcastSig = pAddBssParams->staContext.ucBcastSig; |
| 3083 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3084 | #if defined WLAN_FEATURE_VOWIFI |
| 3085 | rrmCacheMgmtTxPower( pMac, pAddBssParams->txMgmtPower, psessionEntry ); |
| 3086 | #endif |
| 3087 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3088 | pAddStaParams = vos_mem_malloc(sizeof( tAddStaParams )); |
| 3089 | if ( NULL == pAddStaParams ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3090 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3091 | limLog( pMac, LOGP, FL( "Unable to allocate memory during ADD_STA" )); |
Jeff Johnson | 19ba888 | 2013-04-03 17:02:37 -0700 | [diff] [blame] | 3092 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3093 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3094 | vos_mem_set((tANI_U8 *) pAddStaParams, sizeof(tAddStaParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3095 | |
| 3096 | /// Add STA context at MAC HW (BMU, RHP & TFP) |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3097 | vos_mem_copy((tANI_U8 *) pAddStaParams->staMac, |
| 3098 | (tANI_U8 *) psessionEntry->selfMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3099 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3100 | vos_mem_copy((tANI_U8 *) pAddStaParams->bssId, |
| 3101 | psessionEntry->bssId, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3102 | |
| 3103 | // Update this when we get reassoc rsp , with success. |
| 3104 | // pAddStaParams->assocId = psessionEntry->limAID; |
| 3105 | |
| 3106 | pAddStaParams->staType = STA_ENTRY_SELF; |
| 3107 | pAddStaParams->status = eHAL_STATUS_SUCCESS; |
| 3108 | pAddStaParams->respReqd = 1; |
| 3109 | |
| 3110 | /* Update PE session ID */ |
| 3111 | pAddStaParams->sessionId = psessionEntry->peSessionId; |
| 3112 | |
| 3113 | // This will indicate HAL to "allocate" a new STA index |
| 3114 | pAddStaParams->staIdx = HAL_STA_INVALID_IDX; |
| 3115 | pAddStaParams->updateSta = FALSE; |
| 3116 | |
| 3117 | pAddStaParams->shortPreambleSupported = (tANI_U8)psessionEntry->beaconParams.fShortPreamble; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3118 | #ifdef WLAN_FEATURE_11AC |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 3119 | limPopulatePeerRateSet(pMac, &pAddStaParams->supportedRates, NULL, false,psessionEntry, NULL); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3120 | #else |
Leela Venkata Kiran Kumar Reddy Chirala | 85c9fb1 | 2013-09-05 20:47:36 -0700 | [diff] [blame] | 3121 | limPopulatePeerRateSet(pMac, &pAddStaParams->supportedRates, NULL, false,psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3122 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3123 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3124 | if( psessionEntry->htCapability) |
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 | pAddStaParams->htCapable = psessionEntry->htCapability; |
Varun Reddy Yeturu | ee871e3 | 2014-02-20 14:20:51 -0800 | [diff] [blame] | 3127 | #ifdef WLAN_FEATURE_11AC |
| 3128 | pAddStaParams->vhtCapable = psessionEntry->vhtCapability; |
| 3129 | pAddStaParams->vhtTxChannelWidthSet = psessionEntry->vhtTxChannelWidthSet; |
| 3130 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3131 | #ifdef DISABLE_GF_FOR_INTEROP |
| 3132 | /* |
| 3133 | * To resolve the interop problem with Broadcom AP, |
| 3134 | * where TQ STA could not pass traffic with GF enabled, |
| 3135 | * TQ STA will do Greenfield only with TQ AP, for |
| 3136 | * everybody else it will be turned off. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3137 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3138 | if( (psessionEntry->pLimJoinReq != NULL) && (!psessionEntry->pLimJoinReq->bssDescription.aniIndicator)) |
| 3139 | { |
| 3140 | limLog( pMac, LOGE, FL(" Turning off Greenfield, when adding self entry")); |
| 3141 | pAddStaParams->greenFieldCapable = WNI_CFG_GREENFIELD_CAPABILITY_DISABLE; |
| 3142 | } |
| 3143 | else |
| 3144 | #endif |
| 3145 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3146 | pAddStaParams->greenFieldCapable = limGetHTCapability( pMac, eHT_GREENFIELD, psessionEntry); |
Varun Reddy Yeturu | ee871e3 | 2014-02-20 14:20:51 -0800 | [diff] [blame] | 3147 | if (psessionEntry->limRFBand == SIR_BAND_2_4_GHZ) |
| 3148 | { |
| 3149 | pAddStaParams->txChannelWidthSet = |
| 3150 | pMac->roam.configParam.channelBondingMode24GHz; |
| 3151 | } |
| 3152 | else |
| 3153 | { |
| 3154 | pAddStaParams->txChannelWidthSet = |
| 3155 | pMac->roam.configParam.channelBondingMode5GHz; |
| 3156 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3157 | pAddStaParams->mimoPS = limGetHTCapability( pMac, eHT_MIMO_POWER_SAVE, psessionEntry ); |
| 3158 | pAddStaParams->rifsMode = limGetHTCapability( pMac, eHT_RIFS_MODE, psessionEntry ); |
| 3159 | pAddStaParams->lsigTxopProtection = limGetHTCapability( pMac, eHT_LSIG_TXOP_PROTECTION, psessionEntry ); |
| 3160 | pAddStaParams->delBASupport = limGetHTCapability( pMac, eHT_DELAYED_BA, psessionEntry ); |
| 3161 | pAddStaParams->maxAmpduDensity = limGetHTCapability( pMac, eHT_MPDU_DENSITY, psessionEntry ); |
| 3162 | pAddStaParams->maxAmpduSize = limGetHTCapability(pMac, eHT_MAX_RX_AMPDU_FACTOR, psessionEntry); |
| 3163 | pAddStaParams->maxAmsduSize = limGetHTCapability( pMac, eHT_MAX_AMSDU_LENGTH, psessionEntry ); |
| 3164 | pAddStaParams->fDsssCckMode40Mhz = limGetHTCapability( pMac, eHT_DSSS_CCK_MODE_40MHZ, psessionEntry); |
| 3165 | pAddStaParams->fShortGI20Mhz = limGetHTCapability( pMac, eHT_SHORT_GI_20MHZ, psessionEntry); |
| 3166 | pAddStaParams->fShortGI40Mhz = limGetHTCapability( pMac, eHT_SHORT_GI_40MHZ, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3167 | } |
| 3168 | |
| 3169 | if (wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &listenInterval) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3170 | limLog(pMac, LOGP, FL("Couldn't get LISTEN_INTERVAL")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3171 | pAddStaParams->listenInterval = (tANI_U16)listenInterval; |
Varun Reddy Yeturu | ee871e3 | 2014-02-20 14:20:51 -0800 | [diff] [blame] | 3172 | wlan_cfgGetInt(pMac, WNI_CFG_DOT11_MODE, &selfStaDot11Mode); |
| 3173 | pAddStaParams->supportedRates.opRateMode = limGetStaRateMode((tANI_U8)selfStaDot11Mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3174 | // Lets save this for when we receive the Reassoc Rsp |
| 3175 | pMac->ft.ftPEContext.pAddStaReq = pAddStaParams; |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 3176 | |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 3177 | if (pAddBssParams != NULL) |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 3178 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3179 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 3180 | vos_mem_free(pAddBssParams); |
| 3181 | pAddBssParams = NULL; |
| 3182 | limMsgQ->bodyptr = NULL; |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 3183 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3184 | return; |
| 3185 | |
| 3186 | end: |
| 3187 | // Free up buffer allocated for reassocReq |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 3188 | if (psessionEntry != NULL) |
| 3189 | if (psessionEntry->pLimMlmReassocReq != NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3190 | { |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 3191 | vos_mem_free(psessionEntry->pLimMlmReassocReq); |
| 3192 | psessionEntry->pLimMlmReassocReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3193 | } |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 3194 | |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 3195 | if (pAddBssParams != NULL) |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 3196 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3197 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Varun Reddy Yeturu | cf58934 | 2013-08-09 09:31:50 -0700 | [diff] [blame] | 3198 | vos_mem_free(pAddBssParams); |
| 3199 | pAddBssParams = NULL; |
| 3200 | limMsgQ->bodyptr = NULL; |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 3201 | } |
| 3202 | |
| 3203 | mlmReassocCnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; |
| 3204 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Gopichand Nakkala | 94273ab | 2013-03-25 14:47:39 +0530 | [diff] [blame] | 3205 | /* Update PE session Id*/ |
Kiran Kumar Lokere | a4db3dc | 2013-03-25 18:05:24 -0700 | [diff] [blame] | 3206 | if (psessionEntry != NULL) |
| 3207 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
Jeff Johnson | 19ba888 | 2013-04-03 17:02:37 -0700 | [diff] [blame] | 3208 | else |
| 3209 | mlmReassocCnf.sessionId = 0; |
Dhanashri Atre | 4a6e3ea | 2012-12-12 14:10:33 -0800 | [diff] [blame] | 3210 | |
| 3211 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 3212 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3213 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3214 | /** |
| 3215 | * limProcessStaMlmAddBssRsp() |
| 3216 | * |
| 3217 | *FUNCTION: |
| 3218 | * This function is called to process a WDA_ADD_BSS_RSP from HAL. |
| 3219 | * Upon receipt of this message from HAL, MLME - |
| 3220 | * > Validates the result of WDA_ADD_BSS_REQ |
| 3221 | * > Now, send an ADD_STA to HAL and ADD the "local" STA itself |
| 3222 | * |
| 3223 | *LOGIC: |
| 3224 | * MLME had sent WDA_ADD_BSS_REQ to HAL |
| 3225 | * HAL responded with WDA_ADD_BSS_RSP to MLME |
| 3226 | * MLME now sends WDA_ADD_STA_REQ to HAL |
| 3227 | * |
| 3228 | *ASSUMPTIONS: |
| 3229 | * tSirMsgQ.body is allocated by MLME during limProcessMlmJoinReq |
| 3230 | * tSirMsgQ.body will now be freed by this routine |
| 3231 | * |
| 3232 | *NOTE: |
| 3233 | * |
| 3234 | * @param pMac Pointer to Global MAC structure |
| 3235 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 3236 | * |
| 3237 | * @return None |
| 3238 | */ |
| 3239 | static void |
| 3240 | limProcessStaMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry) |
| 3241 | { |
| 3242 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 3243 | tLimMlmAssocCnf mlmAssocCnf; |
| 3244 | tANI_U32 mesgType = LIM_MLM_ASSOC_CNF; |
| 3245 | tANI_U32 subType = LIM_ASSOC; |
| 3246 | tpDphHashNode pStaDs = NULL; |
| 3247 | tANI_U16 staIdx = HAL_STA_INVALID_IDX; |
| 3248 | tANI_U8 updateSta = false; |
| 3249 | mlmAssocCnf.resultCode = eSIR_SME_SUCCESS; |
| 3250 | |
| 3251 | if(eLIM_MLM_WT_ADD_BSS_RSP_PREASSOC_STATE == psessionEntry->limMlmState) |
| 3252 | { |
| 3253 | //Done: 7-28-2009. JIM_FIX_ME: sessionize the following function |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 3254 | limLog(pMac,LOG1,"SessionId:%d limProcessStaMlmAddBssRspPreAssoc", |
| 3255 | psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3256 | limProcessStaMlmAddBssRspPreAssoc(pMac, limMsgQ, psessionEntry); |
| 3257 | goto end; |
| 3258 | } |
Mukul Sharma | 9151bb9 | 2014-12-18 16:13:52 +0530 | [diff] [blame] | 3259 | |
| 3260 | if(( eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE == psessionEntry->limMlmState ) || |
| 3261 | ( eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE == psessionEntry->limMlmState )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3262 | { |
| 3263 | mesgType = LIM_MLM_REASSOC_CNF; |
| 3264 | subType = LIM_REASSOC; |
Mukul Sharma | 9151bb9 | 2014-12-18 16:13:52 +0530 | [diff] [blame] | 3265 | //If Reassoc is happening for the same BSS, then use the existing StaId and indicate to HAL |
| 3266 | //to update the existing STA entry. |
| 3267 | //If Reassoc is happening for the new BSS, then old BSS and STA entry would have been already deleted |
| 3268 | //before PE tries to add BSS for the new BSS, so set the updateSta to false and pass INVALID STA Index. |
| 3269 | if (sirCompareMacAddr( psessionEntry->bssId, psessionEntry->limReAssocbssId)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3270 | { |
| 3271 | staIdx = psessionEntry->staId; |
| 3272 | updateSta = true; |
| 3273 | } |
| 3274 | } |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 3275 | |
Madan Mohan Koyyalamudi | 830ed80 | 2012-11-29 11:38:12 -0800 | [diff] [blame] | 3276 | if(pAddBssParams == 0) |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 3277 | goto end; |
| 3278 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3279 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 3280 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 3281 | #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] | 3282 | if( eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE == psessionEntry->limMlmState ) |
| 3283 | { |
| 3284 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 3285 | PELOGE(limLog(pMac, LOG1, FL("Mlm=%d %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3286 | psessionEntry->limMlmState, |
| 3287 | eLIM_MLM_WT_ADD_BSS_RSP_REASSOC_STATE);) |
| 3288 | #endif |
| 3289 | limProcessStaMlmAddBssRspFT( pMac, limMsgQ, psessionEntry); |
| 3290 | goto end; |
| 3291 | } |
| 3292 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 3293 | |
| 3294 | // Set MLME state |
| 3295 | psessionEntry->limMlmState = eLIM_MLM_WT_ADD_STA_RSP_STATE; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3296 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3297 | psessionEntry->statypeForBss = STA_ENTRY_PEER; //to know the session started for self or for peer oct6th |
| 3298 | // Now, send WDA_ADD_STA_REQ |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 3299 | limLog( pMac, LOGW, FL( "SessionId:%d On STA: ADD_BSS was successful" ), |
| 3300 | psessionEntry->peSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3301 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 3302 | if (pStaDs == NULL) |
| 3303 | { |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 3304 | PELOGE(limLog(pMac, LOGE, FL("SessionId:%d could not Add Self" |
| 3305 | "Entry for the station"),psessionEntry->peSessionId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3306 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 3307 | } |
| 3308 | else |
| 3309 | { |
| 3310 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 3311 | //Success, handle below |
| 3312 | pStaDs->bssId = pAddBssParams->bssIdx; |
| 3313 | //STA Index(genr by HAL) for the BSS entry is stored here |
| 3314 | pStaDs->staIndex = pAddBssParams->staContext.staIdx; |
| 3315 | pStaDs->ucUcastSig = pAddBssParams->staContext.ucUcastSig; |
| 3316 | pStaDs->ucBcastSig = pAddBssParams->staContext.ucBcastSig; |
| 3317 | // Downgrade the EDCA parameters if needed |
| 3318 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 3319 | // Send the active EDCA parameters to HAL |
| 3320 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) { |
| 3321 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 3322 | } else { |
| 3323 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 3324 | } |
| 3325 | #if defined WLAN_FEATURE_VOWIFI |
| 3326 | rrmCacheMgmtTxPower( pMac, pAddBssParams->txMgmtPower, psessionEntry ); |
| 3327 | #endif |
| 3328 | |
| 3329 | if (subType == LIM_REASSOC) |
| 3330 | limDeactivateAndChangeTimer(pMac, eLIM_KEEPALIVE_TIMER); |
| 3331 | if (limAddStaSelf(pMac,staIdx, updateSta, psessionEntry) != eSIR_SUCCESS) |
| 3332 | { |
| 3333 | // Add STA context at HW |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 3334 | PELOGE(limLog(pMac, LOGE, FL("SessionId:%d could not Add Self" |
| 3335 | "Entry for the station"),psessionEntry->peSessionId);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3336 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
| 3337 | } |
| 3338 | } |
| 3339 | } |
| 3340 | else |
| 3341 | { |
Mukul Sharma | 9151bb9 | 2014-12-18 16:13:52 +0530 | [diff] [blame] | 3342 | limLog( pMac, LOGP, FL( "SessionId:%d ADD_BSS failed! mlmState = %d" ), |
| 3343 | psessionEntry->peSessionId, psessionEntry->limMlmState); |
Abhishek Singh | c0fccd2 | 2015-10-19 16:44:00 +0530 | [diff] [blame] | 3344 | mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3345 | // Return Assoc confirm to SME with failure |
Mukul Sharma | 9151bb9 | 2014-12-18 16:13:52 +0530 | [diff] [blame] | 3346 | if(eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE == psessionEntry->limMlmState) |
| 3347 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_FT_REASSOC_FAILURE; |
| 3348 | else |
| 3349 | mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_REFUSED; |
Abhishek Singh | de7f051 | 2015-10-23 14:31:15 +0530 | [diff] [blame] | 3350 | psessionEntry->addBssfailed = true; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3351 | } |
| 3352 | |
| 3353 | if(mlmAssocCnf.resultCode != eSIR_SME_SUCCESS) |
| 3354 | { |
Mukul Sharma | 9151bb9 | 2014-12-18 16:13:52 +0530 | [diff] [blame] | 3355 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
| 3356 | //Set the RXP mode to IDLE, so it starts filtering the frames. |
| 3357 | if(limSetLinkState(pMac, eSIR_LINK_IDLE_STATE,psessionEntry->bssId, |
| 3358 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) |
| 3359 | PELOGE(limLog(pMac, LOGE, FL("Failed to set the LinkState\n"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3360 | /* Update PE session Id*/ |
| 3361 | mlmAssocCnf.sessionId = psessionEntry->peSessionId; |
| 3362 | limPostSmeMessage( pMac, mesgType, (tANI_U32 *) &mlmAssocCnf ); |
| 3363 | } |
| 3364 | end: |
| 3365 | if( 0 != limMsgQ->bodyptr ) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3366 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3367 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3368 | vos_mem_free(pAddBssParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3369 | limMsgQ->bodyptr = NULL; |
| 3370 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3371 | } |
| 3372 | |
| 3373 | |
| 3374 | |
| 3375 | /** |
| 3376 | * limProcessMlmAddBssRsp() |
| 3377 | * |
| 3378 | *FUNCTION: |
| 3379 | * This function is called to process a WDA_ADD_BSS_RSP from HAL. |
| 3380 | * Upon receipt of this message from HAL, MLME - |
| 3381 | * > Determines the "state" in which this message was received |
| 3382 | * > Forwards it to the appropriate callback |
| 3383 | * |
| 3384 | *LOGIC: |
| 3385 | * WDA_ADD_BSS_RSP can be received by MLME while the LIM is |
| 3386 | * in the following two states: |
| 3387 | * 1) As AP, LIM state = eLIM_SME_WT_START_BSS_STATE |
| 3388 | * 2) As STA, LIM state = eLIM_SME_WT_JOIN_STATE |
| 3389 | * Based on these two states, this API will determine where to |
| 3390 | * route the message to |
| 3391 | * |
| 3392 | *ASSUMPTIONS: |
| 3393 | * |
| 3394 | *NOTE: |
| 3395 | * |
| 3396 | * @param pMac Pointer to Global MAC structure |
| 3397 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 3398 | * |
| 3399 | * @return None |
| 3400 | */ |
| 3401 | void limProcessMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 3402 | { |
| 3403 | tLimMlmStartCnf mlmStartCnf; |
| 3404 | tpPESession psessionEntry; |
| 3405 | tpAddBssParams pAddBssParams = (tpAddBssParams) (limMsgQ->bodyptr); |
| 3406 | |
| 3407 | if(NULL == pAddBssParams ) |
| 3408 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3409 | limLog( pMac, LOGE, FL( "Encountered NULL Pointer" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3410 | return; |
| 3411 | } |
| 3412 | |
| 3413 | // |
| 3414 | // TODO & FIXME_GEN4 |
| 3415 | // Need to inspect tSirMsgQ.reserved for a valid Dialog token! |
| 3416 | // |
| 3417 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 3418 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 3419 | //the deffered flag. |
| 3420 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3421 | // Validate SME/LIM state |
| 3422 | // Validate MLME state |
| 3423 | if((psessionEntry = peFindSessionBySessionId(pMac,pAddBssParams->sessionId))== NULL) |
| 3424 | { |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 3425 | limLog( pMac, LOGE, FL( "SessionId:%d Session Does not exist" ), |
| 3426 | pAddBssParams->sessionId); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3427 | if( NULL != pAddBssParams ) |
| 3428 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3429 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3430 | vos_mem_free(pAddBssParams); |
| 3431 | limMsgQ->bodyptr = NULL; |
| 3432 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3433 | return; |
| 3434 | } |
| 3435 | /* update PE session Id*/ |
| 3436 | mlmStartCnf.sessionId = psessionEntry->peSessionId; |
| 3437 | if( eSIR_IBSS_MODE == psessionEntry->bssType ) |
| 3438 | limProcessIbssMlmAddBssRsp( pMac, limMsgQ, psessionEntry ); |
| 3439 | else |
| 3440 | { |
| 3441 | if( eLIM_SME_WT_START_BSS_STATE == psessionEntry->limSmeState ) |
| 3442 | { |
| 3443 | if( eLIM_MLM_WT_ADD_BSS_RSP_STATE != psessionEntry->limMlmState ) |
| 3444 | { |
| 3445 | // Mesg received from HAL in Invalid state! |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 3446 | limLog( pMac, LOGE,FL( "SessionId:%d Received unexpected" |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3447 | "WDA_ADD_BSS_RSP in state %d" ), |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 3448 | psessionEntry->peSessionId,psessionEntry->limMlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3449 | mlmStartCnf.resultCode = eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED; |
| 3450 | if( 0 != limMsgQ->bodyptr ) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3451 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3452 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3453 | vos_mem_free(pAddBssParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3454 | limMsgQ->bodyptr = NULL; |
| 3455 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3456 | limPostSmeMessage( pMac, LIM_MLM_START_CNF, (tANI_U32 *) &mlmStartCnf ); |
| 3457 | } |
| 3458 | else if ((psessionEntry->bssType == eSIR_BTAMP_AP_MODE)||(psessionEntry->bssType == eSIR_BTAMP_STA_MODE)) |
| 3459 | { |
| 3460 | limProcessBtampAddBssRsp(pMac,limMsgQ,psessionEntry); |
| 3461 | } |
| 3462 | else |
| 3463 | limProcessApMlmAddBssRsp( pMac,limMsgQ); |
| 3464 | } |
Padma, Santhosh Kumar | 7cdb524 | 2017-01-11 19:19:08 +0530 | [diff] [blame] | 3465 | else { |
| 3466 | #ifdef WLAN_FEATURE_LFR_MBB |
| 3467 | if (pMac->ft.ftSmeContext.is_preauth_lfr_mbb) { |
| 3468 | lim_process_sta_mlm_add_bss_rsp_mbb(pMac, limMsgQ, psessionEntry); |
| 3469 | return; |
| 3470 | } |
| 3471 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3472 | /* Called while processing assoc response */ |
| 3473 | limProcessStaMlmAddBssRsp( pMac, limMsgQ,psessionEntry); |
Padma, Santhosh Kumar | 7cdb524 | 2017-01-11 19:19:08 +0530 | [diff] [blame] | 3474 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3475 | } |
Madan Mohan Koyyalamudi | 01cba04 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 3476 | |
| 3477 | if(limIsInMCC(pMac)) |
| 3478 | { |
| 3479 | WDA_TrafficStatsTimerActivate(TRUE); |
| 3480 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3481 | |
| 3482 | #ifdef WLAN_FEATURE_11W |
| 3483 | if (psessionEntry->limRmfEnabled) |
| 3484 | { |
| 3485 | if ( eSIR_SUCCESS != limSendExcludeUnencryptInd(pMac, FALSE, psessionEntry) ) |
| 3486 | { |
| 3487 | limLog( pMac, LOGE, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 3488 | FL( "Could not send down Exclude Unencrypted Indication!" ) ); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 3489 | } |
| 3490 | } |
| 3491 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3492 | } |
| 3493 | /** |
| 3494 | * limProcessMlmSetKeyRsp() |
| 3495 | * |
| 3496 | *FUNCTION: |
| 3497 | * This function is called to process the following two |
| 3498 | * messages from HAL: |
| 3499 | * 1) WDA_SET_BSSKEY_RSP |
| 3500 | * 2) WDA_SET_STAKEY_RSP |
| 3501 | * 3) WDA_SET_STA_BCASTKEY_RSP |
| 3502 | * Upon receipt of this message from HAL, |
| 3503 | * MLME - |
| 3504 | * > Determines the "state" in which this message was received |
| 3505 | * > Forwards it to the appropriate callback |
| 3506 | * |
| 3507 | *LOGIC: |
| 3508 | * WDA_SET_BSSKEY_RSP/WDA_SET_STAKEY_RSP can be |
| 3509 | * received by MLME while in the following state: |
| 3510 | * MLME state = eLIM_MLM_WT_SET_BSS_KEY_STATE --OR-- |
| 3511 | * MLME state = eLIM_MLM_WT_SET_STA_KEY_STATE --OR-- |
| 3512 | * MLME state = eLIM_MLM_WT_SET_STA_BCASTKEY_STATE |
| 3513 | * Based on this state, this API will determine where to |
| 3514 | * route the message to |
| 3515 | * |
| 3516 | *ASSUMPTIONS: |
| 3517 | * ONLY the MLME state is being taken into account for now. |
| 3518 | * This is because, it appears that the handling of the |
| 3519 | * SETKEYS REQ is handled symmetrically on both the AP & STA |
| 3520 | * |
| 3521 | *NOTE: |
| 3522 | * |
| 3523 | * @param pMac Pointer to Global MAC structure |
| 3524 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 3525 | * |
| 3526 | * @return None |
| 3527 | */ |
| 3528 | void limProcessMlmSetStaKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 3529 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3530 | tANI_U8 respReqd = 1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3531 | tLimMlmSetKeysCnf mlmSetKeysCnf; |
| 3532 | tANI_U8 sessionId = 0; |
| 3533 | tpPESession psessionEntry; |
| 3534 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3535 | vos_mem_set((void *)&mlmSetKeysCnf, sizeof( tLimMlmSetKeysCnf ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3536 | //BTAMP |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3537 | if( NULL == limMsgQ->bodyptr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3538 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3539 | PELOGE(limLog(pMac, LOGE,FL("limMsgQ bodyptr is NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3540 | return; |
| 3541 | } |
| 3542 | sessionId = ((tpSetStaKeyParams) limMsgQ->bodyptr)->sessionId; |
| 3543 | if((psessionEntry = peFindSessionBySessionId(pMac, sessionId))== NULL) |
| 3544 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3545 | 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] | 3546 | vos_mem_zero(limMsgQ->bodyptr, sizeof(tSetStaKeyParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3547 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3548 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3549 | return; |
| 3550 | } |
| 3551 | if( eLIM_MLM_WT_SET_STA_KEY_STATE != psessionEntry->limMlmState ) |
| 3552 | { |
| 3553 | // Mesg received from HAL in Invalid state! |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3554 | 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] | 3555 | // There's not much that MLME can do at this stage... |
| 3556 | respReqd = 0; |
| 3557 | } |
| 3558 | else |
| 3559 | mlmSetKeysCnf.resultCode = (tANI_U16) (((tpSetStaKeyParams) limMsgQ->bodyptr)->status); |
| 3560 | |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3561 | vos_mem_zero(limMsgQ->bodyptr, sizeof(tSetStaKeyParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3562 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3563 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3564 | // Restore MLME state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3565 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3566 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3567 | if( respReqd ) |
| 3568 | { |
| 3569 | tpLimMlmSetKeysReq lpLimMlmSetKeysReq = (tpLimMlmSetKeysReq) pMac->lim.gpLimMlmSetKeysReq; |
| 3570 | // Prepare and Send LIM_MLM_SETKEYS_CNF |
| 3571 | if( NULL != lpLimMlmSetKeysReq ) |
| 3572 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3573 | vos_mem_copy((tANI_U8 *) &mlmSetKeysCnf.peerMacAddr, |
| 3574 | (tANI_U8 *) lpLimMlmSetKeysReq->peerMacAddr, |
| 3575 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3576 | // Free the buffer cached for the global pMac->lim.gpLimMlmSetKeysReq |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3577 | vos_mem_zero(pMac->lim.gpLimMlmSetKeysReq, |
| 3578 | sizeof(tLimMlmSetKeysReq)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3579 | vos_mem_free(pMac->lim.gpLimMlmSetKeysReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3580 | pMac->lim.gpLimMlmSetKeysReq = NULL; |
| 3581 | } |
| 3582 | mlmSetKeysCnf.sessionId = sessionId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3583 | limPostSmeMessage(pMac, LIM_MLM_SETKEYS_CNF, (tANI_U32 *) &mlmSetKeysCnf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3584 | } |
| 3585 | } |
| 3586 | void limProcessMlmSetBssKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 3587 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3588 | tLimMlmSetKeysCnf mlmSetKeysCnf; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3589 | tANI_U16 resultCode; |
| 3590 | tANI_U8 sessionId = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3591 | tpPESession psessionEntry; |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3592 | tpLimMlmSetKeysReq lpLimMlmSetKeysReq; |
| 3593 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3594 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3595 | vos_mem_set((void *)&mlmSetKeysCnf, sizeof( tLimMlmSetKeysCnf ), 0); |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3596 | if ( NULL == limMsgQ->bodyptr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3597 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3598 | PELOGE(limLog(pMac, LOGE,FL("limMsgQ bodyptr is null"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3599 | return; |
| 3600 | } |
| 3601 | sessionId = ((tpSetBssKeyParams) limMsgQ->bodyptr)->sessionId; |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3602 | if ((psessionEntry = peFindSessionBySessionId(pMac, sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3603 | { |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3604 | limLog(pMac, LOGE,FL("session does not exist for sessionId %d"), |
| 3605 | sessionId); |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3606 | vos_mem_zero(limMsgQ->bodyptr, sizeof(tSetBssKeyParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3607 | vos_mem_free( limMsgQ->bodyptr ); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3608 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3609 | return; |
| 3610 | } |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3611 | if ( eLIM_MLM_WT_SET_BSS_KEY_STATE == psessionEntry->limMlmState ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3612 | resultCode = (tANI_U16) (((tpSetBssKeyParams) limMsgQ->bodyptr)->status); |
| 3613 | else |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3614 | /* BCAST key also uses tpSetStaKeyParams. Done this way for readabilty */ |
| 3615 | resultCode = (tANI_U16) (((tpSetStaKeyParams) limMsgQ->bodyptr)->status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3616 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3617 | if( eLIM_MLM_WT_SET_BSS_KEY_STATE != psessionEntry->limMlmState && |
| 3618 | eLIM_MLM_WT_SET_STA_BCASTKEY_STATE != psessionEntry->limMlmState ) |
| 3619 | { |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3620 | /* Mesg received from HAL in Invalid state! */ |
| 3621 | limLog( pMac, LOGW, |
| 3622 | FL( "Received unexpected [Mesg Id - %d] in state %d" ), |
| 3623 | limMsgQ->type, psessionEntry->limMlmState ); |
| 3624 | mlmSetKeysCnf.resultCode = eSIR_SME_INVALID_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3625 | } |
| 3626 | else |
| 3627 | mlmSetKeysCnf.resultCode = resultCode; |
| 3628 | |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3629 | vos_mem_zero(limMsgQ->bodyptr, sizeof(tSetBssKeyParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3630 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3631 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3632 | // Restore MLME state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3633 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
| 3634 | |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3635 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, |
| 3636 | psessionEntry->peSessionId, psessionEntry->limMlmState)); |
| 3637 | lpLimMlmSetKeysReq = (tpLimMlmSetKeysReq) pMac->lim.gpLimMlmSetKeysReq; |
| 3638 | mlmSetKeysCnf.sessionId = sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3639 | |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3640 | /* Prepare and Send LIM_MLM_SETKEYS_CNF */ |
| 3641 | if( NULL != lpLimMlmSetKeysReq ) |
| 3642 | { |
| 3643 | vos_mem_copy((tANI_U8 *) &mlmSetKeysCnf.peerMacAddr, |
| 3644 | (tANI_U8 *) lpLimMlmSetKeysReq->peerMacAddr, |
| 3645 | sizeof(tSirMacAddr)); |
| 3646 | /* Free the buffer cached for the global pMac->lim.gpLimMlmSetKeysReq */ |
| 3647 | vos_mem_zero(pMac->lim.gpLimMlmSetKeysReq, |
| 3648 | sizeof(tLimMlmSetKeysReq)); |
| 3649 | vos_mem_free(pMac->lim.gpLimMlmSetKeysReq); |
| 3650 | pMac->lim.gpLimMlmSetKeysReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3651 | } |
Abhishek Singh | b0c9c8b | 2015-01-05 14:32:43 +0530 | [diff] [blame] | 3652 | limPostSmeMessage(pMac, LIM_MLM_SETKEYS_CNF, (tANI_U32 *) &mlmSetKeysCnf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3653 | } |
| 3654 | /** |
| 3655 | * limProcessMlmRemoveKeyRsp() |
| 3656 | * |
| 3657 | *FUNCTION: |
| 3658 | * |
| 3659 | *LOGIC: |
| 3660 | * |
| 3661 | *ASSUMPTIONS: |
| 3662 | * |
| 3663 | *NOTE: |
| 3664 | * |
| 3665 | * @param pMac Pointer to Global MAC structure |
| 3666 | * @param tSirMsgQ The MsgQ header, which contains the response buffer |
| 3667 | * |
| 3668 | * @return None |
| 3669 | */ |
| 3670 | void limProcessMlmRemoveKeyRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) |
| 3671 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3672 | tANI_U8 respReqd = 1; |
| 3673 | tLimMlmRemoveKeyCnf mlmRemoveCnf; |
| 3674 | tANI_U16 resultCode; |
| 3675 | tANI_U8 sessionId = 0; |
| 3676 | tpPESession psessionEntry; |
| 3677 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3678 | vos_mem_set((void *) &mlmRemoveCnf, sizeof( tLimMlmRemoveKeyCnf ), 0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3679 | |
| 3680 | if( NULL == limMsgQ->bodyptr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3681 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3682 | PELOGE(limLog(pMac, LOGE,FL("limMsgQ bodyptr is NULL"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3683 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3684 | } |
| 3685 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3686 | if (limMsgQ->type == WDA_REMOVE_STAKEY_RSP) |
| 3687 | sessionId = ((tpRemoveStaKeyParams) limMsgQ->bodyptr)->sessionId; |
| 3688 | else if (limMsgQ->type == WDA_REMOVE_BSSKEY_RSP) |
| 3689 | sessionId = ((tpRemoveBssKeyParams) limMsgQ->bodyptr)->sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3690 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3691 | if((psessionEntry = peFindSessionBySessionId(pMac, sessionId))== NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3692 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3693 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given sessionId"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3694 | return; |
| 3695 | } |
| 3696 | |
| 3697 | if( eLIM_MLM_WT_REMOVE_BSS_KEY_STATE == psessionEntry->limMlmState ) |
| 3698 | resultCode = (tANI_U16) (((tpRemoveBssKeyParams) limMsgQ->bodyptr)->status); |
| 3699 | else |
| 3700 | resultCode = (tANI_U16) (((tpRemoveStaKeyParams) limMsgQ->bodyptr)->status); |
| 3701 | |
| 3702 | // Validate MLME state |
| 3703 | if( eLIM_MLM_WT_REMOVE_BSS_KEY_STATE != psessionEntry->limMlmState && |
| 3704 | eLIM_MLM_WT_REMOVE_STA_KEY_STATE != psessionEntry->limMlmState ) |
| 3705 | { |
| 3706 | // Mesg received from HAL in Invalid state! |
| 3707 | limLog(pMac, LOGW, |
Sushant Kaushik | 1b64538 | 2014-10-13 16:39:36 +0530 | [diff] [blame] | 3708 | FL("Received unexpected [Mesg Id - %d] in state %d"), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3709 | limMsgQ->type, |
| 3710 | psessionEntry->limMlmState ); |
| 3711 | respReqd = 0; |
| 3712 | } |
| 3713 | else |
| 3714 | mlmRemoveCnf.resultCode = resultCode; |
| 3715 | |
| 3716 | // |
| 3717 | // TODO & FIXME_GEN4 |
| 3718 | // Need to inspect tSirMsgQ.reserved for a valid Dialog token! |
| 3719 | // |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 3720 | vos_mem_zero(limMsgQ->bodyptr, sizeof(tRemoveStaKeyParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3721 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3722 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3723 | |
| 3724 | // Restore MLME state |
| 3725 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
| 3726 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
| 3727 | |
| 3728 | if( respReqd ) |
| 3729 | { |
| 3730 | tpLimMlmRemoveKeyReq lpLimMlmRemoveKeyReq = (tpLimMlmRemoveKeyReq) pMac->lim.gpLimMlmRemoveKeyReq; |
| 3731 | mlmRemoveCnf.sessionId = sessionId; |
| 3732 | |
| 3733 | // Prepare and Send LIM_MLM_REMOVEKEY_CNF |
| 3734 | if( NULL != lpLimMlmRemoveKeyReq ) |
| 3735 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3736 | vos_mem_copy((tANI_U8 *) &mlmRemoveCnf.peerMacAddr, |
| 3737 | (tANI_U8 *) lpLimMlmRemoveKeyReq->peerMacAddr, |
| 3738 | sizeof( tSirMacAddr )); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3739 | // Free the buffer cached for the global pMac->lim.gpLimMlmRemoveKeyReq |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3740 | vos_mem_free(pMac->lim.gpLimMlmRemoveKeyReq); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3741 | pMac->lim.gpLimMlmRemoveKeyReq = NULL; |
| 3742 | } |
| 3743 | limPostSmeMessage( pMac, LIM_MLM_REMOVEKEY_CNF, (tANI_U32 *) &mlmRemoveCnf ); |
| 3744 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3745 | } |
| 3746 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3747 | |
| 3748 | /** --------------------------------------------------------------------- |
| 3749 | \fn limProcessInitScanRsp |
| 3750 | \brief This function is called when LIM receives WDA_INIT_SCAN_RSP |
| 3751 | \ message from HAL. If status code is failure, then |
| 3752 | \ update the gLimNumOfConsecutiveBkgndScanFailure count. |
| 3753 | \param tpAniSirGlobal pMac |
| 3754 | \param tANI_U32 body |
| 3755 | \return none |
| 3756 | \ ----------------------------------------------------------------------- */ |
| 3757 | void limProcessInitScanRsp(tpAniSirGlobal pMac, void *body) |
| 3758 | { |
| 3759 | tpInitScanParams pInitScanParam; |
| 3760 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3761 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 3762 | pInitScanParam = (tpInitScanParams) body; |
| 3763 | status = pInitScanParam->status; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3764 | vos_mem_free(body); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3765 | |
| 3766 | //Only abort scan if the we are scanning. |
| 3767 | if( pMac->lim.abortScan && |
| 3768 | (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) ) |
| 3769 | { |
krunal soni | d3d60e1 | 2013-07-17 13:24:09 -0700 | [diff] [blame] | 3770 | limLog( pMac, LOGW, FL(" abort scan") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3771 | pMac->lim.abortScan = 0; |
| 3772 | limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); |
| 3773 | limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); |
| 3774 | //Set the resume channel to Any valid channel (invalid). |
| 3775 | //This will instruct HAL to set it to any previous valid channel. |
| 3776 | peSetResumeChannel(pMac, 0, 0); |
krunal soni | d3d60e1 | 2013-07-17 13:24:09 -0700 | [diff] [blame] | 3777 | if (status != eHAL_STATUS_SUCCESS) |
| 3778 | { |
| 3779 | PELOGW(limLog(pMac, LOGW, FL("InitScnRsp failed status=%d"),status);) |
| 3780 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 3781 | pMac->lim.gLimNumOfConsecutiveBkgndScanFailure += 1; |
| 3782 | limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); |
| 3783 | return; |
| 3784 | } |
| 3785 | else |
| 3786 | { |
| 3787 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 3788 | } |
| 3789 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3790 | } |
| 3791 | switch(pMac->lim.gLimHalScanState) |
| 3792 | { |
| 3793 | case eLIM_HAL_INIT_SCAN_WAIT_STATE: |
| 3794 | if (status != (tANI_U32) eHAL_STATUS_SUCCESS) |
| 3795 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3796 | PELOGW(limLog(pMac, LOGW, FL("InitScanRsp with failed status= %d"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3797 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 3798 | pMac->lim.gLimNumOfConsecutiveBkgndScanFailure += 1; |
| 3799 | /* |
| 3800 | * On Windows eSIR_SME_HAL_SCAN_INIT_FAILED message to CSR may trigger |
| 3801 | * another Scan request in the same context (happens when 11d is enabled |
| 3802 | * and first scan request with 11d channels fails for whatever reason, then CSR issues next init |
| 3803 | * scan in the same context but with bigger channel list), so the state needs to be |
| 3804 | * changed before this response message is sent. |
| 3805 | */ |
| 3806 | limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3807 | return; |
| 3808 | } |
| 3809 | else if (status == eHAL_STATUS_SUCCESS) |
| 3810 | { |
| 3811 | /* since we have successfully triggered a background scan, |
| 3812 | * reset the "consecutive bkgnd scan failure" count to 0 |
| 3813 | */ |
| 3814 | pMac->lim.gLimNumOfConsecutiveBkgndScanFailure = 0; |
| 3815 | pMac->lim.gLimNumOfBackgroundScanSuccess += 1; |
Praveen Kumar Sirisilla | 7ea8dc9 | 2013-12-22 16:35:05 -0800 | [diff] [blame] | 3816 | pMac->lim.probeCounter = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3817 | } |
| 3818 | limContinueChannelScan(pMac); |
| 3819 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3820 | //WLAN_SUSPEND_LINK Related |
| 3821 | case eLIM_HAL_SUSPEND_LINK_WAIT_STATE: |
| 3822 | if( pMac->lim.gpLimSuspendCallback ) |
| 3823 | { |
Abhishek Singh | 53bfb33 | 2013-12-12 18:03:29 +0530 | [diff] [blame] | 3824 | if( eHAL_STATUS_SUCCESS == status ) |
| 3825 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3826 | pMac->lim.gLimHalScanState = eLIM_HAL_SUSPEND_LINK_STATE; |
Abhishek Singh | 53bfb33 | 2013-12-12 18:03:29 +0530 | [diff] [blame] | 3827 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3828 | else |
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 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
Abhishek Singh | 53bfb33 | 2013-12-12 18:03:29 +0530 | [diff] [blame] | 3831 | pMac->lim.gLimSystemInScanLearnMode = 0; |
| 3832 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3833 | |
| 3834 | pMac->lim.gpLimSuspendCallback( pMac, status, pMac->lim.gpLimSuspendData ); |
| 3835 | pMac->lim.gpLimSuspendCallback = NULL; |
| 3836 | pMac->lim.gpLimSuspendData = NULL; |
| 3837 | } |
| 3838 | else |
| 3839 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3840 | 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] | 3841 | return; |
| 3842 | } |
| 3843 | break; |
| 3844 | //end WLAN_SUSPEND_LINK Related |
| 3845 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3846 | 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] | 3847 | pMac->lim.gLimHalScanState); |
| 3848 | break; |
| 3849 | } |
| 3850 | return; |
| 3851 | } |
| 3852 | /** |
| 3853 | * limProcessSwitchChannelReAssocReq() |
| 3854 | * |
| 3855 | *FUNCTION: |
| 3856 | * This function is called to send the reassoc req mgmt frame after the |
| 3857 | * switchChannelRsp message is received from HAL. |
| 3858 | * |
| 3859 | *LOGIC: |
| 3860 | * |
| 3861 | *ASSUMPTIONS: |
| 3862 | * NA |
| 3863 | * |
| 3864 | *NOTE: |
| 3865 | * NA |
| 3866 | * |
| 3867 | * @param pMac - Pointer to Global MAC structure. |
| 3868 | * @param psessionEntry - session related information. |
| 3869 | * @param status - channel switch success/failure. |
| 3870 | * |
| 3871 | * @return None |
| 3872 | */ |
| 3873 | static void limProcessSwitchChannelReAssocReq(tpAniSirGlobal pMac, tpPESession psessionEntry, eHalStatus status) |
| 3874 | { |
| 3875 | tLimMlmReassocCnf mlmReassocCnf; |
| 3876 | tLimMlmReassocReq *pMlmReassocReq; |
Sachin Ahuja | 07a4301 | 2015-01-30 17:04:38 +0530 | [diff] [blame] | 3877 | #ifdef FEATURE_WLAN_ESE |
| 3878 | tANI_U32 val = 0; |
| 3879 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3880 | pMlmReassocReq = (tLimMlmReassocReq *)(psessionEntry->pLimMlmReassocReq); |
| 3881 | if(pMlmReassocReq == NULL) |
| 3882 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3883 | limLog(pMac, LOGP, FL("pLimMlmReassocReq does not exist for given switchChanSession")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3884 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3885 | goto end; |
| 3886 | } |
| 3887 | |
| 3888 | if(status != eHAL_STATUS_SUCCESS) |
| 3889 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3890 | PELOGE(limLog(pMac, LOGE, FL("Change channel failed!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3891 | mlmReassocCnf.resultCode = eSIR_SME_CHANNEL_SWITCH_FAIL; |
| 3892 | goto end; |
| 3893 | } |
Sachin Ahuja | 07a4301 | 2015-01-30 17:04:38 +0530 | [diff] [blame] | 3894 | |
| 3895 | #ifdef FEATURE_WLAN_ESE |
| 3896 | /* |
| 3897 | * In case of Ese Reassociation, change the reassoc timer |
| 3898 | * value. |
| 3899 | */ |
| 3900 | val = pMlmReassocReq->reassocFailureTimeout; |
| 3901 | if (psessionEntry->isESEconnection) |
| 3902 | { |
| 3903 | val = val/LIM_MAX_REASSOC_RETRY_LIMIT; |
| 3904 | } |
| 3905 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimReassocFailureTimer) != |
| 3906 | TX_SUCCESS) |
| 3907 | { |
| 3908 | limLog(pMac, LOGP, |
| 3909 | FL("unable to deactivate Reassoc failure timer")); |
| 3910 | } |
| 3911 | val = SYS_MS_TO_TICKS(val); |
| 3912 | if (tx_timer_change(&pMac->lim.limTimers.gLimReassocFailureTimer, |
| 3913 | val, 0) != TX_SUCCESS) |
| 3914 | { |
| 3915 | limLog(pMac, LOGP, |
| 3916 | FL("unable to change Reassociation failure timer")); |
| 3917 | } |
| 3918 | #endif |
| 3919 | pMac->lim.limTimers.gLimReassocFailureTimer.sessionId = psessionEntry->peSessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3920 | /// Start reassociation failure timer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3921 | 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] | 3922 | if (tx_timer_activate(&pMac->lim.limTimers.gLimReassocFailureTimer) |
| 3923 | != TX_SUCCESS) |
| 3924 | { |
| 3925 | /// Could not start reassoc failure timer. |
| 3926 | // Log error |
| 3927 | limLog(pMac, LOGP, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3928 | FL("could not start Reassociation failure timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3929 | // Return Reassoc confirm with |
| 3930 | // Resources Unavailable |
| 3931 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 3932 | goto end; |
| 3933 | } |
| 3934 | /// Prepare and send Reassociation request frame |
| 3935 | limSendReassocReqMgmtFrame(pMac, pMlmReassocReq, psessionEntry); |
| 3936 | return; |
| 3937 | end: |
| 3938 | // Free up buffer allocated for reassocReq |
| 3939 | if(pMlmReassocReq != NULL) |
| 3940 | { |
| 3941 | /* Update PE session Id*/ |
| 3942 | mlmReassocCnf.sessionId = pMlmReassocReq->sessionId; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 3943 | vos_mem_free(pMlmReassocReq); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 3944 | psessionEntry->pLimMlmReassocReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3945 | } |
| 3946 | else |
| 3947 | { |
| 3948 | mlmReassocCnf.sessionId = 0; |
| 3949 | } |
| 3950 | |
| 3951 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 3952 | /* Update PE sessio Id*/ |
| 3953 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
| 3954 | |
| 3955 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 3956 | } |
| 3957 | /** |
| 3958 | * limProcessSwitchChannelJoinReq() |
| 3959 | * |
| 3960 | *FUNCTION: |
| 3961 | * This function is called to send the probe req mgmt frame after the |
| 3962 | * switchChannelRsp message is received from HAL. |
| 3963 | * |
| 3964 | *LOGIC: |
| 3965 | * |
| 3966 | *ASSUMPTIONS: |
| 3967 | * NA |
| 3968 | * |
| 3969 | *NOTE: |
| 3970 | * NA |
| 3971 | * |
| 3972 | * @param pMac - Pointer to Global MAC structure. |
| 3973 | * @param psessionEntry - session related information. |
| 3974 | * @param status - channel switch success/failure. |
| 3975 | * |
| 3976 | * @return None |
| 3977 | */ |
| 3978 | static void limProcessSwitchChannelJoinReq(tpAniSirGlobal pMac, tpPESession psessionEntry, eHalStatus status) |
| 3979 | { |
| 3980 | tANI_U32 val; |
| 3981 | tSirMacSSid ssId; |
| 3982 | tLimMlmJoinCnf mlmJoinCnf; |
| 3983 | if(status != eHAL_STATUS_SUCCESS) |
| 3984 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3985 | PELOGE(limLog(pMac, LOGE, FL("Change channel failed!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3986 | goto error; |
| 3987 | } |
| 3988 | |
| 3989 | if ( (NULL == psessionEntry ) || (NULL == psessionEntry->pLimMlmJoinReq) ) |
| 3990 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 3991 | PELOGE(limLog(pMac, LOGE, FL("invalid pointer!!"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3992 | goto error; |
| 3993 | } |
| 3994 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3995 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3996 | /* eSIR_BTAMP_AP_MODE stroed as bss type in session Table when join req is received, is to be veified */ |
| 3997 | if(psessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 3998 | { |
| 3999 | if (limSetLinkState(pMac, eSIR_LINK_BTAMP_PREASSOC_STATE, psessionEntry->bssId, |
| 4000 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4001 | { |
| 4002 | PELOGE(limLog(pMac, LOGE, FL("Sessionid: %d Set link state " |
| 4003 | "failed!! BSSID:"MAC_ADDRESS_STR),psessionEntry->peSessionId, |
| 4004 | MAC_ADDR_ARRAY(psessionEntry->bssId));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4005 | goto error; |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4006 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4007 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4008 | |
| 4009 | /* Update the lim global gLimTriggerBackgroundScanDuringQuietBss */ |
| 4010 | 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] | 4011 | 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] | 4012 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = (val) ? 1 : 0; |
| 4013 | // Apply previously set configuration at HW |
| 4014 | limApplyConfiguration(pMac, psessionEntry); |
Abhishek Singh | de51a41 | 2014-05-20 19:17:26 +0530 | [diff] [blame] | 4015 | |
| 4016 | /* If sendDeauthBeforeCon is enabled, Send Deauth first to AP if last |
| 4017 | * disconnection was caused by HB failure. |
| 4018 | */ |
| 4019 | if(pMac->roam.configParam.sendDeauthBeforeCon) |
| 4020 | { |
| 4021 | int apCount; |
| 4022 | |
| 4023 | for(apCount = 0; apCount < 2; apCount++) |
| 4024 | { |
| 4025 | |
| 4026 | if (vos_mem_compare(psessionEntry->pLimMlmJoinReq->bssDescription.bssId, |
| 4027 | pMac->lim.gLimHeartBeatApMac[apCount], sizeof(tSirMacAddr))) |
| 4028 | { |
| 4029 | limLog(pMac, LOGE, FL("Index %d Sessionid: %d Send deauth on " |
| 4030 | "channel %d to BSSID: "MAC_ADDRESS_STR ), apCount, |
| 4031 | psessionEntry->peSessionId, psessionEntry->currentOperChannel, |
| 4032 | MAC_ADDR_ARRAY(psessionEntry->pLimMlmJoinReq->bssDescription.bssId)); |
| 4033 | |
| 4034 | limSendDeauthMgmtFrame( pMac, eSIR_MAC_UNSPEC_FAILURE_REASON, |
| 4035 | psessionEntry->pLimMlmJoinReq->bssDescription.bssId, |
| 4036 | psessionEntry, FALSE ); |
| 4037 | |
| 4038 | vos_mem_zero(pMac->lim.gLimHeartBeatApMac[apCount], |
| 4039 | sizeof(tSirMacAddr)); |
| 4040 | break; |
| 4041 | } |
| 4042 | } |
| 4043 | } |
| 4044 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4045 | /// Wait for Beacon to announce join success |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4046 | vos_mem_copy(ssId.ssId, |
| 4047 | psessionEntry->ssId.ssId, |
| 4048 | psessionEntry->ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4049 | ssId.length = psessionEntry->ssId.length; |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 4050 | |
| 4051 | limDeactivateAndChangeTimer(pMac, eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER); |
| 4052 | |
| 4053 | //assign appropriate sessionId to the timer object |
| 4054 | pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer.sessionId = psessionEntry->peSessionId; |
Abhishek Singh | de51a41 | 2014-05-20 19:17:26 +0530 | [diff] [blame] | 4055 | limLog(pMac, LOG1, FL("Sessionid: %d Send Probe req on channel %d ssid: %.*s " |
| 4056 | "BSSID: "MAC_ADDRESS_STR ), psessionEntry->peSessionId, |
| 4057 | psessionEntry->currentOperChannel, ssId.length, ssId.ssId, |
Abhishek Singh | dcbd827 | 2014-01-09 14:16:01 +0530 | [diff] [blame] | 4058 | MAC_ADDR_ARRAY(psessionEntry->pLimMlmJoinReq->bssDescription.bssId)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4059 | // include additional IE if there is |
| 4060 | limSendProbeReqMgmtFrame( pMac, &ssId, |
| 4061 | psessionEntry->pLimMlmJoinReq->bssDescription.bssId, psessionEntry->currentOperChannel/*chanNum*/, |
| 4062 | psessionEntry->selfMacAddr, psessionEntry->dot11mode, |
| 4063 | psessionEntry->pLimJoinReq->addIEScan.length, psessionEntry->pLimJoinReq->addIEScan.addIEdata); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4064 | |
| 4065 | // Sending mgmt frame is a blocking call activate Join failure timer now |
| 4066 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_JOIN_FAIL_TIMER)); |
| 4067 | if (tx_timer_activate(&pMac->lim.limTimers.gLimJoinFailureTimer) != TX_SUCCESS) |
| 4068 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4069 | limLog(pMac, LOGP, FL("could not activate Join failure timer")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4070 | psessionEntry->limMlmState = psessionEntry->limPrevMlmState; |
| 4071 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, pMac->lim.gLimMlmState)); |
| 4072 | //memory is freed up below. |
| 4073 | psessionEntry->pLimMlmJoinReq = NULL; |
| 4074 | goto error; |
| 4075 | } |
| 4076 | |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 4077 | if( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) |
| 4078 | { |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 4079 | // Activate Join Periodic Probe Req timer |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 4080 | if (tx_timer_activate(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer) != TX_SUCCESS) |
| 4081 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4082 | 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] | 4083 | goto error; |
| 4084 | } |
| 4085 | } |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 4086 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4087 | return; |
| 4088 | error: |
| 4089 | if(NULL != psessionEntry) |
| 4090 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4091 | vos_mem_free(psessionEntry->pLimMlmJoinReq); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4092 | psessionEntry->pLimMlmJoinReq = NULL; |
| 4093 | mlmJoinCnf.sessionId = psessionEntry->peSessionId; |
| 4094 | } |
| 4095 | else |
| 4096 | { |
| 4097 | mlmJoinCnf.sessionId = 0; |
| 4098 | } |
| 4099 | mlmJoinCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4100 | mlmJoinCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 4101 | limPostSmeMessage(pMac, LIM_MLM_JOIN_CNF, (tANI_U32 *) &mlmJoinCnf); |
| 4102 | } |
| 4103 | |
| 4104 | /** |
| 4105 | * limProcessSwitchChannelRsp() |
| 4106 | * |
| 4107 | *FUNCTION: |
| 4108 | * This function is called to process switchChannelRsp message from HAL. |
| 4109 | * |
| 4110 | *LOGIC: |
| 4111 | * |
| 4112 | *ASSUMPTIONS: |
| 4113 | * NA |
| 4114 | * |
| 4115 | *NOTE: |
| 4116 | * NA |
| 4117 | * |
| 4118 | * @param pMac - Pointer to Global MAC structure |
| 4119 | * @param body - message body. |
| 4120 | * |
| 4121 | * @return None |
| 4122 | */ |
| 4123 | void limProcessSwitchChannelRsp(tpAniSirGlobal pMac, void *body) |
| 4124 | { |
| 4125 | tpSwitchChannelParams pChnlParams = NULL; |
| 4126 | eHalStatus status; |
| 4127 | tANI_U16 channelChangeReasonCode; |
| 4128 | tANI_U8 peSessionId; |
| 4129 | tpPESession psessionEntry; |
| 4130 | //we need to process the deferred message since the initiating req. there might be nested request. |
| 4131 | //in the case of nested request the new request initiated from the response will take care of resetting |
| 4132 | //the deffered flag. |
| 4133 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 4134 | pChnlParams = (tpSwitchChannelParams) body; |
| 4135 | status = pChnlParams->status; |
| 4136 | peSessionId = pChnlParams->peSessionId; |
| 4137 | if((psessionEntry = peFindSessionBySessionId(pMac, peSessionId))== NULL) |
| 4138 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4139 | vos_mem_free(body); |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4140 | limLog(pMac, LOGP, FL("session does not exist for given sessionId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4141 | return; |
| 4142 | } |
| 4143 | #if defined WLAN_FEATURE_VOWIFI |
| 4144 | //HAL fills in the tx power used for mgmt frames in this field. |
| 4145 | //Store this value to use in TPC report IE. |
| 4146 | rrmCacheMgmtTxPower( pMac, pChnlParams->txMgmtPower, psessionEntry ); |
| 4147 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4148 | channelChangeReasonCode = psessionEntry->channelChangeReasonCode; |
| 4149 | // initialize it back to invalid id |
| 4150 | psessionEntry->channelChangeReasonCode = 0xBAD; |
Abhishek Singh | 39ae47e | 2017-10-30 17:39:50 +0530 | [diff] [blame] | 4151 | limLog(pMac, LOGE, FL("channelChangeReasonCode %d status %d"),channelChangeReasonCode, pChnlParams->status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4152 | switch(channelChangeReasonCode) |
| 4153 | { |
| 4154 | case LIM_SWITCH_CHANNEL_REASSOC: |
| 4155 | limProcessSwitchChannelReAssocReq(pMac, psessionEntry, status); |
| 4156 | break; |
| 4157 | case LIM_SWITCH_CHANNEL_JOIN: |
| 4158 | limProcessSwitchChannelJoinReq(pMac, psessionEntry, status); |
| 4159 | break; |
| 4160 | |
| 4161 | case LIM_SWITCH_CHANNEL_OPERATION: |
| 4162 | /* |
| 4163 | * The above code should also use the callback. |
| 4164 | * mechanism below, there is scope for cleanup here. |
| 4165 | * THat way all this response handler does is call the call back |
| 4166 | * We can get rid of the reason code here. |
| 4167 | */ |
| 4168 | if (pMac->lim.gpchangeChannelCallback) |
| 4169 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 4170 | limLog( pMac, LOG1, "Channel changed hence invoke registered call back"); |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 4171 | if (eHAL_CHANNEL_SWITCH_SOURCE_CSA == pChnlParams->channelSwitchSrc ) |
| 4172 | { |
| 4173 | if (IS_MCC_SUPPORTED && limIsLinkSuspended( pMac ) ) |
| 4174 | { |
| 4175 | if ( psessionEntry && psessionEntry->limSmeState |
| 4176 | == eLIM_SME_LINK_EST_STATE ) |
| 4177 | { |
| 4178 | peSetResumeChannel( pMac, |
| 4179 | psessionEntry->currentOperChannel, |
| 4180 | psessionEntry->htSecondaryChannelOffset); |
| 4181 | } |
| 4182 | else |
| 4183 | { |
| 4184 | peSetResumeChannel( pMac, 0, 0); |
| 4185 | } |
| 4186 | limResumeLink(pMac, limSwitchChannelResumeLinkRsp, NULL); |
| 4187 | } |
| 4188 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4189 | pMac->lim.gpchangeChannelCallback(pMac, status, pMac->lim.gpchangeChannelData, psessionEntry); |
| 4190 | } |
| 4191 | break; |
Abhishek Singh | 550aa8c | 2017-10-30 17:34:53 +0530 | [diff] [blame] | 4192 | case LIM_SWITCH_CHANNEL_SAP_ECSA: |
| 4193 | lim_send_sme_ap_channel_switch_resp(pMac, |
| 4194 | psessionEntry, pChnlParams); |
| 4195 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4196 | default: |
| 4197 | break; |
| 4198 | } |
Mukul Sharma | 307aa21 | 2014-07-15 16:21:57 +0530 | [diff] [blame] | 4199 | vos_mem_free(body); |
| 4200 | body = NULL; |
| 4201 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4202 | } |
| 4203 | /** |
| 4204 | * limProcessStartScanRsp() |
| 4205 | * |
| 4206 | *FUNCTION: |
| 4207 | * This function is called to process startScanRsp message from HAL. If scan/learn was successful |
| 4208 | * then it will start scan/learn on the next channel. |
| 4209 | * |
| 4210 | *LOGIC: |
| 4211 | * |
| 4212 | *ASSUMPTIONS: |
| 4213 | * NA |
| 4214 | * |
| 4215 | *NOTE: |
| 4216 | * NA |
| 4217 | * |
| 4218 | * @param pMac - Pointer to Global MAC structure |
| 4219 | * @param body - message body. |
| 4220 | * |
| 4221 | * @return None |
| 4222 | */ |
| 4223 | |
| 4224 | void limProcessStartScanRsp(tpAniSirGlobal pMac, void *body) |
| 4225 | { |
| 4226 | tpStartScanParams pStartScanParam; |
| 4227 | eHalStatus status; |
| 4228 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 4229 | pStartScanParam = (tpStartScanParams) body; |
| 4230 | status = pStartScanParam->status; |
| 4231 | #if defined WLAN_FEATURE_VOWIFI |
| 4232 | //HAL fills in the tx power used for mgmt frames in this field. |
| 4233 | //Store this value to use in TPC report IE. |
| 4234 | rrmCacheMgmtTxPower( pMac, pStartScanParam->txMgmtPower, NULL ); |
| 4235 | //Store start TSF of scan start. This will be stored in BSS params. |
| 4236 | rrmUpdateStartTSF( pMac, pStartScanParam->startTSF ); |
| 4237 | #endif |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4238 | vos_mem_free(body); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4239 | body = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4240 | if( pMac->lim.abortScan ) |
| 4241 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4242 | limLog( pMac, LOGW, FL(" finish scan") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4243 | pMac->lim.abortScan = 0; |
| 4244 | limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); |
| 4245 | limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); |
| 4246 | //Set the resume channel to Any valid channel (invalid). |
| 4247 | //This will instruct HAL to set it to any previous valid channel. |
| 4248 | peSetResumeChannel(pMac, 0, 0); |
| 4249 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 4250 | } |
| 4251 | switch(pMac->lim.gLimHalScanState) |
| 4252 | { |
| 4253 | case eLIM_HAL_START_SCAN_WAIT_STATE: |
| 4254 | if (status != (tANI_U32) eHAL_STATUS_SUCCESS) |
| 4255 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4256 | PELOGW(limLog(pMac, LOGW, FL("StartScanRsp with failed status= %d"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4257 | // |
| 4258 | // FIXME - With this, LIM will try and recover state, but |
| 4259 | // eWNI_SME_SCAN_CNF maybe reporting an incorrect |
| 4260 | // status back to the SME |
| 4261 | // |
| 4262 | //Set the resume channel to Any valid channel (invalid). |
| 4263 | //This will instruct HAL to set it to any previous valid channel. |
| 4264 | peSetResumeChannel(pMac, 0, 0); |
| 4265 | limSendHalFinishScanReq( pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE ); |
| 4266 | //limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); |
| 4267 | } |
| 4268 | else |
| 4269 | { |
| 4270 | pMac->lim.gLimHalScanState = eLIM_HAL_SCANNING_STATE; |
| 4271 | limContinuePostChannelScan(pMac); |
| 4272 | } |
| 4273 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4274 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4275 | limLog(pMac, LOGW, FL("Rcvd StartScanRsp not in WAIT State, state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4276 | pMac->lim.gLimHalScanState); |
| 4277 | break; |
| 4278 | } |
| 4279 | return; |
| 4280 | } |
| 4281 | void limProcessEndScanRsp(tpAniSirGlobal pMac, void *body) |
| 4282 | { |
| 4283 | tpEndScanParams pEndScanParam; |
| 4284 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4285 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 4286 | pEndScanParam = (tpEndScanParams) body; |
| 4287 | status = pEndScanParam->status; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4288 | vos_mem_free(body); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4289 | body = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4290 | switch(pMac->lim.gLimHalScanState) |
| 4291 | { |
| 4292 | case eLIM_HAL_END_SCAN_WAIT_STATE: |
| 4293 | if (status != (tANI_U32) eHAL_STATUS_SUCCESS) |
| 4294 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4295 | PELOGW(limLog(pMac, LOGW, FL("EndScanRsp with failed status= %d"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4296 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 4297 | limCompleteMlmScan(pMac, eSIR_SME_HAL_SCAN_INIT_FAILED); |
| 4298 | } |
| 4299 | else |
| 4300 | { |
Madan Mohan Koyyalamudi | c5992c9 | 2012-11-15 16:40:57 -0800 | [diff] [blame] | 4301 | pMac->lim.gLimCurrentScanChannelId++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4302 | limContinueChannelScan(pMac); |
| 4303 | } |
| 4304 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4305 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4306 | limLog(pMac, LOGW, FL("Rcvd endScanRsp not in WAIT State, state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4307 | pMac->lim.gLimHalScanState); |
| 4308 | break; |
| 4309 | } |
| 4310 | return; |
| 4311 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4312 | /** |
| 4313 | * limStopTxAndSwitch() |
| 4314 | * |
| 4315 | *FUNCTION: |
| 4316 | * Start channel switch on all sessions that is in channel switch state. |
| 4317 | * |
| 4318 | * @param pMac - pointer to global adapter context |
| 4319 | * |
| 4320 | * @return None |
| 4321 | * |
| 4322 | */ |
| 4323 | static void |
| 4324 | limStopTxAndSwitch (tpAniSirGlobal pMac) |
| 4325 | { |
| 4326 | tANI_U8 i; |
| 4327 | |
| 4328 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 4329 | { |
| 4330 | if(pMac->lim.gpSession[i].valid && |
| 4331 | pMac->lim.gpSession[i].gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) |
| 4332 | { |
| 4333 | limStopTxAndSwitchChannel(pMac, i); |
| 4334 | } |
| 4335 | } |
| 4336 | return; |
| 4337 | } |
| 4338 | /** |
| 4339 | * limStartQuietOnSession() |
| 4340 | * |
| 4341 | *FUNCTION: |
| 4342 | * This function is called to start quiet timer after finish scan if there is |
| 4343 | * qeuieting on any session. |
| 4344 | * |
| 4345 | *LOGIC: |
| 4346 | * |
| 4347 | *ASSUMPTIONS: |
| 4348 | * NA |
| 4349 | * |
| 4350 | *NOTE: |
| 4351 | * NA |
| 4352 | * |
| 4353 | * @param pMac - Pointer to Global MAC structure |
| 4354 | * |
| 4355 | * @return None |
| 4356 | */ |
| 4357 | static void |
| 4358 | limStartQuietOnSession (tpAniSirGlobal pMac) |
| 4359 | { |
| 4360 | tANI_U8 i; |
| 4361 | |
| 4362 | for(i =0; i < pMac->lim.maxBssId; i++) |
| 4363 | { |
| 4364 | if(pMac->lim.gpSession[i].valid && |
| 4365 | pMac->lim.gpSession[i].gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN) |
| 4366 | { |
| 4367 | limStartQuietTimer(pMac, i); |
| 4368 | } |
| 4369 | } |
| 4370 | return; |
| 4371 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4372 | void limProcessFinishScanRsp(tpAniSirGlobal pMac, void *body) |
| 4373 | { |
| 4374 | tpFinishScanParams pFinishScanParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4375 | eHalStatus status; |
| 4376 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 4377 | pFinishScanParam = (tpFinishScanParams) body; |
| 4378 | status = pFinishScanParam->status; |
Praveen Kumar Sirisilla | ac600a8 | 2013-10-18 11:07:47 -0700 | [diff] [blame] | 4379 | |
Sushant Kaushik | 826de80 | 2014-05-08 18:04:11 +0530 | [diff] [blame] | 4380 | limLog(pMac, LOG1, FL("Rcvd FinishScanRsp in state %d channel %d "), |
| 4381 | pMac->lim.gLimHalScanState, |
| 4382 | pFinishScanParam->currentOperChannel); |
Praveen Kumar Sirisilla | ac600a8 | 2013-10-18 11:07:47 -0700 | [diff] [blame] | 4383 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4384 | switch(pMac->lim.gLimHalScanState) |
| 4385 | { |
| 4386 | case eLIM_HAL_FINISH_SCAN_WAIT_STATE: |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 4387 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
Deepthi Gowri | 639d504 | 2015-11-16 20:23:39 +0530 | [diff] [blame] | 4388 | limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_COMP_EVENT, NULL, |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 4389 | status, eSIR_SUCCESS); |
| 4390 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4391 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
Padma, Santhosh Kumar | 8eb1d7a | 2015-07-31 11:35:53 +0530 | [diff] [blame] | 4392 | if (pMac->lim.abortScan) |
| 4393 | pMac->lim.abortScan = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4394 | limCompleteMlmScan(pMac, eSIR_SME_SUCCESS); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4395 | if (limIsChanSwitchRunning(pMac)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4396 | { |
| 4397 | /** Right time to stop tx and start the timer for channel switch */ |
| 4398 | /* Sending Session ID 0, may not be correct, since SCAN is global there should not |
| 4399 | * be any associated session id |
| 4400 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4401 | limStopTxAndSwitch(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4402 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4403 | else if (limIsQuietBegin(pMac)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4404 | { |
| 4405 | /** Start the quieting */ |
| 4406 | /* Sending Session ID 0, may not be correct, since SCAN is global there should not |
| 4407 | * be any associated session id |
| 4408 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4409 | limStartQuietOnSession(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4410 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4411 | if (status != (tANI_U32) eHAL_STATUS_SUCCESS) |
| 4412 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4413 | PELOGW(limLog(pMac, LOGW, FL("EndScanRsp with failed status= %d"), status);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4414 | } |
| 4415 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4416 | //WLAN_SUSPEND_LINK Related |
| 4417 | case eLIM_HAL_RESUME_LINK_WAIT_STATE: |
| 4418 | if( pMac->lim.gpLimResumeCallback ) |
| 4419 | { |
| 4420 | pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE; |
| 4421 | pMac->lim.gpLimResumeCallback( pMac, status, pMac->lim.gpLimResumeData ); |
| 4422 | pMac->lim.gpLimResumeCallback = NULL; |
| 4423 | pMac->lim.gpLimResumeData = NULL; |
| 4424 | pMac->lim.gLimSystemInScanLearnMode = 0; |
| 4425 | } |
| 4426 | else |
| 4427 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4428 | 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] | 4429 | vos_mem_free(body); |
| 4430 | body = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4431 | return; |
| 4432 | } |
| 4433 | break; |
| 4434 | //end WLAN_SUSPEND_LINK Related |
| 4435 | |
| 4436 | default: |
Praveen Kumar Sirisilla | ac600a8 | 2013-10-18 11:07:47 -0700 | [diff] [blame] | 4437 | limLog(pMac, LOGE, FL("Rcvd FinishScanRsp not in WAIT State, state %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4438 | pMac->lim.gLimHalScanState); |
| 4439 | break; |
| 4440 | } |
Mukul Sharma | 307aa21 | 2014-07-15 16:21:57 +0530 | [diff] [blame] | 4441 | vos_mem_free(body); |
| 4442 | body = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4443 | return; |
| 4444 | } |
| 4445 | /** |
| 4446 | * @function : limProcessMlmHalAddBARsp |
| 4447 | * |
| 4448 | * @brief: Process WDA_ADDBA_RSP coming from HAL |
| 4449 | * |
| 4450 | * |
| 4451 | * @param pMac The global tpAniSirGlobal object |
| 4452 | * |
| 4453 | * @param tSirMsgQ The MsgQ header containing the response buffer |
| 4454 | * |
| 4455 | * @return none |
| 4456 | */ |
| 4457 | void limProcessMlmHalAddBARsp( tpAniSirGlobal pMac, |
| 4458 | tpSirMsgQ limMsgQ ) |
| 4459 | { |
| 4460 | // Send LIM_MLM_ADDBA_CNF to LIM |
| 4461 | tpLimMlmAddBACnf pMlmAddBACnf; |
lukez | 3c80922 | 2013-05-03 10:23:02 -0700 | [diff] [blame] | 4462 | tpPESession psessionEntry = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4463 | tpAddBAParams pAddBAParams = (tpAddBAParams) limMsgQ->bodyptr; |
lukez | 3c80922 | 2013-05-03 10:23:02 -0700 | [diff] [blame] | 4464 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4465 | //now LIM can process any defer message. |
| 4466 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 4467 | if (pAddBAParams == NULL) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4468 | PELOGE(limLog(pMac, LOGE,FL("NULL ADD BA Response from HAL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4469 | return; |
| 4470 | } |
| 4471 | if((psessionEntry = peFindSessionBySessionId(pMac, pAddBAParams->sessionId))==NULL) |
| 4472 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4473 | 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] | 4474 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4475 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4476 | return; |
| 4477 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4478 | |
| 4479 | // Allocate for LIM_MLM_ADDBA_CNF |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4480 | pMlmAddBACnf = vos_mem_malloc(sizeof(tLimMlmAddBACnf)); |
| 4481 | if ( NULL == pMlmAddBACnf ) { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 4482 | limLog( pMac, LOGP, FL(" AllocateMemory failed for pMlmAddBACnf")); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4483 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4484 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4485 | return; |
| 4486 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4487 | vos_mem_set((void *) pMlmAddBACnf, sizeof( tLimMlmAddBACnf ), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4488 | // Copy the peer MAC |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4489 | vos_mem_copy(pMlmAddBACnf->peerMacAddr, pAddBAParams->peerMacAddr, |
| 4490 | sizeof( tSirMacAddr )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4491 | // Copy other ADDBA Rsp parameters |
| 4492 | pMlmAddBACnf->baDialogToken = pAddBAParams->baDialogToken; |
| 4493 | pMlmAddBACnf->baTID = pAddBAParams->baTID; |
| 4494 | pMlmAddBACnf->baPolicy = pAddBAParams->baPolicy; |
| 4495 | pMlmAddBACnf->baBufferSize = pAddBAParams->baBufferSize; |
| 4496 | pMlmAddBACnf->baTimeout = pAddBAParams->baTimeout; |
| 4497 | pMlmAddBACnf->baDirection = pAddBAParams->baDirection; |
| 4498 | pMlmAddBACnf->sessionId = psessionEntry->peSessionId; |
| 4499 | if(eHAL_STATUS_SUCCESS == pAddBAParams->status) |
| 4500 | pMlmAddBACnf->addBAResultCode = eSIR_MAC_SUCCESS_STATUS; |
| 4501 | else |
| 4502 | pMlmAddBACnf->addBAResultCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 4503 | |
| 4504 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 4505 | limDiagEventReport(pMac, WLAN_PE_DIAG_HAL_ADDBA_RSP_EVENT, psessionEntry, |
| 4506 | pAddBAParams->status, pMlmAddBACnf->addBAResultCode); |
| 4507 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 4508 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4509 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4510 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4511 | // Send ADDBA CNF to LIM |
| 4512 | limPostSmeMessage( pMac, LIM_MLM_ADDBA_CNF, (tANI_U32 *) pMlmAddBACnf ); |
| 4513 | } |
| 4514 | /** |
| 4515 | * \brief Process LIM_MLM_ADDBA_CNF |
| 4516 | * |
| 4517 | * \sa limProcessMlmAddBACnf |
| 4518 | * |
| 4519 | * \param pMac The global tpAniSirGlobal object |
| 4520 | * |
| 4521 | * \param tSirMsgQ The MsgQ header containing the response buffer |
| 4522 | * |
| 4523 | * \return none |
| 4524 | */ |
| 4525 | void limProcessMlmAddBACnf( tpAniSirGlobal pMac, |
| 4526 | tANI_U32 *pMsgBuf ) |
| 4527 | { |
| 4528 | tpLimMlmAddBACnf pMlmAddBACnf; |
| 4529 | tpDphHashNode pSta; |
| 4530 | tANI_U16 aid; |
| 4531 | tLimBAState curBaState; |
| 4532 | tpPESession psessionEntry = NULL; |
| 4533 | if(pMsgBuf == NULL) |
| 4534 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4535 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4536 | return; |
| 4537 | } |
| 4538 | pMlmAddBACnf = (tpLimMlmAddBACnf) pMsgBuf; |
| 4539 | if((psessionEntry = peFindSessionBySessionId(pMac,pMlmAddBACnf->sessionId))== NULL) |
| 4540 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4541 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));) |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4542 | vos_mem_free(pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4543 | return; |
| 4544 | } |
| 4545 | // First, extract the DPH entry |
| 4546 | pSta = dphLookupHashEntry( pMac, pMlmAddBACnf->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); |
| 4547 | if( NULL == pSta ) |
| 4548 | { |
| 4549 | PELOGE(limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4550 | FL( "STA context not found - ignoring ADDBA CNF from HAL" ));) |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4551 | vos_mem_free(pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4552 | return; |
| 4553 | } |
| 4554 | LIM_GET_STA_BA_STATE(pSta, pMlmAddBACnf->baTID, &curBaState); |
| 4555 | // Need to validate SME state |
| 4556 | if( eLIM_BA_STATE_WT_ADD_RSP != curBaState) |
| 4557 | { |
| 4558 | PELOGE(limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4559 | FL( "Received unexpected ADDBA CNF when STA BA state is %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4560 | curBaState );) |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4561 | vos_mem_free(pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4562 | return; |
| 4563 | } |
| 4564 | // Restore STA BA state |
| 4565 | LIM_SET_STA_BA_STATE(pSta, pMlmAddBACnf->baTID, eLIM_BA_STATE_IDLE); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 4566 | if( eSIR_MAC_SUCCESS_STATUS == pMlmAddBACnf->addBAResultCode ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4567 | { |
| 4568 | // Update LIM internal cache... |
| 4569 | if( eBA_RECIPIENT == pMlmAddBACnf->baDirection ) |
| 4570 | { |
| 4571 | pSta->tcCfg[pMlmAddBACnf->baTID].fUseBARx = 1; |
| 4572 | pSta->tcCfg[pMlmAddBACnf->baTID].fRxCompBA = 1; |
| 4573 | pSta->tcCfg[pMlmAddBACnf->baTID].fRxBApolicy = pMlmAddBACnf->baPolicy; |
| 4574 | pSta->tcCfg[pMlmAddBACnf->baTID].rxBufSize = pMlmAddBACnf->baBufferSize; |
| 4575 | pSta->tcCfg[pMlmAddBACnf->baTID].tuRxBAWaitTimeout = pMlmAddBACnf->baTimeout; |
Shailender Karmuchi | 2a74d4c | 2013-03-24 23:25:27 -0700 | [diff] [blame] | 4576 | // Package LIM_MLM_ADDBA_RSP to MLME, with proper |
| 4577 | // status code. MLME will then send an ADDBA RSP |
| 4578 | // over the air to the peer MAC entity |
| 4579 | if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac, |
| 4580 | pMlmAddBACnf->peerMacAddr, |
| 4581 | pMlmAddBACnf->addBAResultCode, |
| 4582 | pMlmAddBACnf->baDialogToken, |
| 4583 | (tANI_U8) pMlmAddBACnf->baTID, |
| 4584 | (tANI_U8) pMlmAddBACnf->baPolicy, |
| 4585 | pMlmAddBACnf->baBufferSize, |
| 4586 | pMlmAddBACnf->baTimeout,psessionEntry)) |
| 4587 | { |
| 4588 | PELOGW(limLog( pMac, LOGW, |
| 4589 | FL( "Failed to post LIM_MLM_ADDBA_RSP to " )); |
| 4590 | limPrintMacAddr( pMac, pMlmAddBACnf->peerMacAddr, LOGW );) |
| 4591 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4592 | } |
| 4593 | else |
| 4594 | { |
| 4595 | pSta->tcCfg[pMlmAddBACnf->baTID].fUseBATx = 1; |
| 4596 | pSta->tcCfg[pMlmAddBACnf->baTID].fTxCompBA = 1; |
| 4597 | pSta->tcCfg[pMlmAddBACnf->baTID].fTxBApolicy = pMlmAddBACnf->baPolicy; |
| 4598 | pSta->tcCfg[pMlmAddBACnf->baTID].txBufSize = pMlmAddBACnf->baBufferSize; |
| 4599 | pSta->tcCfg[pMlmAddBACnf->baTID].tuTxBAWaitTimeout = pMlmAddBACnf->baTimeout; |
| 4600 | } |
| 4601 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4602 | // Free the memory allocated for LIM_MLM_ADDBA_CNF |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4603 | vos_mem_free(pMsgBuf); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4604 | pMsgBuf = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4605 | } |
| 4606 | /** |
| 4607 | * \brief Process LIM_MLM_DELBA_CNF |
| 4608 | * |
| 4609 | * \sa limProcessMlmDelBACnf |
| 4610 | * |
| 4611 | * \param pMac The global tpAniSirGlobal object |
| 4612 | * |
| 4613 | * \param tSirMsgQ The MsgQ header containing the response buffer |
| 4614 | * |
| 4615 | * \return none |
| 4616 | */ |
| 4617 | void limProcessMlmDelBACnf( tpAniSirGlobal pMac, |
| 4618 | tANI_U32 *pMsgBuf ) |
| 4619 | { |
| 4620 | tpLimMlmDelBACnf pMlmDelBACnf; |
| 4621 | tpDphHashNode pSta; |
| 4622 | tANI_U16 aid; |
| 4623 | // tANI_U8 sessionId; |
| 4624 | tLimBAState curBaState; |
| 4625 | tpPESession psessionEntry; |
| 4626 | |
| 4627 | if(pMsgBuf == NULL) |
| 4628 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4629 | PELOGE(limLog(pMac, LOGE,FL("Buffer is Pointing to NULL"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4630 | return; |
| 4631 | } |
| 4632 | pMlmDelBACnf = (tpLimMlmDelBACnf) pMsgBuf; |
| 4633 | if((psessionEntry = peFindSessionBySessionId(pMac, pMlmDelBACnf->sessionId))== NULL) |
| 4634 | { |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 4635 | limLog(pMac, LOGP,FL("SessionId:%d Session Does not exist"), |
| 4636 | pMlmDelBACnf->sessionId); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4637 | vos_mem_free(pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4638 | return; |
| 4639 | } |
| 4640 | // First, extract the DPH entry |
| 4641 | pSta = dphLookupHashEntry( pMac, pMlmDelBACnf->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable ); |
| 4642 | if( NULL == pSta ) |
| 4643 | { |
| 4644 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4645 | FL( "STA context not found - ignoring DELBA CNF from HAL" )); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4646 | vos_mem_free(pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4647 | return; |
| 4648 | } |
| 4649 | if(NULL == pMlmDelBACnf) |
| 4650 | { |
| 4651 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4652 | FL( "pMlmDelBACnf is NULL - ignoring DELBA CNF from HAL" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4653 | return; |
| 4654 | } |
| 4655 | // Need to validate baState |
| 4656 | LIM_GET_STA_BA_STATE(pSta, pMlmDelBACnf->baTID, &curBaState); |
| 4657 | if( eLIM_BA_STATE_WT_DEL_RSP != curBaState ) |
| 4658 | { |
| 4659 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4660 | FL( "Received unexpected DELBA CNF when STA BA state is %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4661 | curBaState ); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4662 | vos_mem_free(pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4663 | return; |
| 4664 | } |
| 4665 | // Restore STA BA state |
| 4666 | LIM_SET_STA_BA_STATE(pSta, pMlmDelBACnf->baTID, eLIM_BA_STATE_IDLE); |
| 4667 | // Free the memory allocated for LIM_MLM_DELBA_CNF |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4668 | vos_mem_free(pMsgBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4669 | } |
| 4670 | /** |
| 4671 | * \brief Process SIR_LIM_DEL_BA_IND |
| 4672 | * |
| 4673 | * \sa limProcessMlmHalBADeleteInd |
| 4674 | * |
| 4675 | * \param pMac The global tpAniSirGlobal object |
| 4676 | * |
| 4677 | * \param tSirMsgQ The MsgQ header containing the indication buffer |
| 4678 | * |
| 4679 | * \return none |
| 4680 | */ |
| 4681 | void limProcessMlmHalBADeleteInd( tpAniSirGlobal pMac, |
| 4682 | tpSirMsgQ limMsgQ ) |
| 4683 | { |
| 4684 | tSirRetStatus status = eSIR_SUCCESS; |
| 4685 | tpBADeleteParams pBADeleteParams; |
| 4686 | tpDphHashNode pSta; |
| 4687 | tANI_U16 aid; |
| 4688 | tLimBAState curBaState; |
| 4689 | tpPESession psessionEntry; |
| 4690 | tANI_U8 sessionId; |
| 4691 | |
| 4692 | pBADeleteParams = (tpBADeleteParams) limMsgQ->bodyptr; |
| 4693 | |
| 4694 | if((psessionEntry = peFindSessionByBssid(pMac,pBADeleteParams->bssId,&sessionId))== NULL) |
| 4695 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4696 | PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));) |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4697 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4698 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4699 | return; |
| 4700 | } |
| 4701 | // First, extract the DPH entry |
| 4702 | pSta = dphLookupHashEntry( pMac, pBADeleteParams->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable ); |
| 4703 | if( NULL == pSta ) |
| 4704 | { |
| 4705 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4706 | FL( "STA context not found - ignoring BA Delete IND from HAL" )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4707 | goto returnAfterCleanup; |
| 4708 | } |
| 4709 | |
| 4710 | // Need to validate BA state |
| 4711 | LIM_GET_STA_BA_STATE(pSta, pBADeleteParams->baTID, &curBaState); |
| 4712 | if( eLIM_BA_STATE_IDLE != curBaState ) |
| 4713 | { |
| 4714 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4715 | FL( "Received unexpected BA Delete IND when STA BA state is %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4716 | curBaState ); |
| 4717 | goto returnAfterCleanup; |
Abhishek Singh | 66c1676 | 2014-08-14 19:13:19 +0530 | [diff] [blame] | 4718 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4719 | |
Abhishek Singh | 66c1676 | 2014-08-14 19:13:19 +0530 | [diff] [blame] | 4720 | // Post DELBA REQ to MLME... |
| 4721 | if( eSIR_SUCCESS != |
| 4722 | (status = limPostMlmDelBAReq( pMac, |
| 4723 | pSta, |
| 4724 | pBADeleteParams->baDirection, |
| 4725 | pBADeleteParams->baTID, |
| 4726 | eSIR_MAC_UNSPEC_FAILURE_REASON,psessionEntry ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4727 | { |
Abhishek Singh | 66c1676 | 2014-08-14 19:13:19 +0530 | [diff] [blame] | 4728 | limLog( pMac, LOGE, |
| 4729 | 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] | 4730 | } |
| 4731 | else |
| 4732 | { |
Abhishek Singh | 66c1676 | 2014-08-14 19:13:19 +0530 | [diff] [blame] | 4733 | limLog( pMac, LOGE, |
| 4734 | FL( "BA Delete - Reason 0x%08x. Attempting to delete BA session for TID %d with peer STA " ), |
| 4735 | pBADeleteParams->reasonCode, pBADeleteParams->baTID ); |
| 4736 | limPrintMacAddr( pMac, pSta->staAddr, LOGE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4737 | } |
| 4738 | returnAfterCleanup: |
| 4739 | // Free the memory allocated for SIR_LIM_DEL_BA_IND |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4740 | vos_mem_free(limMsgQ->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4741 | limMsgQ->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4742 | } |
| 4743 | /** |
| 4744 | * @function : limProcessSetMimoRsp() |
| 4745 | * |
| 4746 | * @brief : This function is called upon receiving the WDA_SET_MIMOPS_RSP from the HAL |
| 4747 | * after Processing the Req from the SME (PMC) |
| 4748 | * |
| 4749 | * LOGIC: |
| 4750 | * |
| 4751 | * ASSUMPTIONS: |
| 4752 | * NA |
| 4753 | * |
| 4754 | * NOTE: |
| 4755 | * NA |
| 4756 | * |
| 4757 | * @param pMac - Pointer to Global MAC structure |
| 4758 | * @param limMsg - Lim Message structure object with the MimoPSparam in body |
| 4759 | * @return None |
| 4760 | */ |
| 4761 | |
| 4762 | void |
| 4763 | limProcessSetMimoRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 4764 | { |
| 4765 | #if 0 |
| 4766 | tSirRetStatus retStatus; |
| 4767 | tpSetMIMOPS pMIMO_PSParams; |
| 4768 | |
| 4769 | |
| 4770 | do { |
| 4771 | |
| 4772 | pMIMO_PSParams = (tpSetMIMOPS)limMsg->bodyptr; |
| 4773 | if( NULL == pMIMO_PSParams ) { |
| 4774 | PELOGE(limLog(pMac, LOGE, "Received the WDA_SET_MIMOPS_RSP with NULL as the PS param");) |
| 4775 | return; |
| 4776 | } |
| 4777 | |
| 4778 | /** If Updation of the HAL Fail's*/ |
| 4779 | if (pMIMO_PSParams->status != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4780 | 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] | 4781 | break; |
| 4782 | } |
| 4783 | |
| 4784 | if ((pMac->lim.gLimSystemRole != eSYSTEM_STA_ROLE) || |
| 4785 | (pMac->lim.gLimSmeState != eLIM_SME_LINK_EST_STATE) ) |
| 4786 | break; |
| 4787 | |
| 4788 | pMac->lim.gLimMlmState = pMac->lim.gLimPrevMlmState; |
| 4789 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, 0, pMac->lim.gLimMlmState)); |
| 4790 | |
| 4791 | /** In the Case of Exiting out of the Powersave (changing from Dynamic/Static mode to SM Enabled) |
| 4792 | * send the action Frame to Peer to update the PS State of the STA , for the case of Entering PowerSave |
| 4793 | * the Action Frame is being sent at first before setting the internal structures |
| 4794 | */ |
| 4795 | if (!isEnteringMimoPS(pMac->lim.gHTMIMOPSState, pMIMO_PSParams->htMIMOPSState)) { |
| 4796 | tSirMacAddr macAddr; |
| 4797 | |
| 4798 | /** Obtain the AP's Mac Address */ |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4799 | vos_mem_copy((tANI_U8 *)macAddr, pMac->lim.gLimBssid, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4800 | |
| 4801 | /** Send Action Frame with the corresponding mode */ |
| 4802 | retStatus = limSendSMPowerStateFrame(pMac, macAddr, pMIMO_PSParams->htMIMOPSState); |
| 4803 | if (retStatus != eSIR_SUCCESS) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4804 | PELOGE(limLog(pMac, LOGE, FL("Sending Action Frame has failed"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4805 | break; |
| 4806 | } |
| 4807 | } |
| 4808 | PELOG1(limLog(pMac, LOG1, FL("The Setting up of LimGlobals is successful for MIMOPS"));) |
| 4809 | }while(0); |
| 4810 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4811 | vos_mem_free((void *) pMIMO_PSParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4812 | #endif |
| 4813 | } |
| 4814 | /** |
| 4815 | * @function : limHandleDelBssInReAssocContext |
| 4816 | * @brief : While Processing the ReAssociation Response Frame in STA, |
| 4817 | * a. immediately after receiving the Reassoc Response the RxCleanUp is |
| 4818 | * being issued and the end of DelBSS the new BSS is being added. |
| 4819 | * |
| 4820 | * b .If an AP rejects the ReAssociation (Disassoc / Deauth) with some context |
| 4821 | * change, We need to update CSR with ReAssocCNF Response with the |
| 4822 | * ReAssoc Fail and the reason Code, that is also being handled in the DELBSS |
| 4823 | * context only |
| 4824 | * |
| 4825 | * @param : pMac - tpAniSirGlobal |
| 4826 | * pStaDs - Station Descriptor |
| 4827 | * |
| 4828 | * @return : none |
| 4829 | */ |
| 4830 | static void |
| 4831 | limHandleDelBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionEntry) |
| 4832 | { |
| 4833 | tLimMlmReassocCnf mlmReassocCnf; |
| 4834 | /** Skipped the DeleteDPH Hash Entry as we need it for the new BSS*/ |
| 4835 | /** Set the MlmState to IDLE*/ |
| 4836 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4837 | /* Update PE session Id*/ |
| 4838 | mlmReassocCnf.sessionId = psessionEntry->peSessionId; |
Sushant Kaushik | 374fd05 | 2015-03-12 16:47:53 +0530 | [diff] [blame] | 4839 | switch (psessionEntry->limSmeState) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4840 | case eLIM_SME_WT_REASSOC_STATE : |
| 4841 | { |
| 4842 | tpSirAssocRsp assocRsp; |
| 4843 | tpDphHashNode pStaDs; |
| 4844 | tSirRetStatus retStatus = eSIR_SUCCESS; |
Sushant Kaushik | 374fd05 | 2015-03-12 16:47:53 +0530 | [diff] [blame] | 4845 | tpSchBeaconStruct pBeaconStruct; |
| 4846 | pBeaconStruct = vos_mem_vmalloc(sizeof(tSchBeaconStruct)); |
| 4847 | if (NULL == pBeaconStruct) |
| 4848 | { |
| 4849 | limLog(pMac, LOGE, FL("beaconStruct allocation failed")); |
| 4850 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4851 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 4852 | limDeleteDphHashEntry(pMac, psessionEntry->bssId, |
| 4853 | DPH_STA_HASH_INDEX_PEER, psessionEntry); |
| 4854 | goto Error; |
| 4855 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4856 | /** Delete the older STA Table entry */ |
| 4857 | limDeleteDphHashEntry(pMac, psessionEntry->bssId, DPH_STA_HASH_INDEX_PEER, psessionEntry); |
| 4858 | /** |
| 4859 | * Add an entry for AP to hash table |
| 4860 | * maintained by DPH module |
| 4861 | */ |
| 4862 | if ((pStaDs = dphAddHashEntry(pMac, psessionEntry->limReAssocbssId, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable)) == NULL) |
| 4863 | { |
| 4864 | // Could not add hash table entry |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4865 | 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] | 4866 | limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE); |
| 4867 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4868 | mlmReassocCnf.protStatusCode = eSIR_SME_SUCCESS; |
Abhishek Singh | 2b05585 | 2015-10-07 14:14:13 +0530 | [diff] [blame] | 4869 | vos_mem_vfree(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4870 | goto Error; |
| 4871 | } |
| 4872 | /** While Processing the ReAssoc Response Frame the ReAssocRsp Frame |
| 4873 | * is being stored to be used here for sending ADDBSS |
| 4874 | */ |
| 4875 | assocRsp = (tpSirAssocRsp)psessionEntry->limAssocResponseData; |
| 4876 | limUpdateAssocStaDatas(pMac, pStaDs, assocRsp,psessionEntry); |
| 4877 | limUpdateReAssocGlobals(pMac, assocRsp,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4878 | limExtractApCapabilities( pMac, |
Abhishek Singh | bad2b32 | 2016-10-21 11:22:33 +0530 | [diff] [blame] | 4879 | (tANI_U8 *) |
| 4880 | psessionEntry->pLimReAssocReq->bssDescription.ieFields, |
| 4881 | GET_IE_LEN_IN_BSS( |
| 4882 | psessionEntry->pLimReAssocReq->bssDescription.length), |
| 4883 | pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4884 | if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
Sushant Kaushik | 374fd05 | 2015-03-12 16:47:53 +0530 | [diff] [blame] | 4885 | limDecideStaProtectionOnAssoc(pMac, pBeaconStruct, psessionEntry); |
| 4886 | if(pBeaconStruct->erpPresent) { |
| 4887 | if (pBeaconStruct->erpIEInfo.barkerPreambleMode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4888 | psessionEntry->beaconParams.fShortPreamble = 0; |
| 4889 | else |
| 4890 | psessionEntry->beaconParams.fShortPreamble = 1; |
| 4891 | } |
| 4892 | //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] | 4893 | if (eSIR_SUCCESS != limStaSendAddBss( pMac, assocRsp, pBeaconStruct, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4894 | &psessionEntry->pLimReAssocReq->bssDescription, false, psessionEntry)) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4895 | limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4896 | retStatus = eSIR_FAILURE; |
| 4897 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4898 | if (retStatus != eSIR_SUCCESS) |
| 4899 | { |
| 4900 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 4901 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4902 | vos_mem_free(assocRsp); |
Sushant Kaushik | 374fd05 | 2015-03-12 16:47:53 +0530 | [diff] [blame] | 4903 | vos_mem_vfree(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4904 | pMac->lim.gLimAssocResponseData = NULL; |
| 4905 | goto Error; |
| 4906 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4907 | vos_mem_free(assocRsp); |
Sushant Kaushik | 374fd05 | 2015-03-12 16:47:53 +0530 | [diff] [blame] | 4908 | vos_mem_vfree(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4909 | psessionEntry->limAssocResponseData = NULL; |
| 4910 | } |
| 4911 | break; |
| 4912 | case eLIM_SME_WT_REASSOC_LINK_FAIL_STATE: |
| 4913 | { |
| 4914 | /** Case wherein the DisAssoc / Deauth |
| 4915 | * being sent as response to ReAssoc Req*/ |
| 4916 | /** Send the Reason code as the same received in Disassoc / Deauth Frame*/ |
| 4917 | mlmReassocCnf.resultCode = pStaDs->mlmStaContext.disassocReason; |
| 4918 | mlmReassocCnf.protStatusCode = pStaDs->mlmStaContext.cleanupTrigger; |
| 4919 | /** Set the SME State back to WT_Reassoc State*/ |
| 4920 | psessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4921 | limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId,psessionEntry); |
| 4922 | if((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| |
| 4923 | (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) |
| 4924 | { |
| 4925 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4926 | } |
| 4927 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 4928 | } |
| 4929 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4930 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4931 | 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] | 4932 | mlmReassocCnf.resultCode = eSIR_SME_REFUSED; |
| 4933 | mlmReassocCnf.protStatusCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 4934 | goto Error; |
| 4935 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4936 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4937 | Error: |
| 4938 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 4939 | } |
| 4940 | |
| 4941 | /* Added For BT -AMP Support */ |
| 4942 | static void |
| 4943 | limProcessBtampAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESession psessionEntry) |
| 4944 | { |
| 4945 | tLimMlmStartCnf mlmStartCnf; |
| 4946 | tANI_U32 val; |
| 4947 | tpAddBssParams pAddBssParams = (tpAddBssParams) limMsgQ->bodyptr; |
| 4948 | |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 4949 | if (NULL == pAddBssParams) |
| 4950 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4951 | limLog( pMac, LOGE, FL( "Invalid body pointer in message")); |
Pratik Bhalgat | aa1ae39 | 2012-11-22 17:44:33 +0530 | [diff] [blame] | 4952 | goto end; |
| 4953 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4954 | if( eHAL_STATUS_SUCCESS == pAddBssParams->status ) |
| 4955 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4956 | 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] | 4957 | if (psessionEntry->bssType == eSIR_BTAMP_AP_MODE) |
| 4958 | { |
| 4959 | if (limSetLinkState(pMac, eSIR_LINK_BTAMP_AP_STATE, psessionEntry->bssId, |
| 4960 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 4961 | goto end; |
| 4962 | } else if (psessionEntry->bssType == eSIR_BTAMP_STA_MODE) { |
| 4963 | if (limSetLinkState(pMac, eSIR_LINK_SCAN_STATE, psessionEntry->bssId, |
| 4964 | psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) |
| 4965 | goto end; |
| 4966 | } |
| 4967 | |
| 4968 | // Set MLME state |
| 4969 | psessionEntry->limMlmState= eLIM_MLM_BSS_STARTED_STATE; |
| 4970 | psessionEntry->statypeForBss = STA_ENTRY_SELF; // to know session started for peer or for self |
| 4971 | psessionEntry->bssIdx = (tANI_U8) pAddBssParams->bssIdx; |
| 4972 | schEdcaProfileUpdate(pMac, psessionEntry); |
Gopichand Nakkala | 777e603 | 2012-12-31 16:39:21 -0800 | [diff] [blame] | 4973 | limInitPeerIdxpool(pMac,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4974 | // Create timers used by LIM |
| 4975 | if (!pMac->lim.gLimTimersCreated) |
| 4976 | limCreateTimers(pMac); |
| 4977 | /* Update the lim global gLimTriggerBackgroundScanDuringQuietBss */ |
| 4978 | 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] | 4979 | 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] | 4980 | pMac->lim.gLimTriggerBackgroundScanDuringQuietBss = (val) ? 1 : 0; |
| 4981 | // Apply previously set configuration at HW |
| 4982 | limApplyConfiguration(pMac,psessionEntry); |
| 4983 | psessionEntry->staId = pAddBssParams->staContext.staIdx; |
| 4984 | mlmStartCnf.resultCode = eSIR_SME_SUCCESS; |
| 4985 | } |
| 4986 | else |
| 4987 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 4988 | 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] | 4989 | mlmStartCnf.resultCode = eSIR_SME_HAL_SEND_MESSAGE_FAIL; |
| 4990 | } |
| 4991 | mlmStartCnf.sessionId = psessionEntry->peSessionId; |
| 4992 | limPostSmeMessage( pMac, LIM_MLM_START_CNF, (tANI_U32 *) &mlmStartCnf ); |
| 4993 | end: |
| 4994 | if( 0 != limMsgQ->bodyptr ) |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4995 | { |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 4996 | vos_mem_zero(pAddBssParams, sizeof(tAddBssParams)); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 4997 | vos_mem_free(pAddBssParams); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 4998 | limMsgQ->bodyptr = NULL; |
| 4999 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5000 | } |
| 5001 | |
| 5002 | /** |
| 5003 | * @function : limHandleAddBssInReAssocContext |
| 5004 | * @brief : While Processing the ReAssociation Response Frame in STA, |
| 5005 | * a. immediately after receiving the Reassoc Response the RxCleanUp is |
| 5006 | * being issued and the end of DelBSS the new BSS is being added. |
| 5007 | * |
| 5008 | * b .If an AP rejects the ReAssociation (Disassoc / Deauth) with some context |
| 5009 | * change, We need to update CSR with ReAssocCNF Response with the |
| 5010 | * ReAssoc Fail and the reason Code, that is also being handled in the DELBSS |
| 5011 | * context only |
| 5012 | * |
| 5013 | * @param : pMac - tpAniSirGlobal |
| 5014 | * pStaDs - Station Descriptor |
| 5015 | * |
| 5016 | * @return : none |
| 5017 | */ |
| 5018 | void |
| 5019 | limHandleAddBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry) |
| 5020 | { |
| 5021 | tLimMlmReassocCnf mlmReassocCnf; |
| 5022 | /** Skipped the DeleteDPH Hash Entry as we need it for the new BSS*/ |
| 5023 | /** Set the MlmState to IDLE*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5024 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
| 5025 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5026 | switch (psessionEntry->limSmeState) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5027 | case eLIM_SME_WT_REASSOC_STATE : { |
| 5028 | tpSirAssocRsp assocRsp; |
| 5029 | tpDphHashNode pStaDs; |
| 5030 | tSirRetStatus retStatus = eSIR_SUCCESS; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 5031 | tSchBeaconStruct *pBeaconStruct; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5032 | pBeaconStruct = vos_mem_malloc(sizeof(tSchBeaconStruct)); |
| 5033 | if ( NULL == pBeaconStruct ) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 5034 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5035 | limLog(pMac, LOGE, FL("Unable to allocate memory in limHandleAddBssInReAssocContext") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 5036 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 5037 | mlmReassocCnf.protStatusCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 5038 | goto Error; |
| 5039 | } |
| 5040 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5041 | // Get the AP entry from DPH hash table |
| 5042 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 5043 | if (pStaDs == NULL ) |
| 5044 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5045 | 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] | 5046 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 5047 | mlmReassocCnf.protStatusCode = eSIR_SME_SUCCESS; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5048 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5049 | goto Error; |
| 5050 | } |
| 5051 | /** While Processing the ReAssoc Response Frame the ReAssocRsp Frame |
| 5052 | * is being stored to be used here for sending ADDBSS |
| 5053 | */ |
| 5054 | assocRsp = (tpSirAssocRsp)psessionEntry->limAssocResponseData; |
| 5055 | limUpdateAssocStaDatas(pMac, pStaDs, assocRsp, psessionEntry); |
| 5056 | limUpdateReAssocGlobals(pMac, assocRsp, psessionEntry); |
Abhishek Singh | bad2b32 | 2016-10-21 11:22:33 +0530 | [diff] [blame] | 5057 | limExtractApCapabilities(pMac, |
| 5058 | (tANI_U8 *) |
| 5059 | psessionEntry->pLimReAssocReq->bssDescription.ieFields, |
| 5060 | GET_IE_LEN_IN_BSS( |
| 5061 | psessionEntry->pLimReAssocReq->bssDescription.length), |
| 5062 | pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5063 | if(pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 5064 | limDecideStaProtectionOnAssoc(pMac, pBeaconStruct, psessionEntry); |
| 5065 | |
| 5066 | if(pBeaconStruct->erpPresent) |
| 5067 | { |
| 5068 | if (pBeaconStruct->erpIEInfo.barkerPreambleMode) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5069 | psessionEntry->beaconParams.fShortPreamble = 0; |
| 5070 | else |
| 5071 | psessionEntry->beaconParams.fShortPreamble = 1; |
| 5072 | } |
| 5073 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 5074 | if (eSIR_SUCCESS != limStaSendAddBss( pMac, assocRsp, pBeaconStruct, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5075 | &psessionEntry->pLimReAssocReq->bssDescription, true, psessionEntry)) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5076 | limLog( pMac, LOGE, FL( "Posting ADDBSS in the ReAssocContext has Failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5077 | retStatus = eSIR_FAILURE; |
| 5078 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5079 | if (retStatus != eSIR_SUCCESS) |
| 5080 | { |
| 5081 | mlmReassocCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; |
| 5082 | mlmReassocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5083 | vos_mem_free(assocRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5084 | pMac->lim.gLimAssocResponseData = NULL; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5085 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5086 | goto Error; |
| 5087 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5088 | vos_mem_free(assocRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5089 | psessionEntry->limAssocResponseData = NULL; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5090 | vos_mem_free(pBeaconStruct); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5091 | } |
| 5092 | break; |
| 5093 | case eLIM_SME_WT_REASSOC_LINK_FAIL_STATE: { /** Case wherein the DisAssoc / Deauth |
| 5094 | * being sent as response to ReAssoc Req*/ |
| 5095 | /** Send the Reason code as the same received in Disassoc / Deauth Frame*/ |
| 5096 | mlmReassocCnf.resultCode = pStaDs->mlmStaContext.disassocReason; |
| 5097 | mlmReassocCnf.protStatusCode = pStaDs->mlmStaContext.cleanupTrigger; |
| 5098 | /** Set the SME State back to WT_Reassoc State*/ |
| 5099 | psessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; |
| 5100 | limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, psessionEntry); |
| 5101 | if(psessionEntry->limSystemRole == eLIM_STA_ROLE) |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 5102 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5103 | psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 5104 | MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); |
| 5105 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5106 | |
| 5107 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 5108 | } |
| 5109 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5110 | default: |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5111 | 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] | 5112 | mlmReassocCnf.resultCode = eSIR_SME_REFUSED; |
| 5113 | mlmReassocCnf.protStatusCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; |
| 5114 | goto Error; |
| 5115 | } |
| 5116 | return; |
| 5117 | Error: |
| 5118 | limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); |
| 5119 | } |
| 5120 | |
| 5121 | #if 0 |
| 5122 | static void |
| 5123 | limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsgBuf) |
| 5124 | { |
| 5125 | tSirSmeAssocCnf assocCnf; |
| 5126 | tpDphHashNode pStaDs; |
| 5127 | tpPESession psessionEntry; |
| 5128 | tANI_U8 sessionId; |
| 5129 | |
| 5130 | if(pMsgBuf == NULL) |
| 5131 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5132 | limLog(pMac, LOGE, FL("pMsgBuf is NULL ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5133 | goto end; |
| 5134 | } |
| 5135 | if ((limAssocCnfSerDes(pMac, &assocCnf, (tANI_U8 *) pMsgBuf) == eSIR_FAILURE) || |
| 5136 | !__limIsSmeAssocCnfValid(&assocCnf)) |
| 5137 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5138 | limLog(pMac, LOGE, FL("Received invalid SME_RE(ASSOC)_CNF message ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5139 | goto end; |
| 5140 | } |
| 5141 | if((psessionEntry = peFindSessionByBssid(pMac, assocCnf.bssId, &sessionId))== NULL) |
| 5142 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5143 | limLog(pMac, LOGE, FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5144 | goto end; |
| 5145 | } |
| 5146 | if ( ((psessionEntry->limSystemRole != eLIM_AP_ROLE) && (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) || |
| 5147 | ((psessionEntry->limSmeState != eLIM_SME_NORMAL_STATE) && (psessionEntry->limSmeState != eLIM_SME_NORMAL_CHANNEL_SCAN_STATE))) |
| 5148 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5149 | 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] | 5150 | msgType, psessionEntry->limSmeState , psessionEntry->limSystemRole); |
| 5151 | goto end; |
| 5152 | } |
| 5153 | pStaDs = dphGetHashEntry(pMac, assocCnf.aid, &psessionEntry->dph.dphHashTable); |
| 5154 | if (pStaDs == NULL) |
| 5155 | { |
| 5156 | limLog(pMac, LOG1, |
| 5157 | FL("Received invalid message %X due to no STA context, for aid %d, peer "), |
| 5158 | msgType, assocCnf.aid); |
| 5159 | limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1); |
| 5160 | /* |
| 5161 | ** send a DISASSOC_IND message to WSM to make sure |
| 5162 | ** the state in WSM and LIM is the same |
| 5163 | **/ |
| 5164 | limSendSmeDisassocNtf( pMac, assocCnf.peerMacAddr, eSIR_SME_STA_NOT_ASSOCIATED, |
| 5165 | eLIM_PEER_ENTITY_DISASSOC, assocCnf.aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); |
| 5166 | goto end; |
| 5167 | } |
| 5168 | if ((pStaDs && |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5169 | (( !vos_mem_compare((tANI_U8 *) pStaDs->staAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5170 | (tANI_U8 *) assocCnf.peerMacAddr, |
| 5171 | sizeof(tSirMacAddr)) ) || |
| 5172 | (pStaDs->mlmStaContext.mlmState != eLIM_MLM_WT_ASSOC_CNF_STATE) || |
| 5173 | ((pStaDs->mlmStaContext.subType == LIM_ASSOC) && |
| 5174 | (msgType != eWNI_SME_ASSOC_CNF)) || |
| 5175 | ((pStaDs->mlmStaContext.subType == LIM_REASSOC) && |
| 5176 | (msgType != eWNI_SME_REASSOC_CNF))))) |
| 5177 | { |
| 5178 | limLog(pMac, LOG1, |
| 5179 | FL("Received invalid message %X due to peerMacAddr mismatched or not in eLIM_MLM_WT_ASSOC_CNF_STATE state, for aid %d, peer "), |
| 5180 | msgType, assocCnf.aid); |
| 5181 | limPrintMacAddr(pMac, assocCnf.peerMacAddr, LOG1); |
| 5182 | goto end; |
| 5183 | } |
| 5184 | /* |
| 5185 | ** Deactivate/delet CNF_WAIT timer since ASSOC_CNF |
| 5186 | ** has been received |
| 5187 | **/ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5188 | limLog(pMac, LOG1, FL("Received SME_ASSOC_CNF. Delete Timer")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5189 | limDeactivateAndChangePerStaIdTimer(pMac, eLIM_CNF_WAIT_TIMER, pStaDs->assocId); |
| 5190 | if (assocCnf.statusCode == eSIR_SME_SUCCESS) |
| 5191 | { |
| 5192 | /* In BTAMP-AP, PE already finished the WDA_ADD_STA sequence |
| 5193 | * when it had received Assoc Request frame. Now, PE just needs to send |
| 5194 | * Association Response frame to the requesting BTAMP-STA. |
| 5195 | */ |
| 5196 | pStaDs->mlmStaContext.mlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5197 | 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] | 5198 | limSendAssocRspMgmtFrame( pMac, eSIR_SUCCESS, pStaDs->assocId, pStaDs->staAddr, |
| 5199 | pStaDs->mlmStaContext.subType, pStaDs, psessionEntry); |
| 5200 | goto end; |
| 5201 | } // (assocCnf.statusCode == eSIR_SME_SUCCESS) |
| 5202 | else |
| 5203 | { |
| 5204 | // SME_ASSOC_CNF status is non-success, so STA is not allowed to be associated |
| 5205 | limRejectAssociation(pMac, pStaDs->staAddr, |
| 5206 | pStaDs->mlmStaContext.subType, |
| 5207 | true, pStaDs->mlmStaContext.authType, |
| 5208 | pStaDs->assocId, true, |
| 5209 | assocCnf.statusCode, psessionEntry); |
| 5210 | return; |
| 5211 | } |
| 5212 | end: |
| 5213 | if ( psessionEntry->parsedAssocReq[pStaDs->assocId] != NULL ) |
| 5214 | { |
| 5215 | if ( ((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame) |
| 5216 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5217 | vos_mem_free(((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5218 | ((tpSirAssocReq)(psessionEntry->parsedAssocReq[pStaDs->assocId]))->assocReqFrame = NULL; |
| 5219 | } |
| 5220 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5221 | vos_mem_free(psessionEntry->parsedAssocReq[pStaDs->assocId]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5222 | psessionEntry->parsedAssocReq[pStaDs->assocId] = NULL; |
| 5223 | } |
| 5224 | } /*** end __limProcessSmeAssocCnfNew() ***/ |
| 5225 | #endif |
| 5226 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5227 | void |
| 5228 | limSendBeaconInd(tpAniSirGlobal pMac, tpPESession psessionEntry){ |
| 5229 | tBeaconGenParams *pBeaconGenParams = NULL; |
| 5230 | tSirMsgQ limMsg; |
| 5231 | /** Allocate the Memory for Beacon Pre Message and for Stations in PoweSave*/ |
| 5232 | if(psessionEntry == NULL ){ |
| 5233 | PELOGE( limLog( pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 5234 | FL( "Error:Unable to get the PESessionEntry" ));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5235 | return; |
| 5236 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5237 | pBeaconGenParams = vos_mem_malloc(sizeof(*pBeaconGenParams)); |
| 5238 | if ( NULL == pBeaconGenParams ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5239 | { |
| 5240 | PELOGE( limLog( pMac, LOGP, |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5241 | FL( "Unable to allocate memory during sending beaconPreMessage" ));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5242 | return; |
| 5243 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 5244 | vos_mem_set(pBeaconGenParams, sizeof(*pBeaconGenParams), 0); |
| 5245 | vos_mem_copy((void *) pBeaconGenParams->bssId, |
| 5246 | (void *)psessionEntry->bssId, |
| 5247 | SIR_MAC_ADDR_LENGTH ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5248 | limMsg.bodyptr = pBeaconGenParams; |
| 5249 | schProcessPreBeaconInd(pMac, &limMsg); |
| 5250 | return; |
| 5251 | } |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 5252 | |
| 5253 | void limSendScanOffloadComplete(tpAniSirGlobal pMac, |
| 5254 | tSirResultCodes reasonCode) |
| 5255 | { |
| 5256 | tANI_U16 scanRspLen = 0; |
| 5257 | |
| 5258 | pMac->lim.gLimSmeScanResultLength += |
| 5259 | pMac->lim.gLimMlmScanResultLength; |
Madan Mohan Koyyalamudi | cfe89a5 | 2013-07-05 20:49:50 +0530 | [diff] [blame] | 5260 | pMac->lim.gLimRspReqd = false; |
| 5261 | if ((reasonCode == eSIR_SME_SUCCESS) || |
| 5262 | pMac->lim.gLimSmeScanResultLength) { |
| 5263 | scanRspLen = sizeof(tSirSmeScanRsp) + |
| 5264 | pMac->lim.gLimSmeScanResultLength - |
| 5265 | sizeof(tSirBssDescription); |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 5266 | } |
Madan Mohan Koyyalamudi | cfe89a5 | 2013-07-05 20:49:50 +0530 | [diff] [blame] | 5267 | else |
| 5268 | scanRspLen = sizeof(tSirSmeScanRsp); |
| 5269 | |
| 5270 | limSendSmeScanRsp(pMac, scanRspLen, reasonCode, |
| 5271 | pMac->lim.gSmeSessionId, |
| 5272 | pMac->lim.gTransactionId); |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 5273 | } |
| 5274 | |
| 5275 | |
| 5276 | void limProcessRxScanEvent(tpAniSirGlobal pMac, void *buf) |
| 5277 | { |
| 5278 | tSirScanOffloadEvent *pScanEvent = (tSirScanOffloadEvent *) buf; |
| 5279 | |
| 5280 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5281 | "scan_id = %u", pScanEvent->scanId); |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 5282 | |
| 5283 | switch (pScanEvent->event) |
| 5284 | { |
| 5285 | case SCAN_EVENT_STARTED: |
| 5286 | break; |
| 5287 | case SCAN_EVENT_START_FAILED: |
| 5288 | case SCAN_EVENT_COMPLETED: |
| 5289 | limSendScanOffloadComplete(pMac, pScanEvent->reasonCode); |
| 5290 | break; |
| 5291 | case SCAN_EVENT_BSS_CHANNEL: |
| 5292 | case SCAN_EVENT_FOREIGN_CHANNEL: |
| 5293 | case SCAN_EVENT_DEQUEUED: |
| 5294 | case SCAN_EVENT_PREEMPTED: |
| 5295 | default: |
| 5296 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_DEBUG, |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 5297 | "Received unhandled scan event %u", pScanEvent->event); |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 5298 | } |
| 5299 | } |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 5300 | |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 5301 | void limProcessMlmSpoofMacAddrRsp(tpAniSirGlobal pMac, tSirRetStatus rspStatus) |
| 5302 | { |
Hanumantha Reddy Pothula | ca1d1cc | 2015-10-26 15:37:35 +0530 | [diff] [blame] | 5303 | tANI_U32 val; |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 5304 | |
Hanumantha Reddy Pothula | ca1d1cc | 2015-10-26 15:37:35 +0530 | [diff] [blame] | 5305 | if (wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_MAC_ADDR_SPOOFING, &val) |
| 5306 | != eSIR_SUCCESS) |
| 5307 | { |
| 5308 | limLog(pMac, LOGP, FL("fail to Get WNI_CFG_ENABLE_MAC_ADDR_SPOOFING")); |
| 5309 | /*If we here means mac spoofing is enable. So enable both Host and |
| 5310 | FW spoofing */ |
| 5311 | val = 1; |
| 5312 | } |
| 5313 | if ((rspStatus != eSIR_SUCCESS) || (val != 1) || |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 5314 | (TRUE == vos_is_macaddr_zero((v_MACADDR_t *)&pMac->lim.spoofMacAddr))) |
| 5315 | { |
Hanumantha Reddy Pothula | ca1d1cc | 2015-10-26 15:37:35 +0530 | [diff] [blame] | 5316 | limLog(pMac, LOG1, FL(" LIM Disabling Spoofing %d"), val); |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 5317 | pMac->lim.isSpoofingEnabled = FALSE; |
| 5318 | } else { |
| 5319 | limLog(pMac, LOG1, FL(" LIM Enabling Spoofing")); |
| 5320 | pMac->lim.isSpoofingEnabled = TRUE; |
| 5321 | } |
| 5322 | |
| 5323 | return; |
| 5324 | } |
| 5325 | |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 5326 | void limSwitchChannelResumeLinkRsp(tpAniSirGlobal pMac, |
| 5327 | eHalStatus status, |
| 5328 | tANI_U32* mlmAddBssRsp) |
| 5329 | { |
| 5330 | if (status != eHAL_STATUS_SUCCESS) |
| 5331 | { |
| 5332 | limLog(pMac, LOGE, |
| 5333 | FL(" CSA failed to get the response for resume link")); |
| 5334 | } |
| 5335 | return; |
| 5336 | } |