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-2013 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. |
| 20 | */ |
| 21 | |
| 22 | /* |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 23 | * Copyright (c) 2012-2013 Qualcomm Atheros, Inc. |
| 24 | * All Rights Reserved. |
| 25 | * Qualcomm Atheros Confidential and Proprietary. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 26 | * |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 27 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 28 | |
| 29 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 30 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 31 | * This file lim ProcessMessageQueue.cc contains the code |
| 32 | * for processing LIM message Queue. |
| 33 | * Author: Chandra Modumudi |
| 34 | * Date: 02/11/02 |
| 35 | * History:- |
| 36 | * Date Modified by Modification Information |
| 37 | * -------------------------------------------------------------------- |
| 38 | * |
| 39 | */ |
| 40 | #include "palTypes.h" |
| 41 | #include "wniApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 42 | #include "wlan_qct_wdi_ds.h" |
| 43 | #include "wlan_qct_pal_packet.h" |
| 44 | #include "wlan_qct_wda.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 45 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 46 | #include "wniCfgSta.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 47 | #include "cfgApi.h" |
| 48 | #include "sirCommon.h" |
| 49 | #include "utilsApi.h" |
| 50 | #include "limTypes.h" |
| 51 | #include "limUtils.h" |
| 52 | #include "limAssocUtils.h" |
| 53 | #include "limPropExtsUtils.h" |
| 54 | |
| 55 | #include "limAdmitControl.h" |
| 56 | #include "pmmApi.h" |
| 57 | #include "limIbssPeerMgmt.h" |
| 58 | #include "schApi.h" |
| 59 | #include "limSession.h" |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 60 | #include "limSendMessages.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 61 | |
| 62 | #if defined WLAN_FEATURE_VOWIFI |
| 63 | #include "rrmApi.h" |
| 64 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 65 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
| 66 | #include "eseApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 67 | #endif |
| 68 | |
| 69 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 70 | #include "limFT.h" |
| 71 | #endif |
| 72 | |
| 73 | #ifdef WMM_APSD |
| 74 | #include "wmmApsd.h" |
| 75 | #endif |
| 76 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | #include "vos_types.h" |
| 78 | #include "vos_packet.h" |
| 79 | #include "vos_memory.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 80 | |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 81 | /* This value corresponds to 500 ms */ |
| 82 | #define MAX_PROBEREQ_TIME 5000 |
| 83 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 101 | if(pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | { |
| 103 | // Defer processsing this message |
| 104 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 105 | { |
Madan Mohan Koyyalamudi | 5695b50 | 2012-09-24 14:21:12 -0700 | [diff] [blame] | 106 | PELOGW(limLog(pMac, LOGW, FL("Unable to Defer message(0x%X) %s limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 107 | limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 108 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 109 | limLogSessionStates(pMac); |
| 110 | limHandleDeferMsgError(pMac, limMsg); |
| 111 | } |
| 112 | return true; |
| 113 | } |
| 114 | |
| 115 | //When defer is requested then defer all the messages except HAL responses. |
| 116 | if((!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) && |
| 117 | !pMac->lim.gLimSystemInScanLearnMode) |
| 118 | { |
| 119 | if((limMsg->type != WDA_ADD_BSS_RSP) && |
| 120 | (limMsg->type != WDA_DELETE_BSS_RSP) && |
| 121 | (limMsg->type != WDA_ADD_STA_RSP) && |
| 122 | (limMsg->type != WDA_ADD_STA_SELF_RSP) && |
| 123 | (limMsg->type != WDA_DEL_STA_SELF_RSP) && |
| 124 | (limMsg->type != WDA_DELETE_STA_RSP)&& |
| 125 | (limMsg->type != WDA_SET_BSSKEY_RSP)&& |
| 126 | (limMsg->type != WDA_SET_STAKEY_RSP)&& |
| 127 | (limMsg->type != WDA_SET_STA_BCASTKEY_RSP) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 128 | (limMsg->type != eWNI_SME_START_REQ) && |
| 129 | (limMsg->type != WDA_AGGR_QOS_RSP) && |
| 130 | (limMsg->type != WDA_REMOVE_BSSKEY_RSP) && |
| 131 | (limMsg->type != WDA_REMOVE_STAKEY_RSP) && |
| 132 | (limMsg->type != WDA_SET_MIMOPS_RSP)&& |
| 133 | (limMsg->type != WDA_ADDBA_RSP) && |
| 134 | (limMsg->type != WDA_ENTER_BMPS_RSP) && |
| 135 | (limMsg->type != WDA_EXIT_BMPS_RSP) && |
| 136 | (limMsg->type != WDA_ENTER_IMPS_RSP) && |
| 137 | (limMsg->type != WDA_EXIT_IMPS_RSP) && |
| 138 | (limMsg->type != WDA_ENTER_UAPSD_RSP) && |
| 139 | (limMsg->type != WDA_EXIT_UAPSD_RSP) && |
| 140 | (limMsg->type != WDA_WOWL_ENTER_RSP) && |
| 141 | (limMsg->type != WDA_WOWL_EXIT_RSP) && |
| 142 | (limMsg->type != WDA_SWITCH_CHANNEL_RSP) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 143 | (limMsg->type != WDA_P2P_NOA_ATTR_IND) && |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 144 | (limMsg->type != WDA_P2P_NOA_START_IND) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 145 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 146 | (limMsg->type != WDA_START_OEM_DATA_RSP) && |
| 147 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 148 | (limMsg->type != WDA_ADD_TS_RSP)) |
| 149 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 150 | PELOG1(limLog(pMac, LOG1, FL("Defer the current message %s , gLimProcessDefdMsgs is false and system is not in scan/learn mode"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 151 | limMsgStr(limMsg->type));) |
| 152 | |
| 153 | // Defer processsing this message |
| 154 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 155 | { |
Madan Mohan Koyyalamudi | 5695b50 | 2012-09-24 14:21:12 -0700 | [diff] [blame] | 156 | PELOGW(limLog(pMac, LOGW, FL("Unable to Defer message(0x%X) %s limSmeState %d (prev sme state %d) sysRole %d mlm state %d (prev mlm state %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 211 | * limDeferMsg() |
| 212 | * |
| 213 | *FUNCTION: |
| 214 | * This function is called to defer the messages received |
| 215 | * during Learn mode |
| 216 | * |
| 217 | *LOGIC: |
| 218 | * NA |
| 219 | * |
| 220 | *ASSUMPTIONS: |
| 221 | * NA |
| 222 | * |
| 223 | *NOTE: |
| 224 | * NA |
| 225 | * |
| 226 | * @param pMac - Pointer to Global MAC structure |
| 227 | * @param pMsg of type tSirMsgQ - Pointer to the message structure |
| 228 | * @return None |
| 229 | */ |
| 230 | |
| 231 | tANI_U32 |
| 232 | limDeferMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg) |
| 233 | { |
| 234 | tANI_U32 retCode = TX_SUCCESS; |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 235 | |
| 236 | retCode = limWriteDeferredMsgQ(pMac, pMsg); |
| 237 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 238 | if (retCode == TX_SUCCESS) |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 239 | { |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 240 | limLog(pMac, LOG1, |
| 241 | FL("Deferred message(0x%X) limSmeState %d (prev sme state %d)" |
| 242 | " sysRole %d mlm state %d (prev mlm state %d)"), |
| 243 | pMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 244 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, |
| 245 | pMac->lim.gLimPrevMlmState); |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 246 | MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));) |
| 247 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 248 | else |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 249 | { |
Agarwal Ashish | e865f33 | 2014-04-08 13:20:06 +0530 | [diff] [blame^] | 250 | limLog(pMac, LOG1, FL("Dropped lim message (0x%X)"), pMsg->type); |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 251 | MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));) |
| 252 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 253 | |
| 254 | return retCode; |
| 255 | } /*** end limDeferMsg() ***/ |
| 256 | |
| 257 | |
| 258 | |
| 259 | /** |
| 260 | * limHandleFramesInScanState() |
| 261 | * |
| 262 | *FUNCTION: |
| 263 | * This function is called to process 802.11 frames |
| 264 | * received by LIM in scan state. |
| 265 | * |
| 266 | *LOGIC: |
| 267 | * NA |
| 268 | * |
| 269 | *ASSUMPTIONS: |
| 270 | * NA |
| 271 | * |
| 272 | *NOTE: |
| 273 | * NA |
| 274 | * |
| 275 | * @param pMac - Pointer to Global MAC structure |
| 276 | * @param limMsg - Received message |
| 277 | * @param pRxPacketInfo - Pointer to Rx packet info structure |
| 278 | * @param deferMsg - Indicates whether the frame shall be deferred |
| 279 | * @return None |
| 280 | */ |
| 281 | |
| 282 | static void |
| 283 | limHandleFramesInScanState(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pRxPacketInfo, tANI_U8 *deferMsg, tpPESession psessionEntry) |
| 284 | { |
| 285 | tSirMacFrameCtl fc; |
| 286 | tpSirMacMgmtHdr pHdr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 287 | |
| 288 | *deferMsg = false; |
| 289 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 290 | fc = pHdr->fc; |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 291 | limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | fc.protVer, fc.type, fc.subType ); |
| 293 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 294 | // defer all message in scan state except for Beacons and Probe Response |
| 295 | if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON)) |
| 296 | { |
| 297 | if (psessionEntry == NULL) |
| 298 | limProcessBeaconFrameNoSession(pMac, pRxPacketInfo); |
| 299 | else |
| 300 | limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry); |
| 301 | } |
| 302 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP)) |
| 303 | { |
| 304 | if (psessionEntry == NULL) |
| 305 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 306 | else |
| 307 | limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry); |
| 308 | } |
| 309 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_REQ)) |
| 310 | { |
| 311 | limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo, psessionEntry); |
| 312 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 313 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_ACTION)) |
| 314 | { |
| 315 | limProcessActionFrameNoSession( pMac, pRxPacketInfo); |
| 316 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 317 | else |
| 318 | { |
| 319 | *deferMsg = true; |
| 320 | return; |
| 321 | } |
| 322 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 323 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 324 | return; |
| 325 | |
| 326 | } /*** end limHandleFramesInScanState() ***/ |
| 327 | |
| 328 | /** ------------------------------------------------------------ |
| 329 | \brief This function handles Unknown Unicast (A2 Index) |
| 330 | \ packets. |
| 331 | \param tpAniSirGlobal pMac Global Mac data structure |
| 332 | \param void *pRxPacketInfo Pointer to Buffer Descriptor |
| 333 | \return none |
| 334 | \ |
| 335 | \ -------------------------------------------------------------- */ |
| 336 | static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketInfo,tpPESession psessionEntry) |
| 337 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 338 | /* addr2 mismatch interrupt occurred this means previous |
| 339 | disassociation was not successful |
| 340 | In Volans pRxPacketInfo only contains pointer 48-bit address2 field */ |
| 341 | /*Send disassociation message again*/ |
| 342 | //Dinesh need one more arguement. |
| 343 | //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 344 | //TODO: verify this |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 345 | //This could be a public action frame. |
| 346 | if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE ) |
| 347 | limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 348 | |
| 349 | #ifdef FEATURE_WLAN_TDLS |
| 350 | { |
| 351 | tpSirMacDataHdr3a pMacHdr; |
| 352 | pMacHdr = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo); |
| 353 | |
| 354 | if (limIsGroupAddr(pMacHdr->addr2)) |
| 355 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 356 | PELOG2(limLog(pMac, LOG2, FL("Ignoring A2 Invalid Packet received for MC/BC:")); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 357 | limPrintMacAddr(pMac, pMacHdr->addr2, LOG2);) |
| 358 | |
| 359 | return; |
| 360 | } |
| 361 | /* TDLS_hklee: move down here to reject Addr2 == Group (first checking above) |
| 362 | and also checking if SystemRole == STA */ |
| 363 | if (psessionEntry->limSystemRole == eLIM_STA_ROLE) |
| 364 | { |
| 365 | /* ADD handling of Public Action Frame */ |
| 366 | LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, \ |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 367 | ("limHandleUnknownA2IndexFrames: type=0x%x, subtype=0x%x"),pMacHdr->fc.type, pMacHdr->fc.subType)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 368 | switch (pMacHdr->fc.type) |
| 369 | { |
| 370 | case SIR_MAC_MGMT_FRAME: |
| 371 | { |
| 372 | switch (pMacHdr->fc.subType) |
| 373 | { |
| 374 | case SIR_MAC_MGMT_ACTION: |
| 375 | { |
| 376 | limProcessActionFrame(pMac, pRxPacketInfo, psessionEntry) ; |
| 377 | break ; |
| 378 | } |
| 379 | default: |
| 380 | { |
| 381 | break ; |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | default: |
| 386 | { |
| 387 | break ; |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | } |
| 392 | #endif |
| 393 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 394 | |
| 395 | return; |
| 396 | } |
| 397 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 398 | /** |
| 399 | * limCheckMgmtRegisteredFrames() |
| 400 | * |
| 401 | *FUNCTION: |
| 402 | * This function is called to process to check if received frame match with |
| 403 | * any of the registered frame from HDD. If yes pass this frame to SME. |
| 404 | * |
| 405 | *LOGIC: |
| 406 | * |
| 407 | *ASSUMPTIONS: |
| 408 | * |
| 409 | *NOTE: |
| 410 | * |
| 411 | * @param pMac Pointer to Global MAC structure |
| 412 | * @param *pBd Pointer to the received Buffer Descriptor+payload |
| 413 | * @param *psessionEntry Pointer to session on which packet is received |
| 414 | * @return None |
| 415 | */ |
| 416 | static tANI_BOOLEAN |
| 417 | limCheckMgmtRegisteredFrames(tpAniSirGlobal pMac, tANI_U8 *pBd, |
| 418 | tpPESession psessionEntry) |
| 419 | { |
| 420 | tSirMacFrameCtl fc; |
| 421 | tpSirMacMgmtHdr pHdr; |
| 422 | tANI_U8 *pBody; |
| 423 | tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL; |
| 424 | tANI_U16 frameType; |
| 425 | tANI_U16 framelen; |
| 426 | tANI_U8 type,subType; |
| 427 | tANI_BOOLEAN match = VOS_FALSE; |
| 428 | VOS_STATUS vosStatus; |
| 429 | |
| 430 | pHdr = WDA_GET_RX_MAC_HEADER(pBd); |
| 431 | fc = pHdr->fc; |
| 432 | frameType = (fc.type << 2 ) | (fc.subType << 4); |
| 433 | pBody = WDA_GET_RX_MPDU_DATA(pBd); |
| 434 | framelen = WDA_GET_RX_PAYLOAD_LEN(pBd); |
| 435 | |
| 436 | vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 437 | (vos_list_node_t**)&pLimMgmtRegistration); |
| 438 | |
| 439 | while(pLimMgmtRegistration != NULL) |
| 440 | { |
| 441 | type = (pLimMgmtRegistration->frameType >> 2) & 0x03; |
| 442 | subType = (pLimMgmtRegistration->frameType >> 4) & 0x0f; |
| 443 | if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME) |
| 444 | && (subType == SIR_MAC_MGMT_RESERVED15) ) |
| 445 | { |
| 446 | limLog( pMac, LOG3, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 447 | FL("rcvd frame match with SIR_MAC_MGMT_RESERVED15")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 448 | match = VOS_TRUE; |
| 449 | break; |
| 450 | } |
| 451 | |
| 452 | if (pLimMgmtRegistration->frameType == frameType) |
| 453 | { |
| 454 | if (pLimMgmtRegistration->matchLen > 0) |
| 455 | { |
| 456 | if (pLimMgmtRegistration->matchLen <= framelen) |
| 457 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 458 | if (vos_mem_compare(pLimMgmtRegistration->matchData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 459 | pBody, pLimMgmtRegistration->matchLen)) |
| 460 | { |
Madan Mohan Koyyalamudi | c537df2 | 2012-10-22 15:07:08 -0700 | [diff] [blame] | 461 | /* found match! */ |
| 462 | match = VOS_TRUE; |
| 463 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 464 | } |
Madan Mohan Koyyalamudi | c537df2 | 2012-10-22 15:07:08 -0700 | [diff] [blame] | 465 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 466 | } |
| 467 | else |
| 468 | { |
| 469 | /* found match! */ |
| 470 | match = VOS_TRUE; |
| 471 | break; |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | vosStatus = |
| 476 | vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 477 | (vos_list_node_t*) pLimMgmtRegistration, |
| 478 | (vos_list_node_t**) &pNext ); |
| 479 | pLimMgmtRegistration = pNext; |
| 480 | pNext = NULL; |
| 481 | } |
| 482 | |
| 483 | if (match) |
| 484 | { |
| 485 | limLog( pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 486 | FL("rcvd frame match with registered frame params")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 487 | |
| 488 | /* Indicate this to SME */ |
Rashmi Ramanna | 0d0adec | 2014-02-05 20:35:37 +0530 | [diff] [blame] | 489 | limSendSmeMgmtFrameInd( pMac, pLimMgmtRegistration->sessionId, |
| 490 | pBd, psessionEntry, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 491 | |
| 492 | if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME) |
| 493 | && (subType == SIR_MAC_MGMT_RESERVED15) ) |
| 494 | { |
| 495 | // These packets needs to be processed by PE/SME as well as HDD. |
| 496 | // If it returns TRUE here, the packet is forwarded to HDD only. |
| 497 | match = VOS_FALSE; |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | return match; |
| 502 | } /*** end limCheckMgmtRegisteredFrames() ***/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 503 | |
| 504 | |
| 505 | /** |
| 506 | * limHandle80211Frames() |
| 507 | * |
| 508 | *FUNCTION: |
| 509 | * This function is called to process 802.11 frames |
| 510 | * received by LIM. |
| 511 | * |
| 512 | *LOGIC: |
| 513 | * NA |
| 514 | * |
| 515 | *ASSUMPTIONS: |
| 516 | * NA |
| 517 | * |
| 518 | *NOTE: |
| 519 | * NA |
| 520 | * |
| 521 | * @param pMac - Pointer to Global MAC structure |
| 522 | * @param pMsg of type tSirMsgQ - Pointer to the message structure |
| 523 | * @return None |
| 524 | */ |
| 525 | |
| 526 | static void |
| 527 | limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) |
| 528 | { |
| 529 | tANI_U8 *pRxPacketInfo = NULL; |
| 530 | tSirMacFrameCtl fc; |
| 531 | tpSirMacMgmtHdr pHdr=NULL; |
| 532 | tpPESession psessionEntry=NULL; |
| 533 | tANI_U8 sessionId; |
| 534 | tAniBool isFrmFt = FALSE; |
| 535 | tANI_U16 fcOffset = WLANHAL_RX_BD_HEADER_SIZE; |
| 536 | |
| 537 | *pDeferMsg= false; |
| 538 | limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo); |
| 539 | |
| 540 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 541 | isFrmFt = WDA_GET_RX_FT_DONE(pRxPacketInfo); |
| 542 | fcOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(pRxPacketInfo); |
| 543 | fc = pHdr->fc; |
| 544 | |
Madan Mohan Koyyalamudi | 99af06e | 2013-08-08 02:17:17 +0530 | [diff] [blame] | 545 | #ifdef WLAN_DUMP_MGMTFRAMES |
| 546 | limLog( pMac, LOGE, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"), |
| 547 | fc.protVer, fc.type, fc.subType, |
| 548 | WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
| 549 | VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, pHdr, |
| 550 | WDA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo)); |
| 551 | #endif |
| 552 | |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 553 | if (pMac->fEnableDebugLog & 0x1) { |
| 554 | if ((fc.type == SIR_MAC_MGMT_FRAME) && |
| 555 | (fc.subType != SIR_MAC_MGMT_PROBE_REQ) && |
| 556 | (fc.subType != SIR_MAC_MGMT_PROBE_RSP) && |
| 557 | (fc.subType != SIR_MAC_MGMT_BEACON)) |
| 558 | { |
| 559 | limLog(pMac, LOGE, FL("RX MGMT - Type %hu, SubType %hu"), |
| 560 | fc.type, fc.subType); |
| 561 | } |
| 562 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 563 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 564 | if ( WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo)) |
| 565 | { |
| 566 | limLog( pMac, LOG2, FL("Notify SME with candidate ind")); |
| 567 | //send a session 0 for now - TBD |
| 568 | limSendSmeCandidateFoundInd(pMac, 0); |
| 569 | goto end; |
| 570 | } |
| 571 | if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) |
| 572 | { |
| 573 | if (fc.subType == SIR_MAC_MGMT_BEACON) |
| 574 | { |
| 575 | limLog( pMac, LOG2, FL("Save this beacon in LFR cache")); |
| 576 | __limHandleBeacon(pMac, limMsg, NULL); |
| 577 | } |
| 578 | else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP) |
| 579 | { |
| 580 | limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache")); |
| 581 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 582 | } |
| 583 | else |
| 584 | { |
| 585 | limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"), |
| 586 | fc.type, fc.subType); |
| 587 | } |
| 588 | goto end; |
| 589 | } |
| 590 | #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 591 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 592 | if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt) |
| 593 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 594 | #if 0 // Ese TBD Need to PORT |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 595 | tpSirMacDot3Hdr pDataFrmHdr; |
| 596 | |
| 597 | pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD)); |
| 598 | if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL) |
| 599 | { |
| 600 | limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType); |
| 601 | limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE); |
| 602 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr); |
| 603 | return; |
| 604 | } |
| 605 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 606 | if (!psessionEntry->isESEconnection) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 607 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 608 | limLog( pMac, LOGE, FL("LIM received Type %d, Subtype %d in Non ESE connection"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 609 | fc.type, fc.subType); |
| 610 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr); |
| 611 | return; |
| 612 | } |
| 613 | limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:")); |
| 614 | limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE); |
| 615 | #else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 616 | printk("%s: Need to port handling of IAPP frames to PRIMA for ESE", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 617 | #endif |
| 618 | |
| 619 | |
| 620 | } else |
| 621 | #endif |
| 622 | /* Added For BT-AMP Support */ |
| 623 | if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL) |
| 624 | { |
| 625 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 626 | if (fc.subType == SIR_MAC_MGMT_AUTH) |
| 627 | { |
| 628 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 629 | limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 630 | fc.protVer, fc.type, fc.subType, WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 631 | limPrintMacAddr(pMac, pHdr->bssId, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 632 | #endif |
| 633 | if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS) |
| 634 | { |
| 635 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); |
| 636 | return; |
| 637 | } |
| 638 | } |
| 639 | #endif |
| 640 | if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&& |
| 641 | (fc.subType != SIR_MAC_MGMT_BEACON)&& |
| 642 | (fc.subType != SIR_MAC_MGMT_PROBE_REQ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 643 | && (fc.subType != SIR_MAC_MGMT_ACTION ) //Public action frame can be received from non-associated stations. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 644 | ) |
| 645 | { |
| 646 | |
| 647 | if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL) |
| 648 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 649 | limLog(pMac, LOG1, FL("session does not exist for given bssId")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 650 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); |
| 651 | return; |
| 652 | } |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 653 | else |
| 654 | limLog(pMac,LOG1,"SessionId:%d Session Exist for given Bssid", |
| 655 | psessionEntry->peSessionId); |
Gopichand Nakkala | 6265d6f | 2013-03-20 23:32:50 +0530 | [diff] [blame] | 656 | } |
| 657 | // For p2p resp frames search for valid session with DA as |
| 658 | // BSSID will be SA and session will be present with DA only |
| 659 | if(fc.subType == SIR_MAC_MGMT_ACTION ) |
| 660 | { |
| 661 | psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId); |
| 662 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 663 | } |
| 664 | |
| 665 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 666 | /* Check if frame is registered by HDD */ |
| 667 | if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry)) |
| 668 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 669 | limLog( pMac, LOG1, FL("Received frame is passed to SME")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 670 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, limMsg->bodyptr); |
| 671 | return; |
| 672 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 673 | |
| 674 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 675 | |
| 676 | if (fc.protVer != SIR_MAC_PROTOCOL_VERSION) |
| 677 | { // Received Frame with non-zero Protocol Version |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 678 | limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 679 | fc.protVer); |
| 680 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 681 | #ifdef WLAN_DEBUG |
| 682 | pMac->lim.numProtErr++; |
| 683 | #endif |
| 684 | return; |
| 685 | } |
| 686 | |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 687 | if (!pMac->fScanOffload) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 688 | { |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 689 | if (limIsSystemInScanState(pMac)) |
| 690 | { |
| 691 | limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry); |
| 692 | return; |
| 693 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 694 | } |
| 695 | |
| 696 | /* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */ |
| 697 | |
| 698 | #if 0 |
| 699 | if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 700 | limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting..." ),psessionEntry->limSystemRole ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 701 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 702 | |
| 703 | #ifdef WLAN_DEBUG |
| 704 | pMac->lim.numProtErr++; |
| 705 | #endif |
| 706 | return; |
| 707 | } |
| 708 | #endif //HACK to continue scanning |
| 709 | |
| 710 | |
| 711 | #ifdef WLAN_DEBUG |
| 712 | pMac->lim.numMAC[fc.type][fc.subType]++; |
| 713 | #endif |
| 714 | |
| 715 | switch (fc.type) |
| 716 | { |
| 717 | case SIR_MAC_MGMT_FRAME: |
| 718 | { |
| 719 | #if 0 //TBD-RAJESH fix this |
| 720 | if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) && |
| 721 | (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP)) |
| 722 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 723 | limLog(pMac, LOGE, FL("Frame with Type - %d, Subtype - %d received in ReAssoc Wait state, dropping..."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 724 | fc.type, fc.subType); |
| 725 | return; |
| 726 | } |
| 727 | #endif //HACK to continue scanning |
| 728 | // Received Management frame |
| 729 | switch (fc.subType) |
| 730 | { |
| 731 | case SIR_MAC_MGMT_ASSOC_REQ: |
| 732 | // Make sure the role supports Association |
| 733 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 734 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 735 | ) |
| 736 | limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry); |
| 737 | |
| 738 | else |
| 739 | { |
| 740 | // Unwanted messages - Log error |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 741 | limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 742 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 743 | } |
| 744 | break; |
| 745 | |
| 746 | case SIR_MAC_MGMT_ASSOC_RSP: |
| 747 | limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry); |
| 748 | break; |
| 749 | |
| 750 | case SIR_MAC_MGMT_REASSOC_REQ: |
| 751 | // Make sure the role supports Reassociation |
| 752 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 753 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 754 | ){ |
| 755 | limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry); |
| 756 | } |
| 757 | else |
| 758 | { |
| 759 | // Unwanted messages - Log error |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 760 | limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 761 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 762 | } |
| 763 | break; |
| 764 | |
| 765 | case SIR_MAC_MGMT_REASSOC_RSP: |
| 766 | limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry); |
| 767 | break; |
| 768 | |
| 769 | case SIR_MAC_MGMT_PROBE_REQ: |
| 770 | limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry); |
| 771 | break; |
| 772 | |
| 773 | case SIR_MAC_MGMT_PROBE_RSP: |
| 774 | if(psessionEntry == NULL) |
| 775 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 776 | else |
| 777 | limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry); |
| 778 | break; |
| 779 | |
| 780 | case SIR_MAC_MGMT_BEACON: |
| 781 | __limHandleBeacon(pMac, limMsg,psessionEntry); |
| 782 | break; |
| 783 | |
| 784 | case SIR_MAC_MGMT_DISASSOC: |
| 785 | limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry); |
| 786 | break; |
| 787 | |
| 788 | case SIR_MAC_MGMT_AUTH: |
| 789 | limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry); |
| 790 | break; |
| 791 | |
| 792 | case SIR_MAC_MGMT_DEAUTH: |
| 793 | limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry); |
| 794 | break; |
| 795 | |
| 796 | case SIR_MAC_MGMT_ACTION: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 797 | if(psessionEntry == NULL) |
| 798 | limProcessActionFrameNoSession(pMac, pRxPacketInfo); |
| 799 | else |
| 800 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 801 | if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo)) |
| 802 | limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry); |
| 803 | else |
| 804 | limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 805 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 806 | break; |
| 807 | default: |
| 808 | // Received Management frame of 'reserved' subtype |
| 809 | break; |
| 810 | } // switch (fc.subType) |
| 811 | |
| 812 | } |
| 813 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 814 | case SIR_MAC_DATA_FRAME: |
| 815 | { |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 816 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 817 | /* |
| 818 | * if we reach here, following cases are possible. |
| 819 | * Possible cases: a) if frame translation is disabled. |
| 820 | * b) Some frame with ADRR2 filter enabled may come |
| 821 | * here. |
| 822 | */ |
| 823 | tANI_U8 *dataOffset = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 824 | tANI_U8 *rfc1042Hdr = (tANI_U8 *)(dataOffset + RFC1042_HDR_LENGTH) ; |
| 825 | tANI_U16 ethType = GET_BE16(rfc1042Hdr) ; |
| 826 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 827 | ("TDLS frame with 80211 Header")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 828 | if(ETH_TYPE_89_0d == ethType) |
| 829 | { |
| 830 | tANI_U8 payloadType = (rfc1042Hdr + ETH_TYPE_LEN)[0] ; |
| 831 | if(PAYLOAD_TYPE_TDLS == payloadType) |
| 832 | { |
| 833 | limProcessTdlsFrame(pMac, (tANI_U32*)pRxPacketInfo) ; |
| 834 | } |
| 835 | } |
| 836 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 837 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 838 | /* We accept data frame (IAPP frame) only if Session is |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 839 | * present and ese connection is established on that |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 840 | * session |
| 841 | */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 842 | if (psessionEntry && psessionEntry->isESEconnection) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 843 | limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry); |
| 844 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 845 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 846 | } |
| 847 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 848 | default: |
| 849 | // Received frame of type 'reserved' |
| 850 | break; |
| 851 | |
| 852 | } // switch (fc.type) |
| 853 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 854 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 855 | end: |
| 856 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 857 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ; |
| 858 | return; |
| 859 | } /*** end limHandle80211Frames() ***/ |
| 860 | |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 861 | /** |
| 862 | * limSendStopScanOffloadReq() |
| 863 | * |
| 864 | *FUNCTION: |
| 865 | * This function will be called to abort the ongoing offloaded scan |
| 866 | * request. |
| 867 | * |
| 868 | * |
| 869 | *NOTE: |
| 870 | * |
| 871 | * @param pMac Pointer to Global MAC structure |
| 872 | * @return eHAL_STATUS_SUCCESS or eHAL_STATUS_FAILURE |
| 873 | */ |
| 874 | eHalStatus limSendStopScanOffloadReq(tpAniSirGlobal pMac, tANI_U8 SessionId) |
| 875 | { |
| 876 | tSirMsgQ msg; |
| 877 | tSirRetStatus rc = eSIR_SUCCESS; |
| 878 | tAbortScanParams *pAbortScanParams; |
| 879 | |
Kiet Lam | b123319 | 2013-11-28 13:38:20 +0530 | [diff] [blame] | 880 | pAbortScanParams = vos_mem_malloc(sizeof(tAbortScanParams)); |
| 881 | if (NULL == pAbortScanParams) |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 882 | { |
| 883 | limLog(pMac, LOGP, FL("Memory allocation failed for AbortScanParams")); |
| 884 | return eHAL_STATUS_FAILURE; |
| 885 | } |
| 886 | |
| 887 | pAbortScanParams->SessionId = SessionId; |
| 888 | msg.type = WDA_STOP_SCAN_OFFLOAD_REQ; |
| 889 | msg.bodyptr = pAbortScanParams; |
| 890 | msg.bodyval = 0; |
| 891 | |
| 892 | rc = wdaPostCtrlMsg(pMac, &msg); |
| 893 | if (rc != eSIR_SUCCESS) |
| 894 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 895 | limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure")); |
Kiet Lam | b123319 | 2013-11-28 13:38:20 +0530 | [diff] [blame] | 896 | vos_mem_free(pAbortScanParams); |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 897 | return eHAL_STATUS_FAILURE; |
| 898 | } |
| 899 | |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 900 | limLog(pMac, LOG1, FL("Abort ongoing offload scan.")); |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 901 | return eHAL_STATUS_SUCCESS; |
| 902 | |
| 903 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 904 | |
| 905 | /** |
| 906 | * limProcessAbortScanInd() |
| 907 | * |
| 908 | *FUNCTION: |
| 909 | * This function is called from HDD to abort the scan which is presently being run |
| 910 | * |
| 911 | * |
| 912 | *NOTE: |
| 913 | * |
| 914 | * @param pMac Pointer to Global MAC structure |
| 915 | * @param *pMsgBuf A pointer to the SME message buffer |
| 916 | * @return None |
| 917 | */ |
| 918 | void |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 919 | limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 920 | { |
| 921 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 922 | limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0); |
| 923 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 924 | |
| 925 | /* Deactivate the gLimBackgroundScanTimer as part of the abort scan. |
| 926 | * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication |
| 927 | * to start the background scan again |
| 928 | */ |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 929 | PELOG2(limLog(pMac, LOG2, FL("Processing AbortScan Ind"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 930 | |
| 931 | limAbortBackgroundScan(pMac); |
| 932 | |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 933 | if (pMac->fScanOffload) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 934 | { |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 935 | /* send stop scan cmd to fw if scan offload is enabled. */ |
| 936 | limSendStopScanOffloadReq(pMac, SessionId); |
| 937 | } |
| 938 | else |
| 939 | { |
| 940 | /* Abort the scan if its running, else just return */ |
| 941 | if(limIsSystemInScanState(pMac)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 942 | { |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 943 | if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 944 | (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 945 | (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 946 | (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) ) |
| 947 | { |
| 948 | //Simply signal we need to abort |
| 949 | limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState ); |
| 950 | pMac->lim.abortScan = 1; |
| 951 | } |
| 952 | else |
| 953 | { |
| 954 | //Force abort |
| 955 | limLog( pMac, LOGW, FL(" Force aborting scan") ); |
| 956 | pMac->lim.abortScan = 0; |
| 957 | limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); |
| 958 | limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); |
| 959 | //Set the resume channel to Any valid channel (invalid). |
| 960 | //This will instruct HAL to set it to any previous valid channel. |
| 961 | peSetResumeChannel(pMac, 0, 0); |
| 962 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 963 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 964 | } |
| 965 | } |
| 966 | return; |
| 967 | } |
| 968 | |
| 969 | /** |
| 970 | * limMessageProcessor |
| 971 | * |
| 972 | *FUNCTION: |
| 973 | * Wrapper function for limProcessMessages when handling messages received by LIM. |
| 974 | * Could either defer messages or process them. |
| 975 | * @param pMac Pointer to Global MAC structure |
| 976 | * @param limMsg Received LIM message |
| 977 | * @return None |
| 978 | */ |
| 979 | |
| 980 | void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 981 | { |
| 982 | if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState) |
| 983 | { |
| 984 | peFreeMsg(pMac, limMsg); |
| 985 | return; |
| 986 | } |
| 987 | |
| 988 | if (!defMsgDecision(pMac, limMsg)) |
| 989 | { |
| 990 | limProcessMessages(pMac, limMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 991 | // process deferred message queue if allowed |
| 992 | { |
| 993 | if ( (! (pMac->lim.gLimAddtsSent)) |
| 994 | && |
| 995 | (! (limIsSystemInScanState(pMac))) |
| 996 | ) |
| 997 | { |
| 998 | if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 999 | limProcessDeferredMessageQueue(pMac); |
| 1000 | } |
| 1001 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1002 | } |
| 1003 | } |
| 1004 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1005 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1006 | |
| 1007 | void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp) |
| 1008 | { |
| 1009 | if(status != eHAL_STATUS_SUCCESS) |
| 1010 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1011 | limLog(pMac, LOGE, FL("OEM Data Rsp failed to get the response for resume link")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1012 | } |
| 1013 | |
| 1014 | if(NULL != pMac->lim.gpLimMlmOemDataReq) |
| 1015 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1016 | vos_mem_free(pMac->lim.gpLimMlmOemDataReq); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1017 | pMac->lim.gpLimMlmOemDataReq = NULL; |
| 1018 | } |
| 1019 | |
| 1020 | //"Failure" status doesn't mean that Oem Data Rsp did not happen |
| 1021 | //and hence we need to respond to upper layers. Only Resume link is failed, but |
| 1022 | //we got the oem data response already. |
| 1023 | //Post the meessage to MLM |
| 1024 | limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp)); |
| 1025 | |
| 1026 | return; |
| 1027 | } |
| 1028 | |
| 1029 | void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body) |
| 1030 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1031 | tpLimMlmOemDataRsp mlmOemDataRsp = NULL; |
| 1032 | tpStartOemDataRsp oemDataRsp = NULL; |
| 1033 | |
| 1034 | //Process all the messages for the lim queue |
| 1035 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 1036 | |
| 1037 | oemDataRsp = (tpStartOemDataRsp)(body); |
| 1038 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1039 | mlmOemDataRsp = vos_mem_malloc(sizeof(tLimMlmOemDataRsp)); |
| 1040 | if ( NULL == mlmOemDataRsp ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1041 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1042 | limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1043 | return; |
| 1044 | } |
| 1045 | |
| 1046 | //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp |
| 1047 | //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1048 | vos_mem_copy((void*)(mlmOemDataRsp), (void*)(oemDataRsp), |
| 1049 | sizeof(tLimMlmOemDataRsp)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1050 | |
| 1051 | //Now free the incoming memory |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1052 | vos_mem_free(oemDataRsp); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1053 | |
| 1054 | limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp); |
| 1055 | |
| 1056 | return; |
| 1057 | } |
| 1058 | |
| 1059 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1060 | |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 1061 | static tANI_BOOLEAN limAgeOutProbeReq( tpAniSirGlobal pMac, tpSirMsgQ limMsg, |
| 1062 | vos_pkt_t *pVosPkt ) |
| 1063 | { |
| 1064 | tANI_U8 *pRxPacketInfo = NULL; |
| 1065 | tSirMacFrameCtl fc; |
| 1066 | tpSirMacMgmtHdr pHdr=NULL; |
| 1067 | tANI_BOOLEAN match = VOS_FALSE; |
| 1068 | |
| 1069 | limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo); |
| 1070 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1071 | fc = pHdr->fc; |
| 1072 | if ( fc.subType == SIR_MAC_MGMT_PROBE_REQ ) |
| 1073 | { |
| 1074 | if( vos_timer_get_system_ticks() - pVosPkt->timestamp >= MAX_PROBEREQ_TIME ) |
| 1075 | { |
| 1076 | // drop packet |
| 1077 | limLog(pMac, LOGE, |
| 1078 | FL("Dropping Aged Out probe requests. Peer MAC is "MAC_ADDRESS_STR), |
| 1079 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 1080 | |
| 1081 | vos_pkt_return_packet(pVosPkt); |
| 1082 | match = VOS_TRUE; |
| 1083 | } |
| 1084 | } |
| 1085 | return match; |
| 1086 | } |
| 1087 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1088 | |
| 1089 | /** |
| 1090 | * limProcessMessages |
| 1091 | * |
| 1092 | *FUNCTION: |
| 1093 | * This function is called by limProcessMessageQueue function. This |
| 1094 | * function processes messages received by LIM. |
| 1095 | * |
| 1096 | *LOGIC: |
| 1097 | * Depending on the message type, corresponding function will be |
| 1098 | * called, for example limProcessSmeMessages() will be called to |
| 1099 | * process SME messages received from HDD/Upper layer software module. |
| 1100 | * |
| 1101 | *ASSUMPTIONS: |
| 1102 | * NA |
| 1103 | * |
| 1104 | *NOTE: |
| 1105 | * NA |
| 1106 | * |
| 1107 | * @param pMac Pointer to Global MAC structure |
| 1108 | * @param limMsg Received LIM message |
| 1109 | * @return None |
| 1110 | */ |
| 1111 | |
| 1112 | void |
| 1113 | limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1114 | { |
| 1115 | tANI_U8 deferMsg = false; |
| 1116 | tLinkStateParams *linkStateParams; |
| 1117 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1118 | tpPESession pSession; |
| 1119 | #endif |
| 1120 | #if defined(ANI_DVT_DEBUG) |
| 1121 | tSirMsgQ msgQ; |
| 1122 | #endif |
| 1123 | if(pMac->gDriverType == eDRIVER_TYPE_MFG) |
| 1124 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1125 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1126 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1127 | return; |
| 1128 | } |
| 1129 | #ifdef WLAN_DEBUG |
| 1130 | pMac->lim.numTot++; |
| 1131 | #endif |
| 1132 | |
| 1133 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1134 | PELOG3(limLog(pMac, LOG3, FL("rcvd msgType = %s, sme state = %s, mlm state = %s"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1135 | limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState), |
| 1136 | limMlmStateStr(pMac->lim.gLimMlmState));) |
| 1137 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1138 | MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1139 | |
| 1140 | switch (limMsg->type) |
| 1141 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1142 | |
| 1143 | case SIR_LIM_UPDATE_BEACON: |
| 1144 | limUpdateBeacon(pMac); |
| 1145 | break; |
| 1146 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1147 | case SIR_CFG_PARAM_UPDATE_IND: |
| 1148 | /// CFG parameter updated |
| 1149 | if (limIsSystemInScanState(pMac)) |
| 1150 | { |
| 1151 | // System is in DFS (Learn) mode |
| 1152 | // Defer processsing this message |
| 1153 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1154 | { |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1155 | if(!(pMac->lim.deferredMsgCnt & 0xF)) |
| 1156 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1157 | 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)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1158 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1159 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1160 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1161 | limLogSessionStates(pMac); |
| 1162 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1163 | } |
| 1164 | } |
| 1165 | else |
| 1166 | { |
| 1167 | limHandleCFGparamUpdate(pMac, limMsg->bodyval); |
| 1168 | } |
| 1169 | |
| 1170 | break; |
| 1171 | |
| 1172 | case WDA_INIT_SCAN_RSP: |
| 1173 | limProcessInitScanRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1174 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1175 | break; |
| 1176 | |
| 1177 | case WDA_START_SCAN_RSP: |
| 1178 | limProcessStartScanRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1179 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1180 | break; |
| 1181 | |
| 1182 | case WDA_END_SCAN_RSP: |
| 1183 | limProcessEndScanRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1184 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1185 | break; |
| 1186 | |
| 1187 | case WDA_FINISH_SCAN_RSP: |
| 1188 | limProcessFinishScanRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1189 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1190 | break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1191 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1192 | case WDA_START_OEM_DATA_RSP: |
| 1193 | limProcessOemDataRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1194 | limMsg->bodyptr = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1195 | break; |
| 1196 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1197 | |
| 1198 | case WDA_SWITCH_CHANNEL_RSP: |
| 1199 | limProcessSwitchChannelRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1200 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1201 | break; |
| 1202 | |
| 1203 | #ifdef ANI_SIR_IBSS_PEER_CACHING |
| 1204 | case WDA_IBSS_STA_ADD: |
| 1205 | limIbssStaAdd(pMac, limMsg->bodyptr); |
| 1206 | break; |
| 1207 | #endif |
| 1208 | case SIR_BB_XPORT_MGMT_MSG: |
| 1209 | // These messages are from Peer MAC entity. |
| 1210 | #ifdef WLAN_DEBUG |
| 1211 | pMac->lim.numBbt++; |
| 1212 | #endif |
| 1213 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1214 | { |
| 1215 | v_U16_t pktLen = 0; |
| 1216 | vos_pkt_t *pVosPkt; |
| 1217 | VOS_STATUS vosStatus; |
| 1218 | tSirMsgQ limMsgNew; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1219 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 1220 | tANI_U32 *pBD = NULL ; |
| 1221 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1222 | |
| 1223 | /* The original limMsg which we were deferring have the |
| 1224 | * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy |
| 1225 | * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer. |
| 1226 | * and next time when we try to process the msg, we will try to use 'BD' as |
| 1227 | * 'Vos Pkt' which will cause a crash |
| 1228 | */ |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1229 | vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg, |
| 1230 | sizeof(tSirMsgQ)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1231 | pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr; |
| 1232 | vos_pkt_get_packet_length(pVosPkt, &pktLen); |
| 1233 | |
| 1234 | vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE ); |
| 1235 | |
| 1236 | if( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 1237 | { |
| 1238 | vos_pkt_return_packet(pVosPkt); |
| 1239 | break; |
| 1240 | |
| 1241 | } |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 1242 | |
| 1243 | /* |
| 1244 | * putting a check for age out probe request frames |
| 1245 | * such that any probe req more than 0.5 sec old can directly |
| 1246 | * be dropped. With this, there won't be blocking of MC thread. |
| 1247 | */ |
| 1248 | |
| 1249 | if( limAgeOutProbeReq ( pMac, &limMsgNew, pVosPkt )) |
| 1250 | { |
| 1251 | break; |
| 1252 | } |
| 1253 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1254 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 1255 | /* |
| 1256 | * TDLS frames comes as translated frames as well as |
| 1257 | * MAC 802.11 data frames.. |
| 1258 | */ |
| 1259 | limGetBDfromRxPacket(pMac, limMsgNew.bodyptr, &pBD); |
| 1260 | if(0 != WDA_GET_RX_FT_DONE(pBD)) |
| 1261 | { |
| 1262 | /* |
| 1263 | * TODO: check for scanning state and set deferMesg flag |
| 1264 | * accordingly.. |
| 1265 | */ |
| 1266 | deferMsg = false ; |
| 1267 | |
| 1268 | limProcessTdlsFrame(pMac, pBD) ; |
| 1269 | } |
| 1270 | else |
| 1271 | #endif |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 1272 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1273 | limHandle80211Frames(pMac, &limMsgNew, &deferMsg); |
| 1274 | |
| 1275 | if ( deferMsg == true ) |
| 1276 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1277 | PELOG1(limLog(pMac, LOG1, FL("Defer message type=%X "), limMsg->type);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1278 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1279 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1280 | 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)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1281 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1282 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 1283 | limLogSessionStates(pMac); |
| 1284 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1285 | vos_pkt_return_packet(pVosPkt); |
| 1286 | } |
| 1287 | } |
| 1288 | else |
| 1289 | { |
| 1290 | /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return. |
| 1291 | * Asumption here is when Rx mgmt frame processing is done, |
| 1292 | * voss packet could be freed here. |
| 1293 | */ |
| 1294 | vos_pkt_return_packet(pVosPkt); |
| 1295 | } |
| 1296 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1297 | break; |
| 1298 | |
| 1299 | case eWNI_SME_SCAN_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1300 | case eWNI_SME_REMAIN_ON_CHANNEL_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1301 | case eWNI_SME_DISASSOC_REQ: |
| 1302 | case eWNI_SME_DEAUTH_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1303 | case eWNI_SME_GET_SCANNED_CHANNEL_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1304 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1305 | case eWNI_SME_OEM_DATA_REQ: |
| 1306 | #endif |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1307 | #ifdef FEATURE_WLAN_TDLS |
| 1308 | case eWNI_SME_TDLS_SEND_MGMT_REQ: |
| 1309 | case eWNI_SME_TDLS_ADD_STA_REQ: |
| 1310 | case eWNI_SME_TDLS_DEL_STA_REQ: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1311 | case eWNI_SME_TDLS_LINK_ESTABLISH_REQ: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1312 | #endif |
| 1313 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 1314 | case eWNI_SME_TDLS_DISCOVERY_START_REQ: |
| 1315 | case eWNI_SME_TDLS_LINK_START_REQ: |
| 1316 | case eWNI_SME_TDLS_TEARDOWN_REQ: |
| 1317 | #endif |
Gopichand Nakkala | cca24d1 | 2013-03-07 17:05:07 +0530 | [diff] [blame] | 1318 | case eWNI_SME_RESET_AP_CAPS_CHANGED: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1319 | // These messages are from HDD |
| 1320 | limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd |
| 1321 | break; |
| 1322 | |
| 1323 | case eWNI_SME_SCAN_ABORT_IND: |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1324 | { |
| 1325 | tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr; |
| 1326 | limProcessAbortScanInd(pMac, *pSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1327 | vos_mem_free((v_VOID_t *)limMsg->bodyptr); |
| 1328 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1329 | break; |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1330 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1331 | case eWNI_SME_START_REQ: |
| 1332 | case eWNI_SME_SYS_READY_IND: |
| 1333 | #ifndef WNI_ASKEY_NON_SUPPORT_FEATURE |
| 1334 | case eWNI_SME_JOIN_REQ: |
| 1335 | #endif |
| 1336 | case eWNI_SME_AUTH_REQ: |
| 1337 | case eWNI_SME_REASSOC_REQ: |
| 1338 | case eWNI_SME_START_BSS_REQ: |
| 1339 | case eWNI_SME_STOP_BSS_REQ: |
| 1340 | case eWNI_SME_SWITCH_CHL_REQ: |
| 1341 | case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ: |
| 1342 | case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ: |
| 1343 | case eWNI_SME_SETCONTEXT_REQ: |
| 1344 | case eWNI_SME_REMOVEKEY_REQ: |
| 1345 | #ifndef WNI_ASKEY_NON_SUPPORT_FEATURE |
| 1346 | case eWNI_SME_PROMISCUOUS_MODE_REQ: |
| 1347 | #endif |
| 1348 | case eWNI_SME_DISASSOC_CNF: |
| 1349 | case eWNI_SME_DEAUTH_CNF: |
| 1350 | case eWNI_SME_ASSOC_CNF: |
| 1351 | case eWNI_SME_REASSOC_CNF: |
| 1352 | case eWNI_SME_ADDTS_REQ: |
| 1353 | case eWNI_SME_DELTS_REQ: |
| 1354 | case eWNI_SME_DEL_BA_PEER_IND: |
| 1355 | case eWNI_SME_SET_TX_POWER_REQ: |
| 1356 | case eWNI_SME_GET_TX_POWER_REQ: |
| 1357 | case eWNI_SME_GET_NOISE_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1358 | case eWNI_SME_GET_ASSOC_STAS_REQ: |
| 1359 | case eWNI_SME_TKIP_CNTR_MEAS_REQ: |
| 1360 | case eWNI_SME_UPDATE_APWPSIE_REQ: |
| 1361 | case eWNI_SME_HIDE_SSID_REQ: |
| 1362 | case eWNI_SME_GET_WPSPBC_SESSION_REQ: |
| 1363 | case eWNI_SME_SET_APWPARSNIEs_REQ: |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 1364 | case eWNI_SME_CHNG_MCC_BEACON_INTERVAL: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1365 | #if defined WLAN_FEATURE_VOWIFI |
| 1366 | case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: |
| 1367 | case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND: |
| 1368 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1369 | #if defined FEATURE_WLAN_ESE |
| 1370 | case eWNI_SME_ESE_ADJACENT_AP_REPORT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1371 | #endif |
| 1372 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1373 | case eWNI_SME_FT_UPDATE_KEY: |
| 1374 | case eWNI_SME_FT_PRE_AUTH_REQ: |
| 1375 | case eWNI_SME_FT_AGGR_QOS_REQ: |
| 1376 | #endif |
| 1377 | case eWNI_SME_ADD_STA_SELF_REQ: |
| 1378 | case eWNI_SME_DEL_STA_SELF_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1379 | case eWNI_SME_REGISTER_MGMT_FRAME_REQ: |
| 1380 | case eWNI_SME_UPDATE_NOA: |
Gopichand Nakkala | c178ac8 | 2013-05-30 19:53:39 +0530 | [diff] [blame] | 1381 | case eWNI_SME_CLEAR_DFS_CHANNEL_LIST: |
Madan Mohan Koyyalamudi | 44bbc15 | 2013-07-05 21:13:10 +0530 | [diff] [blame] | 1382 | case eWNI_SME_STA_STAT_REQ: |
| 1383 | case eWNI_SME_AGGR_STAT_REQ: |
| 1384 | case eWNI_SME_GLOBAL_STAT_REQ: |
| 1385 | case eWNI_SME_STAT_SUMM_REQ: |
| 1386 | case eWNI_SME_GET_STATISTICS_REQ: |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1387 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Madan Mohan Koyyalamudi | 44bbc15 | 2013-07-05 21:13:10 +0530 | [diff] [blame] | 1388 | case eWNI_SME_GET_ROAM_RSSI_REQ: |
| 1389 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1390 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1391 | case eWNI_SME_GET_TSM_STATS_REQ: |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1392 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1393 | // These messages are from HDD |
| 1394 | limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd |
| 1395 | break; |
| 1396 | |
| 1397 | //Power Save Messages From HDD |
| 1398 | case eWNI_PMC_PWR_SAVE_CFG: |
| 1399 | case eWNI_PMC_ENTER_BMPS_REQ: |
| 1400 | case eWNI_PMC_EXIT_BMPS_REQ: |
| 1401 | case eWNI_PMC_ENTER_IMPS_REQ: |
| 1402 | case eWNI_PMC_EXIT_IMPS_REQ: |
| 1403 | case eWNI_PMC_ENTER_UAPSD_REQ: |
| 1404 | case eWNI_PMC_EXIT_UAPSD_REQ: |
| 1405 | case eWNI_PMC_ENTER_WOWL_REQ: |
| 1406 | case eWNI_PMC_EXIT_WOWL_REQ: |
| 1407 | case eWNI_PMC_WOWL_ADD_BCAST_PTRN: |
| 1408 | case eWNI_PMC_WOWL_DEL_BCAST_PTRN: |
| 1409 | pmmProcessMessage(pMac, limMsg); |
| 1410 | break; |
| 1411 | |
| 1412 | case eWNI_PMC_SMPS_STATE_IND : |
| 1413 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1414 | if(limMsg->bodyptr){ |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1415 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1416 | limMsg->bodyptr = NULL; |
| 1417 | } |
| 1418 | } |
| 1419 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1420 | case eWNI_SME_SEND_ACTION_FRAME_IND: |
| 1421 | limSendP2PActionFrame(pMac, limMsg); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1422 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1423 | limMsg->bodyptr = NULL; |
| 1424 | break; |
| 1425 | case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND: |
| 1426 | limAbortRemainOnChan(pMac); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1427 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1428 | limMsg->bodyptr = NULL; |
| 1429 | break; |
| 1430 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1431 | case SIR_HAL_P2P_NOA_START_IND: |
| 1432 | { |
| 1433 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 1434 | tANI_U8 i; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1435 | tANI_U8 p2pGOExists = 0; |
Gopichand Nakkala | 78a6c81 | 2013-05-13 16:39:49 +0530 | [diff] [blame] | 1436 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1437 | limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1438 | |
| 1439 | /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */ |
| 1440 | limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER); |
| 1441 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1442 | for(i=0; i < pMac->lim.maxBssId; i++) |
| 1443 | { |
| 1444 | psessionEntry = &pMac->lim.gpSession[i]; |
| 1445 | if ( (psessionEntry != NULL) && (psessionEntry->valid) && |
| 1446 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 1447 | { //Save P2P NOA start attributes for P2P Go persona |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1448 | p2pGOExists = 1; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1449 | vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr, |
| 1450 | sizeof(tSirP2PNoaStart)); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1451 | if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS) |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1452 | { |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1453 | limLog(pMac, LOGW, FL("GO NOA start failure status %d reported by FW." |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1454 | " - still go ahead with deferred sme req. This is just info"), |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1455 | psessionEntry->p2pGoPsNoaStartInd.status); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1456 | } |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1457 | break; |
| 1458 | } |
| 1459 | } |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1460 | |
| 1461 | if (p2pGOExists == 0) |
| 1462 | { |
| 1463 | limLog(pMac, LOGW, FL("By the time, we received NOA start, GO is already removed." |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1464 | " - still go ahead with deferred sme req. This is just info")); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1465 | } |
| 1466 | |
| 1467 | /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */ |
| 1468 | limProcessRegdDefdSmeReqAfterNOAStart(pMac); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1469 | vos_mem_free(limMsg->bodyptr); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1470 | limMsg->bodyptr = NULL; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1471 | } |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1472 | break; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1473 | #ifdef FEATURE_WLAN_TDLS |
| 1474 | case SIR_HAL_TDLS_IND: |
| 1475 | { |
| 1476 | tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ; |
| 1477 | tpDphHashNode pStaDs = NULL ; |
| 1478 | tpPESession psessionEntry = NULL; |
| 1479 | tANI_U8 sessionId; |
| 1480 | if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL) |
| 1481 | { |
| 1482 | limLog(pMac, LOG1, FL("session does not exist for given bssId\n")); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1483 | vos_mem_free(limMsg->bodyptr); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1484 | limMsg->bodyptr = NULL; |
| 1485 | return; |
| 1486 | } |
| 1487 | if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL) |
| 1488 | { |
| 1489 | limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n")); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1490 | vos_mem_free(limMsg->bodyptr); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1491 | limMsg->bodyptr = NULL; |
| 1492 | return; |
| 1493 | } |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1494 | |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1495 | if ((STA_ENTRY_TDLS_PEER == pStaDs->staType)) |
| 1496 | { |
| 1497 | limLog(pMac, LOGE, |
| 1498 | FL("received TDLS Indication from the Firmware with Reason Code %d "), |
| 1499 | pTdlsInd->reasonCode); |
| 1500 | limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry, |
Gopichand Nakkala | 574f6d1 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 1501 | pTdlsInd->reasonCode); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1502 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1503 | vos_mem_free(limMsg->bodyptr); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1504 | limMsg->bodyptr = NULL; |
| 1505 | } |
| 1506 | break; |
| 1507 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1508 | case SIR_HAL_P2P_NOA_ATTR_IND: |
| 1509 | { |
| 1510 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 1511 | tANI_U8 i; |
| 1512 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1513 | limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1514 | for(i=0; i < pMac->lim.maxBssId; i++) |
| 1515 | { |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1516 | psessionEntry = &pMac->lim.gpSession[i]; |
| 1517 | if ( (psessionEntry != NULL) && (psessionEntry->valid) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1518 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 1519 | { //Save P2P attributes for P2P Go persona |
| 1520 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1521 | vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr, |
| 1522 | sizeof(tSirP2PNoaAttr)); |
| 1523 | |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1524 | limLog(pMac, LOG2, FL(" &psessionEntry->bssId " |
| 1525 | MAC_ADDRESS_STR " ctWin=%d oppPsFlag=%d"), |
| 1526 | MAC_ADDR_ARRAY(psessionEntry->bssId), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1527 | psessionEntry->p2pGoPsUpdate.ctWin, |
| 1528 | psessionEntry->p2pGoPsUpdate.oppPsFlag); |
| 1529 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1530 | limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1531 | psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt, |
| 1532 | psessionEntry->p2pGoPsUpdate.uNoa1Duration, |
| 1533 | psessionEntry->p2pGoPsUpdate.uNoa1Interval, |
| 1534 | psessionEntry->p2pGoPsUpdate.uNoa1StartTime); |
| 1535 | |
| 1536 | |
| 1537 | break; |
| 1538 | } |
| 1539 | } |
| 1540 | |
| 1541 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1542 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1543 | limMsg->bodyptr = NULL; |
| 1544 | |
| 1545 | break; |
| 1546 | |
| 1547 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1548 | /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the |
| 1549 | * device comes out of full power for the full power request sent |
| 1550 | * because of channel switch with switch count as 0, so call the same |
| 1551 | * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT) |
| 1552 | * for switching the channel*/ |
| 1553 | case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1554 | if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) ) |
| 1555 | { |
| 1556 | limProcessChannelSwitchTimeout(pMac); |
| 1557 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1558 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1559 | limMsg->bodyptr = NULL; |
| 1560 | break; |
| 1561 | |
| 1562 | //Power Save Related Messages From HAL |
| 1563 | case WDA_ENTER_BMPS_RSP: |
| 1564 | case WDA_EXIT_BMPS_RSP: |
| 1565 | case WDA_EXIT_BMPS_IND: |
| 1566 | case WDA_ENTER_IMPS_RSP: |
| 1567 | case WDA_EXIT_IMPS_RSP: |
| 1568 | case WDA_ENTER_UAPSD_RSP: |
| 1569 | case WDA_EXIT_UAPSD_RSP: |
| 1570 | case WDA_WOWL_ENTER_RSP: |
| 1571 | case WDA_WOWL_EXIT_RSP: |
| 1572 | pmmProcessMessage(pMac, limMsg); |
| 1573 | break; |
| 1574 | |
| 1575 | case WDA_LOW_RSSI_IND: |
| 1576 | //limHandleLowRssiInd(pMac); |
| 1577 | break; |
| 1578 | |
| 1579 | case WDA_BMPS_STATUS_IND: |
| 1580 | limHandleBmpsStatusInd(pMac); |
| 1581 | break; |
| 1582 | |
| 1583 | case WDA_MISSED_BEACON_IND: |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 1584 | limHandleMissedBeaconInd(pMac, limMsg); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1585 | vos_mem_free(limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 1586 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1587 | break; |
| 1588 | case WDA_MIC_FAILURE_IND: |
| 1589 | limMicFailureInd(pMac, limMsg); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1590 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1591 | limMsg->bodyptr = NULL; |
| 1592 | break; |
| 1593 | |
| 1594 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1595 | |
| 1596 | case SIR_LIM_ADDTS_RSP_TIMEOUT: |
| 1597 | limProcessSmeReqMessages(pMac,limMsg); |
| 1598 | break; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1599 | #ifdef FEATURE_WLAN_ESE |
| 1600 | case SIR_LIM_ESE_TSM_TIMEOUT: |
| 1601 | #ifndef FEATURE_WLAN_ESE_UPLOAD |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1602 | limProcessTsmTimeoutHandler(pMac,limMsg); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1603 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1604 | break; |
| 1605 | case WDA_TSM_STATS_RSP: |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1606 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
| 1607 | limSendSmePEEseTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1608 | #else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1609 | limProcessHalEseTsmRsp(pMac, limMsg); |
| 1610 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1611 | break; |
| 1612 | #endif |
| 1613 | case WDA_ADD_TS_RSP: |
| 1614 | limProcessHalAddTsRsp(pMac, limMsg); |
| 1615 | break; |
| 1616 | |
| 1617 | case SIR_LIM_DEL_TS_IND: |
| 1618 | limProcessDelTsInd(pMac, limMsg); |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 1619 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1620 | case SIR_LIM_ADD_BA_IND: |
| 1621 | limProcessAddBaInd(pMac, limMsg); |
| 1622 | break; |
| 1623 | case SIR_LIM_DEL_BA_ALL_IND: |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1624 | limDelAllBASessions(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1625 | break; |
| 1626 | case SIR_LIM_DEL_BA_IND: |
| 1627 | limProcessMlmHalBADeleteInd( pMac, limMsg ); |
| 1628 | break; |
| 1629 | |
| 1630 | case SIR_LIM_BEACON_GEN_IND: { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1631 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1632 | if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1633 | schProcessPreBeaconInd(pMac, limMsg); |
| 1634 | |
| 1635 | } |
| 1636 | break; |
| 1637 | |
| 1638 | case SIR_LIM_DELETE_STA_CONTEXT_IND: |
| 1639 | limDeleteStaContext(pMac, limMsg); |
| 1640 | break; |
| 1641 | |
| 1642 | case SIR_LIM_MIN_CHANNEL_TIMEOUT: |
| 1643 | case SIR_LIM_MAX_CHANNEL_TIMEOUT: |
| 1644 | case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT: |
| 1645 | case SIR_LIM_JOIN_FAIL_TIMEOUT: |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 1646 | case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1654 | case SIR_LIM_REMAIN_CHN_TIMEOUT: |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1655 | case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT: |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1656 | case SIR_LIM_DISASSOC_ACK_TIMEOUT: |
| 1657 | case SIR_LIM_DEAUTH_ACK_TIMEOUT: |
Gopichand Nakkala | d492d20 | 2013-05-10 02:50:47 +0530 | [diff] [blame] | 1658 | case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1659 | // These timeout messages are handled by MLM sub module |
| 1660 | |
| 1661 | limProcessMlmReqMessages(pMac, |
| 1662 | limMsg); |
| 1663 | |
| 1664 | break; |
| 1665 | |
| 1666 | case SIR_LIM_HEART_BEAT_TIMEOUT: |
| 1667 | /** check if heart beat failed, even if one Beacon |
| 1668 | * is rcvd within the Heart Beat interval continue |
| 1669 | * normal processing |
| 1670 | */ |
| 1671 | |
| 1672 | #if 0 |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1673 | PELOG1(limLog(pMac, LOG1, FL("Heartbeat timeout, SME %d, MLME %d, #bcn %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1674 | pMac->lim.gLimSmeState, pMac->lim.gLimMlmState, |
| 1675 | pMac->lim.gLimRxedBeaconCntDuringHB);) |
| 1676 | |
| 1677 | if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE) |
| 1678 | limIbssHeartBeatHandle(pMac); //HeartBeat for peers. |
| 1679 | else |
| 1680 | /** |
| 1681 | * Heartbeat failure occurred on STA |
| 1682 | * This is handled by LMM sub module. |
| 1683 | */ |
| 1684 | limHandleHeartBeatFailure(pMac); |
| 1685 | |
| 1686 | break; |
| 1687 | #endif //TO SUPPORT BT-AMP |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1688 | if (limIsSystemInScanState(pMac)) |
| 1689 | { |
| 1690 | // System is in DFS (Learn) mode |
| 1691 | // Defer processsing this message |
| 1692 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1693 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1694 | 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)"), |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1695 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1696 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 1697 | limLogSessionStates(pMac); |
| 1698 | } |
| 1699 | } |
| 1700 | else |
| 1701 | { |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 1702 | if (NULL == limMsg->bodyptr) |
| 1703 | { |
| 1704 | limHandleHeartBeatTimeout(pMac); |
| 1705 | } |
| 1706 | else |
| 1707 | { |
| 1708 | limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr); |
| 1709 | } |
Gopichand Nakkala | 78a6c81 | 2013-05-13 16:39:49 +0530 | [diff] [blame] | 1710 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1711 | break; |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 1712 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1713 | case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT: |
| 1714 | limHandleHeartBeatFailureTimeout(pMac); |
| 1715 | break; |
| 1716 | |
| 1717 | case SIR_LIM_CHANNEL_SCAN_TIMEOUT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1718 | /** |
| 1719 | * Background scan timeout occurred on STA. |
| 1720 | * This is handled by LMM sub module. |
| 1721 | */ |
| 1722 | limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER); |
| 1723 | |
| 1724 | //We will do background scan even in bcnps mode |
| 1725 | //if (pMac->sys.gSysEnableScanMode) |
| 1726 | pMac->lim.gLimReportBackgroundScanResults = FALSE; |
| 1727 | limTriggerBackgroundScan(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1728 | break; |
| 1729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1730 | |
| 1731 | case SIR_LIM_HASH_MISS_THRES_TIMEOUT: |
| 1732 | |
| 1733 | /* |
| 1734 | ** clear the credit to the send disassociate frame bucket |
| 1735 | **/ |
| 1736 | |
| 1737 | pMac->lim.gLimDisassocFrameCredit = 0; |
| 1738 | break; |
| 1739 | |
| 1740 | case SIR_LIM_CNF_WAIT_TIMEOUT: |
| 1741 | |
| 1742 | /* |
| 1743 | ** Does not receive CNF or dummy packet |
| 1744 | **/ |
| 1745 | limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval); |
| 1746 | |
| 1747 | break; |
| 1748 | |
| 1749 | case SIR_LIM_KEEPALIVE_TIMEOUT: |
| 1750 | limSendKeepAliveToPeer(pMac); |
| 1751 | |
| 1752 | break; |
| 1753 | |
| 1754 | case SIR_LIM_RETRY_INTERRUPT_MSG: |
| 1755 | // Message from ISR upon TFP's max retry limit interrupt |
| 1756 | |
| 1757 | break; |
| 1758 | |
| 1759 | case SIR_LIM_INV_KEY_INTERRUPT_MSG: |
| 1760 | // Message from ISR upon SP's Invalid session key interrupt |
| 1761 | |
| 1762 | break; |
| 1763 | |
| 1764 | case SIR_LIM_KEY_ID_INTERRUPT_MSG: |
| 1765 | // Message from ISR upon SP's Invalid key ID interrupt |
| 1766 | |
| 1767 | break; |
| 1768 | |
| 1769 | case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG: |
| 1770 | // Message from ISR upon SP's Replay threshold interrupt |
| 1771 | |
| 1772 | break; |
| 1773 | |
| 1774 | case SIR_LIM_CHANNEL_SWITCH_TIMEOUT: |
| 1775 | limProcessChannelSwitchTimeout(pMac); |
| 1776 | break; |
| 1777 | |
| 1778 | case SIR_LIM_QUIET_TIMEOUT: |
| 1779 | limProcessQuietTimeout(pMac); |
| 1780 | break; |
| 1781 | |
| 1782 | case SIR_LIM_QUIET_BSS_TIMEOUT: |
| 1783 | limProcessQuietBssTimeout(pMac); |
| 1784 | break; |
| 1785 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1786 | case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT: |
| 1787 | limHandleUpdateOlbcCache(pMac); |
| 1788 | break; |
| 1789 | #if 0 |
| 1790 | case SIR_LIM_WPS_OVERLAP_TIMEOUT: |
| 1791 | limProcessWPSOverlapTimeout(pMac); |
| 1792 | break; |
| 1793 | #endif |
| 1794 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1795 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1796 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 1797 | /* |
| 1798 | * Here discovery timer expires, now we can go ahead and collect all |
| 1799 | * the dicovery responses PE has process till now and send this |
| 1800 | * responses to SME.. |
| 1801 | */ |
| 1802 | case SIR_LIM_TDLS_DISCOVERY_RSP_WAIT: |
| 1803 | { |
| 1804 | //fetch the sessionEntry based on the sessionId |
| 1805 | tpPESession psessionEntry = peFindSessionBySessionId(pMac, |
| 1806 | pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId) ; |
| 1807 | if(NULL == psessionEntry) |
| 1808 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1809 | limLog(pMac, LOGP,FL("Session Does not exist for given sessionID %d"), pMac->lim.limTimers.gLimTdlsDisRspWaitTimer.sessionId); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1810 | return; |
| 1811 | } |
| 1812 | |
| 1813 | VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1814 | ("Discovery Rsp timer expires ")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1815 | #if 0 // TDLS_hklee: D13 no need to open Addr2 unknown data packet |
| 1816 | /* restore RXP filters */ |
| 1817 | limSetLinkState(pMac, eSIR_LINK_FINISH_TDLS_DISCOVERY_STATE, |
| 1818 | psessionEntry->bssId) ; |
| 1819 | #endif |
| 1820 | limSendSmeTdlsDisRsp(pMac, eSIR_SUCCESS, |
| 1821 | eWNI_SME_TDLS_DISCOVERY_START_RSP) ; |
| 1822 | break ; |
| 1823 | } |
| 1824 | |
| 1825 | /* |
| 1826 | * we initiated link setup and did not receive TDLS setup rsp |
| 1827 | * from TDLS peer STA, send failure RSP to SME. |
| 1828 | */ |
| 1829 | case SIR_LIM_TDLS_LINK_SETUP_RSP_TIMEOUT: |
| 1830 | { |
| 1831 | tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ; |
| 1832 | tLimTdlsLinkSetupPeer *setupPeer = NULL ; |
| 1833 | |
| 1834 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1835 | ("TDLS setup rsp timer expires ")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1836 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 1837 | ("TDLS setup rsp timer expires for peer:" |
| 1838 | MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1839 | |
| 1840 | limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ; |
| 1841 | if(NULL != setupPeer) |
| 1842 | { |
| 1843 | limTdlsDelLinkPeer( pMac, peerMac) ; |
| 1844 | } |
| 1845 | |
| 1846 | limSendSmeTdlsLinkStartRsp(pMac, eSIR_FAILURE, peerMac, |
| 1847 | eWNI_SME_TDLS_LINK_START_RSP) ; |
| 1848 | break ; |
| 1849 | } |
| 1850 | case SIR_LIM_TDLS_LINK_SETUP_CNF_TIMEOUT: |
| 1851 | { |
| 1852 | tANI_U8 *peerMac = (tANI_U8 *)limMsg->bodyval ; |
| 1853 | tLimTdlsLinkSetupPeer *setupPeer = NULL ; |
| 1854 | |
| 1855 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1856 | ("TDLS setup CNF timer expires ")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1857 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 1858 | ("TDLS setup CNF timer expires for peer: " |
| 1859 | MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerMac)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1860 | limTdlsFindLinkPeer(pMac, peerMac, &setupPeer) ; |
| 1861 | if(NULL != setupPeer) |
| 1862 | { |
| 1863 | limTdlsDelLinkPeer( pMac, peerMac) ; |
| 1864 | } |
| 1865 | break ; |
| 1866 | } |
| 1867 | #endif /* FEATURE_WLAN_TDLS TIMER */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1868 | case WDA_ADD_BSS_RSP: |
| 1869 | limProcessMlmAddBssRsp( pMac, limMsg ); |
| 1870 | break; |
| 1871 | |
| 1872 | case WDA_ADD_STA_RSP: |
| 1873 | |
| 1874 | //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there. |
| 1875 | limProcessAddStaRsp(pMac,limMsg); |
| 1876 | break; |
| 1877 | |
| 1878 | case WDA_DELETE_STA_RSP: |
| 1879 | limProcessMlmDelStaRsp(pMac, limMsg); |
| 1880 | break; |
| 1881 | |
| 1882 | case WDA_ADD_STA_SELF_RSP: |
| 1883 | limProcessAddStaSelfRsp(pMac, limMsg); |
| 1884 | break; |
| 1885 | case WDA_DEL_STA_SELF_RSP: |
| 1886 | limProcessDelStaSelfRsp(pMac, limMsg); |
| 1887 | break; |
| 1888 | |
| 1889 | case WDA_DELETE_BSS_RSP: |
| 1890 | limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response |
| 1891 | break; |
| 1892 | |
| 1893 | case WDA_SET_BSSKEY_RSP: |
| 1894 | case WDA_SET_STA_BCASTKEY_RSP: |
| 1895 | limProcessMlmSetBssKeyRsp( pMac, limMsg ); |
| 1896 | break; |
| 1897 | case WDA_SET_STAKEY_RSP: |
| 1898 | limProcessMlmSetStaKeyRsp( pMac, limMsg ); |
| 1899 | break; |
| 1900 | case WDA_REMOVE_BSSKEY_RSP: |
| 1901 | case WDA_REMOVE_STAKEY_RSP: |
| 1902 | limProcessMlmRemoveKeyRsp( pMac, limMsg ); |
| 1903 | break; |
| 1904 | case WDA_ADDBA_RSP: |
| 1905 | limProcessMlmHalAddBARsp( pMac, limMsg ); |
| 1906 | break; |
| 1907 | |
| 1908 | case WDA_STA_STAT_RSP: |
| 1909 | case WDA_AGGR_STAT_RSP: |
| 1910 | case WDA_GLOBAL_STAT_RSP: |
| 1911 | case WDA_STAT_SUMM_RSP: |
| 1912 | limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr); |
| 1913 | break; |
| 1914 | |
| 1915 | case WDA_GET_STATISTICS_RSP: |
| 1916 | limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr); |
| 1917 | break; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1918 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 1919 | case WDA_GET_ROAM_RSSI_RSP: |
| 1920 | limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr); |
| 1921 | break; |
| 1922 | #endif |
| 1923 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1924 | |
| 1925 | case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg); |
| 1926 | case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg); |
| 1927 | case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg); |
| 1928 | case WDA_GET_NOISE_RSP: |
| 1929 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 1930 | limMsg->bodyptr = NULL; |
| 1931 | //limProcessGetNoiseRsp(pMac, limMsg); |
| 1932 | break; |
| 1933 | |
| 1934 | case WDA_SET_MAX_TX_POWER_RSP: |
| 1935 | #if defined WLAN_FEATURE_VOWIFI |
| 1936 | rrmSetMaxTxPowerRsp( pMac, limMsg ); |
| 1937 | #endif |
| 1938 | if(limMsg->bodyptr != NULL) |
| 1939 | { |
| 1940 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 1941 | limMsg->bodyptr = NULL; |
| 1942 | } |
| 1943 | break; |
| 1944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1945 | case SIR_LIM_ADDR2_MISS_IND: |
| 1946 | { |
| 1947 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1948 | FL("Addr2 mismatch interrupt received %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1949 | limMsg->type); |
| 1950 | /*a message from HAL indicating addr2 mismatch interrupt occurred |
| 1951 | limMsg->bodyptr contains only pointer to 48-bit addr2 field*/ |
| 1952 | //Dinesh fix this. the third parameter should be sessionentry. |
| 1953 | //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr); |
| 1954 | |
| 1955 | /*Free message body pointer*/ |
| 1956 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1957 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1958 | break; |
| 1959 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1960 | |
| 1961 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1962 | case WDA_AGGR_QOS_RSP: |
| 1963 | limProcessFTAggrQoSRsp( pMac, limMsg ); |
| 1964 | break; |
| 1965 | #endif |
| 1966 | |
| 1967 | case WDA_SET_LINK_STATE_RSP: |
| 1968 | linkStateParams = (tLinkStateParams *)limMsg->bodyptr; |
| 1969 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1970 | pSession = linkStateParams->session; |
| 1971 | if(linkStateParams->ft) |
| 1972 | { |
| 1973 | limSendReassocReqWithFTIEsMgmtFrame(pMac, |
| 1974 | pSession->pLimMlmReassocReq, |
| 1975 | pSession); |
| 1976 | } |
| 1977 | #endif |
| 1978 | if( linkStateParams->callback ) |
| 1979 | { |
| 1980 | linkStateParams->callback( pMac, linkStateParams->callbackArg ); |
| 1981 | } |
| 1982 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1983 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1984 | break; |
| 1985 | |
| 1986 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1987 | case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
| 1988 | pmmProcessMessage(pMac, limMsg); |
| 1989 | break; |
| 1990 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 1991 | |
| 1992 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 1993 | case WDA_GTK_OFFLOAD_GETINFO_RSP: |
| 1994 | pmmProcessMessage(pMac, limMsg); |
| 1995 | break; |
| 1996 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 1997 | case eWNI_SME_SET_BCN_FILTER_REQ: |
| 1998 | { |
| 1999 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 2000 | tpPESession psessionEntry; |
| 2001 | tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ; |
| 2002 | psessionEntry = &pMac->lim.gpSession[sessionId]; |
| 2003 | if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) |
| 2004 | { |
| 2005 | // sending beacon filtering information down to HAL |
| 2006 | if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS) |
| 2007 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2008 | limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info ")); |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2009 | } |
| 2010 | } |
Dhanashri Atre | d7885c2 | 2013-03-29 11:19:05 -0700 | [diff] [blame] | 2011 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 2012 | limMsg->bodyptr = NULL; |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2013 | #endif |
| 2014 | } |
| 2015 | break; |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2016 | case eWNI_SME_HT40_OBSS_SCAN_IND: |
| 2017 | { |
| 2018 | tpPESession psessionEntry; |
| 2019 | tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ; |
| 2020 | |
| 2021 | psessionEntry = &pMac->lim.gpSession[sessionId]; |
| 2022 | |
| 2023 | VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO, |
| 2024 | "%s eWNI_SME_HT40_OBSS_SCAN_IND htSupportedChannelWidthSet %d \n", |
| 2025 | __func__, psessionEntry->htSupportedChannelWidthSet); |
| 2026 | |
| 2027 | if (psessionEntry != NULL && |
| 2028 | IS_HT40_OBSS_SCAN_FEATURE_ENABLE && |
| 2029 | psessionEntry->htSupportedChannelWidthSet == |
| 2030 | WNI_CFG_CHANNEL_BONDING_MODE_ENABLE ) |
| 2031 | { |
| 2032 | limSendHT40OBSSScanInd(pMac, psessionEntry); |
| 2033 | } |
| 2034 | else |
| 2035 | { |
| 2036 | VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO, |
| 2037 | "OBSS Scan not started: htSupportedChannelWidthSet- %d ", |
| 2038 | psessionEntry->htSupportedChannelWidthSet ); |
| 2039 | } |
| 2040 | vos_mem_free(limMsg->bodyptr); |
| 2041 | limMsg->bodyptr = NULL; |
| 2042 | } |
| 2043 | break; |
| 2044 | case eWNI_SME_HT40_STOP_OBSS_SCAN_IND: |
| 2045 | { |
| 2046 | tpPESession psessionEntry = NULL; |
| 2047 | tANI_U8 sessionId = (tANI_U8)limMsg->bodyval ; |
| 2048 | |
| 2049 | psessionEntry = &pMac->lim.gpSession[sessionId]; |
| 2050 | /* Sending LIM STOP OBSS SCAN Indication |
| 2051 | Stop command support is only for debugging purpose */ |
| 2052 | if ( IS_HT40_OBSS_SCAN_FEATURE_ENABLE ) |
| 2053 | limSendHT40OBSSStopScanInd(pMac, psessionEntry); |
| 2054 | else |
| 2055 | VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_ERROR, |
| 2056 | "OBSS Scan Stop not started "); |
| 2057 | } |
| 2058 | break; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2059 | #ifdef FEATURE_WLAN_TDLS |
| 2060 | case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP: |
| 2061 | { |
Gopichand Nakkala | 24be531 | 2013-07-02 16:47:12 +0530 | [diff] [blame] | 2062 | tpPESession psessionEntry; |
| 2063 | tANI_U8 sessionId; |
Gopichand Nakkala | 574f6d1 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 2064 | tTdlsLinkEstablishParams *pTdlsLinkEstablishParams; |
| 2065 | pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr; |
Gopichand Nakkala | 24be531 | 2013-07-02 16:47:12 +0530 | [diff] [blame] | 2066 | |
| 2067 | if((psessionEntry = peFindSessionByStaId(pMac, |
| 2068 | pTdlsLinkEstablishParams->staIdx, |
| 2069 | &sessionId))== NULL) |
| 2070 | { |
| 2071 | limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId); |
| 2072 | /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME |
| 2073 | with session id as zero and status as FAILURE so, that message |
| 2074 | queued in SME queue can be freed to prevent the SME cmd buffer leak */ |
| 2075 | limSendSmeTdlsLinkEstablishReqRsp(pMac, |
| 2076 | 0, |
| 2077 | NULL, |
| 2078 | NULL, |
| 2079 | eSIR_FAILURE); |
| 2080 | } |
| 2081 | else |
| 2082 | { |
| 2083 | limSendSmeTdlsLinkEstablishReqRsp(pMac, |
| 2084 | psessionEntry->smeSessionId, |
| 2085 | NULL, |
| 2086 | NULL, |
| 2087 | pTdlsLinkEstablishParams->status) ; |
| 2088 | } |
Gopichand Nakkala | 574f6d1 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 2089 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 2090 | limMsg->bodyptr = NULL; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2091 | break; |
| 2092 | } |
| 2093 | #endif |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 2094 | |
| 2095 | case WDA_RX_SCAN_EVENT: |
| 2096 | limProcessRxScanEvent(pMac, limMsg->bodyptr); |
| 2097 | break; |
| 2098 | |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 2099 | case WDA_IBSS_PEER_INACTIVITY_IND: |
| 2100 | { |
| 2101 | limProcessIbssPeerInactivity(pMac, limMsg->bodyptr); |
| 2102 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 2103 | limMsg->bodyptr = NULL; |
| 2104 | break; |
| 2105 | } |
| 2106 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2107 | default: |
| 2108 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2109 | limMsg->bodyptr = NULL; |
| 2110 | // Unwanted messages |
| 2111 | // Log error |
| 2112 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2113 | FL("Discarding unexpected message received %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2114 | limMsg->type); |
| 2115 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 2116 | break; |
| 2117 | |
| 2118 | } // switch (limMsg->type) |
| 2119 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2120 | PELOG2(limLog(pMac, LOG2, FL("Done Processing msgType = %d, sme state = %s, mlm state = %s"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2121 | limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState), |
| 2122 | limMlmStateStr(pMac->lim.gLimMlmState));) |
| 2123 | |
| 2124 | } /*** end limProcessMessages() ***/ |
| 2125 | |
| 2126 | |
| 2127 | |
| 2128 | /** |
| 2129 | * limProcessDeferredMessageQueue |
| 2130 | * |
| 2131 | *FUNCTION: |
| 2132 | * This function is called by LIM while exiting from Learn |
| 2133 | * mode. This function fetches messages posted to the LIM |
| 2134 | * deferred message queue limDeferredMsgQ. |
| 2135 | * |
| 2136 | *LOGIC: |
| 2137 | * |
| 2138 | *ASSUMPTIONS: |
| 2139 | * NA |
| 2140 | * |
| 2141 | *NOTE: |
| 2142 | * NA |
| 2143 | * |
| 2144 | * @param pMac - Pointer to Global MAC structure |
| 2145 | * @return None |
| 2146 | */ |
| 2147 | |
| 2148 | void |
| 2149 | limProcessDeferredMessageQueue(tpAniSirGlobal pMac) |
| 2150 | { |
| 2151 | tSirMsgQ limMsg = { 0, 0, 0 }; |
| 2152 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2153 | tSirMsgQ *readMsg; |
| 2154 | tANI_U16 size; |
| 2155 | |
| 2156 | /* |
| 2157 | ** check any deferred messages need to be processed |
| 2158 | **/ |
| 2159 | size = pMac->lim.gLimDeferredMsgQ.size; |
| 2160 | if (size > 0) |
| 2161 | { |
| 2162 | while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL) |
| 2163 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2164 | vos_mem_copy((tANI_U8*) &limMsg, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2165 | (tANI_U8*) readMsg, sizeof(tSirMsgQ)); |
| 2166 | size--; |
| 2167 | limProcessMessages(pMac, &limMsg); |
| 2168 | |
| 2169 | if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) || |
| 2170 | (pMac->lim.gLimSystemInScanLearnMode)) |
| 2171 | break; |
| 2172 | } |
| 2173 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2174 | } /*** end limProcessDeferredMessageQueue() ***/ |
| 2175 | |
| 2176 | |
| 2177 | /* |
| 2178 | * limProcessNormalHddMsg |
| 2179 | * Function: this function checks the current lim state and decide whether the message passed shall be deffered. |
| 2180 | * @param pMac - Pointer to Global MAC structure |
| 2181 | * pLimMsg -- the message need to be processed |
| 2182 | * fRspReqd -- whether return result to hdd |
| 2183 | * @return None |
| 2184 | */ |
| 2185 | void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd) |
| 2186 | { |
| 2187 | tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE; |
| 2188 | |
| 2189 | /* Added For BT-AMP Support */ |
| 2190 | if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE ) |
| 2191 | ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE) |
| 2192 | ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)) |
| 2193 | { |
| 2194 | /** This check is required only for the AP and in 2 cases. |
| 2195 | * 1. If we are in learn mode and we receive any of these messages, |
| 2196 | * you have to come out of scan and process the message, hence dont |
| 2197 | * defer the message here. In handler, these message could be defered |
| 2198 | * till we actually come out of scan mode. |
| 2199 | * 2. If radar is detected, you might have to defer all of these |
| 2200 | * messages except Stop BSS request/ Switch channel request. This |
| 2201 | * decision is also made inside its handler. |
| 2202 | * |
| 2203 | * Please be careful while using the flag fDeferMsg. Possibly you |
| 2204 | * might end up in an infinite loop. |
| 2205 | **/ |
| 2206 | if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) || |
| 2207 | (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) || |
| 2208 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) || |
| 2209 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) || |
| 2210 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ))) |
| 2211 | { |
| 2212 | fDeferMsg = eANI_BOOLEAN_FALSE; |
| 2213 | } |
| 2214 | } |
| 2215 | |
| 2216 | /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2217 | if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*|| |
| 2218 | (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2219 | { |
| 2220 | // System is in DFS (Learn) mode or awaiting addts response |
| 2221 | // or if radar is detected, Defer processsing this message |
| 2222 | if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS) |
| 2223 | { |
| 2224 | #ifdef WLAN_DEBUG |
| 2225 | pMac->lim.numSme++; |
| 2226 | #endif |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2227 | 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)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2228 | pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 2229 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 2230 | limLogSessionStates(pMac); |
| 2231 | limPrintMsgName(pMac, LOGE, pLimMsg->type); |
| 2232 | // Release body |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2233 | vos_mem_free(pLimMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2234 | pLimMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2235 | } |
| 2236 | } |
| 2237 | else |
| 2238 | { |
| 2239 | if(fRspReqd) |
| 2240 | { |
| 2241 | // These messages are from HDD |
| 2242 | // Since these requests may also be generated |
| 2243 | // internally within LIM module, need to |
| 2244 | // distinquish and send response to host |
| 2245 | pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE; |
| 2246 | } |
| 2247 | #ifdef WLAN_DEBUG |
| 2248 | pMac->lim.numSme++; |
| 2249 | #endif |
| 2250 | if(limProcessSmeReqMessages(pMac, pLimMsg)) |
| 2251 | { |
| 2252 | // Release body |
| 2253 | // limProcessSmeReqMessage consumed the buffer. We can free it. |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2254 | vos_mem_free(pLimMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2255 | pLimMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2256 | } |
| 2257 | } |
| 2258 | } |
| 2259 | |
| 2260 | void |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2261 | handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2262 | { |
| 2263 | tSirMacHTCapabilityInfo macHTCapabilityInfo; |
| 2264 | tSirMacHTParametersInfo macHTParametersInfo; |
| 2265 | tSirMacHTInfoField1 macHTInfoField1; |
| 2266 | tSirMacHTInfoField2 macHTInfoField2; |
| 2267 | tSirMacHTInfoField3 macHTInfoField3; |
| 2268 | tANI_U32 cfgValue; |
| 2269 | tANI_U8 *ptr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2270 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2271 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS) |
| 2272 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2273 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_CAP_INFO value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2274 | return ; |
| 2275 | } |
| 2276 | ptr = (tANI_U8 *) &macHTCapabilityInfo; |
| 2277 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2278 | pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection; |
| 2279 | pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave; |
| 2280 | pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField; |
| 2281 | pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize; |
| 2282 | pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz; |
| 2283 | pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2284 | pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp; |
| 2285 | pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz; |
| 2286 | |
| 2287 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS) |
| 2288 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2289 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_PARAM_INFO value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2290 | return ; |
| 2291 | } |
| 2292 | ptr = (tANI_U8 *) &macHTParametersInfo; |
| 2293 | *ptr = (tANI_U8) (cfgValue & 0xff); |
| 2294 | pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity; |
| 2295 | pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor; |
| 2296 | |
| 2297 | // Get HT IE Info |
| 2298 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS) |
| 2299 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2300 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2301 | return ; |
| 2302 | } |
| 2303 | ptr = (tANI_U8 *) &macHTInfoField1; |
| 2304 | *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff); |
| 2305 | pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity; |
| 2306 | pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly; |
| 2307 | pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2308 | |
| 2309 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS) |
| 2310 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2311 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2312 | return ; |
| 2313 | } |
| 2314 | ptr = (tANI_U8 *) &macHTInfoField2; |
| 2315 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2316 | pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode; |
| 2317 | |
| 2318 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS) |
| 2319 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2320 | limLog(pMac, LOGP, FL("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2321 | return ; |
| 2322 | } |
| 2323 | ptr = (tANI_U8 *) &macHTInfoField3; |
| 2324 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2325 | pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive; |
| 2326 | pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2327 | pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon; |
| 2328 | pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection; |
| 2329 | pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2330 | |
| 2331 | /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session; |
| 2332 | * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old); |
| 2333 | * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist |
| 2334 | * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below |
| 2335 | */ |
| 2336 | if (psessionEntry != NULL) |
| 2337 | { |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2338 | psessionEntry->htCapability = |
| 2339 | IS_DOT11_MODE_HT(psessionEntry->dot11mode); |
| 2340 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = |
| 2341 | (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport; |
| 2342 | if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME, |
| 2343 | &cfgValue) != eSIR_SUCCESS) |
| 2344 | { |
| 2345 | limLog(pMac, LOGE, FL("Fail to retrieve " |
| 2346 | "WNI_CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME value")); |
| 2347 | return ; |
| 2348 | } |
| 2349 | psessionEntry->obssHT40ScanParam.OBSSScanActiveDwellTime = cfgValue; |
| 2350 | if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME, |
| 2351 | &cfgValue) != eSIR_SUCCESS) |
| 2352 | { |
| 2353 | limLog(pMac, LOGE, FL("Fail to retrieve " |
| 2354 | "WNI_CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME value")); |
| 2355 | return ; |
| 2356 | } |
| 2357 | psessionEntry->obssHT40ScanParam.OBSSScanPassiveDwellTime = cfgValue; |
| 2358 | if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL, |
| 2359 | &cfgValue) != eSIR_SUCCESS) |
| 2360 | { |
| 2361 | limLog(pMac, LOGE, FL("Fail to retrieve " |
| 2362 | "WNI_CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL value")); |
| 2363 | return ; |
| 2364 | } |
| 2365 | psessionEntry->obssHT40ScanParam.BSSChannelWidthTriggerScanInterval |
| 2366 | = cfgValue; |
| 2367 | if (wlan_cfgGetInt(pMac, |
| 2368 | WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL, |
| 2369 | &cfgValue) != eSIR_SUCCESS) |
| 2370 | { |
| 2371 | limLog(pMac, LOGE, FL("Fail to retrieve" |
| 2372 | "WNI_CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL value")); |
| 2373 | return ; |
| 2374 | } |
| 2375 | psessionEntry->obssHT40ScanParam.OBSSScanActiveTotalPerChannel = |
| 2376 | cfgValue; |
| 2377 | if (wlan_cfgGetInt(pMac, |
| 2378 | WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL, &cfgValue) |
| 2379 | != eSIR_SUCCESS) |
| 2380 | { |
| 2381 | limLog(pMac, LOGE, FL("Fail to retrieve" |
| 2382 | "WNI_CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL value")); |
| 2383 | return ; |
| 2384 | } |
| 2385 | psessionEntry->obssHT40ScanParam.OBSSScanPassiveTotalPerChannel = |
| 2386 | cfgValue; |
| 2387 | if (wlan_cfgGetInt(pMac, WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD , |
| 2388 | &cfgValue) != eSIR_SUCCESS) |
| 2389 | { |
| 2390 | limLog(pMac, LOGE, FL("Fail to retrieve " |
| 2391 | "WNI_CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD value")); |
| 2392 | return ; |
| 2393 | } |
| 2394 | psessionEntry->obssHT40ScanParam.OBSSScanActivityThreshold = cfgValue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2395 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2396 | } |
| 2397 | |
| 2398 | void limLogSessionStates(tpAniSirGlobal pMac) |
| 2399 | { |
| 2400 | #ifdef WLAN_DEBUG |
| 2401 | int i; |
| 2402 | |
| 2403 | for(i = 0; i < pMac->lim.maxBssId; i++) |
| 2404 | { |
| 2405 | if(pMac->lim.gpSession[i].valid) |
| 2406 | { |
Madan Mohan Koyyalamudi | 5695b50 | 2012-09-24 14:21:12 -0700 | [diff] [blame] | 2407 | PELOG1(limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d (prev sme state %d) mlm state %d (prev mlm state %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2408 | i, pMac->lim.gpSession[i].limSystemRole, pMac->lim.gpSession[i].limSmeState, |
| 2409 | pMac->lim.gpSession[i].limPrevSmeState, pMac->lim.gpSession[i].limMlmState, |
| 2410 | pMac->lim.gpSession[i].limPrevMlmState);) |
| 2411 | } |
| 2412 | } |
| 2413 | #endif //ifdef WLAN_DEBUG |
| 2414 | } |