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