Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2012, Code Aurora Forum. 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. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * Airgo Networks, Inc proprietary. All rights reserved. |
| 24 | * This file lim ProcessMessageQueue.cc contains the code |
| 25 | * for processing LIM message Queue. |
| 26 | * Author: Chandra Modumudi |
| 27 | * Date: 02/11/02 |
| 28 | * History:- |
| 29 | * Date Modified by Modification Information |
| 30 | * -------------------------------------------------------------------- |
| 31 | * |
| 32 | */ |
| 33 | #include "palTypes.h" |
| 34 | #include "wniApi.h" |
| 35 | #ifdef FEATURE_WLAN_NON_INTEGRATED_SOC |
| 36 | #include "halDataStruct.h" |
| 37 | #include "halCommonApi.h" |
| 38 | #elif defined FEATURE_WLAN_INTEGRATED_SOC |
| 39 | #include "wlan_qct_wdi_ds.h" |
| 40 | #include "wlan_qct_pal_packet.h" |
| 41 | #include "wlan_qct_wda.h" |
| 42 | #endif |
| 43 | |
| 44 | #ifdef ANI_PRODUCT_TYPE_AP |
| 45 | #include "wniCfgAp.h" |
| 46 | #else |
| 47 | #include "wniCfgSta.h" |
| 48 | #endif |
| 49 | #include "cfgApi.h" |
| 50 | #include "sirCommon.h" |
| 51 | #include "utilsApi.h" |
| 52 | #include "limTypes.h" |
| 53 | #include "limUtils.h" |
| 54 | #include "limAssocUtils.h" |
| 55 | #include "limPropExtsUtils.h" |
| 56 | |
| 57 | #include "limAdmitControl.h" |
| 58 | #include "pmmApi.h" |
| 59 | #include "limIbssPeerMgmt.h" |
| 60 | #include "schApi.h" |
| 61 | #include "limSession.h" |
| 62 | |
| 63 | #if defined WLAN_FEATURE_VOWIFI |
| 64 | #include "rrmApi.h" |
| 65 | #endif |
| 66 | #if defined FEATURE_WLAN_CCX |
| 67 | #include "ccxApi.h" |
| 68 | #endif |
| 69 | |
| 70 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 71 | #include "limFT.h" |
| 72 | #endif |
| 73 | |
| 74 | #ifdef WMM_APSD |
| 75 | #include "wmmApsd.h" |
| 76 | #endif |
| 77 | |
| 78 | #ifdef VOSS_ENABLED |
| 79 | #include "vos_types.h" |
| 80 | #include "vos_packet.h" |
| 81 | #include "vos_memory.h" |
| 82 | #endif |
| 83 | |
| 84 | void limLogSessionStates(tpAniSirGlobal pMac); |
| 85 | |
| 86 | /** ------------------------------------------------------------- |
| 87 | \fn defMsgDecision |
| 88 | \brief The function decides whether to defer a message or not in limProcessMessage function |
| 89 | \param tpAniSirGlobal pMac |
| 90 | \param tSirMsgQ limMsg |
| 91 | \param tSirMacTspecIE *ppInfo |
| 92 | \return none |
| 93 | -------------------------------------------------------------*/ |
| 94 | |
| 95 | tANI_U8 static |
| 96 | defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 97 | { |
| 98 | |
| 99 | |
| 100 | /* this function should not changed */ |
| 101 | if((pMac->lim.gLimSmeState == eLIM_SME_SUSPEND_STATE) && |
| 102 | (limMsg->type != SIR_LIM_RESUME_ACTIVITY_NTF)) |
| 103 | { |
| 104 | // Defer processsing this message |
| 105 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 106 | { |
| 107 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) %s limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 108 | limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 109 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 110 | limLogSessionStates(pMac); |
| 111 | limHandleDeferMsgError(pMac, limMsg); |
| 112 | } |
| 113 | return true; |
| 114 | } |
| 115 | |
| 116 | //When defer is requested then defer all the messages except HAL responses. |
| 117 | if((!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) && |
| 118 | !pMac->lim.gLimSystemInScanLearnMode) |
| 119 | { |
| 120 | if((limMsg->type != WDA_ADD_BSS_RSP) && |
| 121 | (limMsg->type != WDA_DELETE_BSS_RSP) && |
| 122 | (limMsg->type != WDA_ADD_STA_RSP) && |
| 123 | (limMsg->type != WDA_ADD_STA_SELF_RSP) && |
| 124 | (limMsg->type != WDA_DEL_STA_SELF_RSP) && |
| 125 | (limMsg->type != WDA_DELETE_STA_RSP)&& |
| 126 | (limMsg->type != WDA_SET_BSSKEY_RSP)&& |
| 127 | (limMsg->type != WDA_SET_STAKEY_RSP)&& |
| 128 | (limMsg->type != WDA_SET_STA_BCASTKEY_RSP) && |
| 129 | (limMsg->type != SIR_LIM_RESUME_ACTIVITY_NTF)&& |
| 130 | (limMsg->type != eWNI_SME_START_REQ) && |
| 131 | (limMsg->type != WDA_AGGR_QOS_RSP) && |
| 132 | (limMsg->type != WDA_REMOVE_BSSKEY_RSP) && |
| 133 | (limMsg->type != WDA_REMOVE_STAKEY_RSP) && |
| 134 | (limMsg->type != WDA_SET_MIMOPS_RSP)&& |
| 135 | (limMsg->type != WDA_ADDBA_RSP) && |
| 136 | (limMsg->type != WDA_ENTER_BMPS_RSP) && |
| 137 | (limMsg->type != WDA_EXIT_BMPS_RSP) && |
| 138 | (limMsg->type != WDA_ENTER_IMPS_RSP) && |
| 139 | (limMsg->type != WDA_EXIT_IMPS_RSP) && |
| 140 | (limMsg->type != WDA_ENTER_UAPSD_RSP) && |
| 141 | (limMsg->type != WDA_EXIT_UAPSD_RSP) && |
| 142 | (limMsg->type != WDA_WOWL_ENTER_RSP) && |
| 143 | (limMsg->type != WDA_WOWL_EXIT_RSP) && |
| 144 | (limMsg->type != WDA_SWITCH_CHANNEL_RSP) && |
| 145 | #ifdef WLAN_FEATURE_P2P |
| 146 | (limMsg->type != WDA_P2P_NOA_ATTR_IND) && |
| 147 | #endif |
| 148 | (limMsg->type != WDA_ADD_TS_RSP)) |
| 149 | { |
| 150 | PELOG1(limLog(pMac, LOG1, FL("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode\n"), |
| 151 | limMsgStr(limMsg->type));) |
| 152 | |
| 153 | // Defer processsing this message |
| 154 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 155 | { |
| 156 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) %s limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 157 | limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 158 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 159 | limLogSessionStates(pMac); |
| 160 | limHandleDeferMsgError(pMac, limMsg); |
| 161 | |
| 162 | } |
| 163 | return true; |
| 164 | } |
| 165 | } |
| 166 | return false; |
| 167 | } |
| 168 | |
| 169 | /* |
| 170 | * Beacon Handling Cases: |
| 171 | * during scanning, when no session is active: |
| 172 | * handled by limHandleFramesInScanState before __limHandleBeacon call is invoked. |
| 173 | * during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null. |
| 174 | * handled by limHandleFramesInScanState before __limHandleBeacon call is invoked. |
| 175 | * during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null. |
| 176 | * handled by limHandleFramesInScanState before __limHandleBeacon call is invoked. |
| 177 | * Not scanning, no session: |
| 178 | * there should not be any beacon coming, if coming, should be dropped. |
| 179 | * Not Scanning, |
| 180 | */ |
| 181 | static void |
| 182 | __limHandleBeacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tpPESession psessionEntry) |
| 183 | { |
| 184 | /* checking for global SME state...*/ |
| 185 | tANI_U8 *pRxPacketInfo; |
| 186 | limGetBDfromRxPacket(pMac, pMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo); |
| 187 | |
| 188 | //This function should not be called if beacon is received in scan state. |
| 189 | //So not doing any checks for the global state. |
| 190 | |
| 191 | if(psessionEntry == NULL) |
| 192 | { |
| 193 | schBeaconProcess(pMac, pRxPacketInfo, NULL); |
| 194 | } |
| 195 | else if( (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) || |
| 196 | (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE)) |
| 197 | { |
| 198 | schBeaconProcess(pMac, pRxPacketInfo, psessionEntry); |
| 199 | } |
| 200 | else |
| 201 | limProcessBeaconFrame(pMac, pRxPacketInfo, psessionEntry); |
| 202 | |
| 203 | return; |
| 204 | } |
| 205 | |
| 206 | |
| 207 | //Fucntion prototype |
| 208 | void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd); |
| 209 | |
| 210 | /** |
| 211 | * limProcessMessageQueue |
| 212 | * |
| 213 | *FUNCTION: |
| 214 | * This function is called by LIM thread entry function. This |
| 215 | * function fetches messages posted to the message queue |
| 216 | * limMsgQ. |
| 217 | * |
| 218 | *LOGIC: |
| 219 | * |
| 220 | *ASSUMPTIONS: |
| 221 | * NA |
| 222 | * |
| 223 | *NOTE: |
| 224 | * NA |
| 225 | * |
| 226 | * @param pMac - Pointer to Global MAC structure |
| 227 | * @return None |
| 228 | */ |
| 229 | |
| 230 | void |
| 231 | limProcessMessageQueue(tpAniSirGlobal pMac) |
| 232 | { |
| 233 | tSirMsgQ limMsg = { 0, 0, 0 }; |
| 234 | |
| 235 | if(pMac->gDriverType == eDRIVER_TYPE_MFG) |
| 236 | { |
| 237 | return; |
| 238 | } |
| 239 | |
| 240 | #if defined(ANI_OS_TYPE_RTAI_LINUX) |
| 241 | ULONG param; |
| 242 | while(get_timer_event(LIM_TIMER_EXPIRY_LIST,¶m)) |
| 243 | { |
| 244 | limMsg.type = (tANI_U16) param; |
| 245 | limMsg.bodyval = 0; |
| 246 | limMsg.bodyptr = NULL; |
| 247 | limMessageProcessor(pMac, &limMsg); |
| 248 | } |
| 249 | #endif |
| 250 | |
| 251 | if (tx_queue_receive( &pMac->sys.gSirLimMsgQ, (void *) &limMsg, TX_WAIT_FOREVER) |
| 252 | == TX_SUCCESS) |
| 253 | { |
| 254 | PELOG3(limLog(pMac, LOG3, FL("LIM Received message %s\n"), limMsgStr(limMsg.type));) |
| 255 | limPrintMsgInfo(pMac, LOG3, &limMsg); |
| 256 | limMessageProcessor(pMac, &limMsg); |
| 257 | } // if (tx_queue_receive) |
| 258 | |
| 259 | } /*** end limProcessMessageQueue() ***/ |
| 260 | |
| 261 | |
| 262 | |
| 263 | /** |
| 264 | * limDeferMsg() |
| 265 | * |
| 266 | *FUNCTION: |
| 267 | * This function is called to defer the messages received |
| 268 | * during Learn mode |
| 269 | * |
| 270 | *LOGIC: |
| 271 | * NA |
| 272 | * |
| 273 | *ASSUMPTIONS: |
| 274 | * NA |
| 275 | * |
| 276 | *NOTE: |
| 277 | * NA |
| 278 | * |
| 279 | * @param pMac - Pointer to Global MAC structure |
| 280 | * @param pMsg of type tSirMsgQ - Pointer to the message structure |
| 281 | * @return None |
| 282 | */ |
| 283 | |
| 284 | tANI_U32 |
| 285 | limDeferMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg) |
| 286 | { |
| 287 | tANI_U32 retCode = TX_SUCCESS; |
| 288 | #if defined(ANI_OS_TYPE_LINUX) || defined(ANI_OS_TYPE_OSX) |
| 289 | PELOG3(limLog(pMac, LOG3, FL("Deferring message %X in Learn mode\n"), |
| 290 | pMsg->type); |
| 291 | limPrintMsgName(pMac, LOG3, pMsg->type);) |
| 292 | retCode = tx_queue_send(&pMac->sys.gSirLimDeferredMsgQ, |
| 293 | pMsg, |
| 294 | TX_NO_WAIT); |
| 295 | if (retCode == TX_SUCCESS) |
| 296 | pMac->lim.gLimNumDeferredMsgs++; |
| 297 | #else |
| 298 | |
| 299 | retCode = limWriteDeferredMsgQ(pMac, pMsg); |
| 300 | |
| 301 | #endif |
| 302 | if(retCode == TX_SUCCESS) |
| 303 | { |
| 304 | MTRACE(macTraceMsgRx(pMac, 0, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));) |
| 305 | } |
| 306 | else |
| 307 | { |
| 308 | MTRACE(macTraceMsgRx(pMac, 0, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));) |
| 309 | } |
| 310 | |
| 311 | |
| 312 | return retCode; |
| 313 | } /*** end limDeferMsg() ***/ |
| 314 | |
| 315 | |
| 316 | |
| 317 | /** |
| 318 | * limHandleFramesInScanState() |
| 319 | * |
| 320 | *FUNCTION: |
| 321 | * This function is called to process 802.11 frames |
| 322 | * received by LIM in scan state. |
| 323 | * |
| 324 | *LOGIC: |
| 325 | * NA |
| 326 | * |
| 327 | *ASSUMPTIONS: |
| 328 | * NA |
| 329 | * |
| 330 | *NOTE: |
| 331 | * NA |
| 332 | * |
| 333 | * @param pMac - Pointer to Global MAC structure |
| 334 | * @param limMsg - Received message |
| 335 | * @param pRxPacketInfo - Pointer to Rx packet info structure |
| 336 | * @param deferMsg - Indicates whether the frame shall be deferred |
| 337 | * @return None |
| 338 | */ |
| 339 | |
| 340 | static void |
| 341 | limHandleFramesInScanState(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pRxPacketInfo, tANI_U8 *deferMsg, tpPESession psessionEntry) |
| 342 | { |
| 343 | tSirMacFrameCtl fc; |
| 344 | tpSirMacMgmtHdr pHdr; |
| 345 | #if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP) |
| 346 | tANI_U32 ignore = 0; |
| 347 | tSirMacAddr bssIdRcv; |
| 348 | #endif |
| 349 | |
| 350 | *deferMsg = false; |
| 351 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 352 | fc = pHdr->fc; |
| 353 | limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d\n"), |
| 354 | fc.protVer, fc.type, fc.subType ); |
| 355 | |
| 356 | #if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP) |
| 357 | // System is in DFS (Learn) mode |
| 358 | pMac->lim.numLearn++; |
| 359 | |
| 360 | // Process all BDs and extract PHY stats |
| 361 | limGetBssidFromBD(pMac, (tpHalBufDesc) pRxPacketInfo, bssIdRcv, &ignore); |
| 362 | |
| 363 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) && |
| 364 | palEqualMemory( pMac->hHdd,bssIdRcv, psessionEntry->bssId, sizeof(tSirMacAddr))) |
| 365 | { |
| 366 | /** |
| 367 | * Frame from current BSS. Defer processing of |
| 368 | * Disassociation/Deauthentication from |
| 369 | * STAs that are currently associated. |
| 370 | * Collect stats for other received frames. |
| 371 | */ |
| 372 | if ((fc.subType == SIR_MAC_MGMT_DISASSOC) || |
| 373 | (fc.subType == SIR_MAC_MGMT_DEAUTH)) |
| 374 | { |
| 375 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 376 | { |
| 377 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 378 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 379 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 380 | limLogSessionStates(pMac); |
| 381 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 382 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, NULL, limMsg->bodyptr); |
| 383 | } |
| 384 | return; |
| 385 | } |
| 386 | pMac->lim.numLearnIgnore++; |
| 387 | } |
| 388 | else |
| 389 | { |
| 390 | // Frame received from other BSS |
| 391 | if (fc.type == SIR_MAC_DATA_FRAME && psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 392 | { |
| 393 | /** |
| 394 | * Data Frame from neighbor BSS. |
| 395 | * Extract neighbor BSS info as much as possible. |
| 396 | */ |
| 397 | limCollectMeasurementData(pMac, pRxPacketInfo, NULL); |
| 398 | } |
| 399 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON)) |
| 400 | { |
| 401 | if (psessionEntry == NULL) |
| 402 | limProcessBeaconFrameNoSession(pMac, pRxPacketInfo); |
| 403 | else |
| 404 | limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry); |
| 405 | } |
| 406 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP)) |
| 407 | { |
| 408 | if (psessionEntry == NULL) |
| 409 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 410 | else |
| 411 | limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry); |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | #else |
| 416 | // defer all message in scan state except for Beacons and Probe Response |
| 417 | if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON)) |
| 418 | { |
| 419 | if (psessionEntry == NULL) |
| 420 | limProcessBeaconFrameNoSession(pMac, pRxPacketInfo); |
| 421 | else |
| 422 | limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry); |
| 423 | } |
| 424 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP)) |
| 425 | { |
| 426 | if (psessionEntry == NULL) |
| 427 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 428 | else |
| 429 | limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry); |
| 430 | } |
| 431 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_REQ)) |
| 432 | { |
| 433 | limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo, psessionEntry); |
| 434 | } |
| 435 | #if defined WLAN_FEATURE_P2P |
| 436 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_ACTION)) |
| 437 | { |
| 438 | limProcessActionFrameNoSession( pMac, pRxPacketInfo); |
| 439 | } |
| 440 | #endif |
| 441 | else |
| 442 | { |
| 443 | *deferMsg = true; |
| 444 | return; |
| 445 | } |
| 446 | |
| 447 | #endif |
| 448 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 449 | return; |
| 450 | |
| 451 | } /*** end limHandleFramesInScanState() ***/ |
| 452 | |
| 453 | /** ------------------------------------------------------------ |
| 454 | \brief This function handles Unknown Unicast (A2 Index) |
| 455 | \ packets. |
| 456 | \param tpAniSirGlobal pMac Global Mac data structure |
| 457 | \param void *pRxPacketInfo Pointer to Buffer Descriptor |
| 458 | \return none |
| 459 | \ |
| 460 | \ -------------------------------------------------------------- */ |
| 461 | static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketInfo,tpPESession psessionEntry) |
| 462 | { |
| 463 | #ifndef ANI_CHIPSET_VOLANS |
| 464 | tpSirMacDataHdr3a pMacHdr; |
| 465 | |
| 466 | /** This prevents from disassoc/deauth being sent in a burst, |
| 467 | and gLimDisassocFrameCredit is reset for every 10 seconds.*/ |
| 468 | if (pMac->lim.gLimDisassocFrameCredit > pMac->lim.gLimDisassocFrameThreshold) |
| 469 | return; |
| 470 | |
| 471 | pMac->lim.gLimDisassocFrameCredit++; |
| 472 | |
| 473 | pMacHdr = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo); |
| 474 | |
| 475 | if (limIsGroupAddr(pMacHdr->addr2)) |
| 476 | { |
| 477 | PELOG2(limLog(pMac, LOG2, FL("Ignoring A2 Invalid Packet received for MC/BC:\n")); |
| 478 | limPrintMacAddr(pMac, pMacHdr->addr2, LOG2);) |
| 479 | |
| 480 | return; |
| 481 | } |
| 482 | |
| 483 | if (((psessionEntry->limSystemRole == eLIM_AP_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) )&& |
| 484 | (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE)) |
| 485 | { |
| 486 | switch (pMacHdr->fc.type) |
| 487 | { |
| 488 | case SIR_MAC_MGMT_FRAME: |
| 489 | switch (pMacHdr->fc.subType) |
| 490 | { |
| 491 | case SIR_MAC_MGMT_ACTION: |
| 492 | // Send Disassociation frame to |
| 493 | // sender if role is AP |
| 494 | PELOG1(limLog(pMac, LOG1, FL("Send Disassoc Frame due to Invalid Addr2 packet")); |
| 495 | limPrintMacAddr(pMac, pMacHdr->addr2, LOG1);) |
| 496 | limSendDisassocMgmtFrame(pMac, |
| 497 | eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON, pMacHdr->addr2,psessionEntry); |
| 498 | break; |
| 499 | |
| 500 | default: |
| 501 | break; |
| 502 | |
| 503 | } |
| 504 | break; |
| 505 | |
| 506 | case SIR_MAC_CTRL_FRAME: |
| 507 | switch (pMacHdr->fc.subType) |
| 508 | { |
| 509 | case SIR_MAC_CTRL_PS_POLL: |
| 510 | case SIR_MAC_CTRL_BAR: |
| 511 | // Send Disassociation frame to |
| 512 | // sender if role is AP |
| 513 | PELOG1(limLog(pMac, LOG1, FL("Send Disassoc Frame due to Invalid Addr2 packet")); |
| 514 | limPrintMacAddr(pMac, pMacHdr->addr2, LOG1);) |
| 515 | limSendDisassocMgmtFrame(pMac, |
| 516 | eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON, pMacHdr->addr2,psessionEntry); |
| 517 | break; |
| 518 | |
| 519 | default: |
| 520 | break; |
| 521 | } |
| 522 | break; |
| 523 | |
| 524 | case SIR_MAC_DATA_FRAME: |
| 525 | switch (pMacHdr->fc.subType) |
| 526 | { |
| 527 | case SIR_MAC_DATA_NULL: |
| 528 | case SIR_MAC_DATA_QOS_NULL: |
| 529 | // Send Disassociation frame to |
| 530 | // sender if role is AP |
| 531 | PELOG1(limLog(pMac, LOG1, FL("Send Disassoc Frame due to Invalid Addr2 packet")); |
| 532 | limPrintMacAddr(pMac, pMacHdr->addr2, LOG1);) |
| 533 | limSendDisassocMgmtFrame(pMac, |
| 534 | eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON, pMacHdr->addr2,psessionEntry); |
| 535 | break; |
| 536 | |
| 537 | default: |
| 538 | // Send Deauthentication frame to |
| 539 | // sender if role is AP |
| 540 | PELOG1(limLog(pMac, LOG1, FL("Sending Deauth frame due to Invalid Addr2 packet")); |
| 541 | limPrintMacAddr(pMac, pMacHdr->addr2, LOG1);) |
| 542 | limSendDeauthMgmtFrame(pMac, |
| 543 | eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON, pMacHdr->addr2,psessionEntry); |
| 544 | break; |
| 545 | } |
| 546 | break; |
| 547 | } |
| 548 | } |
| 549 | #else |
| 550 | /* addr2 mismatch interrupt occurred this means previous |
| 551 | disassociation was not successful |
| 552 | In Volans pRxPacketInfo only contains pointer 48-bit address2 field */ |
| 553 | /*Send disassociation message again*/ |
| 554 | //Dinesh need one more arguement. |
| 555 | //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo); |
| 556 | #if defined WLAN_FEATURE_P2P |
| 557 | //This could be a public action frame. |
| 558 | if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE ) |
| 559 | limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo); |
| 560 | #endif |
| 561 | #endif |
| 562 | |
| 563 | return; |
| 564 | } |
| 565 | |
| 566 | #ifdef WLAN_FEATURE_P2P |
| 567 | /** |
| 568 | * limCheckMgmtRegisteredFrames() |
| 569 | * |
| 570 | *FUNCTION: |
| 571 | * This function is called to process to check if received frame match with |
| 572 | * any of the registered frame from HDD. If yes pass this frame to SME. |
| 573 | * |
| 574 | *LOGIC: |
| 575 | * |
| 576 | *ASSUMPTIONS: |
| 577 | * |
| 578 | *NOTE: |
| 579 | * |
| 580 | * @param pMac Pointer to Global MAC structure |
| 581 | * @param *pBd Pointer to the received Buffer Descriptor+payload |
| 582 | * @param *psessionEntry Pointer to session on which packet is received |
| 583 | * @return None |
| 584 | */ |
| 585 | static tANI_BOOLEAN |
| 586 | limCheckMgmtRegisteredFrames(tpAniSirGlobal pMac, tANI_U8 *pBd, |
| 587 | tpPESession psessionEntry) |
| 588 | { |
| 589 | tSirMacFrameCtl fc; |
| 590 | tpSirMacMgmtHdr pHdr; |
| 591 | tANI_U8 *pBody; |
| 592 | tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL; |
| 593 | tANI_U16 frameType; |
| 594 | tANI_U16 framelen; |
| 595 | tANI_U8 type,subType; |
| 596 | tANI_BOOLEAN match = VOS_FALSE; |
| 597 | VOS_STATUS vosStatus; |
| 598 | |
| 599 | pHdr = WDA_GET_RX_MAC_HEADER(pBd); |
| 600 | fc = pHdr->fc; |
| 601 | frameType = (fc.type << 2 ) | (fc.subType << 4); |
| 602 | pBody = WDA_GET_RX_MPDU_DATA(pBd); |
| 603 | framelen = WDA_GET_RX_PAYLOAD_LEN(pBd); |
| 604 | |
| 605 | vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 606 | (vos_list_node_t**)&pLimMgmtRegistration); |
| 607 | |
| 608 | while(pLimMgmtRegistration != NULL) |
| 609 | { |
| 610 | type = (pLimMgmtRegistration->frameType >> 2) & 0x03; |
| 611 | subType = (pLimMgmtRegistration->frameType >> 4) & 0x0f; |
| 612 | if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME) |
| 613 | && (subType == SIR_MAC_MGMT_RESERVED15) ) |
| 614 | { |
| 615 | limLog( pMac, LOG3, |
| 616 | FL("rcvd frame match with SIR_MAC_MGMT_RESERVED15\n")); |
| 617 | match = VOS_TRUE; |
| 618 | break; |
| 619 | } |
| 620 | |
| 621 | if (pLimMgmtRegistration->frameType == frameType) |
| 622 | { |
| 623 | if (pLimMgmtRegistration->matchLen > 0) |
| 624 | { |
| 625 | if (pLimMgmtRegistration->matchLen <= framelen) |
| 626 | { |
| 627 | if (palEqualMemory(pMac, pLimMgmtRegistration->matchData, |
| 628 | pBody, pLimMgmtRegistration->matchLen)) |
| 629 | { |
| 630 | /* found match! */ |
| 631 | match = VOS_TRUE; |
| 632 | break; |
| 633 | } |
| 634 | } |
| 635 | } |
| 636 | else |
| 637 | { |
| 638 | /* found match! */ |
| 639 | match = VOS_TRUE; |
| 640 | break; |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | vosStatus = |
| 645 | vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 646 | (vos_list_node_t*) pLimMgmtRegistration, |
| 647 | (vos_list_node_t**) &pNext ); |
| 648 | pLimMgmtRegistration = pNext; |
| 649 | pNext = NULL; |
| 650 | } |
| 651 | |
| 652 | if (match) |
| 653 | { |
| 654 | limLog( pMac, LOG1, |
| 655 | FL("rcvd frame match with registered frame params\n")); |
| 656 | |
| 657 | /* Indicate this to SME */ |
| 658 | limSendSmeMgmtFrameInd( pMac, pHdr->fc.subType, (tANI_U8*)pHdr, |
| 659 | WDA_GET_RX_PAYLOAD_LEN(pBd) + sizeof(tSirMacMgmtHdr), |
| 660 | pLimMgmtRegistration->sessionId, |
| 661 | WDA_GET_RX_CH(pBd) ); |
| 662 | |
| 663 | if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME) |
| 664 | && (subType == SIR_MAC_MGMT_RESERVED15) ) |
| 665 | { |
| 666 | // These packets needs to be processed by PE/SME as well as HDD. |
| 667 | // If it returns TRUE here, the packet is forwarded to HDD only. |
| 668 | match = VOS_FALSE; |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | return match; |
| 673 | } /*** end limCheckMgmtRegisteredFrames() ***/ |
| 674 | #endif /* WLAN_FEATURE_P2P */ |
| 675 | |
| 676 | |
| 677 | /** |
| 678 | * limHandle80211Frames() |
| 679 | * |
| 680 | *FUNCTION: |
| 681 | * This function is called to process 802.11 frames |
| 682 | * received by LIM. |
| 683 | * |
| 684 | *LOGIC: |
| 685 | * NA |
| 686 | * |
| 687 | *ASSUMPTIONS: |
| 688 | * NA |
| 689 | * |
| 690 | *NOTE: |
| 691 | * NA |
| 692 | * |
| 693 | * @param pMac - Pointer to Global MAC structure |
| 694 | * @param pMsg of type tSirMsgQ - Pointer to the message structure |
| 695 | * @return None |
| 696 | */ |
| 697 | |
| 698 | static void |
| 699 | limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) |
| 700 | { |
| 701 | tANI_U8 *pRxPacketInfo = NULL; |
| 702 | tSirMacFrameCtl fc; |
| 703 | tpSirMacMgmtHdr pHdr=NULL; |
| 704 | tpPESession psessionEntry=NULL; |
| 705 | tANI_U8 sessionId; |
| 706 | tAniBool isFrmFt = FALSE; |
| 707 | tANI_U16 fcOffset = WLANHAL_RX_BD_HEADER_SIZE; |
| 708 | |
| 709 | *pDeferMsg= false; |
| 710 | limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo); |
| 711 | |
| 712 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 713 | isFrmFt = WDA_GET_RX_FT_DONE(pRxPacketInfo); |
| 714 | fcOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(pRxPacketInfo); |
| 715 | fc = pHdr->fc; |
| 716 | |
| 717 | limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d\n"), |
| 718 | fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
| 719 | |
| 720 | |
| 721 | #ifdef FEATURE_WLAN_CCX |
| 722 | if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt) |
| 723 | { |
| 724 | #if 0 // CCX TBD Need to PORT |
| 725 | tpSirMacDot3Hdr pDataFrmHdr; |
| 726 | |
| 727 | pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD)); |
| 728 | if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL) |
| 729 | { |
| 730 | limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType); |
| 731 | limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE); |
| 732 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr); |
| 733 | return; |
| 734 | } |
| 735 | |
| 736 | if (!psessionEntry->isCCXconnection) |
| 737 | { |
| 738 | limLog( pMac, LOGE, FL("LIM received Type %d, Subtype %d in Non CCX connection\n"), |
| 739 | fc.type, fc.subType); |
| 740 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr); |
| 741 | return; |
| 742 | } |
| 743 | limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:")); |
| 744 | limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE); |
| 745 | #else |
| 746 | printk("%s: Need to port handling of IAPP frames to PRIMA for CCX\n", __func__); |
| 747 | #endif |
| 748 | |
| 749 | |
| 750 | } else |
| 751 | #endif |
| 752 | /* Added For BT-AMP Support */ |
| 753 | if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL) |
| 754 | { |
| 755 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 756 | if (fc.subType == SIR_MAC_MGMT_AUTH) |
| 757 | { |
| 758 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
| 759 | limLog( pMac, LOGE, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d\n"), |
| 760 | fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
| 761 | limPrintMacAddr(pMac, pHdr->bssId, LOGE); |
| 762 | #endif |
| 763 | if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS) |
| 764 | { |
| 765 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); |
| 766 | return; |
| 767 | } |
| 768 | } |
| 769 | #endif |
| 770 | if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&& |
| 771 | (fc.subType != SIR_MAC_MGMT_BEACON)&& |
| 772 | (fc.subType != SIR_MAC_MGMT_PROBE_REQ) |
| 773 | #if defined WLAN_FEATURE_P2P |
| 774 | && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations. |
| 775 | #endif |
| 776 | ) |
| 777 | { |
| 778 | |
| 779 | if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL) |
| 780 | { |
| 781 | limLog(pMac, LOG1, FL("session does not exist for given bssId\n")); |
| 782 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); |
| 783 | return; |
| 784 | } |
| 785 | } |
| 786 | } |
| 787 | |
| 788 | |
| 789 | #ifdef WLAN_FEATURE_P2P |
| 790 | /* Check if frame is registered by HDD */ |
| 791 | if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry)) |
| 792 | { |
| 793 | limLog( pMac, LOG1, FL("Received frame is passed to SME\n")); |
| 794 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); |
| 795 | return; |
| 796 | } |
| 797 | #endif |
| 798 | |
| 799 | |
| 800 | #ifdef ANI_PRODUCT_TYPE_AP |
| 801 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) && (LIM_IS_RADAR_DETECTED(pMac))) |
| 802 | { |
| 803 | PELOGW(limLog(pMac, LOGW, FL("Droping the received packets as radar is detected\n"));) |
| 804 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 805 | return; |
| 806 | } |
| 807 | #endif |
| 808 | |
| 809 | if (fc.protVer != SIR_MAC_PROTOCOL_VERSION) |
| 810 | { // Received Frame with non-zero Protocol Version |
| 811 | limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received\n"), |
| 812 | fc.protVer); |
| 813 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 814 | #ifdef WLAN_DEBUG |
| 815 | pMac->lim.numProtErr++; |
| 816 | #endif |
| 817 | return; |
| 818 | } |
| 819 | |
| 820 | |
| 821 | if (limIsSystemInScanState(pMac)) |
| 822 | { |
| 823 | limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry); |
| 824 | return; |
| 825 | } |
| 826 | |
| 827 | /* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */ |
| 828 | |
| 829 | #if 0 |
| 830 | if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) { |
| 831 | limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting...\n" ),psessionEntry->limSystemRole ); |
| 832 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 833 | |
| 834 | #ifdef WLAN_DEBUG |
| 835 | pMac->lim.numProtErr++; |
| 836 | #endif |
| 837 | return; |
| 838 | } |
| 839 | #endif //HACK to continue scanning |
| 840 | |
| 841 | |
| 842 | #ifdef WLAN_DEBUG |
| 843 | pMac->lim.numMAC[fc.type][fc.subType]++; |
| 844 | #endif |
| 845 | |
| 846 | switch (fc.type) |
| 847 | { |
| 848 | case SIR_MAC_MGMT_FRAME: |
| 849 | { |
| 850 | #if 0 //TBD-RAJESH fix this |
| 851 | if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) && |
| 852 | (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP)) |
| 853 | { |
| 854 | limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping...\n"), |
| 855 | fc.type, fc.subType); |
| 856 | return; |
| 857 | } |
| 858 | #endif //HACK to continue scanning |
| 859 | // Received Management frame |
| 860 | switch (fc.subType) |
| 861 | { |
| 862 | case SIR_MAC_MGMT_ASSOC_REQ: |
| 863 | // Make sure the role supports Association |
| 864 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
| 865 | #ifdef WLAN_SOFTAP_FEATURE |
| 866 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 867 | #endif |
| 868 | ) |
| 869 | limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry); |
| 870 | |
| 871 | else |
| 872 | { |
| 873 | // Unwanted messages - Log error |
| 874 | limLog(pMac, LOGE, FL("unexpected message received %X\n"),limMsg->type); |
| 875 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 876 | } |
| 877 | break; |
| 878 | |
| 879 | case SIR_MAC_MGMT_ASSOC_RSP: |
| 880 | limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry); |
| 881 | break; |
| 882 | |
| 883 | case SIR_MAC_MGMT_REASSOC_REQ: |
| 884 | // Make sure the role supports Reassociation |
| 885 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
| 886 | #ifdef WLAN_SOFTAP_FEATURE |
| 887 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
| 888 | #endif |
| 889 | ){ |
| 890 | limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry); |
| 891 | } |
| 892 | else |
| 893 | { |
| 894 | // Unwanted messages - Log error |
| 895 | limLog(pMac, LOGE, FL("unexpected message received %X\n"),limMsg->type); |
| 896 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 897 | } |
| 898 | break; |
| 899 | |
| 900 | case SIR_MAC_MGMT_REASSOC_RSP: |
| 901 | limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry); |
| 902 | break; |
| 903 | |
| 904 | case SIR_MAC_MGMT_PROBE_REQ: |
| 905 | limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry); |
| 906 | break; |
| 907 | |
| 908 | case SIR_MAC_MGMT_PROBE_RSP: |
| 909 | if(psessionEntry == NULL) |
| 910 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 911 | else |
| 912 | limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry); |
| 913 | break; |
| 914 | |
| 915 | case SIR_MAC_MGMT_BEACON: |
| 916 | __limHandleBeacon(pMac, limMsg,psessionEntry); |
| 917 | break; |
| 918 | |
| 919 | case SIR_MAC_MGMT_DISASSOC: |
| 920 | limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry); |
| 921 | break; |
| 922 | |
| 923 | case SIR_MAC_MGMT_AUTH: |
| 924 | limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry); |
| 925 | break; |
| 926 | |
| 927 | case SIR_MAC_MGMT_DEAUTH: |
| 928 | limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry); |
| 929 | break; |
| 930 | |
| 931 | case SIR_MAC_MGMT_ACTION: |
| 932 | #if defined WLAN_FEATURE_P2P |
| 933 | if(psessionEntry == NULL) |
| 934 | limProcessActionFrameNoSession(pMac, pRxPacketInfo); |
| 935 | else |
| 936 | { |
| 937 | #endif |
| 938 | if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo)) |
| 939 | limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry); |
| 940 | else |
| 941 | limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry); |
| 942 | #if defined WLAN_FEATURE_P2P |
| 943 | } |
| 944 | #endif |
| 945 | break; |
| 946 | default: |
| 947 | // Received Management frame of 'reserved' subtype |
| 948 | break; |
| 949 | } // switch (fc.subType) |
| 950 | |
| 951 | } |
| 952 | break; |
| 953 | #ifdef FEATURE_WLAN_CCX |
| 954 | case SIR_MAC_DATA_FRAME: |
| 955 | { |
| 956 | /* We accept data frame (IAPP frame) only if Session is |
| 957 | * present and ccx connection is established on that |
| 958 | * session |
| 959 | */ |
| 960 | if (psessionEntry && psessionEntry->isCCXconnection) { |
| 961 | limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry); |
| 962 | } |
| 963 | } |
| 964 | break; |
| 965 | #endif |
| 966 | default: |
| 967 | // Received frame of type 'reserved' |
| 968 | break; |
| 969 | |
| 970 | } // switch (fc.type) |
| 971 | |
| 972 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ; |
| 973 | return; |
| 974 | } /*** end limHandle80211Frames() ***/ |
| 975 | |
| 976 | |
| 977 | /** |
| 978 | * limProcessAbortScanInd() |
| 979 | * |
| 980 | *FUNCTION: |
| 981 | * This function is called from HDD to abort the scan which is presently being run |
| 982 | * |
| 983 | * |
| 984 | *NOTE: |
| 985 | * |
| 986 | * @param pMac Pointer to Global MAC structure |
| 987 | * @param *pMsgBuf A pointer to the SME message buffer |
| 988 | * @return None |
| 989 | */ |
| 990 | void |
| 991 | limProcessAbortScanInd(tpAniSirGlobal pMac) |
| 992 | { |
| 993 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 994 | limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0); |
| 995 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 996 | |
| 997 | /* Deactivate the gLimBackgroundScanTimer as part of the abort scan. |
| 998 | * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication |
| 999 | * to start the background scan again |
| 1000 | */ |
| 1001 | PELOGE(limLog(pMac, LOGE, FL("Processing AbortScan Ind\n"));) |
| 1002 | |
| 1003 | limAbortBackgroundScan(pMac); |
| 1004 | |
| 1005 | /* Abort the scan if its running, else just return */ |
| 1006 | if(limIsSystemInScanState(pMac)) |
| 1007 | { |
| 1008 | if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 1009 | (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 1010 | (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 1011 | (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) ) |
| 1012 | { |
| 1013 | //Simply signal we need to abort |
| 1014 | limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d\n"), pMac->lim.gLimHalScanState ); |
| 1015 | pMac->lim.abortScan = 1; |
| 1016 | } |
| 1017 | else |
| 1018 | { |
| 1019 | //Force abort |
| 1020 | limLog( pMac, LOGW, FL(" Force aborting scan\n") ); |
| 1021 | pMac->lim.abortScan = 0; |
| 1022 | limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); |
| 1023 | limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); |
| 1024 | //Set the resume channel to Any valid channel (invalid). |
| 1025 | //This will instruct HAL to set it to any previous valid channel. |
| 1026 | peSetResumeChannel(pMac, 0, 0); |
| 1027 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 1028 | } |
| 1029 | } |
| 1030 | return; |
| 1031 | } |
| 1032 | |
| 1033 | /** |
| 1034 | * limMessageProcessor |
| 1035 | * |
| 1036 | *FUNCTION: |
| 1037 | * Wrapper function for limProcessMessages when handling messages received by LIM. |
| 1038 | * Could either defer messages or process them. |
| 1039 | * @param pMac Pointer to Global MAC structure |
| 1040 | * @param limMsg Received LIM message |
| 1041 | * @return None |
| 1042 | */ |
| 1043 | |
| 1044 | void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1045 | { |
| 1046 | if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState) |
| 1047 | { |
| 1048 | peFreeMsg(pMac, limMsg); |
| 1049 | return; |
| 1050 | } |
| 1051 | |
| 1052 | if (!defMsgDecision(pMac, limMsg)) |
| 1053 | { |
| 1054 | limProcessMessages(pMac, limMsg); |
| 1055 | #ifdef ANI_PRODUCT_TYPE_CLIENT |
| 1056 | // process deferred message queue if allowed |
| 1057 | { |
| 1058 | if ( (! (pMac->lim.gLimAddtsSent)) |
| 1059 | && |
| 1060 | (! (limIsSystemInScanState(pMac))) |
| 1061 | ) |
| 1062 | { |
| 1063 | if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 1064 | limProcessDeferredMessageQueue(pMac); |
| 1065 | } |
| 1066 | } |
| 1067 | #else |
| 1068 | { |
| 1069 | // process deferred message queue if allowed |
| 1070 | if (! (pMac->lim.gLimSystemInScanLearnMode)) |
| 1071 | { |
| 1072 | #if defined(ANI_AP_CLIENT_SDK) |
| 1073 | if (pMac->lim.gLimSystemRole != eLIM_AP_ROLE && (pMac->lim.gLimAddtsSent)) |
| 1074 | return; |
| 1075 | #endif |
| 1076 | |
| 1077 | if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 1078 | limProcessDeferredMessageQueue(pMac); |
| 1079 | } |
| 1080 | } |
| 1081 | #endif |
| 1082 | } |
| 1083 | } |
| 1084 | |
| 1085 | |
| 1086 | |
| 1087 | /** |
| 1088 | * limProcessMessages |
| 1089 | * |
| 1090 | *FUNCTION: |
| 1091 | * This function is called by limProcessMessageQueue function. This |
| 1092 | * function processes messages received by LIM. |
| 1093 | * |
| 1094 | *LOGIC: |
| 1095 | * Depending on the message type, corresponding function will be |
| 1096 | * called, for example limProcessSmeMessages() will be called to |
| 1097 | * process SME messages received from HDD/Upper layer software module. |
| 1098 | * |
| 1099 | *ASSUMPTIONS: |
| 1100 | * NA |
| 1101 | * |
| 1102 | *NOTE: |
| 1103 | * NA |
| 1104 | * |
| 1105 | * @param pMac Pointer to Global MAC structure |
| 1106 | * @param limMsg Received LIM message |
| 1107 | * @return None |
| 1108 | */ |
| 1109 | |
| 1110 | void |
| 1111 | limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1112 | { |
| 1113 | tANI_U8 deferMsg = false; |
| 1114 | tLinkStateParams *linkStateParams; |
| 1115 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1116 | tpPESession pSession; |
| 1117 | #endif |
| 1118 | #if defined(ANI_DVT_DEBUG) |
| 1119 | tSirMsgQ msgQ; |
| 1120 | #endif |
| 1121 | if(pMac->gDriverType == eDRIVER_TYPE_MFG) |
| 1122 | { |
| 1123 | return; |
| 1124 | } |
| 1125 | #ifdef WLAN_DEBUG |
| 1126 | pMac->lim.numTot++; |
| 1127 | #endif |
| 1128 | |
| 1129 | |
| 1130 | PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s\n"), |
| 1131 | limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState), |
| 1132 | limMlmStateStr(pMac->lim.gLimMlmState));) |
| 1133 | |
| 1134 | MTRACE(macTraceMsgRx(pMac, 0, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));) |
| 1135 | |
| 1136 | switch (limMsg->type) |
| 1137 | { |
| 1138 | #if defined(ANI_DVT_DEBUG) |
| 1139 | case SIR_LIM_SUSPEND_ACTIVITY_REQ: |
| 1140 | // This message is from HAL notifying LIM |
| 1141 | // to suspend activity. (PTT needs) |
| 1142 | // Disable TFP & RHP |
| 1143 | //halSetStaTxEnable(pMac, 1, eHAL_CLEAR); |
| 1144 | //halStopDataTraffic(pMac); |
| 1145 | //halSetRxEnable(pMac, eHAL_CLEAR); |
| 1146 | |
| 1147 | pMac->lim.gLimPrevSmeState = pMac->lim.gLimSmeState; |
| 1148 | pMac->lim.gLimSmeState = eLIM_SME_SUSPEND_STATE; |
| 1149 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, 0, pMac->lim.gLimSmeState)); |
| 1150 | |
| 1151 | // Post message back to HAL |
| 1152 | msgQ.type = WDA_SUSPEND_ACTIVITY_RSP; |
| 1153 | MTRACE(macTraceMsgTx(pMac, 0, msgQ.type)); |
| 1154 | wdaPostCtrlMsg(pMac, &msgQ); |
| 1155 | break; |
| 1156 | #endif |
| 1157 | |
| 1158 | case SIR_LIM_UPDATE_BEACON: |
| 1159 | limUpdateBeacon(pMac); |
| 1160 | break; |
| 1161 | |
| 1162 | case SIR_LIM_RESUME_ACTIVITY_NTF: |
| 1163 | // This message is from HAL notifying LIM |
| 1164 | // to resume activity. |
| 1165 | if (pMac->lim.gLimSmeState == eLIM_SME_SUSPEND_STATE) |
| 1166 | { |
| 1167 | limLog(pMac, LOGE, |
| 1168 | FL("Received RESUME_NTF in State %s on Role %d\n"), |
| 1169 | limSmeStateStr(pMac->lim.gLimSmeState), pMac->lim.gLimSystemRole); |
| 1170 | pMac->lim.gLimSmeState = pMac->lim.gLimPrevSmeState; |
| 1171 | MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, 0, pMac->lim.gLimSmeState)); |
| 1172 | |
| 1173 | handleCBCFGChange( pMac, ANI_IGNORE_CFG_ID ); |
| 1174 | handleHTCapabilityandHTInfo(pMac); |
| 1175 | //initialize the TSPEC admission control table. |
| 1176 | limAdmitControlInit(pMac); |
| 1177 | limRegisterHalIndCallBack(pMac); |
| 1178 | } |
| 1179 | else |
| 1180 | { |
| 1181 | limLog(pMac, LOGE, |
| 1182 | FL("Received RESUME_NTF in inval State %X on Role %d\n"), |
| 1183 | pMac->lim.gLimSmeState, pMac->lim.gLimSystemRole); |
| 1184 | limPrintSmeState(pMac, LOGE, pMac->lim.gLimSmeState); |
| 1185 | } |
| 1186 | |
| 1187 | break; |
| 1188 | |
| 1189 | case SIR_CFG_PARAM_UPDATE_IND: |
| 1190 | /// CFG parameter updated |
| 1191 | if (limIsSystemInScanState(pMac)) |
| 1192 | { |
| 1193 | // System is in DFS (Learn) mode |
| 1194 | // Defer processsing this message |
| 1195 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1196 | { |
| 1197 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 1198 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1199 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 1200 | limLogSessionStates(pMac); |
| 1201 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1202 | } |
| 1203 | } |
| 1204 | else |
| 1205 | { |
| 1206 | limHandleCFGparamUpdate(pMac, limMsg->bodyval); |
| 1207 | } |
| 1208 | |
| 1209 | break; |
| 1210 | |
| 1211 | case WDA_INIT_SCAN_RSP: |
| 1212 | limProcessInitScanRsp(pMac, limMsg->bodyptr); |
| 1213 | break; |
| 1214 | |
| 1215 | case WDA_START_SCAN_RSP: |
| 1216 | limProcessStartScanRsp(pMac, limMsg->bodyptr); |
| 1217 | break; |
| 1218 | |
| 1219 | case WDA_END_SCAN_RSP: |
| 1220 | limProcessEndScanRsp(pMac, limMsg->bodyptr); |
| 1221 | break; |
| 1222 | |
| 1223 | case WDA_FINISH_SCAN_RSP: |
| 1224 | limProcessFinishScanRsp(pMac, limMsg->bodyptr); |
| 1225 | break; |
| 1226 | |
| 1227 | case WDA_SWITCH_CHANNEL_RSP: |
| 1228 | limProcessSwitchChannelRsp(pMac, limMsg->bodyptr); |
| 1229 | break; |
| 1230 | |
| 1231 | #ifdef ANI_SIR_IBSS_PEER_CACHING |
| 1232 | case WDA_IBSS_STA_ADD: |
| 1233 | limIbssStaAdd(pMac, limMsg->bodyptr); |
| 1234 | break; |
| 1235 | #endif |
| 1236 | case SIR_BB_XPORT_MGMT_MSG: |
| 1237 | // These messages are from Peer MAC entity. |
| 1238 | #ifdef WLAN_DEBUG |
| 1239 | pMac->lim.numBbt++; |
| 1240 | #endif |
| 1241 | |
| 1242 | #ifdef VOSS_ENABLED |
| 1243 | { |
| 1244 | v_U16_t pktLen = 0; |
| 1245 | vos_pkt_t *pVosPkt; |
| 1246 | VOS_STATUS vosStatus; |
| 1247 | tSirMsgQ limMsgNew; |
| 1248 | |
| 1249 | /* The original limMsg which we were deferring have the |
| 1250 | * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy |
| 1251 | * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer. |
| 1252 | * and next time when we try to process the msg, we will try to use 'BD' as |
| 1253 | * 'Vos Pkt' which will cause a crash |
| 1254 | */ |
| 1255 | palCopyMemory(pMac, (tANI_U8*)&limMsgNew, (tANI_U8*)limMsg, sizeof(tSirMsgQ)); |
| 1256 | pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr; |
| 1257 | vos_pkt_get_packet_length(pVosPkt, &pktLen); |
| 1258 | |
| 1259 | vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE ); |
| 1260 | |
| 1261 | if( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 1262 | { |
| 1263 | vos_pkt_return_packet(pVosPkt); |
| 1264 | break; |
| 1265 | |
| 1266 | } |
| 1267 | limHandle80211Frames(pMac, &limMsgNew, &deferMsg); |
| 1268 | |
| 1269 | if ( deferMsg == true ) |
| 1270 | { |
| 1271 | PELOG1(limLog(pMac, LOG1, FL("Defer message type=%X \n"), limMsg->type);) |
| 1272 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1273 | { |
| 1274 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 1275 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1276 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 1277 | limLogSessionStates(pMac); |
| 1278 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1279 | vos_pkt_return_packet(pVosPkt); |
| 1280 | } |
| 1281 | } |
| 1282 | else |
| 1283 | { |
| 1284 | /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return. |
| 1285 | * Asumption here is when Rx mgmt frame processing is done, |
| 1286 | * voss packet could be freed here. |
| 1287 | */ |
| 1288 | vos_pkt_return_packet(pVosPkt); |
| 1289 | } |
| 1290 | } |
| 1291 | #else |
| 1292 | limHandle80211Frames(pMac, limMsg); |
| 1293 | #endif |
| 1294 | break; |
| 1295 | |
| 1296 | case eWNI_SME_SCAN_REQ: |
| 1297 | #ifdef WLAN_FEATURE_P2P |
| 1298 | case eWNI_SME_REMAIN_ON_CHANNEL_REQ: |
| 1299 | #endif |
| 1300 | case eWNI_SME_DISASSOC_REQ: |
| 1301 | case eWNI_SME_DEAUTH_REQ: |
| 1302 | case eWNI_SME_STA_STAT_REQ: |
| 1303 | case eWNI_SME_AGGR_STAT_REQ: |
| 1304 | case eWNI_SME_GLOBAL_STAT_REQ: |
| 1305 | case eWNI_SME_STAT_SUMM_REQ: |
| 1306 | case eWNI_SME_GET_SCANNED_CHANNEL_REQ: |
| 1307 | case eWNI_SME_GET_STATISTICS_REQ: |
| 1308 | // These messages are from HDD |
| 1309 | limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd |
| 1310 | break; |
| 1311 | |
| 1312 | case eWNI_SME_SCAN_ABORT_IND: |
| 1313 | vos_mem_free((v_VOID_t *)limMsg->bodyptr); |
| 1314 | limMsg->bodyptr = NULL; |
| 1315 | limProcessAbortScanInd(pMac); |
| 1316 | break; |
| 1317 | |
| 1318 | case eWNI_SME_START_REQ: |
| 1319 | case eWNI_SME_SYS_READY_IND: |
| 1320 | #ifndef WNI_ASKEY_NON_SUPPORT_FEATURE |
| 1321 | case eWNI_SME_JOIN_REQ: |
| 1322 | #endif |
| 1323 | case eWNI_SME_AUTH_REQ: |
| 1324 | case eWNI_SME_REASSOC_REQ: |
| 1325 | case eWNI_SME_START_BSS_REQ: |
| 1326 | case eWNI_SME_STOP_BSS_REQ: |
| 1327 | case eWNI_SME_SWITCH_CHL_REQ: |
| 1328 | case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ: |
| 1329 | case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ: |
| 1330 | case eWNI_SME_SETCONTEXT_REQ: |
| 1331 | case eWNI_SME_REMOVEKEY_REQ: |
| 1332 | #ifndef WNI_ASKEY_NON_SUPPORT_FEATURE |
| 1333 | case eWNI_SME_PROMISCUOUS_MODE_REQ: |
| 1334 | #endif |
| 1335 | case eWNI_SME_DISASSOC_CNF: |
| 1336 | case eWNI_SME_DEAUTH_CNF: |
| 1337 | case eWNI_SME_ASSOC_CNF: |
| 1338 | case eWNI_SME_REASSOC_CNF: |
| 1339 | case eWNI_SME_ADDTS_REQ: |
| 1340 | case eWNI_SME_DELTS_REQ: |
| 1341 | case eWNI_SME_DEL_BA_PEER_IND: |
| 1342 | case eWNI_SME_SET_TX_POWER_REQ: |
| 1343 | case eWNI_SME_GET_TX_POWER_REQ: |
| 1344 | case eWNI_SME_GET_NOISE_REQ: |
| 1345 | #ifdef WLAN_SOFTAP_FEATURE |
| 1346 | case eWNI_SME_GET_ASSOC_STAS_REQ: |
| 1347 | case eWNI_SME_TKIP_CNTR_MEAS_REQ: |
| 1348 | case eWNI_SME_UPDATE_APWPSIE_REQ: |
| 1349 | case eWNI_SME_HIDE_SSID_REQ: |
| 1350 | case eWNI_SME_GET_WPSPBC_SESSION_REQ: |
| 1351 | case eWNI_SME_SET_APWPARSNIEs_REQ: |
| 1352 | #endif |
| 1353 | #if defined WLAN_FEATURE_VOWIFI |
| 1354 | case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: |
| 1355 | case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND: |
| 1356 | #endif |
| 1357 | #if defined FEATURE_WLAN_CCX |
| 1358 | case eWNI_SME_CCX_ADJACENT_AP_REPORT: |
| 1359 | #endif |
| 1360 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1361 | case eWNI_SME_FT_UPDATE_KEY: |
| 1362 | case eWNI_SME_FT_PRE_AUTH_REQ: |
| 1363 | case eWNI_SME_FT_AGGR_QOS_REQ: |
| 1364 | #endif |
| 1365 | case eWNI_SME_ADD_STA_SELF_REQ: |
| 1366 | case eWNI_SME_DEL_STA_SELF_REQ: |
| 1367 | #ifdef WLAN_FEATURE_P2P |
| 1368 | case eWNI_SME_REGISTER_MGMT_FRAME_REQ: |
| 1369 | case eWNI_SME_UPDATE_NOA: |
| 1370 | #endif |
| 1371 | // These messages are from HDD |
| 1372 | limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd |
| 1373 | break; |
| 1374 | |
| 1375 | //Power Save Messages From HDD |
| 1376 | case eWNI_PMC_PWR_SAVE_CFG: |
| 1377 | case eWNI_PMC_ENTER_BMPS_REQ: |
| 1378 | case eWNI_PMC_EXIT_BMPS_REQ: |
| 1379 | case eWNI_PMC_ENTER_IMPS_REQ: |
| 1380 | case eWNI_PMC_EXIT_IMPS_REQ: |
| 1381 | case eWNI_PMC_ENTER_UAPSD_REQ: |
| 1382 | case eWNI_PMC_EXIT_UAPSD_REQ: |
| 1383 | case eWNI_PMC_ENTER_WOWL_REQ: |
| 1384 | case eWNI_PMC_EXIT_WOWL_REQ: |
| 1385 | case eWNI_PMC_WOWL_ADD_BCAST_PTRN: |
| 1386 | case eWNI_PMC_WOWL_DEL_BCAST_PTRN: |
| 1387 | pmmProcessMessage(pMac, limMsg); |
| 1388 | break; |
| 1389 | |
| 1390 | case eWNI_PMC_SMPS_STATE_IND : |
| 1391 | { |
| 1392 | #ifdef SUPPORT_eWNI_PMC_SMPS_STATE_IND |
| 1393 | tSirMbMsg *pMBMsg; |
| 1394 | tSirMacHTMIMOPowerSaveState mimoPSstate; |
| 1395 | /** Is System processing any SMPS Indication*/ |
| 1396 | if (!limIsSystemInSetMimopsState(pMac)) |
| 1397 | { |
| 1398 | pMBMsg = (tSirMbMsg *)limMsg->bodyptr; |
| 1399 | palCopyMemory(pMac->hHdd, &mimoPSstate, pMBMsg->data, sizeof(tSirMacHTMIMOPowerSaveState)); |
| 1400 | limSMPowerSaveStateInd(pMac, mimoPSstate); |
| 1401 | } |
| 1402 | else |
| 1403 | { |
| 1404 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1405 | { |
| 1406 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 1407 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1408 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 1409 | limLogSessionStates(pMac); |
| 1410 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1411 | } |
| 1412 | } |
| 1413 | #endif |
| 1414 | if(limMsg->bodyptr){ |
| 1415 | palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr); |
| 1416 | limMsg->bodyptr = NULL; |
| 1417 | } |
| 1418 | } |
| 1419 | break; |
| 1420 | #if defined WLAN_FEATURE_P2P |
| 1421 | case eWNI_SME_SEND_ACTION_FRAME_IND: |
| 1422 | limSendP2PActionFrame(pMac, limMsg); |
| 1423 | palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr); |
| 1424 | limMsg->bodyptr = NULL; |
| 1425 | break; |
| 1426 | case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND: |
| 1427 | limAbortRemainOnChan(pMac); |
| 1428 | palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr); |
| 1429 | limMsg->bodyptr = NULL; |
| 1430 | break; |
| 1431 | |
| 1432 | case SIR_HAL_P2P_NOA_ATTR_IND: |
| 1433 | { |
| 1434 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 1435 | tANI_U8 i; |
| 1436 | |
| 1437 | |
| 1438 | limLog(pMac, LOGW, FL("Received message Noa_ATTR %x\n"), limMsg->type); |
| 1439 | for(i=0; i < pMac->lim.maxBssId; i++) |
| 1440 | { |
| 1441 | if ( (psessionEntry != NULL) && (pMac->lim.gpSession[i].valid) && |
| 1442 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 1443 | { //Save P2P attributes for P2P Go persona |
| 1444 | |
| 1445 | palCopyMemory(pMac->hHdd,&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr,sizeof(tSirP2PNoaAttr)); |
| 1446 | |
| 1447 | |
| 1448 | limLog(pMac, LOGE, FL(" &psessionEntry->bssId%02x:%02x:%02x:%02x:%02x:%02x ctWin=%d oppPsFlag=%d\n"), |
| 1449 | psessionEntry->bssId[0], |
| 1450 | psessionEntry->bssId[1], |
| 1451 | psessionEntry->bssId[2], |
| 1452 | psessionEntry->bssId[3], |
| 1453 | psessionEntry->bssId[4], |
| 1454 | psessionEntry->bssId[5], |
| 1455 | psessionEntry->p2pGoPsUpdate.ctWin, |
| 1456 | psessionEntry->p2pGoPsUpdate.oppPsFlag); |
| 1457 | |
| 1458 | limLog(pMac, LOGE, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d\n"), |
| 1459 | psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt, |
| 1460 | psessionEntry->p2pGoPsUpdate.uNoa1Duration, |
| 1461 | psessionEntry->p2pGoPsUpdate.uNoa1Interval, |
| 1462 | psessionEntry->p2pGoPsUpdate.uNoa1StartTime); |
| 1463 | |
| 1464 | |
| 1465 | break; |
| 1466 | } |
| 1467 | } |
| 1468 | |
| 1469 | } |
| 1470 | palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr); |
| 1471 | limMsg->bodyptr = NULL; |
| 1472 | |
| 1473 | break; |
| 1474 | |
| 1475 | |
| 1476 | #endif |
| 1477 | /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the |
| 1478 | * device comes out of full power for the full power request sent |
| 1479 | * because of channel switch with switch count as 0, so call the same |
| 1480 | * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT) |
| 1481 | * for switching the channel*/ |
| 1482 | case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER: |
| 1483 | limProcessChannelSwitchTimeout(pMac); |
| 1484 | palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr); |
| 1485 | limMsg->bodyptr = NULL; |
| 1486 | break; |
| 1487 | |
| 1488 | //Power Save Related Messages From HAL |
| 1489 | case WDA_ENTER_BMPS_RSP: |
| 1490 | case WDA_EXIT_BMPS_RSP: |
| 1491 | case WDA_EXIT_BMPS_IND: |
| 1492 | case WDA_ENTER_IMPS_RSP: |
| 1493 | case WDA_EXIT_IMPS_RSP: |
| 1494 | case WDA_ENTER_UAPSD_RSP: |
| 1495 | case WDA_EXIT_UAPSD_RSP: |
| 1496 | case WDA_WOWL_ENTER_RSP: |
| 1497 | case WDA_WOWL_EXIT_RSP: |
| 1498 | pmmProcessMessage(pMac, limMsg); |
| 1499 | break; |
| 1500 | |
| 1501 | case WDA_LOW_RSSI_IND: |
| 1502 | //limHandleLowRssiInd(pMac); |
| 1503 | break; |
| 1504 | |
| 1505 | case WDA_BMPS_STATUS_IND: |
| 1506 | limHandleBmpsStatusInd(pMac); |
| 1507 | break; |
| 1508 | |
| 1509 | case WDA_MISSED_BEACON_IND: |
| 1510 | limHandleMissedBeaconInd(pMac); |
| 1511 | break; |
| 1512 | case WDA_MIC_FAILURE_IND: |
| 1513 | limMicFailureInd(pMac, limMsg); |
| 1514 | palFreeMemory(pMac->hHdd, (tANI_U8 *)limMsg->bodyptr); |
| 1515 | limMsg->bodyptr = NULL; |
| 1516 | break; |
| 1517 | |
| 1518 | |
| 1519 | #if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP) |
| 1520 | case eWNI_SME_MEASUREMENT_REQ: |
| 1521 | case eWNI_SME_SET_WDS_INFO_REQ: |
| 1522 | // Message to support ANI feature set |
| 1523 | // These are handled by LMM sub module |
| 1524 | if (limIsSystemInScanState(pMac)) |
| 1525 | { |
| 1526 | // System is in DFS (Learn) mode |
| 1527 | // Defer processsing this message |
| 1528 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1529 | { |
| 1530 | pMac->lim.numSme++; |
| 1531 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 1532 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1533 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 1534 | limLogSessionStates(pMac); |
| 1535 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1536 | // Release body |
| 1537 | palFreeMemory( pMac->hHdd, (tANI_U8 *) limMsg->bodyptr); |
| 1538 | break; |
| 1539 | } |
| 1540 | |
| 1541 | if (limMsg->type == eWNI_SME_MEASUREMENT_REQ) |
| 1542 | { |
| 1543 | if (GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 1544 | { |
| 1545 | //Set the resume channel to Any valid channel (invalid). |
| 1546 | //This will instruct HAL to set it to any previous valid channel. |
| 1547 | peSetResumeChannel(pMac, 0, 0); |
| 1548 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_LEARN_WAIT_STATE); |
| 1549 | } |
| 1550 | } |
| 1551 | } |
| 1552 | else |
| 1553 | { |
| 1554 | pMac->lim.numSme++; |
| 1555 | limProcessLmmMessages(pMac, |
| 1556 | limMsg->type, |
| 1557 | (tANI_U32 *) limMsg->bodyptr); |
| 1558 | |
| 1559 | // Release body |
| 1560 | palFreeMemory( pMac->hHdd, (tANI_U8 *) limMsg->bodyptr); |
| 1561 | } |
| 1562 | break; |
| 1563 | |
| 1564 | case SIR_LIM_LEARN_INTERVAL_TIMEOUT: |
| 1565 | if ((pMac->lim.gLimSystemRole == eLIM_STA_ROLE) && |
| 1566 | ((pMac->lim.gLimMlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) || |
| 1567 | (pMac->lim.gLimMlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE))) |
| 1568 | { |
| 1569 | // BP is in the process of cleaning up |
| 1570 | // its state with previously assocaited AP. |
| 1571 | // Discard processsing this message. |
| 1572 | PELOG1(limLog(pMac, LOG1, |
| 1573 | FL("Discarding LEARN_INTERVAL_TO message\n"));) |
| 1574 | } |
| 1575 | else |
| 1576 | limProcessLmmMessages(pMac, |
| 1577 | limMsg->type, |
| 1578 | (tANI_U32 *) limMsg->bodyptr); |
| 1579 | break; |
| 1580 | |
| 1581 | case SIR_LIM_MEASUREMENT_IND_TIMEOUT: |
| 1582 | case SIR_LIM_LEARN_DURATION_TIMEOUT: |
| 1583 | // These measurement related timeouts are |
| 1584 | // handled by LMM sub module. |
| 1585 | limProcessLmmMessages(pMac, |
| 1586 | limMsg->type, |
| 1587 | (tANI_U32 *) limMsg->bodyptr); |
| 1588 | |
| 1589 | break; |
| 1590 | |
| 1591 | case SIR_LIM_RADAR_DETECT_IND: |
| 1592 | limDetectRadar(pMac, (tANI_U32*)limMsg->bodyptr); |
| 1593 | palFreeMemory( pMac->hHdd, (tANI_U32*)limMsg->bodyptr); |
| 1594 | break; |
| 1595 | |
| 1596 | #endif |
| 1597 | |
| 1598 | case SIR_LIM_ADDTS_RSP_TIMEOUT: |
| 1599 | limProcessSmeReqMessages(pMac,limMsg); |
| 1600 | break; |
| 1601 | #ifdef FEATURE_WLAN_CCX |
| 1602 | case SIR_LIM_CCX_TSM_TIMEOUT: |
| 1603 | limProcessTsmTimeoutHandler(pMac,limMsg); |
| 1604 | break; |
| 1605 | case WDA_TSM_STATS_RSP: |
| 1606 | limProcessHalCcxTsmRsp(pMac, limMsg); |
| 1607 | break; |
| 1608 | #endif |
| 1609 | case WDA_ADD_TS_RSP: |
| 1610 | limProcessHalAddTsRsp(pMac, limMsg); |
| 1611 | break; |
| 1612 | |
| 1613 | case SIR_LIM_DEL_TS_IND: |
| 1614 | limProcessDelTsInd(pMac, limMsg); |
| 1615 | case SIR_LIM_ADD_BA_IND: |
| 1616 | limProcessAddBaInd(pMac, limMsg); |
| 1617 | break; |
| 1618 | case SIR_LIM_DEL_BA_ALL_IND: |
| 1619 | limDelAllBASessions(pMac); // refer notes and change |
| 1620 | break; |
| 1621 | case SIR_LIM_DEL_BA_IND: |
| 1622 | limProcessMlmHalBADeleteInd( pMac, limMsg ); |
| 1623 | break; |
| 1624 | |
| 1625 | case SIR_LIM_BEACON_GEN_IND: { |
| 1626 | #ifdef ANI_PRODUCT_TYPE_AP |
| 1627 | if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE) |
| 1628 | pmmUpdateTIM(pMac, (tpBeaconGenParams)limMsg->bodyptr); |
| 1629 | #endif |
| 1630 | |
| 1631 | #ifdef WLAN_SOFTAP_FEATURE |
| 1632 | if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE ) |
| 1633 | #endif |
| 1634 | schProcessPreBeaconInd(pMac, limMsg); |
| 1635 | |
| 1636 | } |
| 1637 | break; |
| 1638 | |
| 1639 | case SIR_LIM_DELETE_STA_CONTEXT_IND: |
| 1640 | limDeleteStaContext(pMac, limMsg); |
| 1641 | break; |
| 1642 | |
| 1643 | case SIR_LIM_MIN_CHANNEL_TIMEOUT: |
| 1644 | case SIR_LIM_MAX_CHANNEL_TIMEOUT: |
| 1645 | case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT: |
| 1646 | case SIR_LIM_JOIN_FAIL_TIMEOUT: |
| 1647 | case SIR_LIM_AUTH_FAIL_TIMEOUT: |
| 1648 | case SIR_LIM_AUTH_RSP_TIMEOUT: |
| 1649 | case SIR_LIM_ASSOC_FAIL_TIMEOUT: |
| 1650 | case SIR_LIM_REASSOC_FAIL_TIMEOUT: |
| 1651 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1652 | case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT: |
| 1653 | #endif |
| 1654 | #ifdef WLAN_FEATURE_P2P |
| 1655 | case SIR_LIM_REMAIN_CHN_TIMEOUT: |
| 1656 | #endif |
| 1657 | // These timeout messages are handled by MLM sub module |
| 1658 | |
| 1659 | limProcessMlmReqMessages(pMac, |
| 1660 | limMsg); |
| 1661 | |
| 1662 | break; |
| 1663 | |
| 1664 | case SIR_LIM_HEART_BEAT_TIMEOUT: |
| 1665 | /** check if heart beat failed, even if one Beacon |
| 1666 | * is rcvd within the Heart Beat interval continue |
| 1667 | * normal processing |
| 1668 | */ |
| 1669 | |
| 1670 | #if 0 |
| 1671 | PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d\n"), |
| 1672 | pMac->lim.gLimSmeState, pMac->lim.gLimMlmState, |
| 1673 | pMac->lim.gLimRxedBeaconCntDuringHB);) |
| 1674 | |
| 1675 | if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE) |
| 1676 | limIbssHeartBeatHandle(pMac); //HeartBeat for peers. |
| 1677 | else |
| 1678 | /** |
| 1679 | * Heartbeat failure occurred on STA |
| 1680 | * This is handled by LMM sub module. |
| 1681 | */ |
| 1682 | limHandleHeartBeatFailure(pMac); |
| 1683 | |
| 1684 | break; |
| 1685 | #endif //TO SUPPORT BT-AMP |
| 1686 | |
| 1687 | limHandleHeartBeatTimeout(pMac); |
| 1688 | break; |
| 1689 | |
| 1690 | case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT: |
| 1691 | limHandleHeartBeatFailureTimeout(pMac); |
| 1692 | break; |
| 1693 | |
| 1694 | case SIR_LIM_CHANNEL_SCAN_TIMEOUT: |
| 1695 | #if defined(ANI_PRODUCT_TYPE_CLIENT) || defined(ANI_AP_CLIENT_SDK) |
| 1696 | /** |
| 1697 | * Background scan timeout occurred on STA. |
| 1698 | * This is handled by LMM sub module. |
| 1699 | */ |
| 1700 | limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER); |
| 1701 | |
| 1702 | //We will do background scan even in bcnps mode |
| 1703 | //if (pMac->sys.gSysEnableScanMode) |
| 1704 | pMac->lim.gLimReportBackgroundScanResults = FALSE; |
| 1705 | limTriggerBackgroundScan(pMac); |
| 1706 | #endif |
| 1707 | break; |
| 1708 | |
| 1709 | #ifdef ANI_PRODUCT_TYPE_AP |
| 1710 | case SIR_LIM_PREAUTH_CLNUP_TIMEOUT: |
| 1711 | if (limIsSystemInScanState(pMac)) |
| 1712 | { |
| 1713 | // System is in DFS (Learn) mode |
| 1714 | // Defer processsing this message |
| 1715 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1716 | { |
| 1717 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 1718 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1719 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 1720 | limLogSessionStates(pMac); |
| 1721 | } |
| 1722 | } |
| 1723 | else |
| 1724 | { |
| 1725 | // Pre-authentication context cleanup timeout message |
| 1726 | limPreAuthClnupHandler(pMac); |
| 1727 | } |
| 1728 | |
| 1729 | break; |
| 1730 | #endif |
| 1731 | |
| 1732 | case SIR_LIM_HASH_MISS_THRES_TIMEOUT: |
| 1733 | |
| 1734 | /* |
| 1735 | ** clear the credit to the send disassociate frame bucket |
| 1736 | **/ |
| 1737 | |
| 1738 | pMac->lim.gLimDisassocFrameCredit = 0; |
| 1739 | break; |
| 1740 | |
| 1741 | case SIR_LIM_CNF_WAIT_TIMEOUT: |
| 1742 | |
| 1743 | /* |
| 1744 | ** Does not receive CNF or dummy packet |
| 1745 | **/ |
| 1746 | limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval); |
| 1747 | |
| 1748 | break; |
| 1749 | |
| 1750 | case SIR_LIM_KEEPALIVE_TIMEOUT: |
| 1751 | limSendKeepAliveToPeer(pMac); |
| 1752 | |
| 1753 | break; |
| 1754 | |
| 1755 | case SIR_LIM_RETRY_INTERRUPT_MSG: |
| 1756 | // Message from ISR upon TFP's max retry limit interrupt |
| 1757 | |
| 1758 | break; |
| 1759 | |
| 1760 | case SIR_LIM_INV_KEY_INTERRUPT_MSG: |
| 1761 | // Message from ISR upon SP's Invalid session key interrupt |
| 1762 | |
| 1763 | break; |
| 1764 | |
| 1765 | case SIR_LIM_KEY_ID_INTERRUPT_MSG: |
| 1766 | // Message from ISR upon SP's Invalid key ID interrupt |
| 1767 | |
| 1768 | break; |
| 1769 | |
| 1770 | case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG: |
| 1771 | // Message from ISR upon SP's Replay threshold interrupt |
| 1772 | |
| 1773 | break; |
| 1774 | |
| 1775 | case SIR_LIM_CHANNEL_SWITCH_TIMEOUT: |
| 1776 | limProcessChannelSwitchTimeout(pMac); |
| 1777 | break; |
| 1778 | |
| 1779 | case SIR_LIM_QUIET_TIMEOUT: |
| 1780 | limProcessQuietTimeout(pMac); |
| 1781 | break; |
| 1782 | |
| 1783 | case SIR_LIM_QUIET_BSS_TIMEOUT: |
| 1784 | limProcessQuietBssTimeout(pMac); |
| 1785 | break; |
| 1786 | |
| 1787 | #ifdef WLAN_SOFTAP_FEATURE |
| 1788 | case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT: |
| 1789 | limHandleUpdateOlbcCache(pMac); |
| 1790 | break; |
| 1791 | #if 0 |
| 1792 | case SIR_LIM_WPS_OVERLAP_TIMEOUT: |
| 1793 | limProcessWPSOverlapTimeout(pMac); |
| 1794 | break; |
| 1795 | #endif |
| 1796 | |
| 1797 | #endif |
| 1798 | |
| 1799 | case WDA_ADD_BSS_RSP: |
| 1800 | limProcessMlmAddBssRsp( pMac, limMsg ); |
| 1801 | break; |
| 1802 | |
| 1803 | case WDA_ADD_STA_RSP: |
| 1804 | |
| 1805 | //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there. |
| 1806 | limProcessAddStaRsp(pMac,limMsg); |
| 1807 | break; |
| 1808 | |
| 1809 | case WDA_DELETE_STA_RSP: |
| 1810 | limProcessMlmDelStaRsp(pMac, limMsg); |
| 1811 | break; |
| 1812 | |
| 1813 | case WDA_ADD_STA_SELF_RSP: |
| 1814 | limProcessAddStaSelfRsp(pMac, limMsg); |
| 1815 | break; |
| 1816 | case WDA_DEL_STA_SELF_RSP: |
| 1817 | limProcessDelStaSelfRsp(pMac, limMsg); |
| 1818 | break; |
| 1819 | |
| 1820 | case WDA_DELETE_BSS_RSP: |
| 1821 | limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response |
| 1822 | break; |
| 1823 | |
| 1824 | case WDA_SET_BSSKEY_RSP: |
| 1825 | case WDA_SET_STA_BCASTKEY_RSP: |
| 1826 | limProcessMlmSetBssKeyRsp( pMac, limMsg ); |
| 1827 | break; |
| 1828 | case WDA_SET_STAKEY_RSP: |
| 1829 | limProcessMlmSetStaKeyRsp( pMac, limMsg ); |
| 1830 | break; |
| 1831 | case WDA_REMOVE_BSSKEY_RSP: |
| 1832 | case WDA_REMOVE_STAKEY_RSP: |
| 1833 | limProcessMlmRemoveKeyRsp( pMac, limMsg ); |
| 1834 | break; |
| 1835 | case WDA_ADDBA_RSP: |
| 1836 | limProcessMlmHalAddBARsp( pMac, limMsg ); |
| 1837 | break; |
| 1838 | |
| 1839 | case WDA_STA_STAT_RSP: |
| 1840 | case WDA_AGGR_STAT_RSP: |
| 1841 | case WDA_GLOBAL_STAT_RSP: |
| 1842 | case WDA_STAT_SUMM_RSP: |
| 1843 | limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr); |
| 1844 | break; |
| 1845 | |
| 1846 | case WDA_GET_STATISTICS_RSP: |
| 1847 | limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr); |
| 1848 | break; |
| 1849 | |
| 1850 | case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg); |
| 1851 | case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg); |
| 1852 | case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg); |
| 1853 | case WDA_GET_NOISE_RSP: |
| 1854 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 1855 | limMsg->bodyptr = NULL; |
| 1856 | //limProcessGetNoiseRsp(pMac, limMsg); |
| 1857 | break; |
| 1858 | |
| 1859 | case WDA_SET_MAX_TX_POWER_RSP: |
| 1860 | #if defined WLAN_FEATURE_VOWIFI |
| 1861 | rrmSetMaxTxPowerRsp( pMac, limMsg ); |
| 1862 | #endif |
| 1863 | if(limMsg->bodyptr != NULL) |
| 1864 | { |
| 1865 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 1866 | limMsg->bodyptr = NULL; |
| 1867 | } |
| 1868 | break; |
| 1869 | |
| 1870 | #ifdef ANI_CHIPSET_VOLANS |
| 1871 | case SIR_LIM_ADDR2_MISS_IND: |
| 1872 | { |
| 1873 | limLog(pMac, LOGE, |
| 1874 | FL("Addr2 mismatch interrupt received %X\n"), |
| 1875 | limMsg->type); |
| 1876 | /*a message from HAL indicating addr2 mismatch interrupt occurred |
| 1877 | limMsg->bodyptr contains only pointer to 48-bit addr2 field*/ |
| 1878 | //Dinesh fix this. the third parameter should be sessionentry. |
| 1879 | //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr); |
| 1880 | |
| 1881 | /*Free message body pointer*/ |
| 1882 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 1883 | break; |
| 1884 | } |
| 1885 | #endif |
| 1886 | |
| 1887 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1888 | case WDA_AGGR_QOS_RSP: |
| 1889 | limProcessFTAggrQoSRsp( pMac, limMsg ); |
| 1890 | break; |
| 1891 | #endif |
| 1892 | |
| 1893 | case WDA_SET_LINK_STATE_RSP: |
| 1894 | linkStateParams = (tLinkStateParams *)limMsg->bodyptr; |
| 1895 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1896 | pSession = linkStateParams->session; |
| 1897 | if(linkStateParams->ft) |
| 1898 | { |
| 1899 | limSendReassocReqWithFTIEsMgmtFrame(pMac, |
| 1900 | pSession->pLimMlmReassocReq, |
| 1901 | pSession); |
| 1902 | } |
| 1903 | #endif |
| 1904 | if( linkStateParams->callback ) |
| 1905 | { |
| 1906 | linkStateParams->callback( pMac, linkStateParams->callbackArg ); |
| 1907 | } |
| 1908 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 1909 | break; |
| 1910 | |
| 1911 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1912 | case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
| 1913 | pmmProcessMessage(pMac, limMsg); |
| 1914 | break; |
| 1915 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 1916 | |
| 1917 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 1918 | case WDA_GTK_OFFLOAD_GETINFO_RSP: |
| 1919 | pmmProcessMessage(pMac, limMsg); |
| 1920 | break; |
| 1921 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 1922 | |
| 1923 | default: |
| 1924 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 1925 | limMsg->bodyptr = NULL; |
| 1926 | // Unwanted messages |
| 1927 | // Log error |
| 1928 | limLog(pMac, LOGE, |
| 1929 | FL("Discarding unexpected message received %X\n"), |
| 1930 | limMsg->type); |
| 1931 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1932 | break; |
| 1933 | |
| 1934 | } // switch (limMsg->type) |
| 1935 | |
| 1936 | PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s\n"), |
| 1937 | limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState), |
| 1938 | limMlmStateStr(pMac->lim.gLimMlmState));) |
| 1939 | |
| 1940 | } /*** end limProcessMessages() ***/ |
| 1941 | |
| 1942 | |
| 1943 | |
| 1944 | /** |
| 1945 | * limProcessDeferredMessageQueue |
| 1946 | * |
| 1947 | *FUNCTION: |
| 1948 | * This function is called by LIM while exiting from Learn |
| 1949 | * mode. This function fetches messages posted to the LIM |
| 1950 | * deferred message queue limDeferredMsgQ. |
| 1951 | * |
| 1952 | *LOGIC: |
| 1953 | * |
| 1954 | *ASSUMPTIONS: |
| 1955 | * NA |
| 1956 | * |
| 1957 | *NOTE: |
| 1958 | * NA |
| 1959 | * |
| 1960 | * @param pMac - Pointer to Global MAC structure |
| 1961 | * @return None |
| 1962 | */ |
| 1963 | |
| 1964 | void |
| 1965 | limProcessDeferredMessageQueue(tpAniSirGlobal pMac) |
| 1966 | { |
| 1967 | tSirMsgQ limMsg = { 0, 0, 0 }; |
| 1968 | |
| 1969 | #if defined(ANI_OS_TYPE_LINUX) || defined(ANI_OS_TYPE_OSX) |
| 1970 | while (TX_SUCCESS == tx_queue_receive(&pMac->sys.gSirLimDeferredMsgQ, (void *) &limMsg, TX_NO_WAIT)) |
| 1971 | { |
| 1972 | PELOG3(limLog(pMac, LOG3, FL("Processing deferred message %X\n"), limMsg.type);) |
| 1973 | limPrintMsgName(pMac, LOG3, limMsg.type); |
| 1974 | pMac->lim.gLimNumDeferredMsgs--; |
| 1975 | limProcessMessages(pMac, &limMsg); |
| 1976 | |
| 1977 | if(true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 1978 | break; |
| 1979 | } |
| 1980 | #else |
| 1981 | tSirMsgQ *readMsg; |
| 1982 | tANI_U16 size; |
| 1983 | |
| 1984 | /* |
| 1985 | ** check any deferred messages need to be processed |
| 1986 | **/ |
| 1987 | size = pMac->lim.gLimDeferredMsgQ.size; |
| 1988 | if (size > 0) |
| 1989 | { |
| 1990 | while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL) |
| 1991 | { |
| 1992 | palCopyMemory( pMac->hHdd, (tANI_U8*) &limMsg, |
| 1993 | (tANI_U8*) readMsg, sizeof(tSirMsgQ)); |
| 1994 | size--; |
| 1995 | limProcessMessages(pMac, &limMsg); |
| 1996 | |
| 1997 | if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) || |
| 1998 | (pMac->lim.gLimSystemInScanLearnMode)) |
| 1999 | break; |
| 2000 | } |
| 2001 | } |
| 2002 | #endif |
| 2003 | } /*** end limProcessDeferredMessageQueue() ***/ |
| 2004 | |
| 2005 | |
| 2006 | /* |
| 2007 | * limProcessNormalHddMsg |
| 2008 | * Function: this function checks the current lim state and decide whether the message passed shall be deffered. |
| 2009 | * @param pMac - Pointer to Global MAC structure |
| 2010 | * pLimMsg -- the message need to be processed |
| 2011 | * fRspReqd -- whether return result to hdd |
| 2012 | * @return None |
| 2013 | */ |
| 2014 | void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd) |
| 2015 | { |
| 2016 | tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE; |
| 2017 | |
| 2018 | /* Added For BT-AMP Support */ |
| 2019 | if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE ) |
| 2020 | ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE) |
| 2021 | ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)) |
| 2022 | { |
| 2023 | /** This check is required only for the AP and in 2 cases. |
| 2024 | * 1. If we are in learn mode and we receive any of these messages, |
| 2025 | * you have to come out of scan and process the message, hence dont |
| 2026 | * defer the message here. In handler, these message could be defered |
| 2027 | * till we actually come out of scan mode. |
| 2028 | * 2. If radar is detected, you might have to defer all of these |
| 2029 | * messages except Stop BSS request/ Switch channel request. This |
| 2030 | * decision is also made inside its handler. |
| 2031 | * |
| 2032 | * Please be careful while using the flag fDeferMsg. Possibly you |
| 2033 | * might end up in an infinite loop. |
| 2034 | **/ |
| 2035 | if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) || |
| 2036 | (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) || |
| 2037 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) || |
| 2038 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) || |
| 2039 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ))) |
| 2040 | { |
| 2041 | fDeferMsg = eANI_BOOLEAN_FALSE; |
| 2042 | } |
| 2043 | } |
| 2044 | |
| 2045 | /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/ |
| 2046 | if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) || |
| 2047 | (LIM_IS_RADAR_DETECTED(pMac))) && fDeferMsg) |
| 2048 | { |
| 2049 | // System is in DFS (Learn) mode or awaiting addts response |
| 2050 | // or if radar is detected, Defer processsing this message |
| 2051 | if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS) |
| 2052 | { |
| 2053 | #ifdef WLAN_DEBUG |
| 2054 | pMac->lim.numSme++; |
| 2055 | #endif |
| 2056 | PELOGE(limLog(pMac, LOGE, FL("Unable to Defer message(0x%X) limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)\n"), |
| 2057 | pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 2058 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 2059 | limLogSessionStates(pMac); |
| 2060 | limPrintMsgName(pMac, LOGE, pLimMsg->type); |
| 2061 | // Release body |
| 2062 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pLimMsg->bodyptr); |
| 2063 | } |
| 2064 | } |
| 2065 | else |
| 2066 | { |
| 2067 | if(fRspReqd) |
| 2068 | { |
| 2069 | // These messages are from HDD |
| 2070 | // Since these requests may also be generated |
| 2071 | // internally within LIM module, need to |
| 2072 | // distinquish and send response to host |
| 2073 | pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE; |
| 2074 | } |
| 2075 | #ifdef WLAN_DEBUG |
| 2076 | pMac->lim.numSme++; |
| 2077 | #endif |
| 2078 | if(limProcessSmeReqMessages(pMac, pLimMsg)) |
| 2079 | { |
| 2080 | // Release body |
| 2081 | // limProcessSmeReqMessage consumed the buffer. We can free it. |
| 2082 | palFreeMemory( pMac->hHdd, (tANI_U8 *) pLimMsg->bodyptr); |
| 2083 | } |
| 2084 | } |
| 2085 | } |
| 2086 | |
| 2087 | void |
| 2088 | handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac) |
| 2089 | { |
| 2090 | tSirMacHTCapabilityInfo macHTCapabilityInfo; |
| 2091 | tSirMacHTParametersInfo macHTParametersInfo; |
| 2092 | tSirMacHTInfoField1 macHTInfoField1; |
| 2093 | tSirMacHTInfoField2 macHTInfoField2; |
| 2094 | tSirMacHTInfoField3 macHTInfoField3; |
| 2095 | tANI_U32 cfgValue; |
| 2096 | tANI_U8 *ptr; |
| 2097 | tpPESession psessionEntry = &pMac->lim.gpSession[0];//TBD-RAJESH HOW TO GET sessionEntry????? |
| 2098 | |
| 2099 | pMac->lim.htCapability = IS_DOT11_MODE_HT(psessionEntry->dot11mode); |
| 2100 | |
| 2101 | |
| 2102 | |
| 2103 | // Get HT Capabilities |
| 2104 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS) |
| 2105 | { |
| 2106 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value\n")); |
| 2107 | return ; |
| 2108 | } |
| 2109 | ptr = (tANI_U8 *) &macHTCapabilityInfo; |
| 2110 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2111 | pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection; |
| 2112 | pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave; |
| 2113 | pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField; |
| 2114 | pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize; |
| 2115 | pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz; |
| 2116 | pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz; |
| 2117 | pMac->lim.gHTSupportedChannelWidthSet = (tANI_U8)macHTCapabilityInfo.supportedChannelWidthSet; |
| 2118 | pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp; |
| 2119 | pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz; |
| 2120 | |
| 2121 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS) |
| 2122 | { |
| 2123 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value\n")); |
| 2124 | return ; |
| 2125 | } |
| 2126 | ptr = (tANI_U8 *) &macHTParametersInfo; |
| 2127 | *ptr = (tANI_U8) (cfgValue & 0xff); |
| 2128 | pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity; |
| 2129 | pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor; |
| 2130 | |
| 2131 | // Get HT IE Info |
| 2132 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS) |
| 2133 | { |
| 2134 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value\n")); |
| 2135 | return ; |
| 2136 | } |
| 2137 | ptr = (tANI_U8 *) &macHTInfoField1; |
| 2138 | *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff); |
| 2139 | pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity; |
| 2140 | pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly; |
| 2141 | pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode; |
| 2142 | pMac->lim.gHTRecommendedTxWidthSet = (tANI_U8)macHTInfoField1.recommendedTxWidthSet; |
| 2143 | pMac->lim.gHTSecondaryChannelOffset = (tSirMacHTSecondaryChannelOffset)macHTInfoField1.secondaryChannelOffset; |
| 2144 | |
| 2145 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS) |
| 2146 | { |
| 2147 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value\n")); |
| 2148 | return ; |
| 2149 | } |
| 2150 | ptr = (tANI_U8 *) &macHTInfoField2; |
| 2151 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2152 | pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode; |
| 2153 | |
| 2154 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS) |
| 2155 | { |
| 2156 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value\n")); |
| 2157 | return ; |
| 2158 | } |
| 2159 | ptr = (tANI_U8 *) &macHTInfoField3; |
| 2160 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2161 | pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive; |
| 2162 | pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase; |
| 2163 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport; |
| 2164 | pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon; |
| 2165 | pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection; |
| 2166 | pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS; |
| 2167 | } |
| 2168 | |
| 2169 | void limLogSessionStates(tpAniSirGlobal pMac) |
| 2170 | { |
| 2171 | #ifdef WLAN_DEBUG |
| 2172 | int i; |
| 2173 | |
| 2174 | for(i = 0; i < pMac->lim.maxBssId; i++) |
| 2175 | { |
| 2176 | if(pMac->lim.gpSession[i].valid) |
| 2177 | { |
| 2178 | PELOGE(limLog(pMac, LOGE, FL("Session[%d] sysRole(%d) limSmeState %d (prev sme state %d) mlm state %d (prev mlm state %d)\n"), |
| 2179 | i, pMac->lim.gpSession[i].limSystemRole, pMac->lim.gpSession[i].limSmeState, |
| 2180 | pMac->lim.gpSession[i].limPrevSmeState, pMac->lim.gpSession[i].limMlmState, |
| 2181 | pMac->lim.gpSession[i].limPrevMlmState);) |
| 2182 | } |
| 2183 | } |
| 2184 | #endif //ifdef WLAN_DEBUG |
| 2185 | } |