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