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