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