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