Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Masti, Narayanraddi | f10fd79 | 2015-12-15 15:01:01 +0530 | [diff] [blame] | 2 | * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 26 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 27 | |
| 28 | |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 29 | |
| 30 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 31 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 32 | * This file lim ProcessMessageQueue.cc contains the code |
| 33 | * for processing LIM message Queue. |
| 34 | * Author: Chandra Modumudi |
| 35 | * Date: 02/11/02 |
| 36 | * History:- |
| 37 | * Date Modified by Modification Information |
| 38 | * -------------------------------------------------------------------- |
| 39 | * |
| 40 | */ |
| 41 | #include "palTypes.h" |
| 42 | #include "wniApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 43 | #include "wlan_qct_wdi_ds.h" |
| 44 | #include "wlan_qct_pal_packet.h" |
| 45 | #include "wlan_qct_wda.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 46 | |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 47 | #include "wniCfg.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 48 | #include "cfgApi.h" |
| 49 | #include "sirCommon.h" |
| 50 | #include "utilsApi.h" |
| 51 | #include "limTypes.h" |
| 52 | #include "limUtils.h" |
| 53 | #include "limAssocUtils.h" |
| 54 | #include "limPropExtsUtils.h" |
| 55 | |
| 56 | #include "limAdmitControl.h" |
| 57 | #include "pmmApi.h" |
| 58 | #include "limIbssPeerMgmt.h" |
| 59 | #include "schApi.h" |
| 60 | #include "limSession.h" |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 61 | #include "limSendMessages.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 62 | |
| 63 | #if defined WLAN_FEATURE_VOWIFI |
| 64 | #include "rrmApi.h" |
| 65 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 66 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
| 67 | #include "eseApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 68 | #endif |
| 69 | |
| 70 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 71 | #include "limFT.h" |
| 72 | #endif |
| 73 | |
| 74 | #ifdef WMM_APSD |
| 75 | #include "wmmApsd.h" |
| 76 | #endif |
| 77 | |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 78 | #ifdef WLAN_FEATURE_RMC |
| 79 | #include "limRMC.h" |
| 80 | #endif |
| 81 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 82 | #include "vos_types.h" |
| 83 | #include "vos_packet.h" |
| 84 | #include "vos_memory.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 85 | |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 86 | /* This value corresponds to 500 ms */ |
Abhishek Singh | 849366d | 2015-11-26 16:53:47 +0530 | [diff] [blame] | 87 | #define MAX_PROBEREQ_TIME 50 |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 88 | |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 89 | #ifdef WLAN_FEATURE_EXTSCAN |
| 90 | #define SIZE_OF_FIXED_PARAM 12 |
| 91 | #endif |
| 92 | |
Masti, Narayanraddi | f10fd79 | 2015-12-15 15:01:01 +0530 | [diff] [blame] | 93 | #define CHECK_BIT(value, mask) ((value) & (1 << (mask))) |
| 94 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 95 | void limLogSessionStates(tpAniSirGlobal pMac); |
| 96 | |
| 97 | /** ------------------------------------------------------------- |
| 98 | \fn defMsgDecision |
| 99 | \brief The function decides whether to defer a message or not in limProcessMessage function |
| 100 | \param tpAniSirGlobal pMac |
| 101 | \param tSirMsgQ limMsg |
| 102 | \param tSirMacTspecIE *ppInfo |
| 103 | \return none |
| 104 | -------------------------------------------------------------*/ |
| 105 | |
| 106 | tANI_U8 static |
| 107 | defMsgDecision(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 108 | { |
| 109 | |
| 110 | |
| 111 | /* this function should not changed */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 112 | if(pMac->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 113 | { |
| 114 | // Defer processsing this message |
| 115 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 116 | { |
Madan Mohan Koyyalamudi | 5695b50 | 2012-09-24 14:21:12 -0700 | [diff] [blame] | 117 | 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] | 118 | limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 119 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 120 | limLogSessionStates(pMac); |
| 121 | limHandleDeferMsgError(pMac, limMsg); |
| 122 | } |
| 123 | return true; |
| 124 | } |
| 125 | |
| 126 | //When defer is requested then defer all the messages except HAL responses. |
| 127 | if((!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) && |
| 128 | !pMac->lim.gLimSystemInScanLearnMode) |
| 129 | { |
| 130 | if((limMsg->type != WDA_ADD_BSS_RSP) && |
| 131 | (limMsg->type != WDA_DELETE_BSS_RSP) && |
| 132 | (limMsg->type != WDA_ADD_STA_RSP) && |
| 133 | (limMsg->type != WDA_ADD_STA_SELF_RSP) && |
| 134 | (limMsg->type != WDA_DEL_STA_SELF_RSP) && |
| 135 | (limMsg->type != WDA_DELETE_STA_RSP)&& |
| 136 | (limMsg->type != WDA_SET_BSSKEY_RSP)&& |
| 137 | (limMsg->type != WDA_SET_STAKEY_RSP)&& |
| 138 | (limMsg->type != WDA_SET_STA_BCASTKEY_RSP) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 139 | (limMsg->type != eWNI_SME_START_REQ) && |
| 140 | (limMsg->type != WDA_AGGR_QOS_RSP) && |
| 141 | (limMsg->type != WDA_REMOVE_BSSKEY_RSP) && |
| 142 | (limMsg->type != WDA_REMOVE_STAKEY_RSP) && |
| 143 | (limMsg->type != WDA_SET_MIMOPS_RSP)&& |
| 144 | (limMsg->type != WDA_ADDBA_RSP) && |
| 145 | (limMsg->type != WDA_ENTER_BMPS_RSP) && |
| 146 | (limMsg->type != WDA_EXIT_BMPS_RSP) && |
| 147 | (limMsg->type != WDA_ENTER_IMPS_RSP) && |
| 148 | (limMsg->type != WDA_EXIT_IMPS_RSP) && |
| 149 | (limMsg->type != WDA_ENTER_UAPSD_RSP) && |
| 150 | (limMsg->type != WDA_EXIT_UAPSD_RSP) && |
| 151 | (limMsg->type != WDA_WOWL_ENTER_RSP) && |
| 152 | (limMsg->type != WDA_WOWL_EXIT_RSP) && |
| 153 | (limMsg->type != WDA_SWITCH_CHANNEL_RSP) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 154 | (limMsg->type != WDA_P2P_NOA_ATTR_IND) && |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 155 | (limMsg->type != WDA_P2P_NOA_START_IND) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 156 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 157 | (limMsg->type != WDA_START_OEM_DATA_RSP) && |
| 158 | #endif |
Hema Aparna Medicharla | b56b661 | 2015-05-18 11:42:52 +0530 | [diff] [blame] | 159 | (limMsg->type != WDA_ADD_TS_RSP) && |
Hanumantha Reddy Pothula | 3de8d4c | 2015-10-07 12:06:37 +0530 | [diff] [blame] | 160 | |
| 161 | /* LIM won't process any defer queue commands if gLimAddtsSent is set to |
| 162 | TRUE. gLimAddtsSent will be set TRUE to while sending ADDTS REQ. Say, |
| 163 | when deferring is enabled, if SIR_LIM_ADDTS_RSP_TIMEOUT is posted |
| 164 | (because of not receiving ADDTS RSP) then this command will be added |
| 165 | to defer queue and as gLimAddtsSent is set TRUE LIM will never |
| 166 | process any commands from defer queue, including |
| 167 | SIR_LIM_ADDTS_RSP_TIMEOUT. Hence allowing SIR_LIM_ADDTS_RSP_TIMEOUT |
| 168 | command to be processed with deferring enabled, so that this will be |
| 169 | processed immediately and sets gLimAddtsSent to FALSE. |
| 170 | */ |
| 171 | (limMsg->type != SIR_LIM_ADDTS_RSP_TIMEOUT) && |
Sachin Ahuja | 3d47fcd | 2015-08-28 16:02:06 +0530 | [diff] [blame] | 172 | (limMsg->type != WDA_LOST_LINK_PARAMS_IND) && |
Hema Aparna Medicharla | b56b661 | 2015-05-18 11:42:52 +0530 | [diff] [blame] | 173 | /* Allow processing of RX frames while awaiting reception of |
| 174 | ADD TS response over the air. This logic particularly handles the |
| 175 | case when host sends ADD BA request to FW after ADD TS request |
| 176 | is sent over the air and ADD TS response received over the air */ |
| 177 | !(limMsg->type == SIR_BB_XPORT_MGMT_MSG && pMac->lim.gLimAddtsSent)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 178 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 179 | 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] | 180 | limMsgStr(limMsg->type));) |
| 181 | |
| 182 | // Defer processsing this message |
| 183 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 184 | { |
Madan Mohan Koyyalamudi | 5695b50 | 2012-09-24 14:21:12 -0700 | [diff] [blame] | 185 | 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] | 186 | limMsg->type, limMsgStr(limMsg->type), pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 187 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 188 | limLogSessionStates(pMac); |
| 189 | limHandleDeferMsgError(pMac, limMsg); |
| 190 | |
| 191 | } |
| 192 | return true; |
| 193 | } |
| 194 | } |
| 195 | return false; |
| 196 | } |
| 197 | |
| 198 | /* |
| 199 | * Beacon Handling Cases: |
| 200 | * during scanning, when no session is active: |
| 201 | * handled by limHandleFramesInScanState before __limHandleBeacon call is invoked. |
| 202 | * during scanning, when any session is active, but beacon/Pr does not belong to that session, psessionEntry will be null. |
| 203 | * handled by limHandleFramesInScanState before __limHandleBeacon call is invoked. |
| 204 | * during scanning, when any session is active, and beacon/Pr belongs to one of the session, psessionEntry will not be null. |
| 205 | * handled by limHandleFramesInScanState before __limHandleBeacon call is invoked. |
| 206 | * Not scanning, no session: |
| 207 | * there should not be any beacon coming, if coming, should be dropped. |
| 208 | * Not Scanning, |
| 209 | */ |
| 210 | static void |
| 211 | __limHandleBeacon(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tpPESession psessionEntry) |
| 212 | { |
| 213 | /* checking for global SME state...*/ |
| 214 | tANI_U8 *pRxPacketInfo; |
| 215 | limGetBDfromRxPacket(pMac, pMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo); |
| 216 | |
| 217 | //This function should not be called if beacon is received in scan state. |
| 218 | //So not doing any checks for the global state. |
| 219 | |
| 220 | if(psessionEntry == NULL) |
| 221 | { |
| 222 | schBeaconProcess(pMac, pRxPacketInfo, NULL); |
| 223 | } |
| 224 | else if( (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE) || |
| 225 | (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE)) |
| 226 | { |
| 227 | schBeaconProcess(pMac, pRxPacketInfo, psessionEntry); |
| 228 | } |
| 229 | else |
| 230 | limProcessBeaconFrame(pMac, pRxPacketInfo, psessionEntry); |
| 231 | |
| 232 | return; |
| 233 | } |
| 234 | |
| 235 | |
| 236 | //Fucntion prototype |
| 237 | void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd); |
| 238 | |
| 239 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 240 | * limDeferMsg() |
| 241 | * |
| 242 | *FUNCTION: |
| 243 | * This function is called to defer the messages received |
| 244 | * during Learn mode |
| 245 | * |
| 246 | *LOGIC: |
| 247 | * NA |
| 248 | * |
| 249 | *ASSUMPTIONS: |
| 250 | * NA |
| 251 | * |
| 252 | *NOTE: |
| 253 | * NA |
| 254 | * |
| 255 | * @param pMac - Pointer to Global MAC structure |
| 256 | * @param pMsg of type tSirMsgQ - Pointer to the message structure |
| 257 | * @return None |
| 258 | */ |
| 259 | |
| 260 | tANI_U32 |
| 261 | limDeferMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg) |
| 262 | { |
| 263 | tANI_U32 retCode = TX_SUCCESS; |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 264 | |
| 265 | retCode = limWriteDeferredMsgQ(pMac, pMsg); |
| 266 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 267 | if (retCode == TX_SUCCESS) |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 268 | { |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 269 | limLog(pMac, LOG1, |
| 270 | FL("Deferred message(0x%X) limSmeState %d (prev sme state %d)" |
| 271 | " sysRole %d mlm state %d (prev mlm state %d)"), |
| 272 | pMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 273 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, |
| 274 | pMac->lim.gLimPrevMlmState); |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 275 | MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED));) |
| 276 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | else |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 278 | { |
Agarwal Ashish | e865f33 | 2014-04-08 13:20:06 +0530 | [diff] [blame] | 279 | limLog(pMac, LOG1, FL("Dropped lim message (0x%X)"), pMsg->type); |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 280 | MTRACE(macTraceMsgRx(pMac, NO_SESSION, LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED));) |
| 281 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | |
| 283 | return retCode; |
| 284 | } /*** end limDeferMsg() ***/ |
| 285 | |
| 286 | |
| 287 | |
| 288 | /** |
| 289 | * limHandleFramesInScanState() |
| 290 | * |
| 291 | *FUNCTION: |
| 292 | * This function is called to process 802.11 frames |
| 293 | * received by LIM in scan state. |
| 294 | * |
| 295 | *LOGIC: |
| 296 | * NA |
| 297 | * |
| 298 | *ASSUMPTIONS: |
| 299 | * NA |
| 300 | * |
| 301 | *NOTE: |
| 302 | * NA |
| 303 | * |
| 304 | * @param pMac - Pointer to Global MAC structure |
| 305 | * @param limMsg - Received message |
| 306 | * @param pRxPacketInfo - Pointer to Rx packet info structure |
| 307 | * @param deferMsg - Indicates whether the frame shall be deferred |
| 308 | * @return None |
| 309 | */ |
| 310 | |
| 311 | static void |
| 312 | limHandleFramesInScanState(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pRxPacketInfo, tANI_U8 *deferMsg, tpPESession psessionEntry) |
| 313 | { |
| 314 | tSirMacFrameCtl fc; |
| 315 | tpSirMacMgmtHdr pHdr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 316 | |
| 317 | *deferMsg = false; |
| 318 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 319 | fc = pHdr->fc; |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 320 | limLog( pMac, LOG2, FL("ProtVersion %d, Type %d, Subtype %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 321 | fc.protVer, fc.type, fc.subType ); |
| 322 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 323 | // defer all message in scan state except for Beacons and Probe Response |
| 324 | if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_BEACON)) |
| 325 | { |
| 326 | if (psessionEntry == NULL) |
| 327 | limProcessBeaconFrameNoSession(pMac, pRxPacketInfo); |
| 328 | else |
| 329 | limProcessBeaconFrame(pMac, pRxPacketInfo,psessionEntry); |
| 330 | } |
| 331 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_RSP)) |
| 332 | { |
| 333 | if (psessionEntry == NULL) |
| 334 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 335 | else |
| 336 | limProcessProbeRspFrame(pMac, pRxPacketInfo,psessionEntry); |
| 337 | } |
| 338 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_PROBE_REQ)) |
| 339 | { |
| 340 | limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo, psessionEntry); |
| 341 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 342 | else if ((fc.type == SIR_MAC_MGMT_FRAME) && (fc.subType == SIR_MAC_MGMT_ACTION)) |
| 343 | { |
| 344 | limProcessActionFrameNoSession( pMac, pRxPacketInfo); |
| 345 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 346 | else |
| 347 | { |
| 348 | *deferMsg = true; |
| 349 | return; |
| 350 | } |
| 351 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 352 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 353 | return; |
| 354 | |
| 355 | } /*** end limHandleFramesInScanState() ***/ |
| 356 | |
| 357 | /** ------------------------------------------------------------ |
| 358 | \brief This function handles Unknown Unicast (A2 Index) |
| 359 | \ packets. |
| 360 | \param tpAniSirGlobal pMac Global Mac data structure |
| 361 | \param void *pRxPacketInfo Pointer to Buffer Descriptor |
| 362 | \return none |
| 363 | \ |
| 364 | \ -------------------------------------------------------------- */ |
| 365 | static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketInfo,tpPESession psessionEntry) |
| 366 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 367 | /* addr2 mismatch interrupt occurred this means previous |
| 368 | disassociation was not successful |
| 369 | In Volans pRxPacketInfo only contains pointer 48-bit address2 field */ |
| 370 | /*Send disassociation message again*/ |
| 371 | //Dinesh need one more arguement. |
| 372 | //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] | 373 | //TODO: verify this |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 374 | //This could be a public action frame. |
| 375 | if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE ) |
| 376 | limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 377 | |
| 378 | #ifdef FEATURE_WLAN_TDLS |
| 379 | { |
| 380 | tpSirMacDataHdr3a pMacHdr; |
| 381 | pMacHdr = WDA_GET_RX_MPDUHEADER3A(pRxPacketInfo); |
| 382 | |
| 383 | if (limIsGroupAddr(pMacHdr->addr2)) |
| 384 | { |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 385 | limLog(pMac, LOG1, FL("Ignoring A2 Invalid Packet received for MC/BC:")); |
| 386 | limPrintMacAddr(pMac, pMacHdr->addr2, LOG1); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 387 | |
| 388 | return; |
| 389 | } |
| 390 | /* TDLS_hklee: move down here to reject Addr2 == Group (first checking above) |
| 391 | and also checking if SystemRole == STA */ |
| 392 | if (psessionEntry->limSystemRole == eLIM_STA_ROLE) |
| 393 | { |
| 394 | /* ADD handling of Public Action Frame */ |
| 395 | 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] | 396 | ("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] | 397 | switch (pMacHdr->fc.type) |
| 398 | { |
| 399 | case SIR_MAC_MGMT_FRAME: |
| 400 | { |
| 401 | switch (pMacHdr->fc.subType) |
| 402 | { |
| 403 | case SIR_MAC_MGMT_ACTION: |
| 404 | { |
| 405 | limProcessActionFrame(pMac, pRxPacketInfo, psessionEntry) ; |
| 406 | break ; |
| 407 | } |
| 408 | default: |
| 409 | { |
| 410 | break ; |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | default: |
| 415 | { |
| 416 | break ; |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | } |
| 421 | #endif |
| 422 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 423 | |
| 424 | return; |
| 425 | } |
| 426 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 427 | /** |
| 428 | * limCheckMgmtRegisteredFrames() |
| 429 | * |
| 430 | *FUNCTION: |
| 431 | * This function is called to process to check if received frame match with |
| 432 | * any of the registered frame from HDD. If yes pass this frame to SME. |
| 433 | * |
| 434 | *LOGIC: |
| 435 | * |
| 436 | *ASSUMPTIONS: |
| 437 | * |
| 438 | *NOTE: |
| 439 | * |
| 440 | * @param pMac Pointer to Global MAC structure |
| 441 | * @param *pBd Pointer to the received Buffer Descriptor+payload |
| 442 | * @param *psessionEntry Pointer to session on which packet is received |
| 443 | * @return None |
| 444 | */ |
| 445 | static tANI_BOOLEAN |
| 446 | limCheckMgmtRegisteredFrames(tpAniSirGlobal pMac, tANI_U8 *pBd, |
| 447 | tpPESession psessionEntry) |
| 448 | { |
| 449 | tSirMacFrameCtl fc; |
| 450 | tpSirMacMgmtHdr pHdr; |
| 451 | tANI_U8 *pBody; |
| 452 | tpLimMgmtFrameRegistration pLimMgmtRegistration = NULL, pNext = NULL; |
| 453 | tANI_U16 frameType; |
| 454 | tANI_U16 framelen; |
| 455 | tANI_U8 type,subType; |
| 456 | tANI_BOOLEAN match = VOS_FALSE; |
| 457 | VOS_STATUS vosStatus; |
| 458 | |
| 459 | pHdr = WDA_GET_RX_MAC_HEADER(pBd); |
| 460 | fc = pHdr->fc; |
| 461 | frameType = (fc.type << 2 ) | (fc.subType << 4); |
| 462 | pBody = WDA_GET_RX_MPDU_DATA(pBd); |
| 463 | framelen = WDA_GET_RX_PAYLOAD_LEN(pBd); |
| 464 | |
| 465 | vos_list_peek_front(&pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 466 | (vos_list_node_t**)&pLimMgmtRegistration); |
| 467 | |
| 468 | while(pLimMgmtRegistration != NULL) |
| 469 | { |
| 470 | type = (pLimMgmtRegistration->frameType >> 2) & 0x03; |
| 471 | subType = (pLimMgmtRegistration->frameType >> 4) & 0x0f; |
| 472 | if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME) |
| 473 | && (subType == SIR_MAC_MGMT_RESERVED15) ) |
| 474 | { |
| 475 | limLog( pMac, LOG3, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 476 | FL("rcvd frame match with SIR_MAC_MGMT_RESERVED15")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 477 | match = VOS_TRUE; |
| 478 | break; |
| 479 | } |
| 480 | |
| 481 | if (pLimMgmtRegistration->frameType == frameType) |
| 482 | { |
| 483 | if (pLimMgmtRegistration->matchLen > 0) |
| 484 | { |
| 485 | if (pLimMgmtRegistration->matchLen <= framelen) |
| 486 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 487 | if (vos_mem_compare(pLimMgmtRegistration->matchData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 488 | pBody, pLimMgmtRegistration->matchLen)) |
| 489 | { |
Madan Mohan Koyyalamudi | c537df2 | 2012-10-22 15:07:08 -0700 | [diff] [blame] | 490 | /* found match! */ |
| 491 | match = VOS_TRUE; |
| 492 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 493 | } |
Madan Mohan Koyyalamudi | c537df2 | 2012-10-22 15:07:08 -0700 | [diff] [blame] | 494 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 495 | } |
| 496 | else |
| 497 | { |
| 498 | /* found match! */ |
| 499 | match = VOS_TRUE; |
| 500 | break; |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | vosStatus = |
| 505 | vos_list_peek_next ( &pMac->lim.gLimMgmtFrameRegistratinQueue, |
| 506 | (vos_list_node_t*) pLimMgmtRegistration, |
| 507 | (vos_list_node_t**) &pNext ); |
| 508 | pLimMgmtRegistration = pNext; |
| 509 | pNext = NULL; |
| 510 | } |
| 511 | |
| 512 | if (match) |
| 513 | { |
| 514 | limLog( pMac, LOG1, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 515 | FL("rcvd frame match with registered frame params")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 516 | |
| 517 | /* Indicate this to SME */ |
Rashmi Ramanna | 0d0adec | 2014-02-05 20:35:37 +0530 | [diff] [blame] | 518 | limSendSmeMgmtFrameInd( pMac, pLimMgmtRegistration->sessionId, |
| 519 | pBd, psessionEntry, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 520 | |
| 521 | if ( (type == SIR_MAC_MGMT_FRAME) && (fc.type == SIR_MAC_MGMT_FRAME) |
| 522 | && (subType == SIR_MAC_MGMT_RESERVED15) ) |
| 523 | { |
| 524 | // These packets needs to be processed by PE/SME as well as HDD. |
| 525 | // If it returns TRUE here, the packet is forwarded to HDD only. |
| 526 | match = VOS_FALSE; |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | return match; |
| 531 | } /*** end limCheckMgmtRegisteredFrames() ***/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 532 | |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 533 | #ifdef WLAN_FEATURE_EXTSCAN |
| 534 | |
| 535 | void |
| 536 | limProcessEXTScanRealTimeData(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) |
| 537 | { |
| 538 | tpSirMacMgmtHdr pHdr = NULL; |
| 539 | eHalStatus status; |
| 540 | void *pCallbackContext; |
| 541 | tANI_U8 rfBand = 0; |
| 542 | tANI_U8 rxChannelInBD = 0; |
| 543 | tSirMacFrameCtl fc; |
| 544 | tDot11fBeacon *pBeacon = NULL; |
| 545 | tDot11fProbeResponse *pProbeResponse = NULL; |
| 546 | tSirWifiFullScanResultEvent tEXTScanFullScanResult; |
| 547 | |
| 548 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 549 | fc = pHdr->fc; |
| 550 | |
| 551 | limLog(pMac, LOG2, |
| 552 | FL("Received EXTScan Real Time data with length=%d from "), |
| 553 | WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); |
| 554 | |
| 555 | limPrintMacAddr(pMac, pHdr->sa, LOG2); |
| 556 | |
| 557 | vos_mem_set((tANI_U8 *) &tEXTScanFullScanResult, |
| 558 | sizeof(tSirWifiFullScanResultEvent), 0); |
| 559 | |
Dino Mycle | 3f783bc | 2014-08-08 17:40:22 +0530 | [diff] [blame] | 560 | tEXTScanFullScanResult.ap.ts = vos_get_monotonic_boottime(); |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 561 | |
| 562 | vos_mem_copy(&tEXTScanFullScanResult.ap.bssid, |
| 563 | pHdr->bssId, sizeof(tSirMacAddr)); |
| 564 | |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 565 | limPrintMacAddr(pMac, pHdr->bssId, LOG2); |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 566 | |
| 567 | |
| 568 | rfBand = WDA_GET_RX_RFBAND(pRxPacketInfo); |
| 569 | rxChannelInBD = WDA_GET_RX_CH(pRxPacketInfo); |
| 570 | |
| 571 | if ((!rfBand) || IS_5G_BAND(rfBand)) |
| 572 | { |
| 573 | rxChannelInBD = limUnmapChannel(rxChannelInBD); |
| 574 | } |
| 575 | |
c_hpothu | 24b354c | 2014-09-24 18:59:33 +0530 | [diff] [blame] | 576 | tEXTScanFullScanResult.ap.channel = |
| 577 | (tANI_U32)vos_chan_to_freq(rxChannelInBD); |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 578 | tEXTScanFullScanResult.ap.rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo); |
| 579 | |
| 580 | if (fc.subType == SIR_MAC_MGMT_BEACON) |
| 581 | { |
| 582 | limLog( pMac, LOG2, FL("Beacon ")); |
| 583 | |
| 584 | pBeacon = vos_mem_malloc(sizeof(tDot11fBeacon)); |
| 585 | if ( NULL == pBeacon ){ |
| 586 | limLog(pMac, LOGE, FL("Failed to allocate memory\n") ); |
| 587 | return; |
| 588 | } |
| 589 | |
| 590 | vos_mem_set( ( tANI_U8* )pBeacon, sizeof(tDot11fBeacon), 0 ); |
| 591 | // delegate to the framesc-generated code, |
| 592 | status = dot11fUnpackBeacon( pMac, |
| 593 | (tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo), |
| 594 | WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo), pBeacon ); |
| 595 | |
| 596 | if ( DOT11F_FAILED( status ) ) |
| 597 | { |
| 598 | limLog(pMac, LOGE, FL("Failed to parse a Beacons" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 599 | "(%d)"), status); |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 600 | vos_mem_free(pBeacon); |
| 601 | return; |
| 602 | } |
| 603 | if ( pBeacon->SSID.present ) |
| 604 | { |
| 605 | vos_mem_copy(tEXTScanFullScanResult.ap.ssid, |
| 606 | pBeacon->SSID.ssid, |
| 607 | pBeacon->SSID.num_ssid); |
| 608 | } |
| 609 | //NULL Terminate the string. |
| 610 | tEXTScanFullScanResult.ap.ssid[pBeacon->SSID.num_ssid] = 0; |
| 611 | tEXTScanFullScanResult.ap.beaconPeriod = |
| 612 | pBeacon->BeaconInterval.interval; |
| 613 | tEXTScanFullScanResult.ap.capability = |
| 614 | *((tANI_U16 *)&pBeacon->Capabilities); |
| 615 | vos_mem_free(pBeacon); |
| 616 | } |
| 617 | else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP) |
| 618 | { |
| 619 | limLog( pMac, LOG2, FL("Probe rsp ")); |
| 620 | |
| 621 | pProbeResponse = vos_mem_malloc(sizeof(tDot11fProbeResponse)); |
| 622 | if ( NULL == pProbeResponse ){ |
| 623 | limLog(pMac, LOGE, FL("Failed to allocate memory\n") ); |
| 624 | return; |
| 625 | } |
| 626 | |
| 627 | vos_mem_set( ( tANI_U8* )pProbeResponse, |
| 628 | sizeof(tDot11fProbeResponse), 0); |
| 629 | //delegate to the framesc-generated code, |
| 630 | status = dot11fUnpackProbeResponse( pMac, |
| 631 | (tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo), |
| 632 | WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo), pProbeResponse ); |
| 633 | |
| 634 | if ( DOT11F_FAILED( status ) ) |
| 635 | { |
| 636 | limLog(pMac, LOGE, FL("Failed to parse a Probe" |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 637 | "Response (%d"), status); |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 638 | vos_mem_free(pProbeResponse); |
| 639 | return; |
| 640 | } |
| 641 | if ( pProbeResponse->SSID.present ) |
| 642 | { |
| 643 | vos_mem_copy(tEXTScanFullScanResult.ap.ssid, |
| 644 | pProbeResponse->SSID.ssid, |
| 645 | pProbeResponse->SSID.num_ssid); |
| 646 | } |
| 647 | //NULL Terminate the string. |
| 648 | tEXTScanFullScanResult.ap.ssid[pProbeResponse->SSID.num_ssid] = 0; |
| 649 | tEXTScanFullScanResult.ap.beaconPeriod = |
| 650 | pProbeResponse->BeaconInterval.interval; |
| 651 | tEXTScanFullScanResult.ap.capability = |
| 652 | *(((tANI_U16 *)&pProbeResponse->Capabilities)); |
| 653 | |
Gupta, Kapil | 4a5e190 | 2016-02-01 19:54:14 +0530 | [diff] [blame] | 654 | vos_mem_free(pProbeResponse); |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 655 | } |
| 656 | else |
| 657 | { |
| 658 | limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"), |
| 659 | fc.type, fc.subType); |
| 660 | VOS_ASSERT(0); |
| 661 | return; |
| 662 | } |
| 663 | |
| 664 | tEXTScanFullScanResult.requestId = pMac->sme.extScanStartReqId; |
| 665 | tEXTScanFullScanResult.ieLength = |
| 666 | WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) - SIZE_OF_FIXED_PARAM; |
| 667 | tEXTScanFullScanResult.ie =(tSirInformationElement *) |
| 668 | ((tANI_U8 *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo) + SIZE_OF_FIXED_PARAM); |
| 669 | |
| 670 | pCallbackContext = pMac->sme.pEXTScanCallbackContext; |
| 671 | if(pMac->sme.pEXTScanIndCb) |
| 672 | { |
| 673 | pMac->sme.pEXTScanIndCb(pCallbackContext, |
| 674 | SIR_HAL_EXTSCAN_FULL_SCAN_RESULT_IND, |
| 675 | (tANI_U8 *)&tEXTScanFullScanResult); |
| 676 | } |
| 677 | |
| 678 | return; |
| 679 | } /*** end limProcessEXTScanRealTimeData() ***/ |
| 680 | #endif /* WLAN_FEATURE_EXTSCAN */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 681 | |
Agrawal Ashish | a8e8a72 | 2016-10-18 19:07:45 +0530 | [diff] [blame^] | 682 | #ifdef SAP_AUTH_OFFLOAD |
| 683 | /* |
| 684 | * lim_process_sap_offload_indication: function to process add sta/ del sta |
| 685 | * indication for SAP auth offload. |
| 686 | * |
| 687 | * @pMac: mac context |
| 688 | * @pRxPacketInfo: rx buffer |
| 689 | * |
| 690 | * This Function will go through buffer and if |
| 691 | * indication type is ADD_STA_IND, function will extract all data related to |
| 692 | * client and will call limAddSta |
| 693 | * and if indication type is DEL_STA_IND, function will call |
| 694 | * limSendSmeDisassocInd to do cleanup for station. |
| 695 | * |
| 696 | * Return : none |
| 697 | */ |
| 698 | static void lim_process_sap_offload_indication(tpAniSirGlobal pMac, |
| 699 | tANI_U8 *pRxPacketInfo) |
| 700 | { |
| 701 | int i = 0; |
| 702 | tSapOfldIndications *sap_offload_indication_rx_buf = |
| 703 | (tSapOfldIndications *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 704 | tSapOfldInd *sap_offload_ind = |
| 705 | (tSapOfldInd*)sap_offload_indication_rx_buf->indications; |
| 706 | |
| 707 | limLog( pMac, LOG1, |
| 708 | FL("Notify SME with Sap Offload ind and indication type is %d num_indication %d \n"), |
| 709 | sap_offload_ind->indType, |
| 710 | (tANI_U8) sap_offload_indication_rx_buf->num_indications); |
| 711 | |
| 712 | for (i=1; i <= (tANI_U8)(sap_offload_indication_rx_buf->num_indications); |
| 713 | i++) |
| 714 | { |
| 715 | if (sap_offload_ind->indType == SAP_OFFLOAD_ADD_STA_IND) |
| 716 | { |
| 717 | tSapOfldAddStaIndMsg *add_sta; |
| 718 | add_sta = (tSapOfldAddStaIndMsg *)sap_offload_ind->indication; |
| 719 | lim_sap_offload_add_sta(pMac, add_sta); |
| 720 | if (sap_offload_indication_rx_buf->num_indications > 1) |
| 721 | sap_offload_ind = |
| 722 | (tSapOfldInd *)((tANI_U8 *)sap_offload_ind + |
| 723 | sizeof(tSapOfldAddStaIndMsg)); |
| 724 | } |
| 725 | else if (sap_offload_ind->indType == SAP_OFFLOAD_DEL_STA_IND) |
| 726 | { |
| 727 | tSapOfldDelStaIndMsg *del_sta; |
| 728 | del_sta = (tSapOfldDelStaIndMsg *)sap_offload_ind->indication; |
| 729 | lim_sap_offload_del_sta(pMac, del_sta); |
| 730 | sap_offload_ind = (tSapOfldInd *)((tANI_U8 *)sap_offload_ind + |
| 731 | sizeof(tSapOfldDelStaIndMsg)); |
| 732 | } |
| 733 | else |
| 734 | { |
| 735 | limLog(pMac, LOGE, FL("No Valid indication for connected station")); |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | } |
| 740 | #endif |
| 741 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 742 | /** |
| 743 | * limHandle80211Frames() |
| 744 | * |
| 745 | *FUNCTION: |
| 746 | * This function is called to process 802.11 frames |
| 747 | * received by LIM. |
| 748 | * |
| 749 | *LOGIC: |
| 750 | * NA |
| 751 | * |
| 752 | *ASSUMPTIONS: |
| 753 | * NA |
| 754 | * |
| 755 | *NOTE: |
| 756 | * NA |
| 757 | * |
| 758 | * @param pMac - Pointer to Global MAC structure |
| 759 | * @param pMsg of type tSirMsgQ - Pointer to the message structure |
| 760 | * @return None |
| 761 | */ |
| 762 | |
| 763 | static void |
Sushant Kaushik | 3320057 | 2015-08-05 16:46:20 +0530 | [diff] [blame] | 764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 765 | limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) |
| 766 | { |
| 767 | tANI_U8 *pRxPacketInfo = NULL; |
| 768 | tSirMacFrameCtl fc; |
| 769 | tpSirMacMgmtHdr pHdr=NULL; |
| 770 | tpPESession psessionEntry=NULL; |
| 771 | tANI_U8 sessionId; |
| 772 | tAniBool isFrmFt = FALSE; |
| 773 | tANI_U16 fcOffset = WLANHAL_RX_BD_HEADER_SIZE; |
| 774 | |
| 775 | *pDeferMsg= false; |
| 776 | limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo); |
| 777 | |
Agrawal Ashish | a8e8a72 | 2016-10-18 19:07:45 +0530 | [diff] [blame^] | 778 | #ifdef SAP_AUTH_OFFLOAD |
| 779 | if ((WDA_GET_SAP_AUTHOFFLOADIND(pRxPacketInfo) == 1) && |
| 780 | pMac->sap_auth_offload) |
| 781 | { |
| 782 | lim_process_sap_offload_indication(pMac, pRxPacketInfo); |
| 783 | goto end; |
| 784 | } |
| 785 | #endif |
| 786 | |
Dino Mycle | 7a76e66 | 2014-06-10 11:36:34 +0530 | [diff] [blame] | 787 | #ifdef WLAN_FEATURE_EXTSCAN |
| 788 | |
| 789 | if ( WDA_GET_EXTSCANFULLSCANRESIND(pRxPacketInfo)) |
| 790 | { |
| 791 | limLog( pMac, LOG2, FL("Notify EXTSCAN scan results to the HDD")); |
| 792 | limProcessEXTScanRealTimeData(pMac, pRxPacketInfo); |
| 793 | goto end; |
| 794 | } |
| 795 | #endif //WLAN_FEATURE_EXTSCAN |
| 796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 797 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 798 | isFrmFt = WDA_GET_RX_FT_DONE(pRxPacketInfo); |
| 799 | fcOffset = (v_U8_t)WDA_GET_RX_MPDU_HEADER_OFFSET(pRxPacketInfo); |
| 800 | fc = pHdr->fc; |
| 801 | |
Madan Mohan Koyyalamudi | 99af06e | 2013-08-08 02:17:17 +0530 | [diff] [blame] | 802 | #ifdef WLAN_DUMP_MGMTFRAMES |
| 803 | limLog( pMac, LOGE, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"), |
| 804 | fc.protVer, fc.type, fc.subType, |
| 805 | WDA_GET_RX_MAC_RATE_IDX(pRxPacketInfo)); |
| 806 | VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, pHdr, |
| 807 | WDA_GET_RX_MPDU_HEADER_LEN(pRxPacketInfo)); |
| 808 | #endif |
| 809 | |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 810 | if ((fc.type == SIR_MAC_MGMT_FRAME) && |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 811 | (fc.subType != SIR_MAC_MGMT_BEACON)) |
| 812 | { |
Rajeev Kumar Sirasanagandla | 63f85cf | 2016-06-29 16:52:15 +0530 | [diff] [blame] | 813 | limLog(pMac, LOG1, FL("RX MGMT - Type %hu, SubType %hu," |
| 814 | "Seq.no %d, Source mac-addr " |
| 815 | MAC_ADDRESS_STR), fc.type, fc.subType, |
| 816 | ((pHdr->seqControl.seqNumHi << 4) | |
| 817 | (pHdr->seqControl.seqNumLo)), |
| 818 | MAC_ADDR_ARRAY(pHdr->sa)); |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 819 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 820 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Kapil Gupta | 04ab199 | 2016-06-26 13:36:51 +0530 | [diff] [blame] | 821 | if (WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo)) |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 822 | { |
Kapil Gupta | 04ab199 | 2016-06-26 13:36:51 +0530 | [diff] [blame] | 823 | limLog( pMac, LOGW, FL("Notify SME with candidate ind")); |
| 824 | |
| 825 | if (WDA_IF_PER_ROAMCANDIDATEIND(pRxPacketInfo) && |
| 826 | IS_FEATURE_SUPPORTED_BY_FW(PER_BASED_ROAMING) && |
| 827 | pMac->roam.configParam.isPERRoamEnabled) |
| 828 | { |
| 829 | tSirPerRoamScanResult *candidateChanInfo = |
| 830 | (tSirPerRoamScanResult *)WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 831 | int chanInfoLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) |
| 832 | - sizeof(tANI_U32); |
| 833 | |
| 834 | /* Translate network buffer into system buffer */ |
| 835 | vos_buff_to_hl_buff((v_U8_t *)candidateChanInfo, |
| 836 | WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo)); |
| 837 | |
| 838 | /* Max candidates allowed */ |
Kapil Gupta | 3fd3283 | 2016-08-31 17:55:19 +0530 | [diff] [blame] | 839 | if (candidateChanInfo->candidateCount > |
| 840 | SIR_PER_ROAM_MAX_CANDIDATE_CNT) |
Kapil Gupta | 04ab199 | 2016-06-26 13:36:51 +0530 | [diff] [blame] | 841 | { |
| 842 | limLog(pMac, LOGE, |
Kapil Gupta | 3fd3283 | 2016-08-31 17:55:19 +0530 | [diff] [blame] | 843 | FL("Got maximum candidates as %d, setting count as %d"), |
| 844 | candidateChanInfo->candidateCount, |
| 845 | SIR_PER_ROAM_MAX_CANDIDATE_CNT); |
| 846 | candidateChanInfo->candidateCount = |
| 847 | SIR_PER_ROAM_MAX_CANDIDATE_CNT; |
Kapil Gupta | 04ab199 | 2016-06-26 13:36:51 +0530 | [diff] [blame] | 848 | } |
| 849 | |
| 850 | vos_mem_set(&pMac->candidateChannelInfo, |
| 851 | sizeof(tSirCandidateChanInfo) * |
| 852 | SIR_PER_ROAM_MAX_CANDIDATE_CNT, 0); |
| 853 | |
| 854 | vos_mem_copy(&pMac->candidateChannelInfo, |
| 855 | candidateChanInfo->channelInfo, |
| 856 | (sizeof(tSirCandidateChanInfo) * |
| 857 | SIR_PER_ROAM_MAX_CANDIDATE_CNT) < chanInfoLen ? |
| 858 | (sizeof(tSirCandidateChanInfo) * |
| 859 | SIR_PER_ROAM_MAX_CANDIDATE_CNT): |
| 860 | chanInfoLen); |
| 861 | |
| 862 | limLog(pMac, LOG1, |
| 863 | FL("PER based Roam candidates %d"), |
| 864 | candidateChanInfo->candidateCount); |
| 865 | |
| 866 | pMac->PERroamCandidatesCnt = candidateChanInfo->candidateCount; |
| 867 | } else |
| 868 | { |
| 869 | /* Normal RSSI based roaming */ |
| 870 | pMac->PERroamCandidatesCnt = 0; |
| 871 | } |
| 872 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 873 | //send a session 0 for now - TBD |
| 874 | limSendSmeCandidateFoundInd(pMac, 0); |
| 875 | goto end; |
| 876 | } |
| 877 | if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) |
| 878 | { |
| 879 | if (fc.subType == SIR_MAC_MGMT_BEACON) |
| 880 | { |
| 881 | limLog( pMac, LOG2, FL("Save this beacon in LFR cache")); |
| 882 | __limHandleBeacon(pMac, limMsg, NULL); |
| 883 | } |
| 884 | else if (fc.subType == SIR_MAC_MGMT_PROBE_RSP) |
| 885 | { |
| 886 | limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache")); |
| 887 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 888 | } |
| 889 | else |
| 890 | { |
| 891 | limLog( pMac, LOGE, FL("Wrong frame Type %d, Subtype %d for LFR"), |
| 892 | fc.type, fc.subType); |
| 893 | } |
| 894 | goto end; |
| 895 | } |
| 896 | #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 897 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 898 | if (fc.type == SIR_MAC_DATA_FRAME && isFrmFt) |
| 899 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 900 | #if 0 // Ese TBD Need to PORT |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 901 | tpSirMacDot3Hdr pDataFrmHdr; |
| 902 | |
| 903 | pDataFrmHdr = (tpSirMacDot3Hdr)((tANI_U8 *)pBD+ WLANHAL_RX_BD_GET_MPDU_H_OFFSET(pBD)); |
| 904 | if((psessionEntry = peFindSessionByBssid(pMac,pDataFrmHdr->sa,&sessionId))== NULL) |
| 905 | { |
| 906 | limLog( pMac, LOGE, FL("Session not found for Frm type %d, subtype %d, SA: "), fc.type, fc.subType); |
| 907 | limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE); |
| 908 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr); |
| 909 | return; |
| 910 | } |
| 911 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 912 | if (!psessionEntry->isESEconnection) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 913 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 914 | 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] | 915 | fc.type, fc.subType); |
| 916 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pBD, limMsg->bodyptr); |
| 917 | return; |
| 918 | } |
| 919 | limLog( pMac, LOGE, FL("Processing IAPP Frm from SA:")); |
| 920 | limPrintMacAddr(pMac, pDataFrmHdr->sa, LOGE); |
| 921 | #else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 922 | 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] | 923 | #endif |
| 924 | |
| 925 | |
| 926 | } else |
| 927 | #endif |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 928 | |
| 929 | if ((fc.type == SIR_MAC_MGMT_FRAME) && |
| 930 | (fc.subType == SIR_MAC_MGMT_PROBE_RSP) && |
| 931 | pMac->lim.isSpoofingEnabled) |
| 932 | { |
| 933 | limLog( pMac, LOG2, FL("Probe Rsp recieved with DA: "MAC_ADDRESS_STR |
| 934 | " and selfMac Addr:"MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da), |
| 935 | MAC_ADDR_ARRAY(pMac->lim.gSelfMacAddr)); |
| 936 | if (VOS_TRUE == vos_mem_compare((v_VOID_t*) pHdr->da, |
| 937 | (v_VOID_t*) pMac->lim.spoofMacAddr, VOS_MAC_ADDRESS_LEN)) |
| 938 | { |
| 939 | vos_mem_copy(pHdr->da, pMac->lim.gSelfMacAddr, VOS_MAC_ADDRESS_LEN); |
| 940 | } |
| 941 | } |
| 942 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 943 | /* Added For BT-AMP Support */ |
| 944 | if((psessionEntry = peFindSessionByBssid(pMac,pHdr->bssId,&sessionId))== NULL) |
| 945 | { |
| 946 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 947 | if (fc.subType == SIR_MAC_MGMT_AUTH) |
| 948 | { |
| 949 | #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG |
Varun Reddy Yeturu | f68abd6 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 950 | limLog( pMac, LOG1, FL("ProtVersion %d, Type %d, Subtype %d rateIndex=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 951 | 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] | 952 | limPrintMacAddr(pMac, pHdr->bssId, LOG1); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 953 | #endif |
| 954 | if (limProcessAuthFrameNoSession(pMac, pRxPacketInfo, limMsg->bodyptr) == eSIR_SUCCESS) |
| 955 | { |
Kanchanapally, Vidyullatha | c796fc6 | 2015-03-17 10:45:28 +0530 | [diff] [blame] | 956 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 957 | } |
| 958 | } |
| 959 | #endif |
| 960 | if((fc.subType != SIR_MAC_MGMT_PROBE_RSP )&& |
| 961 | (fc.subType != SIR_MAC_MGMT_BEACON)&& |
| 962 | (fc.subType != SIR_MAC_MGMT_PROBE_REQ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 963 | && (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] | 964 | ) |
| 965 | { |
| 966 | |
| 967 | if((psessionEntry = peFindSessionByPeerSta(pMac,pHdr->sa,&sessionId))== NULL) |
| 968 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 969 | limLog(pMac, LOG1, FL("session does not exist for given bssId")); |
Kanchanapally, Vidyullatha | c796fc6 | 2015-03-17 10:45:28 +0530 | [diff] [blame] | 970 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 971 | } |
Padma, Santhosh Kumar | 2b47ca8 | 2014-01-03 16:57:27 +0530 | [diff] [blame] | 972 | else |
| 973 | limLog(pMac,LOG1,"SessionId:%d Session Exist for given Bssid", |
| 974 | psessionEntry->peSessionId); |
Gopichand Nakkala | 6265d6f | 2013-03-20 23:32:50 +0530 | [diff] [blame] | 975 | } |
| 976 | // For p2p resp frames search for valid session with DA as |
| 977 | // BSSID will be SA and session will be present with DA only |
| 978 | if(fc.subType == SIR_MAC_MGMT_ACTION ) |
| 979 | { |
| 980 | psessionEntry = peFindSessionByBssid(pMac,pHdr->da,&sessionId); |
| 981 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 982 | } |
| 983 | |
| 984 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 985 | /* Check if frame is registered by HDD */ |
| 986 | if(limCheckMgmtRegisteredFrames(pMac, pRxPacketInfo, psessionEntry)) |
| 987 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 988 | limLog( pMac, LOG1, FL("Received frame is passed to SME")); |
Kanchanapally, Vidyullatha | c796fc6 | 2015-03-17 10:45:28 +0530 | [diff] [blame] | 989 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 990 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 991 | |
| 992 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 993 | |
| 994 | if (fc.protVer != SIR_MAC_PROTOCOL_VERSION) |
| 995 | { // Received Frame with non-zero Protocol Version |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 996 | limLog(pMac, LOGE, FL("Unexpected frame with protVersion %d received"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 997 | fc.protVer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 998 | #ifdef WLAN_DEBUG |
| 999 | pMac->lim.numProtErr++; |
| 1000 | #endif |
Kanchanapally, Vidyullatha | c796fc6 | 2015-03-17 10:45:28 +0530 | [diff] [blame] | 1001 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1002 | } |
| 1003 | |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 1004 | if (!pMac->fScanOffload) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1005 | { |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 1006 | if (limIsSystemInScanState(pMac)) |
| 1007 | { |
| 1008 | limHandleFramesInScanState(pMac, limMsg, pRxPacketInfo, pDeferMsg, psessionEntry); |
| 1009 | return; |
| 1010 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1011 | } |
| 1012 | |
| 1013 | /* Chance of crashing : to be done BT-AMP ........happens when broadcast probe req is received */ |
| 1014 | |
| 1015 | #if 0 |
| 1016 | if (psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1017 | limLog( pMac, LOGW, FL( "gLimSystemRole is %d. Exiting..." ),psessionEntry->limSystemRole ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1018 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr); |
| 1019 | |
| 1020 | #ifdef WLAN_DEBUG |
| 1021 | pMac->lim.numProtErr++; |
| 1022 | #endif |
| 1023 | return; |
| 1024 | } |
| 1025 | #endif //HACK to continue scanning |
| 1026 | |
| 1027 | |
| 1028 | #ifdef WLAN_DEBUG |
| 1029 | pMac->lim.numMAC[fc.type][fc.subType]++; |
| 1030 | #endif |
| 1031 | |
| 1032 | switch (fc.type) |
| 1033 | { |
| 1034 | case SIR_MAC_MGMT_FRAME: |
| 1035 | { |
| 1036 | #if 0 //TBD-RAJESH fix this |
| 1037 | if (limIsReassocInProgress( pMac,psessionEntry) && (fc.subType != SIR_MAC_MGMT_DISASSOC) && |
| 1038 | (fc.subType != SIR_MAC_MGMT_DEAUTH) && (fc.subType != SIR_MAC_MGMT_REASSOC_RSP)) |
| 1039 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1040 | 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] | 1041 | fc.type, fc.subType); |
| 1042 | return; |
| 1043 | } |
| 1044 | #endif //HACK to continue scanning |
| 1045 | // Received Management frame |
| 1046 | switch (fc.subType) |
| 1047 | { |
| 1048 | case SIR_MAC_MGMT_ASSOC_REQ: |
| 1049 | // Make sure the role supports Association |
| 1050 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1051 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1052 | ) |
| 1053 | limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry); |
| 1054 | |
| 1055 | else |
| 1056 | { |
| 1057 | // Unwanted messages - Log error |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1058 | limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1059 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1060 | } |
| 1061 | break; |
| 1062 | |
| 1063 | case SIR_MAC_MGMT_ASSOC_RSP: |
| 1064 | limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_ASSOC,psessionEntry); |
| 1065 | break; |
| 1066 | |
| 1067 | case SIR_MAC_MGMT_REASSOC_REQ: |
| 1068 | // Make sure the role supports Reassociation |
| 1069 | if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1070 | || (psessionEntry->limSystemRole == eLIM_AP_ROLE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1071 | ){ |
| 1072 | limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry); |
| 1073 | } |
| 1074 | else |
| 1075 | { |
| 1076 | // Unwanted messages - Log error |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1077 | limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1078 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1079 | } |
| 1080 | break; |
| 1081 | |
| 1082 | case SIR_MAC_MGMT_REASSOC_RSP: |
| 1083 | limProcessAssocRspFrame(pMac, pRxPacketInfo, LIM_REASSOC,psessionEntry); |
| 1084 | break; |
| 1085 | |
| 1086 | case SIR_MAC_MGMT_PROBE_REQ: |
| 1087 | limProcessProbeReqFrame_multiple_BSS(pMac, pRxPacketInfo,psessionEntry); |
| 1088 | break; |
| 1089 | |
| 1090 | case SIR_MAC_MGMT_PROBE_RSP: |
| 1091 | if(psessionEntry == NULL) |
| 1092 | limProcessProbeRspFrameNoSession(pMac, pRxPacketInfo); |
| 1093 | else |
| 1094 | limProcessProbeRspFrame(pMac, pRxPacketInfo, psessionEntry); |
| 1095 | break; |
| 1096 | |
| 1097 | case SIR_MAC_MGMT_BEACON: |
| 1098 | __limHandleBeacon(pMac, limMsg,psessionEntry); |
| 1099 | break; |
| 1100 | |
| 1101 | case SIR_MAC_MGMT_DISASSOC: |
| 1102 | limProcessDisassocFrame(pMac, pRxPacketInfo,psessionEntry); |
| 1103 | break; |
| 1104 | |
| 1105 | case SIR_MAC_MGMT_AUTH: |
| 1106 | limProcessAuthFrame(pMac, pRxPacketInfo,psessionEntry); |
| 1107 | break; |
| 1108 | |
| 1109 | case SIR_MAC_MGMT_DEAUTH: |
| 1110 | limProcessDeauthFrame(pMac, pRxPacketInfo,psessionEntry); |
| 1111 | break; |
| 1112 | |
| 1113 | case SIR_MAC_MGMT_ACTION: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1114 | if(psessionEntry == NULL) |
| 1115 | limProcessActionFrameNoSession(pMac, pRxPacketInfo); |
| 1116 | else |
| 1117 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1118 | if (WDA_GET_RX_UNKNOWN_UCAST(pRxPacketInfo)) |
| 1119 | limHandleUnknownA2IndexFrames(pMac, pRxPacketInfo,psessionEntry); |
| 1120 | else |
| 1121 | limProcessActionFrame(pMac, pRxPacketInfo,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1122 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1123 | break; |
| 1124 | default: |
| 1125 | // Received Management frame of 'reserved' subtype |
| 1126 | break; |
| 1127 | } // switch (fc.subType) |
| 1128 | |
| 1129 | } |
| 1130 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1131 | case SIR_MAC_DATA_FRAME: |
| 1132 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1133 | #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1134 | /* We accept data frame (IAPP frame) only if Session is |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1135 | * present and ese connection is established on that |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1136 | * session |
| 1137 | */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1138 | if (psessionEntry && psessionEntry->isESEconnection) { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1139 | limProcessIappFrame(pMac, pRxPacketInfo, psessionEntry); |
| 1140 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1141 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1142 | } |
| 1143 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1144 | default: |
| 1145 | // Received frame of type 'reserved' |
| 1146 | break; |
| 1147 | |
| 1148 | } // switch (fc.type) |
| 1149 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 1150 | end: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1151 | limPktFree(pMac, HAL_TXRX_FRM_802_11_MGMT, pRxPacketInfo, (void *) limMsg->bodyptr) ; |
| 1152 | return; |
| 1153 | } /*** end limHandle80211Frames() ***/ |
| 1154 | |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1155 | /** |
| 1156 | * limSendStopScanOffloadReq() |
| 1157 | * |
| 1158 | *FUNCTION: |
| 1159 | * This function will be called to abort the ongoing offloaded scan |
| 1160 | * request. |
| 1161 | * |
| 1162 | * |
| 1163 | *NOTE: |
| 1164 | * |
| 1165 | * @param pMac Pointer to Global MAC structure |
| 1166 | * @return eHAL_STATUS_SUCCESS or eHAL_STATUS_FAILURE |
| 1167 | */ |
| 1168 | eHalStatus limSendStopScanOffloadReq(tpAniSirGlobal pMac, tANI_U8 SessionId) |
| 1169 | { |
| 1170 | tSirMsgQ msg; |
| 1171 | tSirRetStatus rc = eSIR_SUCCESS; |
| 1172 | tAbortScanParams *pAbortScanParams; |
| 1173 | |
Kiet Lam | b123319 | 2013-11-28 13:38:20 +0530 | [diff] [blame] | 1174 | pAbortScanParams = vos_mem_malloc(sizeof(tAbortScanParams)); |
| 1175 | if (NULL == pAbortScanParams) |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1176 | { |
| 1177 | limLog(pMac, LOGP, FL("Memory allocation failed for AbortScanParams")); |
| 1178 | return eHAL_STATUS_FAILURE; |
| 1179 | } |
| 1180 | |
| 1181 | pAbortScanParams->SessionId = SessionId; |
| 1182 | msg.type = WDA_STOP_SCAN_OFFLOAD_REQ; |
| 1183 | msg.bodyptr = pAbortScanParams; |
| 1184 | msg.bodyval = 0; |
| 1185 | |
| 1186 | rc = wdaPostCtrlMsg(pMac, &msg); |
| 1187 | if (rc != eSIR_SUCCESS) |
| 1188 | { |
Jeff Johnson | 0f4d0bc | 2013-11-03 17:48:50 -0800 | [diff] [blame] | 1189 | limLog(pMac, LOGE, FL("wdaPostCtrlMsg() return failure")); |
Kiet Lam | b123319 | 2013-11-28 13:38:20 +0530 | [diff] [blame] | 1190 | vos_mem_free(pAbortScanParams); |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1191 | return eHAL_STATUS_FAILURE; |
| 1192 | } |
| 1193 | |
Rashmi Ramanna | 6c13a34 | 2014-01-07 11:44:07 +0530 | [diff] [blame] | 1194 | limLog(pMac, LOG1, FL("Abort ongoing offload scan.")); |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1195 | return eHAL_STATUS_SUCCESS; |
| 1196 | |
| 1197 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1198 | |
| 1199 | /** |
| 1200 | * limProcessAbortScanInd() |
| 1201 | * |
| 1202 | *FUNCTION: |
| 1203 | * This function is called from HDD to abort the scan which is presently being run |
| 1204 | * |
| 1205 | * |
| 1206 | *NOTE: |
| 1207 | * |
| 1208 | * @param pMac Pointer to Global MAC structure |
| 1209 | * @param *pMsgBuf A pointer to the SME message buffer |
| 1210 | * @return None |
| 1211 | */ |
| 1212 | void |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1213 | limProcessAbortScanInd(tpAniSirGlobal pMac, tANI_U8 SessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1214 | { |
| 1215 | #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT |
| 1216 | limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT, NULL, 0, 0); |
| 1217 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 1218 | |
| 1219 | /* Deactivate the gLimBackgroundScanTimer as part of the abort scan. |
| 1220 | * SME should send WNI_CFG_BACKGROUND_SCAN_PERIOD indication |
| 1221 | * to start the background scan again |
| 1222 | */ |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 1223 | limLog(pMac, LOG1, FL("Processing AbortScan Ind")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1224 | |
| 1225 | limAbortBackgroundScan(pMac); |
| 1226 | |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1227 | if (pMac->fScanOffload) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1228 | { |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1229 | /* send stop scan cmd to fw if scan offload is enabled. */ |
| 1230 | limSendStopScanOffloadReq(pMac, SessionId); |
| 1231 | } |
| 1232 | else |
| 1233 | { |
| 1234 | /* Abort the scan if its running, else just return */ |
| 1235 | if(limIsSystemInScanState(pMac)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1236 | { |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1237 | if( (eLIM_HAL_INIT_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 1238 | (eLIM_HAL_START_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 1239 | (eLIM_HAL_END_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState ) || |
| 1240 | (eLIM_HAL_FINISH_SCAN_WAIT_STATE == pMac->lim.gLimHalScanState) ) |
| 1241 | { |
| 1242 | //Simply signal we need to abort |
| 1243 | limLog( pMac, LOGW, FL(" waiting for HAL, simply signal abort gLimHalScanState = %d"), pMac->lim.gLimHalScanState ); |
| 1244 | pMac->lim.abortScan = 1; |
| 1245 | } |
| 1246 | else |
| 1247 | { |
| 1248 | //Force abort |
| 1249 | limLog( pMac, LOGW, FL(" Force aborting scan") ); |
| 1250 | pMac->lim.abortScan = 0; |
| 1251 | limDeactivateAndChangeTimer(pMac, eLIM_MIN_CHANNEL_TIMER); |
| 1252 | limDeactivateAndChangeTimer(pMac, eLIM_MAX_CHANNEL_TIMER); |
| 1253 | //Set the resume channel to Any valid channel (invalid). |
| 1254 | //This will instruct HAL to set it to any previous valid channel. |
| 1255 | peSetResumeChannel(pMac, 0, 0); |
| 1256 | limSendHalFinishScanReq(pMac, eLIM_HAL_FINISH_SCAN_WAIT_STATE); |
| 1257 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1258 | } |
| 1259 | } |
| 1260 | return; |
| 1261 | } |
| 1262 | |
| 1263 | /** |
| 1264 | * limMessageProcessor |
| 1265 | * |
| 1266 | *FUNCTION: |
| 1267 | * Wrapper function for limProcessMessages when handling messages received by LIM. |
| 1268 | * Could either defer messages or process them. |
| 1269 | * @param pMac Pointer to Global MAC structure |
| 1270 | * @param limMsg Received LIM message |
| 1271 | * @return None |
| 1272 | */ |
| 1273 | |
| 1274 | void limMessageProcessor(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1275 | { |
| 1276 | if (eLIM_MLM_OFFLINE_STATE == pMac->lim.gLimMlmState) |
| 1277 | { |
| 1278 | peFreeMsg(pMac, limMsg); |
| 1279 | return; |
| 1280 | } |
| 1281 | |
| 1282 | if (!defMsgDecision(pMac, limMsg)) |
| 1283 | { |
| 1284 | limProcessMessages(pMac, limMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1285 | // process deferred message queue if allowed |
| 1286 | { |
| 1287 | if ( (! (pMac->lim.gLimAddtsSent)) |
| 1288 | && |
| 1289 | (! (limIsSystemInScanState(pMac))) |
| 1290 | ) |
| 1291 | { |
| 1292 | if (true == GET_LIM_PROCESS_DEFD_MESGS(pMac)) |
| 1293 | limProcessDeferredMessageQueue(pMac); |
| 1294 | } |
| 1295 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1296 | } |
| 1297 | } |
| 1298 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1299 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1300 | |
| 1301 | void limOemDataRspHandleResumeLinkRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32* mlmOemDataRsp) |
| 1302 | { |
| 1303 | if(status != eHAL_STATUS_SUCCESS) |
| 1304 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1305 | 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] | 1306 | } |
| 1307 | |
| 1308 | if(NULL != pMac->lim.gpLimMlmOemDataReq) |
| 1309 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1310 | vos_mem_free(pMac->lim.gpLimMlmOemDataReq); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1311 | pMac->lim.gpLimMlmOemDataReq = NULL; |
| 1312 | } |
| 1313 | |
| 1314 | //"Failure" status doesn't mean that Oem Data Rsp did not happen |
| 1315 | //and hence we need to respond to upper layers. Only Resume link is failed, but |
| 1316 | //we got the oem data response already. |
| 1317 | //Post the meessage to MLM |
| 1318 | limPostSmeMessage(pMac, LIM_MLM_OEM_DATA_CNF, (tANI_U32*)(mlmOemDataRsp)); |
| 1319 | |
| 1320 | return; |
| 1321 | } |
| 1322 | |
| 1323 | void limProcessOemDataRsp(tpAniSirGlobal pMac, tANI_U32* body) |
| 1324 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1325 | tpLimMlmOemDataRsp mlmOemDataRsp = NULL; |
| 1326 | tpStartOemDataRsp oemDataRsp = NULL; |
| 1327 | |
| 1328 | //Process all the messages for the lim queue |
| 1329 | SET_LIM_PROCESS_DEFD_MESGS(pMac, true); |
| 1330 | |
| 1331 | oemDataRsp = (tpStartOemDataRsp)(body); |
| 1332 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1333 | mlmOemDataRsp = vos_mem_malloc(sizeof(tLimMlmOemDataRsp)); |
| 1334 | if ( NULL == mlmOemDataRsp ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1335 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1336 | limLog(pMac, LOGP, FL("could not allocate memory for mlmOemDataRsp")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1337 | return; |
| 1338 | } |
| 1339 | |
| 1340 | //copy the memory into tLimMlmOemDataRsp and free the tStartOemDataRsp |
| 1341 | //the structures tStartOemDataRsp and tLimMlmOemDataRsp have the same structure |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1342 | vos_mem_copy((void*)(mlmOemDataRsp), (void*)(oemDataRsp), |
| 1343 | sizeof(tLimMlmOemDataRsp)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1344 | |
| 1345 | //Now free the incoming memory |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1346 | vos_mem_free(oemDataRsp); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1347 | |
| 1348 | limResumeLink(pMac, limOemDataRspHandleResumeLinkRsp, (tANI_U32*)mlmOemDataRsp); |
| 1349 | |
| 1350 | return; |
| 1351 | } |
| 1352 | |
| 1353 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1354 | |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 1355 | static tANI_BOOLEAN limAgeOutProbeReq( tpAniSirGlobal pMac, tpSirMsgQ limMsg, |
| 1356 | vos_pkt_t *pVosPkt ) |
| 1357 | { |
| 1358 | tANI_U8 *pRxPacketInfo = NULL; |
| 1359 | tSirMacFrameCtl fc; |
| 1360 | tpSirMacMgmtHdr pHdr=NULL; |
| 1361 | tANI_BOOLEAN match = VOS_FALSE; |
| 1362 | |
| 1363 | limGetBDfromRxPacket(pMac, limMsg->bodyptr, (tANI_U32 **)&pRxPacketInfo); |
| 1364 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1365 | fc = pHdr->fc; |
| 1366 | if ( fc.subType == SIR_MAC_MGMT_PROBE_REQ ) |
| 1367 | { |
| 1368 | if( vos_timer_get_system_ticks() - pVosPkt->timestamp >= MAX_PROBEREQ_TIME ) |
| 1369 | { |
| 1370 | // drop packet |
| 1371 | limLog(pMac, LOGE, |
| 1372 | FL("Dropping Aged Out probe requests. Peer MAC is "MAC_ADDRESS_STR), |
| 1373 | MAC_ADDR_ARRAY(pHdr->sa)); |
| 1374 | |
| 1375 | vos_pkt_return_packet(pVosPkt); |
| 1376 | match = VOS_TRUE; |
| 1377 | } |
| 1378 | } |
| 1379 | return match; |
| 1380 | } |
| 1381 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1382 | /** |
| 1383 | * limProcessMessages |
| 1384 | * |
| 1385 | *FUNCTION: |
| 1386 | * This function is called by limProcessMessageQueue function. This |
| 1387 | * function processes messages received by LIM. |
| 1388 | * |
| 1389 | *LOGIC: |
| 1390 | * Depending on the message type, corresponding function will be |
| 1391 | * called, for example limProcessSmeMessages() will be called to |
| 1392 | * process SME messages received from HDD/Upper layer software module. |
| 1393 | * |
| 1394 | *ASSUMPTIONS: |
| 1395 | * NA |
| 1396 | * |
| 1397 | *NOTE: |
| 1398 | * NA |
| 1399 | * |
| 1400 | * @param pMac Pointer to Global MAC structure |
| 1401 | * @param limMsg Received LIM message |
| 1402 | * @return None |
| 1403 | */ |
| 1404 | |
| 1405 | void |
| 1406 | limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) |
| 1407 | { |
| 1408 | tANI_U8 deferMsg = false; |
| 1409 | tLinkStateParams *linkStateParams; |
| 1410 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1411 | tpPESession pSession; |
| 1412 | #endif |
| 1413 | #if defined(ANI_DVT_DEBUG) |
| 1414 | tSirMsgQ msgQ; |
| 1415 | #endif |
| 1416 | if(pMac->gDriverType == eDRIVER_TYPE_MFG) |
| 1417 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1418 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1419 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1420 | return; |
| 1421 | } |
| 1422 | #ifdef WLAN_DEBUG |
| 1423 | pMac->lim.numTot++; |
| 1424 | #endif |
| 1425 | |
| 1426 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1427 | 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] | 1428 | limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState), |
| 1429 | limMlmStateStr(pMac->lim.gLimMlmState));) |
| 1430 | |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 1431 | /* |
| 1432 | * MTRACE logs not captured for events received from SME |
| 1433 | * SME enums (eWNI_SME_START_REQ) starts with 0x16xx. |
| 1434 | * Compare received SME events with SIR_SME_MODULE_ID |
Konamki, Sreelakshmi | 2bfb8b0 | 2015-07-29 11:41:24 +0530 | [diff] [blame] | 1435 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1436 | |
Konamki, Sreelakshmi | 824f93e | 2015-07-31 12:55:48 +0530 | [diff] [blame] | 1437 | if (SIR_SME_MODULE_ID == (tANI_U8)MAC_TRACE_GET_MODULE_ID(limMsg->type)) |
| 1438 | { |
| 1439 | MTRACE(macTrace(pMac, TRACE_CODE_RX_SME_MSG, NO_SESSION, limMsg->type)); |
| 1440 | } |
| 1441 | else |
| 1442 | { |
| 1443 | /* Omitting below message types as these are too frequent and when crash |
| 1444 | * happens we loose critical trace logs if these are also logged |
| 1445 | */ |
| 1446 | if (limMsg->type != SIR_LIM_MAX_CHANNEL_TIMEOUT && |
| 1447 | limMsg->type != SIR_LIM_MIN_CHANNEL_TIMEOUT && |
| 1448 | limMsg->type != SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT && |
| 1449 | limMsg->type != SIR_CFG_PARAM_UPDATE_IND && |
| 1450 | limMsg->type != SIR_BB_XPORT_MGMT_MSG) |
| 1451 | MTRACE(macTraceMsgRx(pMac, NO_SESSION, |
| 1452 | LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));) |
| 1453 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1454 | switch (limMsg->type) |
| 1455 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1456 | |
| 1457 | case SIR_LIM_UPDATE_BEACON: |
| 1458 | limUpdateBeacon(pMac); |
| 1459 | break; |
| 1460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1461 | case SIR_CFG_PARAM_UPDATE_IND: |
| 1462 | /// CFG parameter updated |
| 1463 | if (limIsSystemInScanState(pMac)) |
| 1464 | { |
| 1465 | // System is in DFS (Learn) mode |
| 1466 | // Defer processsing this message |
| 1467 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1468 | { |
Leela Venkata Kiran Kumar Reddy Chirala | 2247e96 | 2013-03-22 19:21:10 -0700 | [diff] [blame] | 1469 | if(!(pMac->lim.deferredMsgCnt & 0xF)) |
| 1470 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1471 | 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] | 1472 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1473 | 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] | 1474 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1475 | limLogSessionStates(pMac); |
| 1476 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 1477 | } |
| 1478 | } |
| 1479 | else |
| 1480 | { |
| 1481 | limHandleCFGparamUpdate(pMac, limMsg->bodyval); |
| 1482 | } |
| 1483 | |
| 1484 | break; |
| 1485 | |
| 1486 | case WDA_INIT_SCAN_RSP: |
| 1487 | limProcessInitScanRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1488 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1489 | break; |
| 1490 | |
| 1491 | case WDA_START_SCAN_RSP: |
| 1492 | limProcessStartScanRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1493 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1494 | break; |
| 1495 | |
| 1496 | case WDA_END_SCAN_RSP: |
| 1497 | limProcessEndScanRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1498 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1499 | break; |
| 1500 | |
| 1501 | case WDA_FINISH_SCAN_RSP: |
| 1502 | limProcessFinishScanRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1503 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1504 | break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1505 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1506 | case WDA_START_OEM_DATA_RSP: |
| 1507 | limProcessOemDataRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1508 | limMsg->bodyptr = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1509 | break; |
| 1510 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1511 | |
| 1512 | case WDA_SWITCH_CHANNEL_RSP: |
| 1513 | limProcessSwitchChannelRsp(pMac, limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 1514 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1515 | break; |
| 1516 | |
| 1517 | #ifdef ANI_SIR_IBSS_PEER_CACHING |
| 1518 | case WDA_IBSS_STA_ADD: |
| 1519 | limIbssStaAdd(pMac, limMsg->bodyptr); |
| 1520 | break; |
| 1521 | #endif |
| 1522 | case SIR_BB_XPORT_MGMT_MSG: |
| 1523 | // These messages are from Peer MAC entity. |
| 1524 | #ifdef WLAN_DEBUG |
| 1525 | pMac->lim.numBbt++; |
| 1526 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1527 | { |
| 1528 | v_U16_t pktLen = 0; |
| 1529 | vos_pkt_t *pVosPkt; |
| 1530 | VOS_STATUS vosStatus; |
| 1531 | tSirMsgQ limMsgNew; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1532 | /* The original limMsg which we were deferring have the |
| 1533 | * bodyPointer point to 'BD' instead of 'Vos pkt'. If we don't make a copy |
| 1534 | * of limMsg, then vos_pkt_peek_data will overwrite the limMsg->bodyPointer. |
| 1535 | * and next time when we try to process the msg, we will try to use 'BD' as |
| 1536 | * 'Vos Pkt' which will cause a crash |
| 1537 | */ |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1538 | vos_mem_copy((tANI_U8*)&limMsgNew, (tANI_U8*)limMsg, |
| 1539 | sizeof(tSirMsgQ)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1540 | pVosPkt = (vos_pkt_t *)limMsgNew.bodyptr; |
| 1541 | vos_pkt_get_packet_length(pVosPkt, &pktLen); |
| 1542 | |
| 1543 | vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&limMsgNew.bodyptr, VOS_FALSE ); |
| 1544 | |
| 1545 | if( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 1546 | { |
Katya Nigam | fdf5a52 | 2015-02-03 14:38:55 +0530 | [diff] [blame] | 1547 | limDecrementPendingMgmtCount(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1548 | vos_pkt_return_packet(pVosPkt); |
| 1549 | break; |
| 1550 | |
| 1551 | } |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 1552 | |
Padma, Santhosh Kumar | 30971cf | 2015-04-06 19:59:37 +0530 | [diff] [blame] | 1553 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 1554 | if (WDA_GET_ROAMCANDIDATEIND(limMsgNew.bodyptr)) |
| 1555 | limLog(pMac, LOG1, FL("roamCandidateInd %d"), |
| 1556 | WDA_GET_ROAMCANDIDATEIND(limMsgNew.bodyptr)); |
| 1557 | |
| 1558 | if (WDA_GET_OFFLOADSCANLEARN(limMsgNew.bodyptr)) |
| 1559 | limLog(pMac, LOG1, FL("offloadScanLearn %d"), |
| 1560 | WDA_GET_OFFLOADSCANLEARN(limMsgNew.bodyptr)); |
| 1561 | #endif |
| 1562 | |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 1563 | /* |
| 1564 | * putting a check for age out probe request frames |
| 1565 | * such that any probe req more than 0.5 sec old can directly |
| 1566 | * be dropped. With this, there won't be blocking of MC thread. |
| 1567 | */ |
| 1568 | |
| 1569 | if( limAgeOutProbeReq ( pMac, &limMsgNew, pVosPkt )) |
| 1570 | { |
Katya Nigam | fdf5a52 | 2015-02-03 14:38:55 +0530 | [diff] [blame] | 1571 | limDecrementPendingMgmtCount(pMac); |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 1572 | break; |
| 1573 | } |
| 1574 | |
Katya Nigam | 3802f20 | 2013-12-16 19:27:14 +0530 | [diff] [blame] | 1575 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1576 | limHandle80211Frames(pMac, &limMsgNew, &deferMsg); |
| 1577 | |
| 1578 | if ( deferMsg == true ) |
| 1579 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1580 | limLog(pMac, LOG2, FL("Defer message type=%X "), |
| 1581 | limMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1582 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 1583 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1584 | 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] | 1585 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 1586 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 1587 | limLogSessionStates(pMac); |
| 1588 | limPrintMsgName(pMac, LOGE, limMsg->type); |
Katya Nigam | fdf5a52 | 2015-02-03 14:38:55 +0530 | [diff] [blame] | 1589 | limDecrementPendingMgmtCount(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1590 | vos_pkt_return_packet(pVosPkt); |
| 1591 | } |
| 1592 | } |
| 1593 | else |
| 1594 | { |
| 1595 | /* PE is not deferring this 802.11 frame so we need to call vos_pkt_return. |
| 1596 | * Asumption here is when Rx mgmt frame processing is done, |
| 1597 | * voss packet could be freed here. |
| 1598 | */ |
Katya Nigam | fdf5a52 | 2015-02-03 14:38:55 +0530 | [diff] [blame] | 1599 | limDecrementPendingMgmtCount(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1600 | vos_pkt_return_packet(pVosPkt); |
| 1601 | } |
| 1602 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1603 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1604 | case eWNI_SME_SCAN_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1605 | case eWNI_SME_REMAIN_ON_CHANNEL_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1606 | case eWNI_SME_DISASSOC_REQ: |
| 1607 | case eWNI_SME_DEAUTH_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1608 | case eWNI_SME_GET_SCANNED_CHANNEL_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1609 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1610 | case eWNI_SME_OEM_DATA_REQ: |
| 1611 | #endif |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1612 | #ifdef FEATURE_WLAN_TDLS |
| 1613 | case eWNI_SME_TDLS_SEND_MGMT_REQ: |
| 1614 | case eWNI_SME_TDLS_ADD_STA_REQ: |
| 1615 | case eWNI_SME_TDLS_DEL_STA_REQ: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1616 | case eWNI_SME_TDLS_LINK_ESTABLISH_REQ: |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 1617 | // tdlsoffchan |
| 1618 | case eWNI_SME_TDLS_CHANNEL_SWITCH_REQ: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1619 | #endif |
Gopichand Nakkala | cca24d1 | 2013-03-07 17:05:07 +0530 | [diff] [blame] | 1620 | case eWNI_SME_RESET_AP_CAPS_CHANGED: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1621 | // These messages are from HDD |
| 1622 | limProcessNormalHddMsg(pMac, limMsg, true); //need to response to hdd |
| 1623 | break; |
| 1624 | |
| 1625 | case eWNI_SME_SCAN_ABORT_IND: |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1626 | { |
| 1627 | tANI_U8 *pSessionId = (tANI_U8 *)limMsg->bodyptr; |
| 1628 | limProcessAbortScanInd(pMac, *pSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1629 | vos_mem_free((v_VOID_t *)limMsg->bodyptr); |
| 1630 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1631 | break; |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 1632 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1633 | case eWNI_SME_START_REQ: |
| 1634 | case eWNI_SME_SYS_READY_IND: |
| 1635 | #ifndef WNI_ASKEY_NON_SUPPORT_FEATURE |
| 1636 | case eWNI_SME_JOIN_REQ: |
| 1637 | #endif |
| 1638 | case eWNI_SME_AUTH_REQ: |
| 1639 | case eWNI_SME_REASSOC_REQ: |
| 1640 | case eWNI_SME_START_BSS_REQ: |
| 1641 | case eWNI_SME_STOP_BSS_REQ: |
| 1642 | case eWNI_SME_SWITCH_CHL_REQ: |
| 1643 | case eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ: |
| 1644 | case eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ: |
| 1645 | case eWNI_SME_SETCONTEXT_REQ: |
| 1646 | case eWNI_SME_REMOVEKEY_REQ: |
| 1647 | #ifndef WNI_ASKEY_NON_SUPPORT_FEATURE |
| 1648 | case eWNI_SME_PROMISCUOUS_MODE_REQ: |
| 1649 | #endif |
| 1650 | case eWNI_SME_DISASSOC_CNF: |
| 1651 | case eWNI_SME_DEAUTH_CNF: |
| 1652 | case eWNI_SME_ASSOC_CNF: |
| 1653 | case eWNI_SME_REASSOC_CNF: |
| 1654 | case eWNI_SME_ADDTS_REQ: |
| 1655 | case eWNI_SME_DELTS_REQ: |
| 1656 | case eWNI_SME_DEL_BA_PEER_IND: |
| 1657 | case eWNI_SME_SET_TX_POWER_REQ: |
| 1658 | case eWNI_SME_GET_TX_POWER_REQ: |
| 1659 | case eWNI_SME_GET_NOISE_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1660 | case eWNI_SME_GET_ASSOC_STAS_REQ: |
| 1661 | case eWNI_SME_TKIP_CNTR_MEAS_REQ: |
| 1662 | case eWNI_SME_UPDATE_APWPSIE_REQ: |
| 1663 | case eWNI_SME_HIDE_SSID_REQ: |
| 1664 | case eWNI_SME_GET_WPSPBC_SESSION_REQ: |
| 1665 | case eWNI_SME_SET_APWPARSNIEs_REQ: |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 1666 | case eWNI_SME_CHNG_MCC_BEACON_INTERVAL: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1667 | #if defined WLAN_FEATURE_VOWIFI |
| 1668 | case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: |
| 1669 | case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND: |
| 1670 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1671 | #if defined FEATURE_WLAN_ESE |
| 1672 | case eWNI_SME_ESE_ADJACENT_AP_REPORT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1673 | #endif |
| 1674 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1675 | case eWNI_SME_FT_UPDATE_KEY: |
| 1676 | case eWNI_SME_FT_PRE_AUTH_REQ: |
| 1677 | case eWNI_SME_FT_AGGR_QOS_REQ: |
| 1678 | #endif |
| 1679 | case eWNI_SME_ADD_STA_SELF_REQ: |
| 1680 | case eWNI_SME_DEL_STA_SELF_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1681 | case eWNI_SME_REGISTER_MGMT_FRAME_REQ: |
| 1682 | case eWNI_SME_UPDATE_NOA: |
Gopichand Nakkala | c178ac8 | 2013-05-30 19:53:39 +0530 | [diff] [blame] | 1683 | case eWNI_SME_CLEAR_DFS_CHANNEL_LIST: |
Madan Mohan Koyyalamudi | 44bbc15 | 2013-07-05 21:13:10 +0530 | [diff] [blame] | 1684 | case eWNI_SME_STA_STAT_REQ: |
| 1685 | case eWNI_SME_AGGR_STAT_REQ: |
| 1686 | case eWNI_SME_GLOBAL_STAT_REQ: |
| 1687 | case eWNI_SME_STAT_SUMM_REQ: |
| 1688 | case eWNI_SME_GET_STATISTICS_REQ: |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1689 | #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] | 1690 | case eWNI_SME_GET_ROAM_RSSI_REQ: |
| 1691 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1692 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1693 | case eWNI_SME_GET_TSM_STATS_REQ: |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1694 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 1695 | case eWNI_SME_MAC_SPOOF_ADDR_IND: |
Abhishek Singh | 7d624e1 | 2015-11-30 14:29:27 +0530 | [diff] [blame] | 1696 | case eWNI_SME_REGISTER_MGMT_FRAME_CB: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1697 | // These messages are from HDD |
| 1698 | limProcessNormalHddMsg(pMac, limMsg, false); //no need to response to hdd |
| 1699 | break; |
| 1700 | |
| 1701 | //Power Save Messages From HDD |
| 1702 | case eWNI_PMC_PWR_SAVE_CFG: |
| 1703 | case eWNI_PMC_ENTER_BMPS_REQ: |
| 1704 | case eWNI_PMC_EXIT_BMPS_REQ: |
| 1705 | case eWNI_PMC_ENTER_IMPS_REQ: |
| 1706 | case eWNI_PMC_EXIT_IMPS_REQ: |
| 1707 | case eWNI_PMC_ENTER_UAPSD_REQ: |
| 1708 | case eWNI_PMC_EXIT_UAPSD_REQ: |
| 1709 | case eWNI_PMC_ENTER_WOWL_REQ: |
| 1710 | case eWNI_PMC_EXIT_WOWL_REQ: |
| 1711 | case eWNI_PMC_WOWL_ADD_BCAST_PTRN: |
| 1712 | case eWNI_PMC_WOWL_DEL_BCAST_PTRN: |
| 1713 | pmmProcessMessage(pMac, limMsg); |
| 1714 | break; |
| 1715 | |
| 1716 | case eWNI_PMC_SMPS_STATE_IND : |
| 1717 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1718 | if(limMsg->bodyptr){ |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1719 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1720 | limMsg->bodyptr = NULL; |
| 1721 | } |
| 1722 | } |
| 1723 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1724 | case eWNI_SME_SEND_ACTION_FRAME_IND: |
| 1725 | limSendP2PActionFrame(pMac, limMsg); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1726 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1727 | limMsg->bodyptr = NULL; |
| 1728 | break; |
| 1729 | case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND: |
| 1730 | limAbortRemainOnChan(pMac); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1731 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1732 | limMsg->bodyptr = NULL; |
| 1733 | break; |
| 1734 | |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 1735 | #ifdef WLAN_FEATURE_RMC |
| 1736 | case eWNI_SME_ENABLE_RMC_REQ: |
| 1737 | case eWNI_SME_DISABLE_RMC_REQ: |
| 1738 | /* |
| 1739 | * These messages are from HDD |
| 1740 | * No need to response to hdd |
| 1741 | */ |
| 1742 | limProcessSmeReqMessages(pMac,limMsg); |
| 1743 | break; |
| 1744 | #endif /* WLAN_FEATURE_RMC */ |
| 1745 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1746 | case SIR_HAL_P2P_NOA_START_IND: |
| 1747 | { |
| 1748 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 1749 | tANI_U8 i; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1750 | tANI_U8 p2pGOExists = 0; |
Gopichand Nakkala | 78a6c81 | 2013-05-13 16:39:49 +0530 | [diff] [blame] | 1751 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1752 | limLog(pMac, LOG1, "LIM received NOA start %x", limMsg->type); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1753 | |
| 1754 | /* Since insert NOA is done and NOA start msg received, we should deactivate the Insert NOA timer */ |
| 1755 | limDeactivateAndChangeTimer(pMac, eLIM_INSERT_SINGLESHOT_NOA_TIMER); |
| 1756 | |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1757 | for(i=0; i < pMac->lim.maxBssId; i++) |
| 1758 | { |
| 1759 | psessionEntry = &pMac->lim.gpSession[i]; |
| 1760 | if ( (psessionEntry != NULL) && (psessionEntry->valid) && |
| 1761 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 1762 | { //Save P2P NOA start attributes for P2P Go persona |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1763 | p2pGOExists = 1; |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1764 | vos_mem_copy(&psessionEntry->p2pGoPsNoaStartInd, limMsg->bodyptr, |
| 1765 | sizeof(tSirP2PNoaStart)); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1766 | if (psessionEntry->p2pGoPsNoaStartInd.status != eHAL_STATUS_SUCCESS) |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1767 | { |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1768 | 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] | 1769 | " - still go ahead with deferred sme req. This is just info"), |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1770 | psessionEntry->p2pGoPsNoaStartInd.status); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1771 | } |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1772 | break; |
| 1773 | } |
| 1774 | } |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1775 | |
| 1776 | if (p2pGOExists == 0) |
| 1777 | { |
| 1778 | 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] | 1779 | " - still go ahead with deferred sme req. This is just info")); |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1780 | } |
| 1781 | |
| 1782 | /* We received the NOA start indication. Now we can send down the SME request which requires off-channel operation */ |
| 1783 | limProcessRegdDefdSmeReqAfterNOAStart(pMac); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1784 | vos_mem_free(limMsg->bodyptr); |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1785 | limMsg->bodyptr = NULL; |
Viral Modi | d440e68 | 2013-03-06 02:25:31 -0800 | [diff] [blame] | 1786 | } |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1787 | break; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1788 | #ifdef FEATURE_WLAN_TDLS |
| 1789 | case SIR_HAL_TDLS_IND: |
| 1790 | { |
| 1791 | tSirTdlsInd *pTdlsInd = (tpSirTdlsInd)limMsg->bodyptr ; |
| 1792 | tpDphHashNode pStaDs = NULL ; |
| 1793 | tpPESession psessionEntry = NULL; |
| 1794 | tANI_U8 sessionId; |
| 1795 | if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL) |
| 1796 | { |
| 1797 | limLog(pMac, LOG1, FL("session does not exist for given bssId\n")); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1798 | vos_mem_free(limMsg->bodyptr); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1799 | limMsg->bodyptr = NULL; |
| 1800 | return; |
| 1801 | } |
| 1802 | if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL) |
| 1803 | { |
| 1804 | limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n")); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1805 | vos_mem_free(limMsg->bodyptr); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1806 | limMsg->bodyptr = NULL; |
| 1807 | return; |
| 1808 | } |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1809 | |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1810 | if ((STA_ENTRY_TDLS_PEER == pStaDs->staType)) |
| 1811 | { |
| 1812 | limLog(pMac, LOGE, |
| 1813 | FL("received TDLS Indication from the Firmware with Reason Code %d "), |
| 1814 | pTdlsInd->reasonCode); |
| 1815 | limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry, |
Gopichand Nakkala | 574f6d1 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 1816 | pTdlsInd->reasonCode); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1817 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1818 | vos_mem_free(limMsg->bodyptr); |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1819 | limMsg->bodyptr = NULL; |
| 1820 | } |
| 1821 | break; |
| 1822 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1823 | case SIR_HAL_P2P_NOA_ATTR_IND: |
| 1824 | { |
| 1825 | tpPESession psessionEntry = &pMac->lim.gpSession[0]; |
| 1826 | tANI_U8 i; |
| 1827 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1828 | limLog(pMac, LOGW, FL("Received message Noa_ATTR %x"), limMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1829 | for(i=0; i < pMac->lim.maxBssId; i++) |
| 1830 | { |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1831 | psessionEntry = &pMac->lim.gpSession[i]; |
| 1832 | if ( (psessionEntry != NULL) && (psessionEntry->valid) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1833 | (psessionEntry->pePersona == VOS_P2P_GO_MODE)) |
| 1834 | { //Save P2P attributes for P2P Go persona |
| 1835 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1836 | vos_mem_copy(&psessionEntry->p2pGoPsUpdate, limMsg->bodyptr, |
| 1837 | sizeof(tSirP2PNoaAttr)); |
| 1838 | |
Arif Hussain | 24bafea | 2013-11-15 15:10:03 -0800 | [diff] [blame] | 1839 | limLog(pMac, LOG2, FL(" &psessionEntry->bssId " |
| 1840 | MAC_ADDRESS_STR " ctWin=%d oppPsFlag=%d"), |
| 1841 | MAC_ADDR_ARRAY(psessionEntry->bssId), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1842 | psessionEntry->p2pGoPsUpdate.ctWin, |
| 1843 | psessionEntry->p2pGoPsUpdate.oppPsFlag); |
| 1844 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1845 | limLog(pMac, LOG2, FL(" uNoa1IntervalCnt=%d uNoa1Duration=%d uNoa1Interval=%d uNoa1StartTime=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1846 | psessionEntry->p2pGoPsUpdate.uNoa1IntervalCnt, |
| 1847 | psessionEntry->p2pGoPsUpdate.uNoa1Duration, |
| 1848 | psessionEntry->p2pGoPsUpdate.uNoa1Interval, |
| 1849 | psessionEntry->p2pGoPsUpdate.uNoa1StartTime); |
| 1850 | |
| 1851 | |
| 1852 | break; |
| 1853 | } |
| 1854 | } |
| 1855 | |
| 1856 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1857 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1858 | limMsg->bodyptr = NULL; |
| 1859 | |
| 1860 | break; |
| 1861 | |
| 1862 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1863 | /* eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER Message comes after the |
| 1864 | * device comes out of full power for the full power request sent |
| 1865 | * because of channel switch with switch count as 0, so call the same |
| 1866 | * function used in timeout case(i.e SIR_LIM_CHANNEL_SWITCH_TIMEOUT) |
| 1867 | * for switching the channel*/ |
| 1868 | case eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1869 | if ( !tx_timer_running(&pMac->lim.limTimers.gLimChannelSwitchTimer) ) |
| 1870 | { |
| 1871 | limProcessChannelSwitchTimeout(pMac); |
| 1872 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1873 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1874 | limMsg->bodyptr = NULL; |
| 1875 | break; |
| 1876 | |
| 1877 | //Power Save Related Messages From HAL |
| 1878 | case WDA_ENTER_BMPS_RSP: |
| 1879 | case WDA_EXIT_BMPS_RSP: |
| 1880 | case WDA_EXIT_BMPS_IND: |
| 1881 | case WDA_ENTER_IMPS_RSP: |
| 1882 | case WDA_EXIT_IMPS_RSP: |
| 1883 | case WDA_ENTER_UAPSD_RSP: |
| 1884 | case WDA_EXIT_UAPSD_RSP: |
| 1885 | case WDA_WOWL_ENTER_RSP: |
| 1886 | case WDA_WOWL_EXIT_RSP: |
| 1887 | pmmProcessMessage(pMac, limMsg); |
| 1888 | break; |
| 1889 | |
| 1890 | case WDA_LOW_RSSI_IND: |
| 1891 | //limHandleLowRssiInd(pMac); |
| 1892 | break; |
| 1893 | |
| 1894 | case WDA_BMPS_STATUS_IND: |
| 1895 | limHandleBmpsStatusInd(pMac); |
| 1896 | break; |
| 1897 | |
| 1898 | case WDA_MISSED_BEACON_IND: |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 1899 | limHandleMissedBeaconInd(pMac, limMsg); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1900 | vos_mem_free(limMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 1901 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1902 | break; |
| 1903 | case WDA_MIC_FAILURE_IND: |
| 1904 | limMicFailureInd(pMac, limMsg); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 1905 | vos_mem_free(limMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1906 | limMsg->bodyptr = NULL; |
| 1907 | break; |
| 1908 | |
Sachin Ahuja | 3d47fcd | 2015-08-28 16:02:06 +0530 | [diff] [blame] | 1909 | case WDA_LOST_LINK_PARAMS_IND: |
| 1910 | limProcessLostLinkParamsInd(pMac,limMsg); |
| 1911 | vos_mem_free(limMsg->bodyptr); |
| 1912 | limMsg->bodyptr = NULL; |
| 1913 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1914 | |
| 1915 | case SIR_LIM_ADDTS_RSP_TIMEOUT: |
| 1916 | limProcessSmeReqMessages(pMac,limMsg); |
| 1917 | break; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1918 | #ifdef FEATURE_WLAN_ESE |
| 1919 | case SIR_LIM_ESE_TSM_TIMEOUT: |
| 1920 | #ifndef FEATURE_WLAN_ESE_UPLOAD |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1921 | limProcessTsmTimeoutHandler(pMac,limMsg); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1922 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1923 | break; |
| 1924 | case WDA_TSM_STATS_RSP: |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1925 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
| 1926 | limSendSmePEEseTsmRsp(pMac, (tAniGetTsmStatsRsp *)limMsg->bodyptr); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1927 | #else |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1928 | limProcessHalEseTsmRsp(pMac, limMsg); |
| 1929 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1930 | break; |
| 1931 | #endif |
| 1932 | case WDA_ADD_TS_RSP: |
| 1933 | limProcessHalAddTsRsp(pMac, limMsg); |
| 1934 | break; |
| 1935 | |
| 1936 | case SIR_LIM_DEL_TS_IND: |
| 1937 | limProcessDelTsInd(pMac, limMsg); |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 1938 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1939 | case SIR_LIM_ADD_BA_IND: |
| 1940 | limProcessAddBaInd(pMac, limMsg); |
| 1941 | break; |
| 1942 | case SIR_LIM_DEL_BA_ALL_IND: |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1943 | limDelAllBASessions(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1944 | break; |
| 1945 | case SIR_LIM_DEL_BA_IND: |
| 1946 | limProcessMlmHalBADeleteInd( pMac, limMsg ); |
| 1947 | break; |
| 1948 | |
| 1949 | case SIR_LIM_BEACON_GEN_IND: { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1950 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1951 | if( pMac->lim.gLimSystemRole != eLIM_AP_ROLE ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1952 | schProcessPreBeaconInd(pMac, limMsg); |
| 1953 | |
| 1954 | } |
| 1955 | break; |
| 1956 | |
| 1957 | case SIR_LIM_DELETE_STA_CONTEXT_IND: |
| 1958 | limDeleteStaContext(pMac, limMsg); |
| 1959 | break; |
| 1960 | |
| 1961 | case SIR_LIM_MIN_CHANNEL_TIMEOUT: |
| 1962 | case SIR_LIM_MAX_CHANNEL_TIMEOUT: |
| 1963 | case SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT: |
| 1964 | case SIR_LIM_JOIN_FAIL_TIMEOUT: |
Madan Mohan Koyyalamudi | 9aff9ff | 2012-11-29 11:27:25 -0800 | [diff] [blame] | 1965 | case SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1966 | case SIR_LIM_AUTH_FAIL_TIMEOUT: |
| 1967 | case SIR_LIM_AUTH_RSP_TIMEOUT: |
| 1968 | case SIR_LIM_ASSOC_FAIL_TIMEOUT: |
| 1969 | case SIR_LIM_REASSOC_FAIL_TIMEOUT: |
| 1970 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1971 | case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT: |
| 1972 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1973 | case SIR_LIM_REMAIN_CHN_TIMEOUT: |
Viral Modi | d86bde2 | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 1974 | case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT: |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 1975 | case SIR_LIM_DISASSOC_ACK_TIMEOUT: |
| 1976 | case SIR_LIM_DEAUTH_ACK_TIMEOUT: |
Gopichand Nakkala | d492d20 | 2013-05-10 02:50:47 +0530 | [diff] [blame] | 1977 | case SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE: |
Sushant Kaushik | 9e92387 | 2015-04-02 17:09:31 +0530 | [diff] [blame] | 1978 | case SIR_LIM_AUTH_RETRY_TIMEOUT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1979 | // These timeout messages are handled by MLM sub module |
| 1980 | |
| 1981 | limProcessMlmReqMessages(pMac, |
| 1982 | limMsg); |
| 1983 | |
| 1984 | break; |
| 1985 | |
| 1986 | case SIR_LIM_HEART_BEAT_TIMEOUT: |
| 1987 | /** check if heart beat failed, even if one Beacon |
| 1988 | * is rcvd within the Heart Beat interval continue |
| 1989 | * normal processing |
| 1990 | */ |
| 1991 | |
| 1992 | #if 0 |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 1993 | 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] | 1994 | pMac->lim.gLimSmeState, pMac->lim.gLimMlmState, |
| 1995 | pMac->lim.gLimRxedBeaconCntDuringHB);) |
| 1996 | |
| 1997 | if(pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE) |
| 1998 | limIbssHeartBeatHandle(pMac); //HeartBeat for peers. |
| 1999 | else |
| 2000 | /** |
| 2001 | * Heartbeat failure occurred on STA |
| 2002 | * This is handled by LMM sub module. |
| 2003 | */ |
| 2004 | limHandleHeartBeatFailure(pMac); |
| 2005 | |
| 2006 | break; |
| 2007 | #endif //TO SUPPORT BT-AMP |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2008 | if (limIsSystemInScanState(pMac)) |
| 2009 | { |
| 2010 | // System is in DFS (Learn) mode |
| 2011 | // Defer processsing this message |
| 2012 | if (limDeferMsg(pMac, limMsg) != TX_SUCCESS) |
| 2013 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2014 | 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] | 2015 | limMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 2016 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 2017 | limLogSessionStates(pMac); |
| 2018 | } |
| 2019 | } |
| 2020 | else |
| 2021 | { |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 2022 | if (NULL == limMsg->bodyptr) |
| 2023 | { |
| 2024 | limHandleHeartBeatTimeout(pMac); |
| 2025 | } |
| 2026 | else |
| 2027 | { |
| 2028 | limHandleHeartBeatTimeoutForSession(pMac, (tpPESession)limMsg->bodyptr); |
| 2029 | } |
Gopichand Nakkala | 78a6c81 | 2013-05-13 16:39:49 +0530 | [diff] [blame] | 2030 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2031 | break; |
Leela Venkata Kiran Kumar Reddy Chirala | 3ca1790 | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 2032 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2033 | case SIR_LIM_PROBE_HB_FAILURE_TIMEOUT: |
| 2034 | limHandleHeartBeatFailureTimeout(pMac); |
| 2035 | break; |
| 2036 | |
| 2037 | case SIR_LIM_CHANNEL_SCAN_TIMEOUT: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | /** |
| 2039 | * Background scan timeout occurred on STA. |
| 2040 | * This is handled by LMM sub module. |
| 2041 | */ |
| 2042 | limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER); |
| 2043 | |
| 2044 | //We will do background scan even in bcnps mode |
| 2045 | //if (pMac->sys.gSysEnableScanMode) |
| 2046 | pMac->lim.gLimReportBackgroundScanResults = FALSE; |
| 2047 | limTriggerBackgroundScan(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2048 | break; |
| 2049 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2050 | case SIR_LIM_CNF_WAIT_TIMEOUT: |
| 2051 | |
| 2052 | /* |
| 2053 | ** Does not receive CNF or dummy packet |
| 2054 | **/ |
| 2055 | limHandleCnfWaitTimeout(pMac, (tANI_U16) limMsg->bodyval); |
| 2056 | |
| 2057 | break; |
| 2058 | |
| 2059 | case SIR_LIM_KEEPALIVE_TIMEOUT: |
| 2060 | limSendKeepAliveToPeer(pMac); |
| 2061 | |
| 2062 | break; |
| 2063 | |
| 2064 | case SIR_LIM_RETRY_INTERRUPT_MSG: |
| 2065 | // Message from ISR upon TFP's max retry limit interrupt |
| 2066 | |
| 2067 | break; |
| 2068 | |
| 2069 | case SIR_LIM_INV_KEY_INTERRUPT_MSG: |
| 2070 | // Message from ISR upon SP's Invalid session key interrupt |
| 2071 | |
| 2072 | break; |
| 2073 | |
| 2074 | case SIR_LIM_KEY_ID_INTERRUPT_MSG: |
| 2075 | // Message from ISR upon SP's Invalid key ID interrupt |
| 2076 | |
| 2077 | break; |
| 2078 | |
| 2079 | case SIR_LIM_REPLAY_THRES_INTERRUPT_MSG: |
| 2080 | // Message from ISR upon SP's Replay threshold interrupt |
| 2081 | |
| 2082 | break; |
| 2083 | |
| 2084 | case SIR_LIM_CHANNEL_SWITCH_TIMEOUT: |
| 2085 | limProcessChannelSwitchTimeout(pMac); |
| 2086 | break; |
| 2087 | |
| 2088 | case SIR_LIM_QUIET_TIMEOUT: |
| 2089 | limProcessQuietTimeout(pMac); |
| 2090 | break; |
| 2091 | |
| 2092 | case SIR_LIM_QUIET_BSS_TIMEOUT: |
| 2093 | limProcessQuietBssTimeout(pMac); |
| 2094 | break; |
| 2095 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2096 | case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT: |
| 2097 | limHandleUpdateOlbcCache(pMac); |
| 2098 | break; |
| 2099 | #if 0 |
| 2100 | case SIR_LIM_WPS_OVERLAP_TIMEOUT: |
| 2101 | limProcessWPSOverlapTimeout(pMac); |
| 2102 | break; |
| 2103 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2104 | case WDA_ADD_BSS_RSP: |
| 2105 | limProcessMlmAddBssRsp( pMac, limMsg ); |
| 2106 | break; |
| 2107 | |
| 2108 | case WDA_ADD_STA_RSP: |
| 2109 | |
| 2110 | //call a wrapper by paasing bodyptr, their get sessionID and and call proper function from there. |
| 2111 | limProcessAddStaRsp(pMac,limMsg); |
| 2112 | break; |
| 2113 | |
| 2114 | case WDA_DELETE_STA_RSP: |
| 2115 | limProcessMlmDelStaRsp(pMac, limMsg); |
| 2116 | break; |
| 2117 | |
| 2118 | case WDA_ADD_STA_SELF_RSP: |
| 2119 | limProcessAddStaSelfRsp(pMac, limMsg); |
| 2120 | break; |
| 2121 | case WDA_DEL_STA_SELF_RSP: |
| 2122 | limProcessDelStaSelfRsp(pMac, limMsg); |
| 2123 | break; |
| 2124 | |
| 2125 | case WDA_DELETE_BSS_RSP: |
| 2126 | limHandleDeleteBssRsp(pMac,limMsg); //wrapper routine to handle delete bss response |
| 2127 | break; |
| 2128 | |
| 2129 | case WDA_SET_BSSKEY_RSP: |
| 2130 | case WDA_SET_STA_BCASTKEY_RSP: |
| 2131 | limProcessMlmSetBssKeyRsp( pMac, limMsg ); |
| 2132 | break; |
| 2133 | case WDA_SET_STAKEY_RSP: |
| 2134 | limProcessMlmSetStaKeyRsp( pMac, limMsg ); |
| 2135 | break; |
| 2136 | case WDA_REMOVE_BSSKEY_RSP: |
| 2137 | case WDA_REMOVE_STAKEY_RSP: |
| 2138 | limProcessMlmRemoveKeyRsp( pMac, limMsg ); |
| 2139 | break; |
| 2140 | case WDA_ADDBA_RSP: |
| 2141 | limProcessMlmHalAddBARsp( pMac, limMsg ); |
| 2142 | break; |
| 2143 | |
| 2144 | case WDA_STA_STAT_RSP: |
| 2145 | case WDA_AGGR_STAT_RSP: |
| 2146 | case WDA_GLOBAL_STAT_RSP: |
| 2147 | case WDA_STAT_SUMM_RSP: |
| 2148 | limSendSmeStatsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr); |
| 2149 | break; |
| 2150 | |
| 2151 | case WDA_GET_STATISTICS_RSP: |
| 2152 | limSendSmePEStatisticsRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr); |
| 2153 | break; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2154 | #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] | 2155 | case WDA_GET_ROAM_RSSI_RSP: |
| 2156 | limSendSmePEGetRoamRssiRsp ( pMac, limMsg->type, (void *)limMsg->bodyptr); |
| 2157 | break; |
| 2158 | #endif |
| 2159 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2160 | |
| 2161 | case WDA_SET_MIMOPS_RSP: //limProcessSetMimoRsp(pMac, limMsg); |
| 2162 | case WDA_SET_TX_POWER_RSP: //limProcessSetTxPowerRsp(pMac, limMsg); |
| 2163 | case WDA_GET_TX_POWER_RSP: //limProcessGetTxPowerRsp(pMac, limMsg); |
| 2164 | case WDA_GET_NOISE_RSP: |
| 2165 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2166 | limMsg->bodyptr = NULL; |
| 2167 | //limProcessGetNoiseRsp(pMac, limMsg); |
| 2168 | break; |
| 2169 | |
| 2170 | case WDA_SET_MAX_TX_POWER_RSP: |
| 2171 | #if defined WLAN_FEATURE_VOWIFI |
| 2172 | rrmSetMaxTxPowerRsp( pMac, limMsg ); |
| 2173 | #endif |
| 2174 | if(limMsg->bodyptr != NULL) |
| 2175 | { |
| 2176 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2177 | limMsg->bodyptr = NULL; |
| 2178 | } |
| 2179 | break; |
| 2180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2181 | case SIR_LIM_ADDR2_MISS_IND: |
| 2182 | { |
| 2183 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2184 | FL("Addr2 mismatch interrupt received %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2185 | limMsg->type); |
| 2186 | /*a message from HAL indicating addr2 mismatch interrupt occurred |
| 2187 | limMsg->bodyptr contains only pointer to 48-bit addr2 field*/ |
| 2188 | //Dinesh fix this. the third parameter should be sessionentry. |
| 2189 | //limHandleUnknownA2IndexFrames(pMac, (void *)limMsg->bodyptr); |
| 2190 | |
| 2191 | /*Free message body pointer*/ |
| 2192 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2193 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2194 | break; |
| 2195 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2196 | |
| 2197 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2198 | case WDA_AGGR_QOS_RSP: |
| 2199 | limProcessFTAggrQoSRsp( pMac, limMsg ); |
| 2200 | break; |
| 2201 | #endif |
| 2202 | |
| 2203 | case WDA_SET_LINK_STATE_RSP: |
| 2204 | linkStateParams = (tLinkStateParams *)limMsg->bodyptr; |
| 2205 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2206 | pSession = linkStateParams->session; |
| 2207 | if(linkStateParams->ft) |
| 2208 | { |
| 2209 | limSendReassocReqWithFTIEsMgmtFrame(pMac, |
| 2210 | pSession->pLimMlmReassocReq, |
| 2211 | pSession); |
| 2212 | } |
| 2213 | #endif |
| 2214 | if( linkStateParams->callback ) |
| 2215 | { |
| 2216 | linkStateParams->callback( pMac, linkStateParams->callbackArg ); |
| 2217 | } |
| 2218 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2219 | limMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2220 | break; |
| 2221 | |
| 2222 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2223 | case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
| 2224 | pmmProcessMessage(pMac, limMsg); |
| 2225 | break; |
| 2226 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 2227 | |
| 2228 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 2229 | case WDA_GTK_OFFLOAD_GETINFO_RSP: |
| 2230 | pmmProcessMessage(pMac, limMsg); |
| 2231 | break; |
| 2232 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2233 | case eWNI_SME_SET_BCN_FILTER_REQ: |
| 2234 | { |
| 2235 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 2236 | tpPESession psessionEntry; |
Sreelakshmi Konamki | db3f75a | 2016-05-26 15:41:04 +0530 | [diff] [blame] | 2237 | tANI_U8 sessionId; |
| 2238 | tSirSetActiveModeSetBncFilterReq *bcnFilterReq = |
| 2239 | (tSirSetActiveModeSetBncFilterReq *)limMsg->bodyptr; |
| 2240 | psessionEntry = peFindSessionByBssid(pMac, bcnFilterReq->bssid, |
| 2241 | &sessionId); |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2242 | if(psessionEntry != NULL && IS_ACTIVEMODE_OFFLOAD_FEATURE_ENABLE) |
| 2243 | { |
| 2244 | // sending beacon filtering information down to HAL |
| 2245 | if (limSendBeaconFilterInfo(pMac, psessionEntry) != eSIR_SUCCESS) |
| 2246 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2247 | limLog(pMac, LOGE, FL("Fail to send Beacon Filter Info ")); |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2248 | } |
| 2249 | } |
Dhanashri Atre | d7885c2 | 2013-03-29 11:19:05 -0700 | [diff] [blame] | 2250 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 2251 | limMsg->bodyptr = NULL; |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 2252 | #endif |
| 2253 | } |
| 2254 | break; |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2255 | case eWNI_SME_HT40_OBSS_SCAN_IND: |
| 2256 | { |
Sandeep Puligilla | 9f38474 | 2014-04-11 02:27:04 +0530 | [diff] [blame] | 2257 | tpPESession psessionEntry = NULL; |
| 2258 | tANI_U8 sessionId; |
| 2259 | tSirSmeHT40OBSSScanInd *ht40ScanInd = |
Siddharth Bhal | d31c125 | 2014-05-05 19:34:14 +0530 | [diff] [blame] | 2260 | (tSirSmeHT40OBSSScanInd *)limMsg->bodyptr; |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2261 | |
Sandeep Puligilla | 9f38474 | 2014-04-11 02:27:04 +0530 | [diff] [blame] | 2262 | psessionEntry = peFindSessionByBssid(pMac, ht40ScanInd->peerMacAddr, |
Siddharth Bhal | d31c125 | 2014-05-05 19:34:14 +0530 | [diff] [blame] | 2263 | &sessionId); |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2264 | |
Siddharth Bhal | d31c125 | 2014-05-05 19:34:14 +0530 | [diff] [blame] | 2265 | if (psessionEntry != NULL) |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2266 | { |
Siddharth Bhal | d31c125 | 2014-05-05 19:34:14 +0530 | [diff] [blame] | 2267 | if( IS_HT40_OBSS_SCAN_FEATURE_ENABLE && |
| 2268 | psessionEntry->htSupportedChannelWidthSet == |
| 2269 | WNI_CFG_CHANNEL_BONDING_MODE_ENABLE ) |
| 2270 | { |
| 2271 | VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO, |
| 2272 | "OBSS Scan Start Req: session id %d" |
| 2273 | "htSupportedChannelWidthSet %d", psessionEntry->peSessionId, |
| 2274 | psessionEntry->htSupportedChannelWidthSet); |
| 2275 | limSendHT40OBSSScanInd(pMac, psessionEntry); |
| 2276 | } |
| 2277 | else |
| 2278 | { |
| 2279 | VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO, |
| 2280 | "OBSS Scan not started: htSupportedChannelWidthSet- %d" |
| 2281 | " session id %d", psessionEntry->htSupportedChannelWidthSet, |
| 2282 | psessionEntry->peSessionId); |
| 2283 | } |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2284 | } |
| 2285 | else |
| 2286 | { |
| 2287 | VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_INFO, |
Siddharth Bhal | d31c125 | 2014-05-05 19:34:14 +0530 | [diff] [blame] | 2288 | "OBSS Scan not started: session id is NULL"); |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2289 | } |
| 2290 | vos_mem_free(limMsg->bodyptr); |
| 2291 | limMsg->bodyptr = NULL; |
| 2292 | } |
| 2293 | break; |
| 2294 | case eWNI_SME_HT40_STOP_OBSS_SCAN_IND: |
| 2295 | { |
| 2296 | tpPESession psessionEntry = NULL; |
Sreelakshmi Konamki | db3f75a | 2016-05-26 15:41:04 +0530 | [diff] [blame] | 2297 | tANI_U8 sessionId; |
| 2298 | tSirSmeHT40OBSSStopScanInd *ht40StopScanInd = |
| 2299 | (tSirSmeHT40OBSSStopScanInd *)limMsg->bodyptr; |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2300 | |
Sreelakshmi Konamki | db3f75a | 2016-05-26 15:41:04 +0530 | [diff] [blame] | 2301 | psessionEntry = peFindSessionByBssid(pMac, |
| 2302 | ht40StopScanInd->bssid, &sessionId);; |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2303 | /* Sending LIM STOP OBSS SCAN Indication |
| 2304 | Stop command support is only for debugging purpose */ |
Sreelakshmi Konamki | db3f75a | 2016-05-26 15:41:04 +0530 | [diff] [blame] | 2305 | if (psessionEntry && IS_HT40_OBSS_SCAN_FEATURE_ENABLE) |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2306 | limSendHT40OBSSStopScanInd(pMac, psessionEntry); |
| 2307 | else |
| 2308 | VOS_TRACE(VOS_MODULE_ID_PE,VOS_TRACE_LEVEL_ERROR, |
| 2309 | "OBSS Scan Stop not started "); |
| 2310 | } |
Sreelakshmi Konamki | db3f75a | 2016-05-26 15:41:04 +0530 | [diff] [blame] | 2311 | vos_mem_free(limMsg->bodyptr); |
| 2312 | limMsg->bodyptr = NULL; |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2313 | break; |
Hardik Kantilal Patel | 62a3a76 | 2014-11-21 12:55:57 +0530 | [diff] [blame] | 2314 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 2315 | case eWNI_SME_SET_HT_2040_MODE: |
| 2316 | limProcessSmeReqMessages(pMac, limMsg); |
| 2317 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2318 | limMsg->bodyptr = NULL; |
| 2319 | break; |
| 2320 | #endif |
| 2321 | |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2322 | #ifdef FEATURE_WLAN_TDLS |
| 2323 | case WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP: |
| 2324 | { |
Gopichand Nakkala | 24be531 | 2013-07-02 16:47:12 +0530 | [diff] [blame] | 2325 | tpPESession psessionEntry; |
| 2326 | tANI_U8 sessionId; |
Sreelakshmi Konamki | fff0f9e | 2016-07-20 15:02:28 +0530 | [diff] [blame] | 2327 | tDphHashNode *pStaDs = NULL; |
Masti, Narayanraddi | f10fd79 | 2015-12-15 15:01:01 +0530 | [diff] [blame] | 2328 | int i, aid; |
Gopichand Nakkala | 574f6d1 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 2329 | tTdlsLinkEstablishParams *pTdlsLinkEstablishParams; |
| 2330 | pTdlsLinkEstablishParams = (tTdlsLinkEstablishParams*) limMsg->bodyptr; |
Gopichand Nakkala | 24be531 | 2013-07-02 16:47:12 +0530 | [diff] [blame] | 2331 | |
| 2332 | if((psessionEntry = peFindSessionByStaId(pMac, |
| 2333 | pTdlsLinkEstablishParams->staIdx, |
| 2334 | &sessionId))== NULL) |
| 2335 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2336 | limLog(pMac, LOGE, FL("session %u does not exist"), sessionId); |
Gopichand Nakkala | 24be531 | 2013-07-02 16:47:12 +0530 | [diff] [blame] | 2337 | /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME |
| 2338 | with session id as zero and status as FAILURE so, that message |
| 2339 | queued in SME queue can be freed to prevent the SME cmd buffer leak */ |
| 2340 | limSendSmeTdlsLinkEstablishReqRsp(pMac, |
| 2341 | 0, |
| 2342 | NULL, |
| 2343 | NULL, |
| 2344 | eSIR_FAILURE); |
| 2345 | } |
| 2346 | else |
| 2347 | { |
Masti, Narayanraddi | f10fd79 | 2015-12-15 15:01:01 +0530 | [diff] [blame] | 2348 | for (i = 0; |
| 2349 | i < sizeof(psessionEntry->peerAIDBitmap)/sizeof(tANI_U32); |
| 2350 | i++) { |
| 2351 | for (aid = 0; aid < (sizeof(tANI_U32) << 3); aid++) { |
| 2352 | if (CHECK_BIT(psessionEntry->peerAIDBitmap[i], aid)) { |
| 2353 | pStaDs = dphGetHashEntry(pMac, |
| 2354 | (aid + i*(sizeof(tANI_U32) << 3)), |
| 2355 | &psessionEntry->dph.dphHashTable); |
| 2356 | if ((NULL != pStaDs) && |
| 2357 | (pTdlsLinkEstablishParams->staIdx == |
| 2358 | pStaDs->staIndex)) |
| 2359 | goto send_link_resp; |
| 2360 | } |
| 2361 | } |
| 2362 | } |
| 2363 | send_link_resp: |
Sreelakshmi Konamki | fff0f9e | 2016-07-20 15:02:28 +0530 | [diff] [blame] | 2364 | if (pStaDs) |
| 2365 | limSendSmeTdlsLinkEstablishReqRsp(pMac, |
Gopichand Nakkala | 24be531 | 2013-07-02 16:47:12 +0530 | [diff] [blame] | 2366 | psessionEntry->smeSessionId, |
Masti, Narayanraddi | f10fd79 | 2015-12-15 15:01:01 +0530 | [diff] [blame] | 2367 | pStaDs->staAddr, |
| 2368 | pStaDs, |
Gopichand Nakkala | 24be531 | 2013-07-02 16:47:12 +0530 | [diff] [blame] | 2369 | pTdlsLinkEstablishParams->status) ; |
Sreelakshmi Konamki | fff0f9e | 2016-07-20 15:02:28 +0530 | [diff] [blame] | 2370 | else |
| 2371 | limSendSmeTdlsLinkEstablishReqRsp(pMac, |
| 2372 | psessionEntry->smeSessionId, |
| 2373 | NULL, NULL, |
| 2374 | pTdlsLinkEstablishParams->status) ; |
Gopichand Nakkala | 24be531 | 2013-07-02 16:47:12 +0530 | [diff] [blame] | 2375 | } |
Gopichand Nakkala | 574f6d1 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 2376 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 2377 | limMsg->bodyptr = NULL; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2378 | break; |
| 2379 | } |
Atul Mittal | 60bd429 | 2014-08-14 12:19:27 +0530 | [diff] [blame] | 2380 | |
| 2381 | case WDA_SET_TDLS_CHAN_SWITCH_REQ_RSP: |
| 2382 | { |
| 2383 | tpPESession psessionEntry; |
| 2384 | tANI_U8 sessionId; |
Sreelakshmi Konamki | fff0f9e | 2016-07-20 15:02:28 +0530 | [diff] [blame] | 2385 | tDphHashNode *pStaDs = NULL; |
Masti, Narayanraddi | 36c6762 | 2016-01-06 16:07:34 +0530 | [diff] [blame] | 2386 | int i, aid; |
Atul Mittal | 60bd429 | 2014-08-14 12:19:27 +0530 | [diff] [blame] | 2387 | tTdlsChanSwitchParams *pTdlsChanSwitchParams; |
| 2388 | pTdlsChanSwitchParams = (tTdlsChanSwitchParams*) limMsg->bodyptr; |
| 2389 | |
| 2390 | if((psessionEntry = peFindSessionByStaId(pMac, |
| 2391 | pTdlsChanSwitchParams->staIdx, |
| 2392 | &sessionId))== NULL) |
| 2393 | { |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2394 | limLog(pMac, LOGE, FL("session %u does not exist"), sessionId); |
Atul Mittal | 60bd429 | 2014-08-14 12:19:27 +0530 | [diff] [blame] | 2395 | /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME |
| 2396 | with session id as zero and status as FAILURE so, that message |
| 2397 | queued in SME queue can be freed to prevent the SME cmd buffer leak */ |
| 2398 | limSendSmeTdlsChanSwitchReqRsp(pMac, |
| 2399 | 0, |
| 2400 | NULL, |
| 2401 | NULL, |
| 2402 | eSIR_FAILURE); |
| 2403 | } |
| 2404 | else |
| 2405 | { |
Masti, Narayanraddi | 36c6762 | 2016-01-06 16:07:34 +0530 | [diff] [blame] | 2406 | for (i = 0; |
| 2407 | i < sizeof(psessionEntry->peerAIDBitmap)/sizeof(tANI_U32); |
| 2408 | i++) { |
| 2409 | for (aid = 0; aid < (sizeof(tANI_U32) << 3); aid++) { |
| 2410 | if (CHECK_BIT(psessionEntry->peerAIDBitmap[i], aid)) { |
| 2411 | pStaDs = dphGetHashEntry(pMac, |
| 2412 | (aid + i*(sizeof(tANI_U32) << 3)), |
| 2413 | &psessionEntry->dph.dphHashTable); |
| 2414 | if ((NULL != pStaDs) && |
| 2415 | (pTdlsChanSwitchParams->staIdx == |
| 2416 | pStaDs->staIndex)) |
| 2417 | goto send_chan_switch_resp; |
| 2418 | } |
| 2419 | } |
| 2420 | } |
| 2421 | send_chan_switch_resp: |
Sreelakshmi Konamki | fff0f9e | 2016-07-20 15:02:28 +0530 | [diff] [blame] | 2422 | if (pStaDs) |
| 2423 | limSendSmeTdlsChanSwitchReqRsp(pMac, |
Atul Mittal | 60bd429 | 2014-08-14 12:19:27 +0530 | [diff] [blame] | 2424 | psessionEntry->smeSessionId, |
Masti, Narayanraddi | 36c6762 | 2016-01-06 16:07:34 +0530 | [diff] [blame] | 2425 | pStaDs->staAddr, |
| 2426 | pStaDs, |
Sreelakshmi Konamki | fff0f9e | 2016-07-20 15:02:28 +0530 | [diff] [blame] | 2427 | pTdlsChanSwitchParams->status); |
| 2428 | else |
| 2429 | limSendSmeTdlsChanSwitchReqRsp(pMac, |
| 2430 | psessionEntry->smeSessionId, |
| 2431 | NULL, NULL, |
| 2432 | pTdlsChanSwitchParams->status); |
Atul Mittal | 60bd429 | 2014-08-14 12:19:27 +0530 | [diff] [blame] | 2433 | } |
| 2434 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 2435 | limMsg->bodyptr = NULL; |
| 2436 | break; |
| 2437 | } |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2438 | #endif |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 2439 | |
| 2440 | case WDA_RX_SCAN_EVENT: |
| 2441 | limProcessRxScanEvent(pMac, limMsg->bodyptr); |
| 2442 | break; |
| 2443 | |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 2444 | case WDA_IBSS_PEER_INACTIVITY_IND: |
| 2445 | { |
| 2446 | limProcessIbssPeerInactivity(pMac, limMsg->bodyptr); |
| 2447 | vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); |
| 2448 | limMsg->bodyptr = NULL; |
| 2449 | break; |
| 2450 | } |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 2451 | #ifdef WLAN_FEATURE_RMC |
| 2452 | case WDA_RMC_BECOME_RULER: |
| 2453 | limProcessRMCMessages(pMac, eLIM_RMC_BECOME_RULER_RESP, |
| 2454 | (void *)limMsg->bodyptr); |
| 2455 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2456 | limMsg->bodyptr = NULL; |
| 2457 | break ; |
| 2458 | |
| 2459 | case WDA_RMC_RULER_SELECT_RESP: |
| 2460 | limProcessRMCMessages(pMac, eLIM_RMC_RULER_SELECT_RESP, |
| 2461 | (void *)limMsg->bodyptr); |
| 2462 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2463 | limMsg->bodyptr = NULL; |
| 2464 | break ; |
| 2465 | |
| 2466 | case WDA_RMC_UPDATE_IND: |
| 2467 | limProcessRMCMessages(pMac, eLIM_RMC_RULER_PICK_NEW, |
| 2468 | (void *)limMsg->bodyptr); |
| 2469 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2470 | limMsg->bodyptr = NULL; |
| 2471 | break ; |
| 2472 | #endif /* WLAN_FEATURE_RMC */ |
Ravi Joshi | d2ca7c4 | 2013-07-23 08:37:49 -0700 | [diff] [blame] | 2473 | |
Siddharth Bhal | 4f3187c | 2014-10-09 21:38:08 +0530 | [diff] [blame] | 2474 | case WDA_SPOOF_MAC_ADDR_RSP: |
| 2475 | limProcessMlmSpoofMacAddrRsp(pMac, (tSirRetStatus)limMsg->bodyval); |
| 2476 | break; |
| 2477 | |
Pradeep Reddy POTTETI | 3150589 | 2015-04-16 16:47:54 +0530 | [diff] [blame] | 2478 | case eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ: |
| 2479 | limProcessSmeSetTdls2040BSSCoexReq(pMac, limMsg->bodyptr); |
| 2480 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2481 | limMsg->bodyptr = NULL; |
| 2482 | break; |
| 2483 | |
Masti, Narayanraddi | 1fb32a9 | 2015-06-29 13:14:06 +0530 | [diff] [blame] | 2484 | case eWNI_SME_DEL_ALL_TDLS_PEERS: |
| 2485 | limProcessSmeDelAllTdlsPeers(pMac, limMsg->bodyptr); |
| 2486 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2487 | limMsg->bodyptr = NULL; |
| 2488 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2489 | default: |
| 2490 | vos_mem_free((v_VOID_t*)limMsg->bodyptr); |
| 2491 | limMsg->bodyptr = NULL; |
| 2492 | // Unwanted messages |
| 2493 | // Log error |
| 2494 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2495 | FL("Discarding unexpected message received %X"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2496 | limMsg->type); |
| 2497 | limPrintMsgName(pMac, LOGE, limMsg->type); |
| 2498 | break; |
| 2499 | |
| 2500 | } // switch (limMsg->type) |
| 2501 | |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2502 | 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] | 2503 | limMsg->type, limSmeStateStr(pMac->lim.gLimSmeState), |
| 2504 | limMlmStateStr(pMac->lim.gLimMlmState));) |
| 2505 | |
| 2506 | } /*** end limProcessMessages() ***/ |
| 2507 | |
| 2508 | |
| 2509 | |
| 2510 | /** |
| 2511 | * limProcessDeferredMessageQueue |
| 2512 | * |
| 2513 | *FUNCTION: |
| 2514 | * This function is called by LIM while exiting from Learn |
| 2515 | * mode. This function fetches messages posted to the LIM |
| 2516 | * deferred message queue limDeferredMsgQ. |
| 2517 | * |
| 2518 | *LOGIC: |
| 2519 | * |
| 2520 | *ASSUMPTIONS: |
| 2521 | * NA |
| 2522 | * |
| 2523 | *NOTE: |
| 2524 | * NA |
| 2525 | * |
| 2526 | * @param pMac - Pointer to Global MAC structure |
| 2527 | * @return None |
| 2528 | */ |
| 2529 | |
| 2530 | void |
| 2531 | limProcessDeferredMessageQueue(tpAniSirGlobal pMac) |
| 2532 | { |
| 2533 | tSirMsgQ limMsg = { 0, 0, 0 }; |
| 2534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2535 | tSirMsgQ *readMsg; |
| 2536 | tANI_U16 size; |
| 2537 | |
| 2538 | /* |
| 2539 | ** check any deferred messages need to be processed |
| 2540 | **/ |
| 2541 | size = pMac->lim.gLimDeferredMsgQ.size; |
| 2542 | if (size > 0) |
| 2543 | { |
| 2544 | while ((readMsg = limReadDeferredMsgQ(pMac)) != NULL) |
| 2545 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2546 | vos_mem_copy((tANI_U8*) &limMsg, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2547 | (tANI_U8*) readMsg, sizeof(tSirMsgQ)); |
| 2548 | size--; |
| 2549 | limProcessMessages(pMac, &limMsg); |
| 2550 | |
| 2551 | if((limIsSystemInScanState(pMac)) || (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) || |
Hema Aparna Medicharla | b56b661 | 2015-05-18 11:42:52 +0530 | [diff] [blame] | 2552 | (pMac->lim.gLimSystemInScanLearnMode) || pMac->lim.gLimAddtsSent) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2553 | break; |
| 2554 | } |
| 2555 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2556 | } /*** end limProcessDeferredMessageQueue() ***/ |
| 2557 | |
| 2558 | |
| 2559 | /* |
| 2560 | * limProcessNormalHddMsg |
| 2561 | * Function: this function checks the current lim state and decide whether the message passed shall be deffered. |
| 2562 | * @param pMac - Pointer to Global MAC structure |
| 2563 | * pLimMsg -- the message need to be processed |
| 2564 | * fRspReqd -- whether return result to hdd |
| 2565 | * @return None |
| 2566 | */ |
| 2567 | void limProcessNormalHddMsg(tpAniSirGlobal pMac, tSirMsgQ *pLimMsg, tANI_U8 fRspReqd) |
| 2568 | { |
| 2569 | tANI_BOOLEAN fDeferMsg = eANI_BOOLEAN_TRUE; |
| 2570 | |
| 2571 | /* Added For BT-AMP Support */ |
| 2572 | if ((pMac->lim.gLimSystemRole == eLIM_AP_ROLE) ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_AP_ROLE ) |
| 2573 | ||(pMac->lim.gLimSystemRole == eLIM_BT_AMP_STA_ROLE) |
| 2574 | ||(pMac->lim.gLimSystemRole == eLIM_UNKNOWN_ROLE)) |
| 2575 | { |
| 2576 | /** This check is required only for the AP and in 2 cases. |
| 2577 | * 1. If we are in learn mode and we receive any of these messages, |
| 2578 | * you have to come out of scan and process the message, hence dont |
| 2579 | * defer the message here. In handler, these message could be defered |
| 2580 | * till we actually come out of scan mode. |
| 2581 | * 2. If radar is detected, you might have to defer all of these |
| 2582 | * messages except Stop BSS request/ Switch channel request. This |
| 2583 | * decision is also made inside its handler. |
| 2584 | * |
| 2585 | * Please be careful while using the flag fDeferMsg. Possibly you |
| 2586 | * might end up in an infinite loop. |
| 2587 | **/ |
| 2588 | if (((pLimMsg->type == eWNI_SME_START_BSS_REQ) || |
| 2589 | (pLimMsg->type == eWNI_SME_STOP_BSS_REQ) || |
| 2590 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_REQ) || |
| 2591 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_SECONDARY_REQ) || |
| 2592 | (pLimMsg->type == eWNI_SME_SWITCH_CHL_CB_PRIMARY_REQ))) |
| 2593 | { |
| 2594 | fDeferMsg = eANI_BOOLEAN_FALSE; |
| 2595 | } |
| 2596 | } |
| 2597 | |
| 2598 | /* limInsystemInscanState() refers the psessionEntry, how to get session Entry????*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2599 | if (((pMac->lim.gLimAddtsSent) || (limIsSystemInScanState(pMac)) /*|| |
| 2600 | (LIM_IS_RADAR_DETECTED(pMac))*/) && fDeferMsg) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2601 | { |
| 2602 | // System is in DFS (Learn) mode or awaiting addts response |
| 2603 | // or if radar is detected, Defer processsing this message |
| 2604 | if (limDeferMsg(pMac, pLimMsg) != TX_SUCCESS) |
| 2605 | { |
| 2606 | #ifdef WLAN_DEBUG |
| 2607 | pMac->lim.numSme++; |
| 2608 | #endif |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2609 | 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] | 2610 | pLimMsg->type, pMac->lim.gLimSmeState, pMac->lim.gLimPrevSmeState, |
| 2611 | pMac->lim.gLimSystemRole, pMac->lim.gLimMlmState, pMac->lim.gLimPrevMlmState);) |
| 2612 | limLogSessionStates(pMac); |
| 2613 | limPrintMsgName(pMac, LOGE, pLimMsg->type); |
| 2614 | // Release body |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2615 | vos_mem_free(pLimMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2616 | pLimMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2617 | } |
| 2618 | } |
| 2619 | else |
| 2620 | { |
| 2621 | if(fRspReqd) |
| 2622 | { |
| 2623 | // These messages are from HDD |
| 2624 | // Since these requests may also be generated |
| 2625 | // internally within LIM module, need to |
| 2626 | // distinquish and send response to host |
| 2627 | pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE; |
| 2628 | } |
| 2629 | #ifdef WLAN_DEBUG |
| 2630 | pMac->lim.numSme++; |
| 2631 | #endif |
| 2632 | if(limProcessSmeReqMessages(pMac, pLimMsg)) |
| 2633 | { |
| 2634 | // Release body |
| 2635 | // limProcessSmeReqMessage consumed the buffer. We can free it. |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 2636 | vos_mem_free(pLimMsg->bodyptr); |
Leela Venkata Kiran Kumar Reddy Chirala | d6c0fe2 | 2013-12-11 19:10:50 -0800 | [diff] [blame] | 2637 | pLimMsg->bodyptr = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2638 | } |
| 2639 | } |
| 2640 | } |
| 2641 | |
| 2642 | void |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2643 | handleHTCapabilityandHTInfo(struct sAniSirGlobal *pMac, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2644 | { |
| 2645 | tSirMacHTCapabilityInfo macHTCapabilityInfo; |
| 2646 | tSirMacHTParametersInfo macHTParametersInfo; |
| 2647 | tSirMacHTInfoField1 macHTInfoField1; |
| 2648 | tSirMacHTInfoField2 macHTInfoField2; |
| 2649 | tSirMacHTInfoField3 macHTInfoField3; |
| 2650 | tANI_U32 cfgValue; |
| 2651 | tANI_U8 *ptr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2653 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_CAP_INFO, &cfgValue) != eSIR_SUCCESS) |
| 2654 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2655 | 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] | 2656 | return ; |
| 2657 | } |
| 2658 | ptr = (tANI_U8 *) &macHTCapabilityInfo; |
| 2659 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2660 | pMac->lim.gHTLsigTXOPProtection = (tANI_U8)macHTCapabilityInfo.lsigTXOPProtection; |
| 2661 | pMac->lim.gHTMIMOPSState = (tSirMacHTMIMOPowerSaveState) macHTCapabilityInfo.mimoPowerSave; |
| 2662 | pMac->lim.gHTGreenfield = (tANI_U8)macHTCapabilityInfo.greenField; |
| 2663 | pMac->lim.gHTMaxAmsduLength = (tANI_U8)macHTCapabilityInfo.maximalAMSDUsize; |
| 2664 | pMac->lim.gHTShortGI20Mhz = (tANI_U8)macHTCapabilityInfo.shortGI20MHz; |
| 2665 | pMac->lim.gHTShortGI40Mhz = (tANI_U8)macHTCapabilityInfo.shortGI40MHz; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2666 | pMac->lim.gHTPSMPSupport = (tANI_U8)macHTCapabilityInfo.psmp; |
| 2667 | pMac->lim.gHTDsssCckRate40MHzSupport = (tANI_U8)macHTCapabilityInfo.dsssCckMode40MHz; |
| 2668 | |
| 2669 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != eSIR_SUCCESS) |
| 2670 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2671 | 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] | 2672 | return ; |
| 2673 | } |
| 2674 | ptr = (tANI_U8 *) &macHTParametersInfo; |
| 2675 | *ptr = (tANI_U8) (cfgValue & 0xff); |
| 2676 | pMac->lim.gHTAMpduDensity = (tANI_U8)macHTParametersInfo.mpduDensity; |
| 2677 | pMac->lim.gHTMaxRxAMpduFactor = (tANI_U8)macHTParametersInfo.maxRxAMPDUFactor; |
| 2678 | |
| 2679 | // Get HT IE Info |
| 2680 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != eSIR_SUCCESS) |
| 2681 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2682 | 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] | 2683 | return ; |
| 2684 | } |
| 2685 | ptr = (tANI_U8 *) &macHTInfoField1; |
| 2686 | *((tANI_U8 *)ptr) = (tANI_U8) (cfgValue & 0xff); |
| 2687 | pMac->lim.gHTServiceIntervalGranularity = (tANI_U8)macHTInfoField1.serviceIntervalGranularity; |
| 2688 | pMac->lim.gHTControlledAccessOnly = (tANI_U8)macHTInfoField1.controlledAccessOnly; |
| 2689 | pMac->lim.gHTRifsMode = (tANI_U8)macHTInfoField1.rifsMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2690 | |
| 2691 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != eSIR_SUCCESS) |
| 2692 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2693 | 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] | 2694 | return ; |
| 2695 | } |
| 2696 | ptr = (tANI_U8 *) &macHTInfoField2; |
| 2697 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2698 | pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode; |
| 2699 | |
| 2700 | if (wlan_cfgGetInt(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != eSIR_SUCCESS) |
| 2701 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 2702 | 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] | 2703 | return ; |
| 2704 | } |
| 2705 | ptr = (tANI_U8 *) &macHTInfoField3; |
| 2706 | *((tANI_U16 *)ptr) = (tANI_U16) (cfgValue & 0xffff); |
| 2707 | pMac->lim.gHTPCOActive = (tANI_U8)macHTInfoField3.pcoActive; |
| 2708 | pMac->lim.gHTPCOPhase = (tANI_U8)macHTInfoField3.pcoPhase; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2709 | pMac->lim.gHTSecondaryBeacon = (tANI_U8)macHTInfoField3.secondaryBeacon; |
| 2710 | pMac->lim.gHTDualCTSProtection = (tANI_U8)macHTInfoField3.dualCTSProtection; |
| 2711 | pMac->lim.gHTSTBCBasicMCS = (tANI_U8)macHTInfoField3.basicSTBCMCS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2712 | |
| 2713 | /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session; |
| 2714 | * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old); |
| 2715 | * For now, we might come here during init and join with sessionEntry = NULL; in that case just fill the globals which exist |
| 2716 | * Sessionized entries values will be filled in join or add bss req. The ones which are missed in join are filled below |
| 2717 | */ |
| 2718 | if (psessionEntry != NULL) |
| 2719 | { |
Sandeep Puligilla | 11d49a6 | 2014-01-30 12:05:16 +0530 | [diff] [blame] | 2720 | psessionEntry->htCapability = |
| 2721 | IS_DOT11_MODE_HT(psessionEntry->dot11mode); |
| 2722 | psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = |
| 2723 | (tANI_U8)macHTInfoField3.lsigTXOPProtectionFullSupport; |
Sandeep Puligilla | 70b6b16 | 2014-04-19 02:06:04 +0530 | [diff] [blame] | 2724 | limInitOBSSScanParams(pMac, psessionEntry); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2725 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2726 | } |
| 2727 | |
| 2728 | void limLogSessionStates(tpAniSirGlobal pMac) |
| 2729 | { |
| 2730 | #ifdef WLAN_DEBUG |
| 2731 | int i; |
| 2732 | |
| 2733 | for(i = 0; i < pMac->lim.maxBssId; i++) |
| 2734 | { |
| 2735 | if(pMac->lim.gpSession[i].valid) |
| 2736 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 2737 | limLog(pMac, LOG1, FL("Session[%d] sysRole(%d) limSmeState %d " |
| 2738 | "(prev sme state %d) mlm state %d (prev mlm state %d)"), |
| 2739 | i, pMac->lim.gpSession[i].limSystemRole, |
| 2740 | pMac->lim.gpSession[i].limSmeState, |
| 2741 | pMac->lim.gpSession[i].limPrevSmeState, |
| 2742 | pMac->lim.gpSession[i].limMlmState, |
| 2743 | pMac->lim.gpSession[i].limPrevMlmState); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2744 | } |
| 2745 | } |
| 2746 | #endif //ifdef WLAN_DEBUG |
| 2747 | } |