Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Padma, Santhosh Kumar | 071de2d | 2017-02-02 20:38:03 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2017 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. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [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 limProcessActionFrame.cc contains the code |
| 33 | * for processing Action Frame. |
| 34 | * Author: Michael Lui |
| 35 | * Date: 05/23/03 |
| 36 | * History:- |
| 37 | * Date Modified by Modification Information |
| 38 | * -------------------------------------------------------------------- |
| 39 | * |
| 40 | */ |
| 41 | #include "palTypes.h" |
| 42 | #include "wniApi.h" |
| 43 | #include "sirApi.h" |
| 44 | #include "aniGlobal.h" |
Satyanarayana Dash | 6f43827 | 2015-03-03 18:01:06 +0530 | [diff] [blame] | 45 | #include "wniCfg.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 46 | #include "schApi.h" |
| 47 | #include "utilsApi.h" |
| 48 | #include "limTypes.h" |
| 49 | #include "limUtils.h" |
| 50 | #include "limAssocUtils.h" |
| 51 | #include "limSecurityUtils.h" |
| 52 | #include "limSerDesUtils.h" |
| 53 | #include "limSendSmeRspMessages.h" |
| 54 | #include "parserApi.h" |
| 55 | #include "limAdmitControl.h" |
| 56 | #include "wmmApsd.h" |
| 57 | #include "limSendMessages.h" |
| 58 | #if defined WLAN_FEATURE_VOWIFI |
| 59 | #include "rrmApi.h" |
| 60 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 61 | #include "limSessionUtils.h" |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 62 | #ifdef WLAN_FEATURE_RMC |
| 63 | #include "limRMC.h" |
| 64 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 65 | |
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 | #include "wlan_qct_wda.h" |
| 70 | |
Padma, Santhosh Kumar | 071de2d | 2017-02-02 20:38:03 +0530 | [diff] [blame] | 71 | #ifdef WLAN_FEATURE_LFR_MBB |
| 72 | #include "lim_mbb.h" |
| 73 | #endif |
| 74 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 75 | |
| 76 | #define BA_DEFAULT_TX_BUFFER_SIZE 64 |
| 77 | |
| 78 | typedef enum |
| 79 | { |
| 80 | LIM_ADDBA_RSP = 0, |
| 81 | LIM_ADDBA_REQ = 1 |
| 82 | }tLimAddBaValidationReqType; |
| 83 | |
| 84 | /* Note: The test passes if the STAUT stops sending any frames, and no further |
| 85 | frames are transmitted on this channel by the station when the AP has sent |
| 86 | the last 6 beacons, with the channel switch information elements as seen |
| 87 | with the sniffer.*/ |
| 88 | #define SIR_CHANSW_TX_STOP_MAX_COUNT 6 |
| 89 | /**----------------------------------------------------------------- |
| 90 | \fn limStopTxAndSwitchChannel |
| 91 | \brief Stops the transmission if channel switch mode is silent and |
| 92 | starts the channel switch timer. |
| 93 | |
| 94 | \param pMac |
| 95 | \return NONE |
| 96 | -----------------------------------------------------------------*/ |
| 97 | void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId) |
| 98 | { |
| 99 | tANI_U8 isFullPowerRequested = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 100 | tpPESession psessionEntry; |
| 101 | |
| 102 | psessionEntry = peFindSessionBySessionId( pMac , sessionId ); |
| 103 | |
| 104 | if( NULL == psessionEntry ) |
| 105 | { |
| 106 | limLog(pMac, LOGE, FL("Session %d not active\n "), sessionId); |
| 107 | return; |
| 108 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | |
Padma, Santhosh Kumar | a60416c | 2017-03-09 19:23:54 +0530 | [diff] [blame] | 110 | if(pMac->ft.ftPEContext.pFTPreAuthReq) |
| 111 | { |
| 112 | limLog(pMac, LOGE, |
| 113 | FL("Avoid Switch Channel req during pre auth")); |
| 114 | return; |
| 115 | } |
| 116 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 117 | limLog(pMac, LOG1, FL("Channel switch Mode == %d"), |
| 118 | psessionEntry->gLimChannelSwitch.switchMode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 119 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 120 | if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT || |
| 121 | psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 122 | { |
| 123 | /* Freeze the transmission */ |
| 124 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX); |
| 125 | |
| 126 | /*Request for Full power only if the device is in powersave*/ |
| 127 | if(!limIsSystemInActiveState(pMac)) |
| 128 | { |
| 129 | /* Request Full Power */ |
| 130 | limSendSmePreChannelSwitchInd(pMac); |
| 131 | isFullPowerRequested = 1; |
| 132 | } |
| 133 | } |
| 134 | else |
| 135 | { |
| 136 | /* Resume the transmission */ |
| 137 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
| 138 | } |
| 139 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 140 | pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 141 | /* change the channel immediatly only if the channel switch count is 0 and the |
| 142 | * device is not in powersave |
| 143 | * If the device is in powersave channel switch should happen only after the |
| 144 | * device comes out of the powersave */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 145 | if (psessionEntry->gLimChannelSwitch.switchCount == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 146 | { |
| 147 | if(limIsSystemInActiveState(pMac)) |
| 148 | { |
| 149 | limProcessChannelSwitchTimeout(pMac); |
| 150 | } |
| 151 | else if(!isFullPowerRequested) |
| 152 | { |
| 153 | /* If the Full power is already not requested |
| 154 | * Request Full Power so the channel switch happens |
| 155 | * after device comes to full power */ |
| 156 | limSendSmePreChannelSwitchInd(pMac); |
| 157 | } |
| 158 | return; |
| 159 | } |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 160 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_CHANNEL_SWITCH_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 162 | |
| 163 | if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS) |
| 164 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 165 | limLog(pMac, LOGP, FL("tx_timer_activate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 166 | } |
| 167 | return; |
| 168 | } |
| 169 | |
| 170 | /**------------------------------------------------------------ |
| 171 | \fn limStartChannelSwitch |
| 172 | \brief Switches the channel if switch count == 0, otherwise |
| 173 | starts the timer for channel switch and stops BG scan |
| 174 | and heartbeat timer tempororily. |
| 175 | |
| 176 | \param pMac |
| 177 | \param psessionEntry |
| 178 | \return NONE |
| 179 | ------------------------------------------------------------*/ |
| 180 | tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 181 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 182 | limLog(pMac, LOG1, FL(" ENTER")); |
Padma, Santhosh Kumar | 071de2d | 2017-02-02 20:38:03 +0530 | [diff] [blame] | 183 | |
| 184 | #ifdef WLAN_FEATURE_LFR_MBB |
| 185 | if (lim_is_mbb_reassoc_in_progress(pMac, psessionEntry)) |
| 186 | { |
| 187 | limLog(pMac, LOGE, |
| 188 | FL("Ignore channel switch as LFR MBB in progress")); |
| 189 | return eSIR_SUCCESS; |
| 190 | } |
| 191 | #endif |
| 192 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 193 | /*If channel switch is already running and it is on a different session, just return*/ |
| 194 | /*This need to be removed for MCC */ |
| 195 | if( limIsChanSwitchRunning (pMac) && |
| 196 | psessionEntry->gLimSpecMgmt.dot11hChanSwState != eLIM_11H_CHANSW_RUNNING ) |
| 197 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 198 | limLog(pMac, LOGW, FL("Ignoring channel switch on session %d"), psessionEntry->peSessionId); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 199 | return eSIR_SUCCESS; |
| 200 | } |
Sushant Kaushik | b97a008 | 2015-08-31 12:36:45 +0530 | [diff] [blame] | 201 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 202 | limDiagEventReport(pMac, WLAN_PE_DIAG_CHANNEL_SWITCH_ANOUNCEMENT, |
| 203 | psessionEntry, eSIR_SUCCESS, LIM_SWITCH_CHANNEL_CSA); |
| 204 | #endif |
| 205 | |
Kalikinkar dhara | 085c02f | 2014-02-28 15:32:12 -0800 | [diff] [blame] | 206 | psessionEntry->channelChangeCSA = LIM_SWITCH_CHANNEL_CSA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 207 | /* Deactivate and change reconfigure the timeout value */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 208 | //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER); |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 209 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 210 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS) |
| 211 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 212 | limLog(pMac, LOGP, FL("tx_timer_deactivate failed!")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 213 | return eSIR_FAILURE; |
| 214 | } |
| 215 | |
| 216 | if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer, |
| 217 | psessionEntry->gLimChannelSwitch.switchTimeoutValue, |
| 218 | 0) != TX_SUCCESS) |
| 219 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 220 | limLog(pMac, LOGP, FL("tx_timer_change failed ")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 221 | return eSIR_FAILURE; |
| 222 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 223 | |
| 224 | /* Follow the channel switch, forget about the previous quiet. */ |
| 225 | //If quiet is running, chance is there to resume tx on its timeout. |
| 226 | //so stop timer for a safer side. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 227 | if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 228 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 229 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 230 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS) |
| 231 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 232 | limLog(pMac, LOGP, FL("tx_timer_deactivate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 233 | return eSIR_FAILURE; |
| 234 | } |
| 235 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 236 | else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 237 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 238 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 239 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS) |
| 240 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 241 | limLog(pMac, LOGP, FL("tx_timer_deactivate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | return eSIR_FAILURE; |
| 243 | } |
| 244 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 245 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 246 | |
| 247 | /* Prepare for 11h channel switch */ |
| 248 | limPrepareFor11hChannelSwitch(pMac, psessionEntry); |
| 249 | |
| 250 | /** Dont add any more statements here as we posted finish scan request |
| 251 | * to HAL, wait till we get the response |
| 252 | */ |
| 253 | return eSIR_SUCCESS; |
| 254 | } |
| 255 | |
| 256 | |
| 257 | /** |
| 258 | * __limProcessChannelSwitchActionFrame |
| 259 | * |
| 260 | *FUNCTION: |
| 261 | * |
| 262 | *LOGIC: |
| 263 | * |
| 264 | *ASSUMPTIONS: |
| 265 | * |
| 266 | *NOTE: |
| 267 | * |
| 268 | * @param pMac - Pointer to Global MAC structure |
| 269 | * @param *pRxPacketInfo - A pointer to packet info structure |
| 270 | * @return None |
| 271 | */ |
| 272 | |
| 273 | static void |
| 274 | |
| 275 | __limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 276 | { |
| 277 | |
| 278 | tpSirMacMgmtHdr pHdr; |
| 279 | tANI_U8 *pBody; |
| 280 | tDot11fChannelSwitch *pChannelSwitchFrame; |
| 281 | tANI_U16 beaconPeriod; |
| 282 | tANI_U32 val; |
| 283 | tANI_U32 frameLen; |
| 284 | tANI_U32 nStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 285 | |
| 286 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 287 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 288 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 289 | |
Abhishek Singh | 127a844 | 2014-12-15 17:31:27 +0530 | [diff] [blame] | 290 | limLog(pMac, LOG1, FL("Received Channel switch action frame")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 291 | if (!psessionEntry->lim11hEnable) |
| 292 | return; |
| 293 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 294 | pChannelSwitchFrame = vos_mem_malloc(sizeof(*pChannelSwitchFrame)); |
| 295 | if (NULL == pChannelSwitchFrame) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 296 | { |
| 297 | limLog(pMac, LOGE, |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 298 | FL("AllocateMemory failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 299 | return; |
| 300 | } |
| 301 | |
| 302 | /* Unpack channel switch frame */ |
| 303 | nStatus = dot11fUnpackChannelSwitch(pMac, pBody, frameLen, pChannelSwitchFrame); |
| 304 | |
| 305 | if( DOT11F_FAILED( nStatus )) |
| 306 | { |
| 307 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 308 | FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 309 | nStatus, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 310 | frameLen); |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 311 | vos_mem_free(pChannelSwitchFrame); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | return; |
| 313 | } |
| 314 | else if(DOT11F_WARNED( nStatus )) |
| 315 | { |
| 316 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 317 | FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 318 | nStatus, |
| 319 | frameLen); |
| 320 | } |
| 321 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 322 | if (vos_mem_compare((tANI_U8 *) &psessionEntry->bssId, |
| 323 | (tANI_U8 *) &pHdr->sa, |
| 324 | sizeof(tSirMacAddr))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 325 | { |
| 326 | #if 0 |
| 327 | if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS) |
| 328 | { |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 329 | vos_mem_free(pChannelSwitchFrame); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 330 | limLog(pMac, LOGP, FL("could not retrieve Beacon interval")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 331 | return; |
| 332 | } |
| 333 | #endif// TO SUPPORT BT-AMP |
| 334 | |
| 335 | /* copy the beacon interval from psessionEntry*/ |
| 336 | val = psessionEntry->beaconParams.beaconInterval; |
| 337 | |
| 338 | beaconPeriod = (tANI_U16) val; |
| 339 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 340 | psessionEntry->gLimChannelSwitch.primaryChannel = pChannelSwitchFrame->ChanSwitchAnn.newChannel; |
| 341 | psessionEntry->gLimChannelSwitch.switchCount = pChannelSwitchFrame->ChanSwitchAnn.switchCount; |
| 342 | psessionEntry->gLimChannelSwitch.switchTimeoutValue = SYS_MS_TO_TICKS(beaconPeriod) * |
| 343 | psessionEntry->gLimChannelSwitch.switchCount; |
| 344 | psessionEntry->gLimChannelSwitch.switchMode = pChannelSwitchFrame->ChanSwitchAnn.switchMode; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 345 | #ifdef WLAN_FEATURE_11AC |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 346 | if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 347 | { |
| 348 | psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth; |
| 349 | psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0; |
| 350 | psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq1; |
| 351 | } |
| 352 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 353 | |
Abhishek Singh | 127a844 | 2014-12-15 17:31:27 +0530 | [diff] [blame] | 354 | limLog(pMac, LOG1, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"), |
| 355 | psessionEntry->gLimChannelSwitch.switchTimeoutValue); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 356 | |
| 357 | /* Only primary channel switch element is present */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 358 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 359 | psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 360 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 361 | if (psessionEntry->htSupportedChannelWidthSet) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 362 | { |
Abhishek Singh | 15431c4 | 2017-10-25 15:43:02 +0530 | [diff] [blame] | 363 | if ((pChannelSwitchFrame->sec_chan_offset.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) || |
| 364 | (pChannelSwitchFrame->sec_chan_offset.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 365 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 366 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
Abhishek Singh | 15431c4 | 2017-10-25 15:43:02 +0530 | [diff] [blame] | 367 | psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->sec_chan_offset.secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 368 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 369 | #ifdef WLAN_FEATURE_11AC |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 370 | if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present) |
| 371 | { |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 372 | if (pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) |
| 373 | { |
Abhishek Singh | 15431c4 | 2017-10-25 15:43:02 +0530 | [diff] [blame] | 374 | if (pChannelSwitchFrame->sec_chan_offset.present && ((pChannelSwitchFrame->sec_chan_offset.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) || |
| 375 | (pChannelSwitchFrame->sec_chan_offset.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 376 | { |
| 377 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 378 | psessionEntry->gLimChannelSwitch.secondarySubBand = |
| 379 | limGet11ACPhyCBState(pMac, |
| 380 | psessionEntry->gLimChannelSwitch.primaryChannel, |
Abhishek Singh | 15431c4 | 2017-10-25 15:43:02 +0530 | [diff] [blame] | 381 | pChannelSwitchFrame->sec_chan_offset.secondaryChannelOffset, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 382 | pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0, |
| 383 | psessionEntry); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 384 | } |
| 385 | } |
| 386 | } |
| 387 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 388 | } |
| 389 | |
| 390 | } |
| 391 | else |
| 392 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 393 | limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 394 | } |
| 395 | |
| 396 | if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry)) |
| 397 | { |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 398 | limLog(pMac, LOG1, FL("Could not start channel switch")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 399 | } |
| 400 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 401 | vos_mem_free(pChannelSwitchFrame); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 402 | return; |
| 403 | } /*** end limProcessChannelSwitchActionFrame() ***/ |
| 404 | |
Abhishek Singh | 39ae47e | 2017-10-30 17:39:50 +0530 | [diff] [blame] | 405 | /** |
| 406 | * lim_process_ecsa_action_frame()- Process ECSA Action |
| 407 | * Frames. |
| 408 | * @mac_ctx: pointer to global mac structure |
| 409 | * @rx_packet_info: rx packet meta information |
| 410 | * @session_entry: Session entry. |
| 411 | * |
| 412 | * This function is called when ECSA action frame is received on STA interface. |
| 413 | * |
| 414 | * Return: void |
| 415 | */ |
| 416 | static void |
| 417 | lim_process_ecsa_action_frame(tpAniSirGlobal mac_ctx, |
| 418 | uint8_t *rx_packet_info, tpPESession session_entry) |
| 419 | { |
| 420 | tpSirMacMgmtHdr hdr; |
| 421 | uint8_t *body; |
| 422 | tDot11fext_channel_switch_action_frame *ecsa_frame; |
| 423 | struct ecsa_frame_params ecsa_req; |
| 424 | uint32_t frame_len; |
| 425 | uint32_t status; |
| 426 | |
| 427 | hdr = WDA_GET_RX_MAC_HEADER(rx_packet_info); |
| 428 | body = WDA_GET_RX_MPDU_DATA(rx_packet_info); |
| 429 | frame_len = WDA_GET_RX_PAYLOAD_LEN(rx_packet_info); |
| 430 | |
| 431 | limLog(mac_ctx, LOG1, FL("Received ECSA action frame")); |
| 432 | |
| 433 | |
| 434 | ecsa_frame = vos_mem_malloc(sizeof(*ecsa_frame)); |
| 435 | if (!ecsa_frame) { |
| 436 | limLog(mac_ctx, LOGE, FL("AllocateMemory failed")); |
| 437 | return; |
| 438 | } |
| 439 | |
| 440 | /* Unpack channel switch frame */ |
| 441 | status = dot11fUnpackext_channel_switch_action_frame(mac_ctx, |
| 442 | body, frame_len, ecsa_frame); |
| 443 | |
| 444 | if (DOT11F_FAILED(status)) { |
| 445 | limLog(mac_ctx, LOGE, FL("Failed to parse CHANSW action frame (0x%08x, len %d):"), |
| 446 | status, frame_len); |
| 447 | goto free_ecsa; |
| 448 | } else if (DOT11F_WARNED(status)) { |
| 449 | limLog(mac_ctx, LOGW, FL("There were warnings while unpacking CHANSW Request (0x%08x, %d bytes):"), |
| 450 | status, frame_len); |
| 451 | } |
| 452 | |
| 453 | if (session_entry->currentOperChannel == |
| 454 | ecsa_frame->ext_chan_switch_ann_action.new_channel) { |
| 455 | limLog(mac_ctx, LOGE, FL("New channel %d is same as old channel ignore req"), |
| 456 | ecsa_frame->ext_chan_switch_ann_action.new_channel); |
| 457 | goto free_ecsa; |
| 458 | } |
| 459 | |
| 460 | ecsa_req.new_channel = ecsa_frame->ext_chan_switch_ann_action.new_channel; |
| 461 | ecsa_req.op_class = ecsa_frame->ext_chan_switch_ann_action.op_class; |
| 462 | ecsa_req.switch_mode = ecsa_frame->ext_chan_switch_ann_action.switch_mode; |
| 463 | ecsa_req.switch_count = ecsa_frame->ext_chan_switch_ann_action.switch_count; |
| 464 | limLog(mac_ctx, LOG1, FL("New channel %d op class %d switch mode %d switch count %d"), |
| 465 | ecsa_req.new_channel, ecsa_req.op_class, |
| 466 | ecsa_req.switch_mode, ecsa_req.switch_count); |
| 467 | |
| 468 | lim_handle_ecsa_req(mac_ctx, &ecsa_req, session_entry); |
| 469 | free_ecsa: |
| 470 | vos_mem_free(ecsa_frame); |
| 471 | } |
| 472 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 474 | #ifdef WLAN_FEATURE_11AC |
| 475 | static void |
| 476 | __limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 477 | { |
| 478 | |
| 479 | tpSirMacMgmtHdr pHdr; |
| 480 | tANI_U8 *pBody; |
| 481 | tDot11fOperatingMode *pOperatingModeframe; |
| 482 | tANI_U32 frameLen; |
| 483 | tANI_U32 nStatus; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 484 | tpDphHashNode pSta; |
| 485 | tANI_U16 aid; |
Abhishek Singh | df8eb31 | 2014-11-15 00:49:28 +0530 | [diff] [blame] | 486 | tANI_U8 operMode; |
| 487 | tANI_U32 channelBondingMode; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 488 | |
| 489 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 490 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 491 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 492 | |
Abhishek Singh | df8eb31 | 2014-11-15 00:49:28 +0530 | [diff] [blame] | 493 | limLog(pMac, LOG1, FL("Received Operating Mode action frame")); |
| 494 | |
| 495 | if( RF_CHAN_14 >= psessionEntry->currentOperChannel ) |
| 496 | { |
| 497 | channelBondingMode = pMac->roam.configParam.channelBondingMode24GHz; |
| 498 | } |
| 499 | else |
| 500 | { |
| 501 | channelBondingMode = pMac->roam.configParam.channelBondingMode5GHz; |
| 502 | } |
| 503 | |
| 504 | /* Do not update the channel bonding mode if channel bonding |
| 505 | * mode is disabled in INI. |
| 506 | */ |
| 507 | if(WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == channelBondingMode) |
| 508 | { |
| 509 | limLog(pMac, LOGW, |
| 510 | FL("channel bonding disabled")); |
| 511 | return; |
| 512 | } |
| 513 | |
Sushant Kaushik | c112387 | 2015-01-07 13:59:20 +0530 | [diff] [blame] | 514 | if (( RF_CHAN_14 >= psessionEntry->currentOperChannel )&& |
| 515 | !IS_HT40_OBSS_SCAN_FEATURE_ENABLE) |
| 516 | { |
| 517 | limLog(pMac, LOGW, |
| 518 | FL("channel bonding disabled as FW doesn't supoort CB in 2.4gz")); |
| 519 | return; |
| 520 | } |
| 521 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 522 | pOperatingModeframe = vos_mem_malloc(sizeof(*pOperatingModeframe)); |
| 523 | if (NULL == pOperatingModeframe) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 524 | { |
| 525 | limLog(pMac, LOGE, |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 526 | FL("AllocateMemory failed")); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 527 | return; |
| 528 | } |
| 529 | |
| 530 | /* Unpack channel switch frame */ |
| 531 | nStatus = dot11fUnpackOperatingMode(pMac, pBody, frameLen, pOperatingModeframe); |
| 532 | |
| 533 | if( DOT11F_FAILED( nStatus )) |
| 534 | { |
| 535 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 536 | FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 537 | nStatus, |
| 538 | frameLen); |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 539 | vos_mem_free(pOperatingModeframe); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 540 | return; |
| 541 | } |
| 542 | else if(DOT11F_WARNED( nStatus )) |
| 543 | { |
| 544 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 545 | FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 546 | nStatus, |
| 547 | frameLen); |
| 548 | } |
| 549 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
Padma, Santhosh Kumar | 6a3fdc6 | 2015-08-28 17:59:51 +0530 | [diff] [blame] | 550 | if (pSta == NULL) |
| 551 | { |
| 552 | PELOGE(limLog(pMac, LOGE, FL("Station context not found"));) |
| 553 | return; |
| 554 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 555 | |
| 556 | operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ; |
| 557 | if( operMode != pOperatingModeframe->OperatingMode.chanWidth) |
| 558 | { |
| 559 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 560 | FL(" received Chanwidth %d, staIdx = %d"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 561 | (pOperatingModeframe->OperatingMode.chanWidth ), |
| 562 | pSta->staIndex); |
| 563 | |
| 564 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 565 | FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 566 | pHdr->sa[0], |
| 567 | pHdr->sa[1], |
| 568 | pHdr->sa[2], |
| 569 | pHdr->sa[3], |
| 570 | pHdr->sa[4], |
| 571 | pHdr->sa[5]); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 572 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 573 | if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ) |
| 574 | { |
| 575 | pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; |
| 576 | pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; |
| 577 | } |
| 578 | else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ) |
| 579 | { |
| 580 | pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; |
| 581 | pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; |
| 582 | } |
| 583 | else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ) |
| 584 | { |
| 585 | pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; |
| 586 | pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; |
| 587 | } |
| 588 | limCheckVHTOpModeChange( pMac, psessionEntry, |
| 589 | (pOperatingModeframe->OperatingMode.chanWidth), pSta->staIndex);\ |
| 590 | } |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 591 | vos_mem_free(pOperatingModeframe); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 592 | return; |
| 593 | } |
| 594 | #endif |
| 595 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 596 | static void |
| 597 | __limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 598 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 599 | } |
| 600 | |
| 601 | |
| 602 | static void |
| 603 | __limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 604 | { |
| 605 | tSirAddtsRspInfo addts; |
| 606 | tSirRetStatus retval; |
| 607 | tpSirMacMgmtHdr pHdr; |
| 608 | tpDphHashNode pSta; |
| 609 | tANI_U16 aid; |
| 610 | tANI_U32 frameLen; |
| 611 | tANI_U8 *pBody; |
| 612 | tpLimTspecInfo tspecInfo; |
| 613 | tANI_U8 ac; |
| 614 | tpDphHashNode pStaDs = NULL; |
| 615 | tANI_U8 rspReqd = 1; |
| 616 | tANI_U32 cfgLen; |
| 617 | tSirMacAddr peerMacAddr; |
| 618 | |
| 619 | |
| 620 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 621 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 622 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 623 | |
| 624 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 625 | PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 626 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) |
| 627 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 628 | PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 629 | return; |
| 630 | } |
| 631 | |
| 632 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 633 | if (pSta == NULL) |
| 634 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 635 | PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 636 | return; |
| 637 | } |
| 638 | |
| 639 | retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts); |
| 640 | if (retval != eSIR_SUCCESS) |
| 641 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 642 | PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)"), retval);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 643 | return; |
| 644 | } |
| 645 | |
| 646 | // don't have to check for qos/wme capabilities since we wouldn't have this |
| 647 | // flag set otherwise |
| 648 | if (! pMac->lim.gLimAddtsSent) |
| 649 | { |
| 650 | // we never sent an addts request! |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 651 | PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 652 | return; |
| 653 | } |
| 654 | |
| 655 | if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken) |
| 656 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 657 | limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 658 | addts.dialogToken, pMac->lim.gLimAddtsReq.req.dialogToken); |
| 659 | return; |
| 660 | } |
| 661 | |
| 662 | /* |
| 663 | * for successful addts reponse, try to add the classifier. |
| 664 | * if this fails for any reason, we should send a delts request to the ap |
| 665 | * for now, its ok not to send a delts since we are going to add support for |
| 666 | * multiple tclas soon and until then we won't send any addts requests with |
| 667 | * multiple tclas elements anyway. |
| 668 | * In case of addClassifier failure, we just let the addts timer run out |
| 669 | */ |
| 670 | if (((addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) || |
| 671 | (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) && |
| 672 | (addts.status == eSIR_MAC_SUCCESS_STATUS)) |
| 673 | { |
| 674 | // add the classifier - this should always succeed |
| 675 | if (addts.numTclas > 1) // currently no support for multiple tclas elements |
| 676 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 677 | limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 678 | aid, addts.numTclas); |
| 679 | return; |
| 680 | } |
| 681 | else if (addts.numTclas == 1) |
| 682 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 683 | limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!", aid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 684 | addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio); |
| 685 | } |
| 686 | } |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 687 | limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 688 | addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio, |
| 689 | addts.status); |
| 690 | |
| 691 | // deactivate the response timer |
| 692 | limDeactivateAndChangeTimer(pMac, eLIM_ADDTS_RSP_TIMER); |
| 693 | |
| 694 | if (addts.status != eSIR_MAC_SUCCESS_STATUS) |
| 695 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 696 | limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 697 | addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio, |
| 698 | addts.status); |
| 699 | limSendSmeAddtsRsp(pMac, true, addts.status, psessionEntry, addts.tspec, |
| 700 | psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 701 | |
| 702 | // clear the addts flag |
| 703 | pMac->lim.gLimAddtsSent = false; |
| 704 | |
| 705 | return; |
| 706 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 707 | #ifdef FEATURE_WLAN_ESE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 708 | if (addts.tsmPresent) |
| 709 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 710 | limLog(pMac, LOGW, "TSM IE Present"); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 711 | psessionEntry->eseContext.tsm.tid = addts.tspec.tsinfo.traffic.userPrio; |
| 712 | vos_mem_copy(&psessionEntry->eseContext.tsm.tsmInfo, |
| 713 | &addts.tsmIE,sizeof(tSirMacESETSMIE)); |
| 714 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 715 | limSendSmeTsmIEInd(pMac, psessionEntry, addts.tsmIE.tsid, |
| 716 | addts.tsmIE.state, addts.tsmIE.msmt_interval); |
| 717 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 718 | limActivateTSMStatsTimer(pMac, psessionEntry); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 719 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 720 | } |
| 721 | #endif |
| 722 | /* Since AddTS response was successful, check for the PSB flag |
| 723 | * and directional flag inside the TS Info field. |
| 724 | * An AC is trigger enabled AC if the PSB subfield is set to 1 |
| 725 | * in the uplink direction. |
| 726 | * An AC is delivery enabled AC if the PSB subfield is set to 1 |
| 727 | * in the downlink direction. |
| 728 | * An AC is trigger and delivery enabled AC if the PSB subfield |
| 729 | * is set to 1 in the bi-direction field. |
| 730 | */ |
| 731 | if (addts.tspec.tsinfo.traffic.psb == 1) |
| 732 | limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, SET_UAPSD_MASK); |
| 733 | else |
| 734 | limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, CLEAR_UAPSD_MASK); |
| 735 | |
| 736 | |
| 737 | /* ADDTS success, so AC is now admitted. We shall now use the default |
| 738 | * EDCA parameters as advertised by AP and send the updated EDCA params |
| 739 | * to HAL. |
| 740 | */ |
| 741 | ac = upToAc(addts.tspec.tsinfo.traffic.userPrio); |
| 742 | if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK) |
| 743 | { |
| 744 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); |
| 745 | } |
| 746 | else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK) |
| 747 | { |
| 748 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); |
| 749 | } |
| 750 | else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR) |
| 751 | { |
| 752 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); |
| 753 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); |
| 754 | } |
| 755 | |
| 756 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 757 | |
| 758 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 759 | if (pStaDs != NULL) |
| 760 | { |
| 761 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 762 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 763 | else |
| 764 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 765 | } |
| 766 | else |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 767 | limLog(pMac, LOGE, FL("Self entry missing in Hash Table ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 768 | |
| 769 | |
| 770 | sirCopyMacAddr(peerMacAddr,psessionEntry->bssId); |
| 771 | |
| 772 | //if schedule is not present then add TSPEC with svcInterval as 0. |
| 773 | if(!addts.schedulePresent) |
| 774 | addts.schedule.svcInterval = 0; |
| 775 | if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, &addts.tspec, addts.schedule.svcInterval, &tspecInfo)) |
| 776 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 777 | PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 778 | limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec, |
| 779 | psessionEntry); |
| 780 | pMac->lim.gLimAddtsSent = false; |
| 781 | return; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status. |
| 782 | } |
| 783 | if((addts.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA) || |
Madan Mohan Koyyalamudi | 198ade3 | 2013-09-29 03:52:25 +0530 | [diff] [blame] | 784 | ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 785 | { |
| 786 | retval = limSendHalMsgAddTs(pMac, pSta->staIndex, tspecInfo->idx, addts.tspec, psessionEntry->peSessionId); |
| 787 | if(eSIR_SUCCESS != retval) |
| 788 | { |
| 789 | limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecInfo->idx); |
| 790 | |
| 791 | // Send DELTS action frame to AP |
| 792 | cfgLen = sizeof(tSirMacAddr); |
| 793 | limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec, |
| 794 | psessionEntry); |
| 795 | limSendSmeAddtsRsp(pMac, true, retval, psessionEntry, addts.tspec, |
| 796 | psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 797 | pMac->lim.gLimAddtsSent = false; |
| 798 | return; |
| 799 | } |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 800 | PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 801 | addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);) |
| 802 | } |
| 803 | else |
| 804 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 805 | PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 806 | addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);) |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 807 | PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 808 | // Use the smesessionId and smetransactionId from the PE session context |
| 809 | limSendSmeAddtsRsp(pMac, true, eSIR_SME_SUCCESS, psessionEntry, addts.tspec, |
| 810 | psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 811 | } |
| 812 | |
| 813 | // clear the addts flag |
| 814 | pMac->lim.gLimAddtsSent = false; |
| 815 | return; |
| 816 | } |
| 817 | |
| 818 | |
| 819 | static void |
| 820 | __limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 821 | { |
| 822 | tSirRetStatus retval; |
| 823 | tSirDeltsReqInfo delts; |
| 824 | tpSirMacMgmtHdr pHdr; |
| 825 | tpDphHashNode pSta; |
| 826 | tANI_U32 frameLen; |
| 827 | tANI_U16 aid; |
| 828 | tANI_U8 *pBody; |
| 829 | tANI_U8 tsStatus; |
| 830 | tSirMacTSInfo *tsinfo; |
| 831 | tANI_U8 tspecIdx; |
| 832 | tANI_U8 ac; |
| 833 | tpDphHashNode pStaDs = NULL; |
| 834 | |
| 835 | |
| 836 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 837 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 838 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 839 | |
| 840 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 841 | if (pSta == NULL) |
| 842 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 843 | PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 844 | return; |
| 845 | } |
| 846 | |
| 847 | // parse the delts request |
| 848 | retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts); |
| 849 | if (retval != eSIR_SUCCESS) |
| 850 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 851 | PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)"), retval);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 852 | return; |
| 853 | } |
| 854 | |
| 855 | if (delts.wmeTspecPresent) |
| 856 | { |
| 857 | if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled)) |
| 858 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 859 | PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 860 | return; |
| 861 | } |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 862 | limLog(pMac, LOG1, FL("WME Delts received")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 863 | } |
| 864 | else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled) |
| 865 | { |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 866 | limLog(pMac, LOG1, FL("11e QoS Delts received")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 867 | } |
| 868 | else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled) |
| 869 | { |
Abhishek Singh | 525045c | 2014-12-15 17:18:45 +0530 | [diff] [blame] | 870 | limLog(pMac, LOG1, FL("WSM Delts received")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 871 | } |
| 872 | else |
| 873 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 874 | PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 875 | return; |
| 876 | } |
| 877 | |
| 878 | tsinfo = delts.wmeTspecPresent ? &delts.tspec.tsinfo : &delts.tsinfo; |
| 879 | |
| 880 | // if no Admit Control, ignore the request |
| 881 | if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA)) |
| 882 | { |
| 883 | |
Madan Mohan Koyyalamudi | c0a75a4 | 2013-10-07 04:20:49 +0530 | [diff] [blame] | 884 | if (upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 885 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 886 | limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 887 | tsinfo->traffic.userPrio); |
| 888 | return; |
| 889 | } |
| 890 | } |
| 891 | |
Madan Mohan Koyyalamudi | c0a75a4 | 2013-10-07 04:20:49 +0530 | [diff] [blame] | 892 | if ((psessionEntry->limSystemRole != eLIM_AP_ROLE) && |
| 893 | (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) |
| 894 | limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry); |
| 895 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 896 | // try to delete the TS |
| 897 | if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx)) |
| 898 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 899 | PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 900 | return; |
| 901 | } |
| 902 | |
| 903 | else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) || |
| 904 | (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) |
| 905 | { |
| 906 | //Edca only for now. |
| 907 | } |
| 908 | else |
| 909 | { |
| 910 | //send message to HAL to delete TS |
Madan Mohan Koyyalamudi | c0a75a4 | 2013-10-07 04:20:49 +0530 | [diff] [blame] | 911 | if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac, |
| 912 | pSta->staIndex, |
| 913 | tspecIdx, |
| 914 | delts, |
| 915 | psessionEntry->peSessionId, |
| 916 | psessionEntry->bssId)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 917 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 918 | limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 919 | tsinfo->traffic.userPrio); |
| 920 | return; |
| 921 | } |
| 922 | } |
| 923 | |
| 924 | /* We successfully deleted the TSPEC. Update the dynamic UAPSD Mask. |
| 925 | * The AC for this TSPEC is no longer trigger enabled if this Tspec |
| 926 | * was set-up in uplink direction only. |
| 927 | * The AC for this TSPEC is no longer delivery enabled if this Tspec |
| 928 | * was set-up in downlink direction only. |
| 929 | * The AC for this TSPEC is no longer triiger enabled and delivery |
| 930 | * enabled if this Tspec was a bidirectional TSPEC. |
| 931 | */ |
| 932 | limSetTspecUapsdMask(pMac, tsinfo, CLEAR_UAPSD_MASK); |
| 933 | |
| 934 | |
| 935 | /* We're deleting the TSPEC. |
| 936 | * The AC for this TSPEC is no longer admitted in uplink/downlink direction |
| 937 | * if this TSPEC was set-up in uplink/downlink direction only. |
| 938 | * The AC for this TSPEC is no longer admitted in both uplink and downlink |
| 939 | * directions if this TSPEC was a bi-directional TSPEC. |
| 940 | * If ACM is set for this AC and this AC is admitted only in downlink |
| 941 | * direction, PE needs to downgrade the EDCA parameter |
| 942 | * (for the AC for which TS is being deleted) to the |
| 943 | * next best AC for which ACM is not enabled, and send the |
| 944 | * updated values to HAL. |
| 945 | */ |
| 946 | ac = upToAc(tsinfo->traffic.userPrio); |
| 947 | |
| 948 | if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK) |
| 949 | { |
| 950 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac); |
| 951 | } |
| 952 | else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK) |
| 953 | { |
| 954 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac); |
| 955 | } |
| 956 | else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR) |
| 957 | { |
| 958 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac); |
| 959 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac); |
| 960 | } |
| 961 | |
| 962 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 963 | |
| 964 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 965 | if (pStaDs != NULL) |
| 966 | { |
| 967 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 968 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 969 | else |
| 970 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 971 | } |
| 972 | else |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 973 | limLog(pMac, LOGE, FL("Self entry missing in Hash Table ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 974 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 975 | limLog(pMac, LOG1, FL("DeleteTS succeeded")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 976 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 977 | #ifdef FEATURE_WLAN_ESE |
| 978 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 979 | limSendSmeTsmIEInd(pMac, psessionEntry, 0, 0, 0); |
| 980 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 981 | limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 982 | #endif /* FEATURE_WLAN_ESE_UPLOAD */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 983 | #endif |
| 984 | |
| 985 | } |
| 986 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 987 | static void |
| 988 | __limProcessQosMapConfigureFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, |
| 989 | tpPESession psessionEntry) |
| 990 | { |
| 991 | tpSirMacMgmtHdr pHdr; |
| 992 | tANI_U32 frameLen; |
| 993 | tANI_U8 *pBody; |
| 994 | tSirRetStatus retval; |
| 995 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 996 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 997 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 998 | retval = sirConvertQosMapConfigureFrame2Struct(pMac, pBody, frameLen, |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 999 | &psessionEntry->QosMapSet); |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 1000 | if (retval != eSIR_SUCCESS) |
| 1001 | { |
| 1002 | PELOGW(limLog(pMac, LOGE, |
| 1003 | FL("QosMapConfigure frame parsing failed (error %d)"), retval);) |
| 1004 | return; |
| 1005 | } |
Naveen Rawat | 71e1a2e | 2015-07-28 16:11:21 +0530 | [diff] [blame] | 1006 | limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, |
yeshwanth sriram guntuka | c1046a5 | 2017-04-25 16:34:50 +0530 | [diff] [blame] | 1007 | pRxPacketInfo, psessionEntry, |
| 1008 | WDA_GET_RX_RSSI_DB(pRxPacketInfo)); |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 1009 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1010 | |
| 1011 | #ifdef ANI_SUPPORT_11H |
| 1012 | /** |
| 1013 | * limProcessBasicMeasReq |
| 1014 | * |
| 1015 | *FUNCTION: |
| 1016 | * This function is called by limProcessMeasurementRequestFrame() |
| 1017 | * when it received a Basic measurement Request action frame. |
| 1018 | * Station/BP receiving this should perform basic measurements |
| 1019 | * and then send Basic Measurement Report. AP should not perform |
| 1020 | * any measurements, and send report indicating refusal. |
| 1021 | * |
| 1022 | *LOGIC: |
| 1023 | * |
| 1024 | *ASSUMPTIONS: |
| 1025 | * |
| 1026 | *NOTE: |
| 1027 | * |
| 1028 | * @param pMac - Pointer to Global MAC structure |
| 1029 | * @param pMeasReqFrame - A pointer to Basic Meas. Req structure |
| 1030 | * @return None |
| 1031 | */ |
| 1032 | static void |
| 1033 | __limProcessBasicMeasReq(tpAniSirGlobal pMac, |
| 1034 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 1035 | tSirMacAddr peerMacAddr) |
| 1036 | { |
| 1037 | // TBD - Station shall perform basic measurements |
| 1038 | |
| 1039 | if (limSendMeasReportFrame(pMac, |
| 1040 | pMeasReqFrame, |
| 1041 | peerMacAddr) != eSIR_SUCCESS) |
| 1042 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1043 | PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1044 | return; |
| 1045 | } |
| 1046 | } |
| 1047 | |
| 1048 | |
| 1049 | /** |
| 1050 | * limProcessCcaMeasReq |
| 1051 | * |
| 1052 | *FUNCTION: |
| 1053 | * This function is called by limProcessMeasurementRequestFrame() |
| 1054 | * when it received a CCA measurement Request action frame. |
| 1055 | * Station/BP receiving this should perform CCA measurements |
| 1056 | * and then send CCA Measurement Report. AP should not perform |
| 1057 | * any measurements, and send report indicating refusal. |
| 1058 | * |
| 1059 | *LOGIC: |
| 1060 | * |
| 1061 | *ASSUMPTIONS: |
| 1062 | * |
| 1063 | *NOTE: |
| 1064 | * |
| 1065 | * @param pMac - Pointer to Global MAC structure |
| 1066 | * @param pMeasReqFrame - A pointer to CCA Meas. Req structure |
| 1067 | * @return None |
| 1068 | */ |
| 1069 | static void |
| 1070 | __limProcessCcaMeasReq(tpAniSirGlobal pMac, |
| 1071 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 1072 | tSirMacAddr peerMacAddr) |
| 1073 | { |
| 1074 | // TBD - Station shall perform cca measurements |
| 1075 | |
| 1076 | if (limSendMeasReportFrame(pMac, |
| 1077 | pMeasReqFrame, |
| 1078 | peerMacAddr) != eSIR_SUCCESS) |
| 1079 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1080 | PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1081 | return; |
| 1082 | } |
| 1083 | } |
| 1084 | |
| 1085 | |
| 1086 | /** |
| 1087 | * __limProcessRpiMeasReq |
| 1088 | * |
| 1089 | *FUNCTION: |
| 1090 | * This function is called by limProcessMeasurementRequestFrame() |
| 1091 | * when it received a RPI measurement Request action frame. |
| 1092 | * Station/BP/AP receiving this shall not perform any measurements, |
| 1093 | * and send report indicating refusal. |
| 1094 | * |
| 1095 | *LOGIC: |
| 1096 | * |
| 1097 | *ASSUMPTIONS: |
| 1098 | * |
| 1099 | *NOTE: |
| 1100 | * |
| 1101 | * @param pMac - Pointer to Global MAC structure |
| 1102 | * @param pMeasReqFrame - A pointer to RPI Meas. Req structure |
| 1103 | * @return None |
| 1104 | */ |
| 1105 | static void |
| 1106 | __limProcessRpiMeasReq(tpAniSirGlobal pMac, |
| 1107 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 1108 | tSirMacAddr peerMacAddr) |
| 1109 | { |
| 1110 | if (limSendMeasReportFrame(pMac, |
| 1111 | pMeasReqFrame, |
| 1112 | peerMacAddr) != eSIR_SUCCESS) |
| 1113 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1114 | PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1115 | return; |
| 1116 | } |
| 1117 | } |
| 1118 | |
| 1119 | |
| 1120 | /** |
| 1121 | * __limProcessMeasurementRequestFrame |
| 1122 | * |
| 1123 | *FUNCTION: |
| 1124 | * |
| 1125 | *LOGIC: |
| 1126 | * |
| 1127 | *ASSUMPTIONS: |
| 1128 | * |
| 1129 | *NOTE: |
| 1130 | * |
| 1131 | * @param pMac - Pointer to Global MAC structure |
| 1132 | * @param *pRxPacketInfo - A pointer to packet info structure |
| 1133 | * @return None |
| 1134 | */ |
| 1135 | |
| 1136 | static void |
| 1137 | __limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) |
| 1138 | { |
| 1139 | tpSirMacMgmtHdr pHdr; |
| 1140 | tANI_U8 *pBody; |
| 1141 | tpSirMacMeasReqActionFrame pMeasReqFrame; |
| 1142 | tANI_U32 frameLen; |
| 1143 | |
| 1144 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1145 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 1146 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 1147 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1148 | pMeasReqFrame = vos_mem_malloc(sizeof( tSirMacMeasReqActionFrame )); |
| 1149 | if (NULL == pMeasReqFrame) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1150 | { |
| 1151 | limLog(pMac, LOGE, |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1152 | FL("limProcessMeasurementRequestFrame: AllocateMemory failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1153 | return; |
| 1154 | } |
| 1155 | |
| 1156 | if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) != |
| 1157 | eSIR_SUCCESS) |
| 1158 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1159 | PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1160 | return; |
| 1161 | } |
| 1162 | |
| 1163 | |
| 1164 | switch(pMeasReqFrame->measReqIE.measType) |
| 1165 | { |
| 1166 | case SIR_MAC_BASIC_MEASUREMENT_TYPE: |
| 1167 | __limProcessBasicMeasReq(pMac, pMeasReqFrame, pHdr->sa); |
| 1168 | break; |
| 1169 | |
| 1170 | case SIR_MAC_CCA_MEASUREMENT_TYPE: |
| 1171 | __limProcessCcaMeasReq(pMac, pMeasReqFrame, pHdr->sa); |
| 1172 | break; |
| 1173 | |
| 1174 | case SIR_MAC_RPI_MEASUREMENT_TYPE: |
| 1175 | __limProcessRpiMeasReq(pMac, pMeasReqFrame, pHdr->sa); |
| 1176 | break; |
| 1177 | |
| 1178 | default: |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1179 | limLog(pMac, LOG1, FL("Unknown Measurement Type %d "), |
| 1180 | pMeasReqFrame->measReqIE.measType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1181 | break; |
| 1182 | } |
| 1183 | |
| 1184 | } /*** end limProcessMeasurementRequestFrame ***/ |
| 1185 | |
| 1186 | |
| 1187 | /** |
| 1188 | * limProcessTpcRequestFrame |
| 1189 | * |
| 1190 | *FUNCTION: |
| 1191 | * This function is called upon receiving Tpc Request frame. |
| 1192 | * |
| 1193 | *NOTE: |
| 1194 | * |
| 1195 | * @param pMac - Pointer to Global MAC structure |
| 1196 | * @param *pRxPacketInfo - A pointer to packet info structure |
| 1197 | * @return None |
| 1198 | */ |
| 1199 | |
| 1200 | static void |
| 1201 | __limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) |
| 1202 | { |
| 1203 | tpSirMacMgmtHdr pHdr; |
| 1204 | tANI_U8 *pBody; |
| 1205 | tpSirMacTpcReqActionFrame pTpcReqFrame; |
| 1206 | tANI_U32 frameLen; |
| 1207 | |
| 1208 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1209 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 1210 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 1211 | |
Abhishek Singh | 3cbf605 | 2014-12-15 16:46:42 +0530 | [diff] [blame] | 1212 | limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1213 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1214 | pTpcReqFrame = vos_mem_malloc(sizeof( tSirMacTpcReqActionFrame )); |
| 1215 | if (NULL == pTpcReqFrame) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1216 | { |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 1217 | PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1218 | return; |
| 1219 | } |
| 1220 | |
| 1221 | if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) != |
| 1222 | eSIR_SUCCESS) |
| 1223 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1224 | PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1225 | return; |
| 1226 | } |
| 1227 | |
| 1228 | if (limSendTpcReportFrame(pMac, |
| 1229 | pTpcReqFrame, |
| 1230 | pHdr->sa) != eSIR_SUCCESS) |
| 1231 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1232 | PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1233 | return; |
| 1234 | } |
| 1235 | } |
| 1236 | #endif |
| 1237 | |
| 1238 | |
| 1239 | /** |
| 1240 | * \brief Validate an ADDBA Req from peer with respect |
| 1241 | * to our own BA configuration |
| 1242 | * |
| 1243 | * \sa __limValidateAddBAParameterSet |
| 1244 | * |
| 1245 | * \param pMac The global tpAniSirGlobal object |
| 1246 | * |
| 1247 | * \param baParameterSet The ADDBA Parameter Set. |
| 1248 | * |
| 1249 | * \param pDelBAFlag this parameter is NULL except for call from processAddBAReq |
| 1250 | * delBAFlag is set when entry already exists. |
| 1251 | * |
| 1252 | * \param reqType ADDBA Req v/s ADDBA Rsp |
| 1253 | * 1 - ADDBA Req |
| 1254 | * 0 - ADDBA Rsp |
| 1255 | * |
| 1256 | * \return eSIR_SUCCESS if setup completes successfully |
| 1257 | * eSIR_FAILURE is some problem is encountered |
| 1258 | */ |
| 1259 | |
| 1260 | static tSirMacStatusCodes |
| 1261 | __limValidateAddBAParameterSet( tpAniSirGlobal pMac, |
| 1262 | tpDphHashNode pSta, |
| 1263 | tDot11fFfAddBAParameterSet baParameterSet, |
| 1264 | tANI_U8 dialogueToken, |
| 1265 | tLimAddBaValidationReqType reqType , |
| 1266 | tANI_U8* pDelBAFlag /*this parameter is NULL except for call from processAddBAReq*/) |
| 1267 | { |
| 1268 | if(baParameterSet.tid >= STACFG_MAX_TC) |
| 1269 | { |
| 1270 | return eSIR_MAC_WME_INVALID_PARAMS_STATUS; |
| 1271 | } |
| 1272 | |
| 1273 | //check if there is already a BA session setup with this STA/TID while processing AddBaReq |
| 1274 | if((true == pSta->tcCfg[baParameterSet.tid].fUseBARx) && |
| 1275 | (LIM_ADDBA_REQ == reqType)) |
| 1276 | { |
| 1277 | //There is already BA session setup for STA/TID. |
Hoonki Lee | 9af07cf | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 1278 | limLog( pMac, LOGE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1279 | FL( "AddBAReq rcvd when there is already a session for this StaId = %d, tid = %d\n " ), |
| 1280 | pSta->staIndex, baParameterSet.tid); |
| 1281 | limPrintMacAddr( pMac, pSta->staAddr, LOGW ); |
| 1282 | |
| 1283 | if(pDelBAFlag) |
| 1284 | *pDelBAFlag = true; |
| 1285 | } |
| 1286 | return eSIR_MAC_SUCCESS_STATUS; |
| 1287 | } |
| 1288 | |
| 1289 | /** |
| 1290 | * \brief Validate a DELBA Ind from peer with respect |
| 1291 | * to our own BA configuration |
| 1292 | * |
| 1293 | * \sa __limValidateDelBAParameterSet |
| 1294 | * |
| 1295 | * \param pMac The global tpAniSirGlobal object |
| 1296 | * |
| 1297 | * \param baParameterSet The DELBA Parameter Set. |
| 1298 | * |
| 1299 | * \param pSta Runtime, STA-related configuration cached |
| 1300 | * in the HashNode object |
| 1301 | * |
| 1302 | * \return eSIR_SUCCESS if setup completes successfully |
| 1303 | * eSIR_FAILURE is some problem is encountered |
| 1304 | */ |
| 1305 | static tSirMacStatusCodes |
| 1306 | __limValidateDelBAParameterSet( tpAniSirGlobal pMac, |
| 1307 | tDot11fFfDelBAParameterSet baParameterSet, |
| 1308 | tpDphHashNode pSta ) |
| 1309 | { |
| 1310 | tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS; |
| 1311 | |
Sen, Devendra | 5c3834a | 2017-06-01 17:17:10 +0530 | [diff] [blame] | 1312 | if (!(baParameterSet.tid < STACFG_MAX_TC)) |
| 1313 | return statusCode; |
| 1314 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1315 | // Validate if a BA is active for the requested TID |
| 1316 | if( pSta->tcCfg[baParameterSet.tid].fUseBATx || |
| 1317 | pSta->tcCfg[baParameterSet.tid].fUseBARx ) |
| 1318 | { |
| 1319 | statusCode = eSIR_MAC_SUCCESS_STATUS; |
| 1320 | |
| 1321 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1322 | FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1323 | } |
| 1324 | else |
| 1325 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1326 | FL("Received an INVALID DELBA Ind for TID %d..."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1327 | baParameterSet.tid ); |
| 1328 | |
| 1329 | return statusCode; |
| 1330 | } |
| 1331 | |
| 1332 | /** |
| 1333 | * \brief Process an ADDBA REQ |
| 1334 | * |
| 1335 | * \sa limProcessAddBAReq |
| 1336 | * |
| 1337 | * \param pMac The global tpAniSirGlobal object |
| 1338 | * |
| 1339 | * \param pRxPacketInfo Handle to the Rx packet info from HDD |
| 1340 | * |
| 1341 | * \return none |
| 1342 | * |
| 1343 | */ |
| 1344 | static void |
| 1345 | __limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 1346 | { |
| 1347 | tDot11fAddBAReq frmAddBAReq; |
| 1348 | tpSirMacMgmtHdr pHdr; |
| 1349 | tpDphHashNode pSta; |
| 1350 | tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS; |
| 1351 | tANI_U16 aid; |
SaidiReddy Yenuga | c341fbf | 2017-02-01 20:22:45 +0530 | [diff] [blame] | 1352 | tANI_U32 frameLen, nStatus,val, val1; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1353 | tANI_U8 *pBody; |
| 1354 | tANI_U8 delBAFlag =0; |
| 1355 | |
| 1356 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1357 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1358 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1359 | val = 0; |
SaidiReddy Yenuga | c341fbf | 2017-02-01 20:22:45 +0530 | [diff] [blame] | 1360 | val1 = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1361 | |
Yeshwanth Sriram Guntuka | 3293556 | 2018-08-24 15:41:18 +0530 | [diff] [blame^] | 1362 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, |
| 1363 | &psessionEntry->dph.dphHashTable); |
| 1364 | if (((psessionEntry->limSystemRole == eLIM_AP_ROLE || |
| 1365 | psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) && |
| 1366 | pSta != NULL && !pSta->isKeyInstalled) || |
| 1367 | !psessionEntry->isKeyInstalled) { |
| 1368 | limLog(pMac, LOGE, FL("Reject ADDBA as set_key is not done")); |
| 1369 | return; |
| 1370 | } |
| 1371 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1372 | // Unpack the received frame |
| 1373 | nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq ); |
| 1374 | if( DOT11F_FAILED( nStatus )) |
| 1375 | { |
| 1376 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1377 | FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1378 | nStatus, |
| 1379 | frameLen ); |
| 1380 | |
| 1381 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1382 | |
| 1383 | // Without an unpacked request we cannot respond, so silently ignore the request |
| 1384 | return; |
| 1385 | } |
| 1386 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1387 | { |
| 1388 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1389 | FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1390 | nStatus, |
| 1391 | frameLen ); |
| 1392 | |
| 1393 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1394 | } |
| 1395 | |
Kiran Kumar Lokere | 2ac471f | 2013-05-30 16:08:48 -0700 | [diff] [blame] | 1396 | psessionEntry->amsduSupportedInBA = frmAddBAReq.AddBAParameterSet.amsduSupported; |
| 1397 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1398 | if( pSta == NULL ) |
| 1399 | { |
| 1400 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1401 | FL( "STA context not found - ignoring ADDBA from " )); |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1402 | limPrintMacAddr( pMac, pHdr->sa, LOGE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1403 | |
| 1404 | // FIXME - Should we do this? |
| 1405 | status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS; |
| 1406 | goto returnAfterError; |
| 1407 | } |
Abhishek Singh | 02d9f6c | 2014-05-12 14:07:53 +0530 | [diff] [blame] | 1408 | limLog( pMac, LOG1, FL( "ADDBA Req from STA "MAC_ADDRESS_STR " with AID %d" |
| 1409 | " tid = %d policy = %d buffsize = %d" |
| 1410 | " amsduSupported = %d"), MAC_ADDR_ARRAY(pHdr->sa), |
| 1411 | aid, frmAddBAReq.AddBAParameterSet.tid, |
| 1412 | frmAddBAReq.AddBAParameterSet.policy, |
| 1413 | frmAddBAReq.AddBAParameterSet.bufferSize, |
| 1414 | frmAddBAReq.AddBAParameterSet.amsduSupported); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1415 | |
Abhishek Singh | 1f6e653 | 2014-06-05 17:35:08 +0530 | [diff] [blame] | 1416 | limLog( pMac, LOG1, FL( "ssn = %d fragNumber = %d" ), |
| 1417 | frmAddBAReq.BAStartingSequenceControl.ssn, |
| 1418 | frmAddBAReq.BAStartingSequenceControl.fragNumber); |
| 1419 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1420 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 1421 | // we can only do BA on "hard" STAs |
| 1422 | if (!(IS_HWSTA_IDX(pSta->staIndex))) |
| 1423 | { |
| 1424 | status = eSIR_MAC_REQ_DECLINED_STATUS; |
Sravan Kumar Kairam | cebb218 | 2016-01-25 20:50:11 +0530 | [diff] [blame] | 1425 | limLog( pMac, LOG1, |
| 1426 | FL( "ta Id is not HW Sta Id, Status code is %d " ), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1427 | goto returnAfterError; |
| 1428 | } |
| 1429 | #endif //WLAN_SOFTAP_VSTA_FEATURE |
| 1430 | |
SaidiReddy Yenuga | c341fbf | 2017-02-01 20:22:45 +0530 | [diff] [blame] | 1431 | if (wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_TX_RX_AGGREGATION, &val1) != |
| 1432 | eSIR_SUCCESS) |
| 1433 | { |
| 1434 | limLog(pMac, LOGE, |
| 1435 | FL("Unable to get WNI_CFG_ENABLE_TX_RX_AGGREGATION")); |
| 1436 | val1 = 1; |
| 1437 | } |
| 1438 | if (!val1) |
| 1439 | { |
| 1440 | limLog(pMac, LOGE, |
| 1441 | FL("aggregation disabled - ignoring ADDBA")); |
| 1442 | goto returnAfterError; |
| 1443 | } |
| 1444 | |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 1445 | if (wlan_cfgGetInt(pMac, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC, &val) != |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1446 | eSIR_SUCCESS) |
| 1447 | { |
| 1448 | limLog(pMac, LOGE, |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 1449 | FL("Unable to get WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC")); |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1450 | val = 0; |
| 1451 | } |
| 1452 | if ((SIR_BAND_2_4_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) && |
| 1453 | val) |
| 1454 | { |
| 1455 | limLog( pMac, LOGW, |
| 1456 | FL( "BTC disabled aggregation - ignoring ADDBA from " )); |
| 1457 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1458 | |
| 1459 | status = eSIR_MAC_REQ_DECLINED_STATUS; |
| 1460 | goto returnAfterError; |
| 1461 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1462 | |
| 1463 | // Now, validate the ADDBA Req |
| 1464 | if( eSIR_MAC_SUCCESS_STATUS != |
| 1465 | (status = __limValidateAddBAParameterSet( pMac, pSta, |
| 1466 | frmAddBAReq.AddBAParameterSet, |
| 1467 | 0, //dialogue token is don't care in request validation. |
| 1468 | LIM_ADDBA_REQ, &delBAFlag))) |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1469 | { |
| 1470 | limLog( pMac, LOGE, |
| 1471 | FL( "ADDBA parameters validation failed with status %d" ), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1472 | goto returnAfterError; |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1473 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1474 | |
| 1475 | //BA already set, so we need to delete it before adding new one. |
| 1476 | if(delBAFlag) |
| 1477 | { |
| 1478 | if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac, |
| 1479 | pSta, |
| 1480 | (tANI_U8)frmAddBAReq.AddBAParameterSet.tid, |
| 1481 | eBA_RECIPIENT,psessionEntry)) |
| 1482 | { |
| 1483 | status = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1484 | limLog( pMac, LOGE, |
| 1485 | FL( "Deletion of Existing BA session failed with status %d" ), |
| 1486 | status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1487 | goto returnAfterError; |
| 1488 | } |
| 1489 | } |
| 1490 | |
| 1491 | // Check if the ADD BA Declined configuration is Disabled |
| 1492 | if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1493 | limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1494 | frmAddBAReq.AddBAParameterSet.tid); |
| 1495 | status = eSIR_MAC_REQ_DECLINED_STATUS; |
| 1496 | goto returnAfterError; |
| 1497 | } |
| 1498 | |
| 1499 | // |
| 1500 | // Post WDA_ADDBA_REQ to HAL. |
| 1501 | // If HAL/HDD decide to allow this ADDBA Req session, |
| 1502 | // then this BA session is termed active |
| 1503 | // |
| 1504 | |
| 1505 | // Change the Block Ack state of this STA to wait for |
| 1506 | // ADDBA Rsp from HAL |
| 1507 | LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP); |
Kiran Kumar Lokere | 495c614 | 2013-04-01 20:52:41 -0700 | [diff] [blame] | 1508 | |
Madan Mohan Koyyalamudi | dd11eaf | 2012-11-02 16:04:21 -0700 | [diff] [blame] | 1509 | if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 495c614 | 2013-04-01 20:52:41 -0700 | [diff] [blame] | 1510 | { |
| 1511 | limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT")); |
Madan Mohan Koyyalamudi | dd11eaf | 2012-11-02 16:04:21 -0700 | [diff] [blame] | 1512 | return ; |
Kiran Kumar Lokere | 495c614 | 2013-04-01 20:52:41 -0700 | [diff] [blame] | 1513 | } |
| 1514 | |
| 1515 | |
| 1516 | if (frmAddBAReq.AddBAParameterSet.bufferSize) |
| 1517 | { |
| 1518 | frmAddBAReq.AddBAParameterSet.bufferSize = |
| 1519 | VOS_MIN(val, frmAddBAReq.AddBAParameterSet.bufferSize); |
| 1520 | } |
| 1521 | else |
| 1522 | { |
| 1523 | frmAddBAReq.AddBAParameterSet.bufferSize = val; |
| 1524 | } |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1525 | limLog( pMac, LOG1, FL( "ADDBAREQ NUMBUFF %d" ), |
Madan Mohan Koyyalamudi | dd11eaf | 2012-11-02 16:04:21 -0700 | [diff] [blame] | 1526 | frmAddBAReq.AddBAParameterSet.bufferSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1527 | |
| 1528 | if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac, |
| 1529 | pSta, |
| 1530 | (tANI_U8) frmAddBAReq.DialogToken.token, |
| 1531 | (tANI_U8) frmAddBAReq.AddBAParameterSet.tid, |
| 1532 | (tANI_U8) frmAddBAReq.AddBAParameterSet.policy, |
| 1533 | frmAddBAReq.AddBAParameterSet.bufferSize, |
| 1534 | frmAddBAReq.BATimeout.timeout, |
| 1535 | (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn, |
| 1536 | eBA_RECIPIENT,psessionEntry)) |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1537 | { |
| 1538 | status = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 1539 | limLog( pMac, LOGE, |
| 1540 | FL( "Request to setup new BA session with peer " |
| 1541 | " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr)); |
| 1542 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1543 | else |
| 1544 | return; |
| 1545 | |
| 1546 | returnAfterError: |
| 1547 | |
| 1548 | // |
| 1549 | // Package LIM_MLM_ADDBA_RSP to MLME, with proper |
| 1550 | // status code. MLME will then send an ADDBA RSP |
| 1551 | // over the air to the peer MAC entity |
| 1552 | // |
| 1553 | if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac, |
| 1554 | pHdr->sa, |
| 1555 | status, |
| 1556 | frmAddBAReq.DialogToken.token, |
| 1557 | (tANI_U8) frmAddBAReq.AddBAParameterSet.tid, |
| 1558 | (tANI_U8) frmAddBAReq.AddBAParameterSet.policy, |
| 1559 | frmAddBAReq.AddBAParameterSet.bufferSize, |
| 1560 | frmAddBAReq.BATimeout.timeout,psessionEntry)) |
| 1561 | { |
| 1562 | limLog( pMac, LOGW, |
| 1563 | FL( "Failed to post LIM_MLM_ADDBA_RSP to " )); |
| 1564 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1565 | } |
| 1566 | |
| 1567 | } |
| 1568 | |
| 1569 | /** |
| 1570 | * \brief Process an ADDBA RSP |
| 1571 | * |
| 1572 | * \sa limProcessAddBARsp |
| 1573 | * |
| 1574 | * \param pMac The global tpAniSirGlobal object |
| 1575 | * |
| 1576 | * \param pRxPacketInfo Handle to the packet info structure from HDD |
| 1577 | * |
| 1578 | * \return none |
| 1579 | * |
| 1580 | */ |
| 1581 | static void |
| 1582 | __limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 1583 | { |
| 1584 | tDot11fAddBARsp frmAddBARsp; |
| 1585 | tpSirMacMgmtHdr pHdr; |
| 1586 | tpDphHashNode pSta; |
| 1587 | tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1588 | tANI_U16 aid; |
| 1589 | tANI_U32 frameLen, nStatus; |
| 1590 | tANI_U8 *pBody; |
| 1591 | |
| 1592 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1593 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1594 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1595 | |
| 1596 | pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable ); |
| 1597 | if( pSta == NULL ) |
| 1598 | { |
| 1599 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1600 | FL( "STA context not found - ignoring ADDBA from " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1601 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1602 | return; |
| 1603 | } |
| 1604 | |
| 1605 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 1606 | // We can only do BA on "hard" STAs. We should not have issued an ADDBA |
| 1607 | // Request, so we should never be processing a ADDBA Response |
| 1608 | if (!(IS_HWSTA_IDX(pSta->staIndex))) |
| 1609 | { |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1610 | limLog( pMac, LOGE, FL( "Sta Id is not HW Sta Id " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1611 | return; |
| 1612 | } |
| 1613 | #endif //WLAN_SOFTAP_VSTA_FEATURE |
| 1614 | |
| 1615 | // Unpack the received frame |
| 1616 | nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp ); |
| 1617 | if( DOT11F_FAILED( nStatus )) |
| 1618 | { |
| 1619 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1620 | FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1621 | nStatus, |
| 1622 | frameLen ); |
| 1623 | |
| 1624 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1625 | goto returnAfterError; |
| 1626 | } |
| 1627 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1628 | { |
| 1629 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1630 | FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1631 | nStatus, |
| 1632 | frameLen ); |
| 1633 | |
| 1634 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1635 | } |
| 1636 | |
Abhishek Singh | 02d9f6c | 2014-05-12 14:07:53 +0530 | [diff] [blame] | 1637 | limLog( pMac, LOG1, FL( "ADDBA Rsp from STA "MAC_ADDRESS_STR " with AID %d " |
| 1638 | "tid = %d policy = %d buffsize = %d " |
| 1639 | "amsduSupported = %d status = %d"), |
| 1640 | MAC_ADDR_ARRAY(pHdr->sa), aid, |
| 1641 | frmAddBARsp.AddBAParameterSet.tid, |
| 1642 | frmAddBARsp.AddBAParameterSet.policy, |
| 1643 | frmAddBARsp.AddBAParameterSet.bufferSize, |
| 1644 | frmAddBARsp.AddBAParameterSet.amsduSupported, |
| 1645 | frmAddBARsp.Status.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1646 | //if there is no matchin dialougue token then ignore the response. |
| 1647 | |
| 1648 | if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token, |
| 1649 | pSta->assocId, frmAddBARsp.AddBAParameterSet.tid)) |
| 1650 | { |
Abhishek Singh | 6f09e70 | 2016-01-28 15:15:04 +0530 | [diff] [blame] | 1651 | limLog(pMac, LOGE, |
| 1652 | FL("dialogueToken in received addBARsp did not match with outstanding requests")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1653 | return; |
| 1654 | } |
| 1655 | |
| 1656 | // Check first if the peer accepted the ADDBA Req |
| 1657 | if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status ) |
| 1658 | { |
Kaushik, Sushant | 335328c | 2014-07-31 19:15:31 +0530 | [diff] [blame] | 1659 | tANI_U32 val; |
Sreelakshmi Konamki | 60ccfb3 | 2016-07-08 12:53:12 +0530 | [diff] [blame] | 1660 | pMac->lim.staBaInfo[pSta->staIndex]. |
| 1661 | failed_count[frmAddBARsp.AddBAParameterSet.tid] = 0; |
| 1662 | pMac->lim.staBaInfo[pSta->staIndex]. |
| 1663 | failed_timestamp[frmAddBARsp.AddBAParameterSet.tid] = 0; |
Kaushik, Sushant | 335328c | 2014-07-31 19:15:31 +0530 | [diff] [blame] | 1664 | if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS) |
| 1665 | { |
| 1666 | limLog(pMac, LOG1, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT")); |
| 1667 | goto returnAfterError; |
| 1668 | } |
| 1669 | if (0 == frmAddBARsp.AddBAParameterSet.bufferSize) |
| 1670 | frmAddBARsp.AddBAParameterSet.bufferSize = val; |
| 1671 | else |
| 1672 | frmAddBARsp.AddBAParameterSet.bufferSize = |
| 1673 | VOS_MIN(val, frmAddBARsp.AddBAParameterSet.bufferSize); |
| 1674 | limLog( pMac, LOG1, |
| 1675 | FL( "ADDBA RSP Buffsize = %d" ), |
| 1676 | frmAddBARsp.AddBAParameterSet.bufferSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1677 | // Now, validate the ADDBA Rsp |
| 1678 | if( eSIR_MAC_SUCCESS_STATUS != |
| 1679 | __limValidateAddBAParameterSet( pMac, pSta, |
| 1680 | frmAddBARsp.AddBAParameterSet, |
| 1681 | (tANI_U8)frmAddBARsp.DialogToken.token, |
| 1682 | LIM_ADDBA_RSP, NULL)) |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1683 | { |
| 1684 | limLog( pMac, LOGE, |
| 1685 | FL( "ADDBA parameters validation failed" )); |
| 1686 | goto returnAfterError; |
| 1687 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1688 | } |
| 1689 | else |
Sreelakshmi Konamki | 60ccfb3 | 2016-07-08 12:53:12 +0530 | [diff] [blame] | 1690 | { |
| 1691 | pMac->lim.staBaInfo[pSta->staIndex]. |
| 1692 | failed_count[frmAddBARsp.AddBAParameterSet.tid]++; |
| 1693 | pMac->lim.staBaInfo[pSta->staIndex].failed_timestamp[ |
| 1694 | frmAddBARsp.AddBAParameterSet.tid] = jiffies_to_msecs(jiffies); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1695 | goto returnAfterError; |
Sreelakshmi Konamki | 60ccfb3 | 2016-07-08 12:53:12 +0530 | [diff] [blame] | 1696 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1697 | // Change STA state to wait for ADDBA Rsp from HAL |
| 1698 | LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP); |
| 1699 | |
| 1700 | // |
| 1701 | // Post WDA_ADDBA_REQ to HAL. |
| 1702 | // If HAL/HDD decide to allow this ADDBA Rsp session, |
| 1703 | // then this BA session is termed active |
| 1704 | // |
| 1705 | |
| 1706 | if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac, |
| 1707 | pSta, |
| 1708 | (tANI_U8) frmAddBARsp.DialogToken.token, |
| 1709 | (tANI_U8) frmAddBARsp.AddBAParameterSet.tid, |
| 1710 | (tANI_U8) frmAddBARsp.AddBAParameterSet.policy, |
| 1711 | frmAddBARsp.AddBAParameterSet.bufferSize, |
| 1712 | frmAddBARsp.BATimeout.timeout, |
| 1713 | 0, |
| 1714 | eBA_INITIATOR,psessionEntry)) |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1715 | { |
| 1716 | reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1717 | limLog( pMac, LOGE, |
| 1718 | FL( "Request to setup new BA session with peer " |
| 1719 | " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr)); |
| 1720 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1721 | else |
| 1722 | return; |
| 1723 | |
| 1724 | returnAfterError: |
| 1725 | |
| 1726 | // TODO: Do we need to signal an error status to SME, |
| 1727 | // if status != eSIR_MAC_SUCCESS_STATUS |
| 1728 | |
| 1729 | // Restore STA "BA" State |
| 1730 | LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE); |
| 1731 | // |
| 1732 | // Need to send a DELBA IND to peer, who |
| 1733 | // would have setup a BA session with this STA |
| 1734 | // |
| 1735 | if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status ) |
| 1736 | { |
| 1737 | // |
| 1738 | // Package LIM_MLM_DELBA_REQ to MLME, with proper |
| 1739 | // status code. MLME will then send a DELBA IND |
| 1740 | // over the air to the peer MAC entity |
| 1741 | // |
| 1742 | if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac, |
| 1743 | pSta, |
| 1744 | eBA_INITIATOR, |
| 1745 | (tANI_U8) frmAddBARsp.AddBAParameterSet.tid, |
| 1746 | reasonCode, psessionEntry)) |
| 1747 | { |
| 1748 | limLog( pMac, LOGW, |
| 1749 | FL( "Failed to post LIM_MLM_DELBA_REQ to " )); |
| 1750 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1751 | } |
| 1752 | } |
| 1753 | } |
| 1754 | |
| 1755 | /** |
| 1756 | * \brief Process a DELBA Indication |
| 1757 | * |
| 1758 | * \sa limProcessDelBAInd |
| 1759 | * |
| 1760 | * \param pMac The global tpAniSirGlobal object |
| 1761 | * |
| 1762 | * \param pRxPacketInfo Handle to the Rx packet info from HDD |
| 1763 | * |
| 1764 | * \return none |
| 1765 | * |
| 1766 | */ |
| 1767 | static void |
| 1768 | __limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 1769 | { |
| 1770 | tDot11fDelBAInd frmDelBAInd; |
| 1771 | tpSirMacMgmtHdr pHdr; |
| 1772 | tpDphHashNode pSta; |
| 1773 | tANI_U16 aid; |
| 1774 | tANI_U32 frameLen, nStatus; |
| 1775 | tANI_U8 *pBody; |
| 1776 | |
| 1777 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1778 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1779 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1780 | |
| 1781 | pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable ); |
| 1782 | if( pSta == NULL ) |
| 1783 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1784 | limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1785 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1786 | return; |
| 1787 | } |
| 1788 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1789 | limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1790 | |
| 1791 | // Unpack the received frame |
| 1792 | nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd ); |
| 1793 | if( DOT11F_FAILED( nStatus )) |
| 1794 | { |
| 1795 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1796 | FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1797 | nStatus, |
| 1798 | frameLen ); |
| 1799 | |
| 1800 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1801 | return; |
| 1802 | } |
| 1803 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1804 | { |
| 1805 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1806 | FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1807 | nStatus, |
| 1808 | frameLen ); |
| 1809 | |
| 1810 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1811 | } |
| 1812 | |
Abhishek Singh | 1f6e653 | 2014-06-05 17:35:08 +0530 | [diff] [blame] | 1813 | limLog( pMac, LOG1, |
| 1814 | FL( "Received DELBA from: "MAC_ADDRESS_STR" for TID %d, Reason code %d" ), |
| 1815 | MAC_ADDR_ARRAY(pHdr->sa), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1816 | frmDelBAInd.DelBAParameterSet.tid, |
| 1817 | frmDelBAInd.Reason.code ); |
| 1818 | |
| 1819 | // Now, validate the DELBA Ind |
| 1820 | if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac, |
| 1821 | frmDelBAInd.DelBAParameterSet, |
| 1822 | pSta )) |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1823 | { |
| 1824 | limLog( pMac, LOGE, |
| 1825 | FL( "ADDBA parameters validation failed " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1826 | return; |
Masti, Narayanraddi | 04010dc | 2014-12-16 20:06:11 +0530 | [diff] [blame] | 1827 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1828 | // |
| 1829 | // Post WDA_DELBA_IND to HAL and delete the |
| 1830 | // existing BA session |
| 1831 | // |
| 1832 | // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16 |
| 1833 | // is kind of confusing... |
| 1834 | // |
| 1835 | if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac, |
| 1836 | pSta, |
| 1837 | (tANI_U8) frmDelBAInd.DelBAParameterSet.tid, |
| 1838 | (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)? |
| 1839 | eBA_INITIATOR: eBA_RECIPIENT,psessionEntry)) |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1840 | limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1841 | |
| 1842 | return; |
| 1843 | |
| 1844 | } |
| 1845 | |
| 1846 | static void |
| 1847 | __limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry) |
| 1848 | { |
| 1849 | |
| 1850 | #if 0 |
| 1851 | tpSirMacMgmtHdr pHdr; |
| 1852 | tDot11fSMPowerSave frmSMPower; |
| 1853 | tSirMacHTMIMOPowerSaveState state; |
| 1854 | tpDphHashNode pSta; |
| 1855 | tANI_U16 aid; |
| 1856 | tANI_U32 frameLen, nStatus; |
| 1857 | tANI_U8 *pBody; |
| 1858 | |
| 1859 | pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd ); |
| 1860 | pBody = SIR_MAC_BD_TO_MPDUDATA( pBd ); |
| 1861 | frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd ); |
| 1862 | |
| 1863 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable ); |
| 1864 | if( pSta == NULL ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1865 | limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1866 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1867 | return; |
| 1868 | } |
| 1869 | |
| 1870 | /**Unpack the received frame */ |
| 1871 | nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower); |
| 1872 | |
| 1873 | if( DOT11F_FAILED( nStatus )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1874 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1875 | nStatus, frameLen ); |
| 1876 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1877 | return; |
| 1878 | }else if ( DOT11F_WARNED( nStatus ) ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1879 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1880 | nStatus, frameLen ); |
| 1881 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1882 | } |
| 1883 | |
| 1884 | limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d" |
| 1885 | "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En, |
| 1886 | frmSMPower.SMPowerModeSet.Mode); |
| 1887 | |
| 1888 | /** Update in the DPH Table about the Update in the SM Power Save mode*/ |
| 1889 | if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode) |
| 1890 | state = eSIR_HT_MIMO_PS_DYNAMIC; |
| 1891 | else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0)) |
| 1892 | state = eSIR_HT_MIMO_PS_STATIC; |
| 1893 | else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0)) |
| 1894 | state = eSIR_HT_MIMO_PS_NO_LIMIT; |
| 1895 | else { |
| 1896 | PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));) |
| 1897 | return; |
| 1898 | } |
| 1899 | |
| 1900 | if (state == pSta->htMIMOPSState) { |
| 1901 | PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));) |
| 1902 | return; |
| 1903 | } |
| 1904 | |
| 1905 | /** Update in the HAL Station Table for the Update of the Protection Mode */ |
| 1906 | pSta->htMIMOPSState = state; |
| 1907 | limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState); |
| 1908 | |
| 1909 | #endif |
| 1910 | |
| 1911 | } |
| 1912 | |
| 1913 | #if defined WLAN_FEATURE_VOWIFI |
| 1914 | |
| 1915 | static void |
| 1916 | __limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry ) |
| 1917 | { |
| 1918 | tpSirMacMgmtHdr pHdr; |
| 1919 | tDot11fRadioMeasurementRequest frm; |
| 1920 | tANI_U32 frameLen, nStatus; |
| 1921 | tANI_U8 *pBody; |
| 1922 | |
| 1923 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1924 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1925 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1926 | |
| 1927 | if( psessionEntry == NULL ) |
| 1928 | { |
| 1929 | return; |
| 1930 | } |
| 1931 | |
| 1932 | /**Unpack the received frame */ |
| 1933 | nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm ); |
| 1934 | |
| 1935 | if( DOT11F_FAILED( nStatus )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1936 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1937 | nStatus, frameLen ); |
| 1938 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1939 | return; |
| 1940 | }else if ( DOT11F_WARNED( nStatus ) ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1941 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1942 | nStatus, frameLen ); |
| 1943 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1944 | } |
| 1945 | |
| 1946 | // Call rrm function to handle the request. |
| 1947 | |
| 1948 | rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry ); |
| 1949 | } |
| 1950 | |
| 1951 | static void |
| 1952 | __limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry ) |
| 1953 | { |
| 1954 | tpSirMacMgmtHdr pHdr; |
| 1955 | tDot11fLinkMeasurementRequest frm; |
| 1956 | tANI_U32 frameLen, nStatus; |
| 1957 | tANI_U8 *pBody; |
| 1958 | |
| 1959 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1960 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1961 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1962 | |
| 1963 | if( psessionEntry == NULL ) |
| 1964 | { |
| 1965 | return; |
| 1966 | } |
| 1967 | |
| 1968 | /**Unpack the received frame */ |
| 1969 | nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm ); |
| 1970 | |
| 1971 | if( DOT11F_FAILED( nStatus )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1972 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1973 | nStatus, frameLen ); |
| 1974 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1975 | return; |
| 1976 | }else if ( DOT11F_WARNED( nStatus ) ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1977 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1978 | nStatus, frameLen ); |
| 1979 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1980 | } |
| 1981 | |
| 1982 | // Call rrm function to handle the request. |
| 1983 | |
| 1984 | rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry ); |
| 1985 | |
| 1986 | } |
| 1987 | |
| 1988 | static void |
| 1989 | __limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry ) |
| 1990 | { |
| 1991 | tpSirMacMgmtHdr pHdr; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1992 | tDot11fNeighborReportResponse *pFrm; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1993 | tANI_U32 frameLen, nStatus; |
| 1994 | tANI_U8 *pBody; |
| 1995 | |
| 1996 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1997 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1998 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1999 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2000 | pFrm = vos_mem_malloc(sizeof(tDot11fNeighborReportResponse)); |
| 2001 | if (NULL == pFrm) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2002 | { |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2003 | limLog(pMac, LOGE, FL("Unable to allocate memory in __limProcessNeighborReport") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2004 | return; |
| 2005 | } |
| 2006 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2007 | if(psessionEntry == NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2008 | { |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2009 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2010 | return; |
| 2011 | } |
| 2012 | |
| 2013 | /**Unpack the received frame */ |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2014 | nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2015 | |
| 2016 | if( DOT11F_FAILED( nStatus )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2017 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2018 | nStatus, frameLen ); |
| 2019 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2020 | vos_mem_free(pFrm); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2021 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2022 | }else if ( DOT11F_WARNED( nStatus ) ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2023 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2024 | nStatus, frameLen ); |
| 2025 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 2026 | } |
| 2027 | |
| 2028 | //Call rrm function to handle the request. |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 2029 | rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry ); |
| 2030 | |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2031 | vos_mem_free(pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2032 | } |
| 2033 | |
| 2034 | #endif |
| 2035 | |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame] | 2036 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 2037 | static void |
| 2038 | __limProcess2040bssCoexistenceActionFrame(tpAniSirGlobal pMac, |
| 2039 | tANI_U16 sessionId, tANI_U8 *pRxPacketInfo, |
| 2040 | tpPESession psessionEntry) |
| 2041 | { |
| 2042 | tpSirMacMgmtHdr pHdr; |
| 2043 | tANI_U8 *pBody , i; |
| 2044 | tANI_U32 frameLen, nStatus; |
| 2045 | tDot11fHT2040BSSCoexistenceManagementActionFrame *pFrm; |
| 2046 | tpSirHT2040CoexInfoInd pSirSmeHT2040CoexInfoInd = NULL; |
| 2047 | tANI_U16 length; |
| 2048 | tSirMsgQ mmhMsg; |
| 2049 | tANI_U8 num_channelList; |
| 2050 | |
| 2051 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 2052 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 2053 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 2054 | |
| 2055 | pFrm = |
| 2056 | vos_mem_malloc(sizeof(tDot11fHT2040BSSCoexistenceManagementActionFrame)); |
| 2057 | |
| 2058 | if (NULL == pFrm) |
| 2059 | { |
| 2060 | limLog(pMac, LOGE, FL("Unable to allocate memory")); |
| 2061 | return; |
| 2062 | } |
| 2063 | |
| 2064 | if(psessionEntry == NULL) |
| 2065 | { |
| 2066 | vos_mem_free(pFrm); |
| 2067 | return; |
| 2068 | } |
| 2069 | |
| 2070 | /**Unpack the received frame */ |
| 2071 | nStatus = dot11fUnpackHT2040BSSCoexistenceManagementActionFrame( pMac, |
| 2072 | pBody, frameLen, pFrm ); |
| 2073 | |
| 2074 | if( DOT11F_FAILED( nStatus )) |
| 2075 | { |
| 2076 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a 20/40" |
| 2077 | "Coex Action Frame (0x%08x, %d bytes):"), |
| 2078 | nStatus, frameLen ); |
| 2079 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 2080 | vos_mem_free(pFrm); |
| 2081 | return; |
| 2082 | } |
| 2083 | else if ( DOT11F_WARNED( nStatus )) |
| 2084 | { |
| 2085 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a" |
| 2086 | " 20/40 Coex Action Frame (0x%08x, %d bytes):"), |
| 2087 | nStatus, frameLen ); |
| 2088 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 2089 | } |
| 2090 | |
| 2091 | num_channelList = pFrm->HT2040BSSIntolerantReport.num_channelList; |
| 2092 | |
| 2093 | if (num_channelList > 0) |
| 2094 | { |
| 2095 | length = (sizeof(tSirHT2040CoexInfoInd) - sizeof(tANI_U8) + |
| 2096 | (num_channelList * sizeof(tANI_U8))); |
| 2097 | } |
| 2098 | else |
| 2099 | length = sizeof(tSirHT2040CoexInfoInd); |
| 2100 | |
| 2101 | limLog(pMac, LOGW,FL("tSirHT2040CoexInfoInd: Length: %d"),length); |
| 2102 | |
| 2103 | pSirSmeHT2040CoexInfoInd = vos_mem_malloc(length); |
| 2104 | |
| 2105 | if (NULL == pSirSmeHT2040CoexInfoInd) |
| 2106 | { |
| 2107 | limLog(pMac, LOGP, |
| 2108 | FL("AllocateMemory failed for eWNI_SME_2040_COEX_IND")); |
| 2109 | vos_mem_free(pFrm); |
| 2110 | return; |
| 2111 | } |
| 2112 | |
| 2113 | vos_mem_set((void*)pSirSmeHT2040CoexInfoInd, length, 0); |
| 2114 | |
| 2115 | pSirSmeHT2040CoexInfoInd->messageType = eWNI_SME_2040_COEX_IND; |
| 2116 | pSirSmeHT2040CoexInfoInd->sessionId = sessionId; |
| 2117 | pSirSmeHT2040CoexInfoInd->length = length; |
| 2118 | |
| 2119 | if (pFrm->HT2040BSSCoexistence.present) |
| 2120 | { |
| 2121 | |
| 2122 | limLog(pMac, LOGW, FL("infoRequest: %d fortyMHzIntolerant: %d" |
| 2123 | " twentyMHzBssWidthReq: %d obssScanExemptionReq: %d" |
| 2124 | " obssScanExemptionGrant: %d "), |
| 2125 | pFrm->HT2040BSSCoexistence.infoRequest, |
| 2126 | pFrm->HT2040BSSCoexistence.fortyMHzIntolerant, |
| 2127 | pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq, |
| 2128 | pFrm->HT2040BSSCoexistence.obssScanExemptionReq, |
| 2129 | pFrm->HT2040BSSCoexistence.obssScanExemptionGrant); |
| 2130 | |
| 2131 | pSirSmeHT2040CoexInfoInd->HT40MHzIntolerant = |
| 2132 | pFrm->HT2040BSSCoexistence.fortyMHzIntolerant; |
| 2133 | pSirSmeHT2040CoexInfoInd->HT20MHzBssWidthReq = |
| 2134 | pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq; |
| 2135 | } |
| 2136 | |
| 2137 | if (pFrm->HT2040BSSIntolerantReport.present) |
| 2138 | { |
| 2139 | limLog(pMac, LOGW, FL("operatingClass: %d num_channelList: %d "), |
| 2140 | pFrm->HT2040BSSIntolerantReport.operatingClass, |
| 2141 | num_channelList); |
| 2142 | |
| 2143 | if (num_channelList > 0) |
| 2144 | { |
| 2145 | vos_mem_zero(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport, |
| 2146 | num_channelList); |
| 2147 | vos_mem_copy(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport, |
| 2148 | pFrm->HT2040BSSIntolerantReport.channelList, |
| 2149 | num_channelList); |
| 2150 | |
| 2151 | pSirSmeHT2040CoexInfoInd->channel_num = num_channelList; |
| 2152 | } |
| 2153 | |
| 2154 | for(i=0; i < num_channelList; i++) |
| 2155 | { |
| 2156 | limLog(pMac, LOGW, FL("Channel : %d "), |
| 2157 | pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i]); |
| 2158 | } |
| 2159 | } |
| 2160 | |
| 2161 | mmhMsg.type = eWNI_SME_2040_COEX_IND; |
| 2162 | mmhMsg.bodyptr = pSirSmeHT2040CoexInfoInd; |
| 2163 | mmhMsg.bodyval = 0; |
Sushant Kaushik | 8778797 | 2015-09-11 16:05:00 +0530 | [diff] [blame] | 2164 | limLog(pMac, LOGW, FL("Posting eWNI_SME_2040_COEX_IND Message to SME ")); |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame] | 2165 | limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); |
| 2166 | |
| 2167 | vos_mem_free(pFrm); |
| 2168 | } |
| 2169 | #endif |
| 2170 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2171 | #ifdef WLAN_FEATURE_11W |
| 2172 | /** |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2173 | * limProcessSAQueryRequestActionFrame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2174 | * |
| 2175 | *FUNCTION: |
| 2176 | * This function is called by limProcessActionFrame() upon |
| 2177 | * SA query request Action frame reception. |
| 2178 | * |
| 2179 | *LOGIC: |
| 2180 | * |
| 2181 | *ASSUMPTIONS: |
| 2182 | * |
| 2183 | *NOTE: |
| 2184 | * |
| 2185 | * @param pMac - Pointer to Global MAC structure |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2186 | * @param *pRxPacketInfo - Handle to the Rx packet info |
| 2187 | * @param psessionEntry - PE session entry |
| 2188 | * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2189 | * @return None |
| 2190 | */ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2191 | static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2192 | { |
| 2193 | tpSirMacMgmtHdr pHdr; |
| 2194 | tANI_U8 *pBody; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2195 | tANI_U8 transId[2]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2196 | |
| 2197 | /* Prima --- Below Macro not available in prima |
| 2198 | pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd); |
| 2199 | pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */ |
| 2200 | |
| 2201 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 2202 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 2203 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2204 | /* If this is an unprotected SA Query Request, then ignore it. */ |
| 2205 | if (pHdr->fc.wep == 0) |
| 2206 | return; |
| 2207 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2208 | /*Extract 11w trsansId from SA query request action frame |
| 2209 | In SA query response action frame we will send same transId |
| 2210 | In SA query request action frame: |
| 2211 | Category : 1 byte |
| 2212 | Action : 1 byte |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2213 | Transaction ID : 2 bytes */ |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2214 | vos_mem_copy(&transId[0], &pBody[2], 2); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2215 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2216 | //Send 11w SA query response action frame |
| 2217 | if (limSendSaQueryResponseFrame(pMac, |
| 2218 | transId, |
| 2219 | pHdr->sa,psessionEntry) != eSIR_SUCCESS) |
| 2220 | { |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2221 | PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2222 | return; |
| 2223 | } |
| 2224 | } |
| 2225 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2226 | /** |
| 2227 | * __limProcessSAQueryResponseActionFrame |
| 2228 | * |
| 2229 | *FUNCTION: |
| 2230 | * This function is called by limProcessActionFrame() upon |
| 2231 | * SA query response Action frame reception. |
| 2232 | * |
| 2233 | *LOGIC: |
| 2234 | * |
| 2235 | *ASSUMPTIONS: |
| 2236 | * |
| 2237 | *NOTE: |
| 2238 | * |
| 2239 | * @param pMac - Pointer to Global MAC structure |
| 2240 | * @param *pRxPacketInfo - Handle to the Rx packet info |
| 2241 | * @param psessionEntry - PE session entry |
| 2242 | * @return None |
| 2243 | */ |
| 2244 | static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) |
| 2245 | { |
| 2246 | tpSirMacMgmtHdr pHdr; |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 2247 | tANI_U8 *pBody; |
| 2248 | tpDphHashNode pSta; |
| 2249 | tANI_U16 aid; |
| 2250 | tANI_U16 transId; |
| 2251 | tANI_U8 retryNum; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2252 | |
| 2253 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 2254 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2255 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 2256 | ("SA Query Response received...")) ; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2257 | |
Chet Lanctot | dd6beeb | 2014-04-22 11:51:29 -0700 | [diff] [blame] | 2258 | /* When a station, supplicant handles SA Query Response. |
| 2259 | Forward to SME to HDD to wpa_supplicant. */ |
| 2260 | if (eLIM_STA_ROLE == psessionEntry->limSystemRole) |
| 2261 | { |
Naveen Rawat | 71e1a2e | 2015-07-28 16:11:21 +0530 | [diff] [blame] | 2262 | limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, |
yeshwanth sriram guntuka | c1046a5 | 2017-04-25 16:34:50 +0530 | [diff] [blame] | 2263 | pRxPacketInfo, psessionEntry, |
| 2264 | WDA_GET_RX_RSSI_DB(pRxPacketInfo)); |
Chet Lanctot | dd6beeb | 2014-04-22 11:51:29 -0700 | [diff] [blame] | 2265 | return; |
| 2266 | } |
| 2267 | |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 2268 | /* If this is an unprotected SA Query Response, then ignore it. */ |
| 2269 | if (pHdr->fc.wep == 0) |
| 2270 | return; |
| 2271 | |
| 2272 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 2273 | if (NULL == pSta) |
| 2274 | return; |
| 2275 | |
| 2276 | limLog(pMac, LOG1, |
| 2277 | FL("SA Query Response source addr - %0x:%0x:%0x:%0x:%0x:%0x"), |
| 2278 | pHdr->sa[0], pHdr->sa[1], pHdr->sa[2], pHdr->sa[3], |
| 2279 | pHdr->sa[4], pHdr->sa[5]); |
| 2280 | limLog(pMac, LOG1, |
| 2281 | FL("SA Query state for station - %d"), pSta->pmfSaQueryState); |
| 2282 | |
| 2283 | if (DPH_SA_QUERY_IN_PROGRESS != pSta->pmfSaQueryState) |
| 2284 | return; |
| 2285 | |
| 2286 | /* Extract 11w trsansId from SA query reponse action frame |
| 2287 | In SA query response action frame: |
| 2288 | Category : 1 byte |
| 2289 | Action : 1 byte |
| 2290 | Transaction ID : 2 bytes */ |
| 2291 | vos_mem_copy(&transId, &pBody[2], 2); |
| 2292 | |
| 2293 | /* If SA Query is in progress with the station and the station |
| 2294 | responds then the association request that triggered the SA |
| 2295 | query is from a rogue station, just go back to initial state. */ |
| 2296 | for (retryNum = 0; retryNum <= pSta->pmfSaQueryRetryCount; retryNum++) |
| 2297 | if (transId == pSta->pmfSaQueryStartTransId + retryNum) |
| 2298 | { |
| 2299 | limLog(pMac, LOG1, |
| 2300 | FL("Found matching SA Query Request - transaction ID %d"), transId); |
| 2301 | tx_timer_deactivate(&pSta->pmfSaQueryTimer); |
| 2302 | pSta->pmfSaQueryState = DPH_SA_QUERY_NOT_IN_PROGRESS; |
| 2303 | break; |
| 2304 | } |
| 2305 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2306 | #endif |
| 2307 | |
Chet Lanctot | f7abfd4 | 2014-05-23 12:42:15 -0700 | [diff] [blame] | 2308 | #ifdef WLAN_FEATURE_11W |
| 2309 | /** |
| 2310 | * limDropUnprotectedActionFrame |
| 2311 | * |
| 2312 | *FUNCTION: |
| 2313 | * This function checks if an Action frame should be dropped since it is |
| 2314 | * a Robust Managment Frame, it is unprotected, and it is received on a |
| 2315 | * connection where PMF is enabled. |
| 2316 | * |
| 2317 | *LOGIC: |
| 2318 | * |
| 2319 | *ASSUMPTIONS: |
| 2320 | * |
| 2321 | *NOTE: |
| 2322 | * |
| 2323 | * @param pMac - Global MAC structure |
| 2324 | * @param psessionEntry - PE session entry |
| 2325 | * @param pHdr - Frame header |
| 2326 | * @param category - Action frame category |
| 2327 | * @return TRUE if frame should be dropped |
| 2328 | */ |
| 2329 | |
| 2330 | static tANI_BOOLEAN |
| 2331 | limDropUnprotectedActionFrame (tpAniSirGlobal pMac, tpPESession psessionEntry, |
| 2332 | tpSirMacMgmtHdr pHdr, tANI_U8 category) |
| 2333 | { |
| 2334 | tANI_U16 aid; |
| 2335 | tpDphHashNode pStaDs; |
| 2336 | tANI_BOOLEAN rmfConnection = eANI_BOOLEAN_FALSE; |
| 2337 | |
| 2338 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || |
| 2339 | (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) |
| 2340 | { |
| 2341 | pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 2342 | if (pStaDs != NULL) |
| 2343 | if (pStaDs->rmfEnabled) |
| 2344 | rmfConnection = eANI_BOOLEAN_TRUE; |
| 2345 | } |
| 2346 | else if (psessionEntry->limRmfEnabled) |
| 2347 | rmfConnection = eANI_BOOLEAN_TRUE; |
| 2348 | |
| 2349 | if (rmfConnection && (pHdr->fc.wep == 0)) |
| 2350 | { |
| 2351 | PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame " |
| 2352 | "since RMF is enabled."), category);) |
| 2353 | return eANI_BOOLEAN_TRUE; |
| 2354 | } |
| 2355 | else |
| 2356 | return eANI_BOOLEAN_FALSE; |
| 2357 | } |
| 2358 | #endif |
| 2359 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2360 | /** |
| 2361 | * limProcessActionFrame |
| 2362 | * |
| 2363 | *FUNCTION: |
| 2364 | * This function is called by limProcessMessageQueue() upon |
| 2365 | * Action frame reception. |
| 2366 | * |
| 2367 | *LOGIC: |
| 2368 | * |
| 2369 | *ASSUMPTIONS: |
| 2370 | * |
| 2371 | *NOTE: |
| 2372 | * |
| 2373 | * @param pMac - Pointer to Global MAC structure |
| 2374 | * @param *pRxPacketInfo - A pointer to packet info structure |
| 2375 | * @return None |
| 2376 | */ |
| 2377 | |
| 2378 | void |
| 2379 | limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 2380 | { |
| 2381 | tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 2382 | tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2383 | #ifdef WLAN_FEATURE_11W |
| 2384 | tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
Abhishek Singh | 09d4e4a | 2016-01-12 11:20:22 +0530 | [diff] [blame] | 2385 | |
| 2386 | if (lim_is_robust_mgmt_action_frame(pActionHdr->category) && |
| 2387 | limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, |
| 2388 | pActionHdr->category)) { |
| 2389 | limLog(pMac, LOGE, |
| 2390 | FL("Don't send unprotect action frame to upper layer categ %d "), |
| 2391 | pActionHdr->category); |
| 2392 | return; |
| 2393 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2394 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2395 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2396 | switch (pActionHdr->category) |
| 2397 | { |
Selvaraj, Sridhar | c045b8b | 2016-04-06 12:22:35 +0530 | [diff] [blame] | 2398 | |
| 2399 | /* |
| 2400 | * WARNING: If you add Action frame category case here, set the |
| 2401 | * corresponding bit to 1 in sme_set_allowed_action_frames() for |
| 2402 | * the FW to hand over that frame to host without dropping itself |
| 2403 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2404 | case SIR_MAC_ACTION_QOS_MGMT: |
Leela Venkata Kiran Kumar Reddy Chirala | c7c4e7e | 2014-04-29 10:50:16 -0700 | [diff] [blame] | 2405 | if ( (psessionEntry->limQosEnabled) || |
| 2406 | (pActionHdr->actionID == SIR_MAC_QOS_MAP_CONFIGURE) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2407 | { |
| 2408 | switch (pActionHdr->actionID) |
| 2409 | { |
| 2410 | case SIR_MAC_QOS_ADD_TS_REQ: |
| 2411 | __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2412 | break; |
| 2413 | |
| 2414 | case SIR_MAC_QOS_ADD_TS_RSP: |
| 2415 | __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2416 | break; |
| 2417 | |
| 2418 | case SIR_MAC_QOS_DEL_TS_REQ: |
| 2419 | __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2420 | break; |
| 2421 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 2422 | case SIR_MAC_QOS_MAP_CONFIGURE: |
| 2423 | __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2424 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2425 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2426 | limLog(pMac, LOG1, |
| 2427 | FL("Qos action %d not handled"), |
| 2428 | pActionHdr->actionID); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2429 | break; |
| 2430 | } |
| 2431 | break ; |
| 2432 | } |
| 2433 | |
| 2434 | break; |
| 2435 | |
| 2436 | case SIR_MAC_ACTION_SPECTRUM_MGMT: |
| 2437 | switch (pActionHdr->actionID) |
| 2438 | { |
| 2439 | #ifdef ANI_SUPPORT_11H |
| 2440 | case SIR_MAC_ACTION_MEASURE_REQUEST_ID: |
| 2441 | if(psessionEntry->lim11hEnable) |
| 2442 | { |
| 2443 | __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo); |
| 2444 | } |
| 2445 | break; |
| 2446 | |
| 2447 | case SIR_MAC_ACTION_TPC_REQUEST_ID: |
| 2448 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || |
| 2449 | (pessionEntry->limSystemRole == eLIM_AP_ROLE)) |
| 2450 | { |
| 2451 | if(psessionEntry->lim11hEnable) |
| 2452 | { |
| 2453 | __limProcessTpcRequestFrame(pMac, pRxPacketInfo); |
| 2454 | } |
| 2455 | } |
| 2456 | break; |
| 2457 | |
| 2458 | #endif |
| 2459 | case SIR_MAC_ACTION_CHANNEL_SWITCH_ID: |
| 2460 | if (psessionEntry->limSystemRole == eLIM_STA_ROLE) |
| 2461 | { |
| 2462 | __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry); |
| 2463 | } |
| 2464 | break; |
| 2465 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2466 | limLog(pMac, LOG1, |
| 2467 | FL("Spectrum mgmt action id %d not handled"), |
| 2468 | pActionHdr->actionID); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2469 | break; |
| 2470 | } |
| 2471 | break; |
| 2472 | |
| 2473 | case SIR_MAC_ACTION_WME: |
| 2474 | if (! psessionEntry->limWmeEnabled) |
| 2475 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2476 | limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2477 | pActionHdr->actionID); |
| 2478 | break; |
| 2479 | } |
| 2480 | switch(pActionHdr->actionID) |
| 2481 | { |
| 2482 | case SIR_MAC_QOS_ADD_TS_REQ: |
| 2483 | __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2484 | break; |
| 2485 | |
| 2486 | case SIR_MAC_QOS_ADD_TS_RSP: |
| 2487 | __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2488 | break; |
| 2489 | |
| 2490 | case SIR_MAC_QOS_DEL_TS_REQ: |
| 2491 | __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2492 | break; |
| 2493 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 2494 | case SIR_MAC_QOS_MAP_CONFIGURE: |
| 2495 | __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2496 | break; |
| 2497 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2498 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2499 | limLog(pMac, LOG1, FL("WME action %d not handled"), |
| 2500 | pActionHdr->actionID); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2501 | break; |
| 2502 | } |
| 2503 | break; |
| 2504 | |
| 2505 | case SIR_MAC_ACTION_BLKACK: |
| 2506 | // Determine the "type" of BA Action Frame |
| 2507 | switch(pActionHdr->actionID) |
| 2508 | { |
| 2509 | case SIR_MAC_BLKACK_ADD_REQ: |
| 2510 | __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2511 | break; |
| 2512 | |
| 2513 | case SIR_MAC_BLKACK_ADD_RSP: |
| 2514 | __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2515 | break; |
| 2516 | |
| 2517 | case SIR_MAC_BLKACK_DEL: |
| 2518 | __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2519 | break; |
| 2520 | |
| 2521 | default: |
| 2522 | break; |
| 2523 | } |
| 2524 | |
| 2525 | break; |
| 2526 | case SIR_MAC_ACTION_HT: |
| 2527 | /** Type of HT Action to be performed*/ |
| 2528 | switch(pActionHdr->actionID) { |
| 2529 | case SIR_MAC_SM_POWER_SAVE: |
| 2530 | __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2531 | break; |
| 2532 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2533 | limLog(pMac, LOG1, |
| 2534 | FL("Action ID %d not handled in HT Action category"), |
| 2535 | pActionHdr->actionID); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2536 | break; |
| 2537 | } |
| 2538 | break; |
| 2539 | |
Leela Venkata Kiran Kumar Reddy Chirala | e8e62c8 | 2013-10-29 18:23:26 -0700 | [diff] [blame] | 2540 | case SIR_MAC_ACTION_WNM: |
| 2541 | { |
Leela Venkata Kiran Kumar Reddy Chirala | e8e62c8 | 2013-10-29 18:23:26 -0700 | [diff] [blame] | 2542 | PELOGE(limLog(pMac, LOG1, FL("WNM Action category %d action %d."), |
| 2543 | pActionHdr->category, pActionHdr->actionID);) |
| 2544 | switch (pActionHdr->actionID) |
| 2545 | { |
| 2546 | case SIR_MAC_WNM_BSS_TM_QUERY: |
| 2547 | case SIR_MAC_WNM_BSS_TM_REQUEST: |
| 2548 | case SIR_MAC_WNM_BSS_TM_RESPONSE: |
| 2549 | case SIR_MAC_WNM_NOTIF_REQUEST: |
| 2550 | case SIR_MAC_WNM_NOTIF_RESPONSE: |
| 2551 | { |
| 2552 | tpSirMacMgmtHdr pHdr; |
| 2553 | tANI_S8 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo); |
| 2554 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 2555 | /* Forward to the SME to HDD to wpa_supplicant */ |
Naveen Rawat | 71e1a2e | 2015-07-28 16:11:21 +0530 | [diff] [blame] | 2556 | limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, |
| 2557 | pRxPacketInfo, |
Leela Venkata Kiran Kumar Reddy Chirala | e8e62c8 | 2013-10-29 18:23:26 -0700 | [diff] [blame] | 2558 | psessionEntry, rssi); |
| 2559 | break; |
| 2560 | } |
| 2561 | } |
| 2562 | break; |
| 2563 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2564 | #if defined WLAN_FEATURE_VOWIFI |
| 2565 | case SIR_MAC_ACTION_RRM: |
Abhishek Singh | e0bc099 | 2016-05-20 17:58:18 +0530 | [diff] [blame] | 2566 | /* Ignore RRM measurement request until DHCP is set */ |
| 2567 | if(pMac->rrm.rrmPEContext.rrmEnable && |
| 2568 | pMac->roam.roamSession[psessionEntry->smeSessionId].dhcp_done) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2569 | { |
| 2570 | switch(pActionHdr->actionID) { |
| 2571 | case SIR_MAC_RRM_RADIO_MEASURE_REQ: |
| 2572 | __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry ); |
| 2573 | break; |
| 2574 | case SIR_MAC_RRM_LINK_MEASUREMENT_REQ: |
| 2575 | __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry ); |
| 2576 | break; |
| 2577 | case SIR_MAC_RRM_NEIGHBOR_RPT: |
| 2578 | __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry ); |
| 2579 | break; |
| 2580 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2581 | limLog( pMac, LOG1, FL("Action ID %d not handled in RRM"), |
| 2582 | pActionHdr->actionID); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2583 | break; |
| 2584 | |
| 2585 | } |
| 2586 | } |
| 2587 | else |
| 2588 | { |
| 2589 | // Else we will just ignore the RRM messages. |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2590 | limLog( pMac, LOG1, |
Abhishek Singh | e0bc099 | 2016-05-20 17:58:18 +0530 | [diff] [blame] | 2591 | FL("RRM Action frame ignored as rrmEnable is %d or DHCP not completed %d"), |
| 2592 | pMac->rrm.rrmPEContext.rrmEnable, |
| 2593 | pMac->roam.roamSession[psessionEntry->smeSessionId].dhcp_done); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2594 | } |
| 2595 | break; |
| 2596 | #endif |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 2597 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) \ |
| 2598 | || defined (WLAN_FEATURE_RMC) |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2599 | case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY: |
| 2600 | { |
| 2601 | tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr; |
| 2602 | tpSirMacMgmtHdr pHdr; |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2603 | tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 }; |
| 2604 | |
| 2605 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2606 | |
| 2607 | //Check if it is a vendor specific action frame. |
| 2608 | if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2609 | (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr, |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2610 | &pHdr->da[0], sizeof(tSirMacAddr))) && |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 2611 | IS_WES_MODE_ENABLED(pMac) && |
| 2612 | vos_mem_compare(pVendorSpecific->Oui, Oui, 3)) |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2613 | { |
| 2614 | PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"), |
| 2615 | pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);) |
| 2616 | /* Forward to the SME to HDD to wpa_supplicant */ |
| 2617 | // type is ACTION |
Naveen Rawat | 71e1a2e | 2015-07-28 16:11:21 +0530 | [diff] [blame] | 2618 | limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, |
| 2619 | pRxPacketInfo, |
Rashmi Ramanna | 0d0adec | 2014-02-05 20:35:37 +0530 | [diff] [blame] | 2620 | psessionEntry, 0); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2621 | } |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 2622 | #if defined (WLAN_FEATURE_RMC) |
| 2623 | else if ((eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) && |
| 2624 | ((VOS_TRUE == vos_mem_compare(SIR_MAC_RMC_MCAST_ADDRESS, |
| 2625 | &pHdr->da[0], sizeof(tSirMacAddr))) || |
| 2626 | (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr, |
| 2627 | &pHdr->da[0], sizeof(tSirMacAddr)))) && |
| 2628 | vos_mem_compare(pVendorSpecific->Oui, SIR_MAC_RMC_OUI, 3)) |
| 2629 | { |
| 2630 | tANI_U8 MagicCode[] = |
| 2631 | { 0x4f, 0x58, 0x59, 0x47, 0x45, 0x4e }; |
| 2632 | tpSirMacIbssExtNetworkFrameHdr pIbssExtHdr = |
| 2633 | (tpSirMacIbssExtNetworkFrameHdr) pActionHdr; |
| 2634 | |
| 2635 | if (vos_mem_compare(pIbssExtHdr->MagicCode, |
| 2636 | MagicCode, sizeof(MagicCode)) && |
| 2637 | pIbssExtHdr->version == SIR_MAC_RMC_VER ) |
| 2638 | { |
| 2639 | switch (pIbssExtHdr->actionID) |
| 2640 | { |
| 2641 | default: |
| 2642 | PELOGE(limLog(pMac, LOGE, |
| 2643 | FL("Action RMC actionID %d not handled"), |
| 2644 | pIbssExtHdr->actionID);) |
| 2645 | break; |
| 2646 | case SIR_MAC_RMC_RULER_INFORM_SELECTED: |
| 2647 | limLog(pMac, LOG1, |
| 2648 | FL("Action RMC RULER_INFORM_SELECTED.")); |
| 2649 | limProcessRMCMessages(pMac, |
| 2650 | eLIM_RMC_OTA_RULER_INFORM_SELECTED, |
| 2651 | (tANI_U32 *)pRxPacketInfo); |
| 2652 | break; |
| 2653 | case SIR_MAC_RMC_RULER_INFORM_CANCELLED: |
| 2654 | limLog(pMac, LOG1, |
| 2655 | FL("Action RMC RULER_INFORM_CANCELLED.")); |
| 2656 | limProcessRMCMessages(pMac, |
| 2657 | eLIM_RMC_OTA_RULER_INFORM_CANCELLED, |
| 2658 | (tANI_U32 *)pRxPacketInfo); |
| 2659 | break; |
| 2660 | } |
| 2661 | } |
| 2662 | else |
| 2663 | { |
| 2664 | limLog( pMac, LOG1, |
| 2665 | FL("Dropping the vendor specific action frame in IBSS " |
| 2666 | "mode because of Ibss Ext Magic mismatch " |
| 2667 | MAC_ADDRESS_STR " or Version mismatch = %d"), |
| 2668 | MAC_ADDR_ARRAY(pIbssExtHdr->MagicCode), |
| 2669 | pIbssExtHdr->version ); |
| 2670 | } |
| 2671 | } |
| 2672 | #endif /* WLAN_FEATURE_RMC */ |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2673 | else |
| 2674 | { |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2675 | limLog( pMac, LOG1, |
| 2676 | FL("Dropping the vendor specific action frame because of( " |
| 2677 | "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or " |
| 2678 | "not received with SelfSta Mac address) system role = %d"), |
| 2679 | IS_WES_MODE_ENABLED(pMac), |
| 2680 | pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], |
| 2681 | pVendorSpecific->Oui[2], |
| 2682 | psessionEntry->limSystemRole ); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2683 | } |
| 2684 | } |
| 2685 | break; |
Abhishek Singh | 00b7197 | 2016-01-07 10:51:04 +0530 | [diff] [blame] | 2686 | #endif /* WLAN_FEATURE_VOWIFI_11R || FEATURE_WLAN_ESE || |
| 2687 | FEATURE_WLAN_LFR || WLAN_FEATURE_RMC */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2688 | case SIR_MAC_ACTION_PUBLIC_USAGE: |
| 2689 | switch(pActionHdr->actionID) { |
| 2690 | case SIR_MAC_ACTION_VENDOR_SPECIFIC: |
| 2691 | { |
| 2692 | tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2693 | tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 }; |
Vignesh Viswanathan | 3d7f662 | 2017-09-15 17:45:58 +0530 | [diff] [blame] | 2694 | tANI_U32 frameLen; |
| 2695 | |
| 2696 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 2697 | |
| 2698 | if (frameLen < sizeof(pActionHdr)) { |
| 2699 | limLog(pMac, LOG1, |
| 2700 | FL("Received action frame of invalid len %d"), |
| 2701 | frameLen); |
| 2702 | break; |
| 2703 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2705 | //Check if it is a P2P public action frame. |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2706 | if (vos_mem_compare(pPubAction->Oui, P2POui, 4)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2707 | { |
| 2708 | /* Forward to the SME to HDD to wpa_supplicant */ |
| 2709 | // type is ACTION |
Naveen Rawat | 71e1a2e | 2015-07-28 16:11:21 +0530 | [diff] [blame] | 2710 | limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, |
| 2711 | pRxPacketInfo, |
yeshwanth sriram guntuka | c1046a5 | 2017-04-25 16:34:50 +0530 | [diff] [blame] | 2712 | psessionEntry, |
| 2713 | WDA_GET_RX_RSSI_DB(pRxPacketInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2714 | } |
| 2715 | else |
| 2716 | { |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2717 | limLog( pMac, LOG1, |
| 2718 | FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"), |
| 2719 | pPubAction->Oui[0], pPubAction->Oui[1], |
| 2720 | pPubAction->Oui[2], pPubAction->Oui[3] ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2721 | } |
| 2722 | } |
| 2723 | break; |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame] | 2724 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 2725 | case SIR_MAC_ACTION_2040_BSS_COEXISTENCE: |
| 2726 | { |
| 2727 | if (pMac->roam.configParam.apHT40_24GEnabled) |
| 2728 | { |
| 2729 | limLog( pMac, LOGW, FL("Public Action 20/40 BSS" |
| 2730 | "Coexistence Management frame")); |
| 2731 | |
| 2732 | __limProcess2040bssCoexistenceActionFrame(pMac, |
| 2733 | psessionEntry->smeSessionId, (tANI_U8 *) pRxPacketInfo, |
| 2734 | psessionEntry); |
| 2735 | } |
| 2736 | break; |
| 2737 | } |
| 2738 | #endif |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2739 | #ifdef FEATURE_WLAN_TDLS |
| 2740 | case SIR_MAC_TDLS_DIS_RSP: |
| 2741 | { |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 2742 | tANI_S8 rssi; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2743 | |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 2744 | rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2745 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2746 | ("Public Action TDLS Discovery RSP ..")) ; |
Naveen Rawat | 71e1a2e | 2015-07-28 16:11:21 +0530 | [diff] [blame] | 2747 | limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId, |
| 2748 | pRxPacketInfo, |
Rashmi Ramanna | 0d0adec | 2014-02-05 20:35:37 +0530 | [diff] [blame] | 2749 | psessionEntry, rssi); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2750 | } |
| 2751 | break; |
| 2752 | #endif |
Abhishek Singh | 39ae47e | 2017-10-30 17:39:50 +0530 | [diff] [blame] | 2753 | case SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID: |
| 2754 | if (psessionEntry->limSystemRole == eLIM_STA_ROLE) |
| 2755 | { |
| 2756 | lim_process_ecsa_action_frame(pMac, |
| 2757 | pRxPacketInfo, psessionEntry); |
| 2758 | } |
| 2759 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2760 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2761 | limLog(pMac, LOG1, FL("Unhandled public action frame -- %x "), |
| 2762 | pActionHdr->actionID); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2763 | break; |
| 2764 | } |
| 2765 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2766 | |
| 2767 | #ifdef WLAN_FEATURE_11W |
| 2768 | case SIR_MAC_ACTION_SA_QUERY: |
| 2769 | { |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2770 | PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);) |
| 2771 | switch (pActionHdr->actionID) |
| 2772 | { |
| 2773 | case SIR_MAC_SA_QUERY_REQ: |
| 2774 | /**11w SA query request action frame received**/ |
| 2775 | /* Respond directly to the incoming request in LIM */ |
| 2776 | __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry ); |
| 2777 | break; |
| 2778 | case SIR_MAC_SA_QUERY_RSP: |
| 2779 | /**11w SA query response action frame received**/ |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 2780 | /* Handle based on the current SA Query state */ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2781 | __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry ); |
| 2782 | break; |
| 2783 | default: |
| 2784 | break; |
| 2785 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2786 | break; |
| 2787 | } |
| 2788 | #endif |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 2789 | #ifdef WLAN_FEATURE_11AC |
| 2790 | case SIR_MAC_ACTION_VHT: |
| 2791 | { |
| 2792 | if (psessionEntry->vhtCapability) |
| 2793 | { |
| 2794 | switch (pActionHdr->actionID) |
| 2795 | { |
| 2796 | case SIR_MAC_VHT_OPMODE_NOTIFICATION: |
| 2797 | __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry); |
| 2798 | break; |
| 2799 | default: |
| 2800 | break; |
| 2801 | } |
| 2802 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2803 | break; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2804 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 2805 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2806 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2807 | limLog(pMac, LOG1, |
| 2808 | FL("Action category %d not handled"), pActionHdr->category); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2809 | break; |
| 2810 | } |
| 2811 | } |
| 2812 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2813 | /** |
| 2814 | * limProcessActionFrameNoSession |
| 2815 | * |
| 2816 | *FUNCTION: |
| 2817 | * This function is called by limProcessMessageQueue() upon |
| 2818 | * Action frame reception and no session. |
| 2819 | * Currently only public action frames can be received from |
| 2820 | * a non-associated station. |
| 2821 | * |
| 2822 | *LOGIC: |
| 2823 | * |
| 2824 | *ASSUMPTIONS: |
| 2825 | * |
| 2826 | *NOTE: |
| 2827 | * |
| 2828 | * @param pMac - Pointer to Global MAC structure |
| 2829 | * @param *pBd - A pointer to Buffer descriptor + associated PDUs |
| 2830 | * @return None |
| 2831 | */ |
| 2832 | |
| 2833 | void |
| 2834 | limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd) |
| 2835 | { |
| 2836 | tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd); |
| 2837 | tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody; |
| 2838 | |
Mohit Khanna | 2386376 | 2012-09-11 17:40:09 -0700 | [diff] [blame] | 2839 | limLog( pMac, LOG1, "Received a Action frame -- no session"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2840 | |
| 2841 | switch ( pActionHdr->category ) |
| 2842 | { |
| 2843 | case SIR_MAC_ACTION_PUBLIC_USAGE: |
| 2844 | switch(pActionHdr->actionID) { |
| 2845 | case SIR_MAC_ACTION_VENDOR_SPECIFIC: |
| 2846 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2847 | tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 }; |
Vignesh Viswanathan | 3d7f662 | 2017-09-15 17:45:58 +0530 | [diff] [blame] | 2848 | tANI_U32 frameLen; |
| 2849 | |
| 2850 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd); |
| 2851 | |
| 2852 | if (frameLen < sizeof(pActionHdr)) { |
| 2853 | limLog(pMac, LOG1, |
| 2854 | FL("Received action frame of invalid len %d"), |
| 2855 | frameLen); |
| 2856 | break; |
| 2857 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2858 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2859 | //Check if it is a P2P public action frame. |
Bansidhar Gopalachari | 2f7395d | 2013-07-12 11:24:23 +0530 | [diff] [blame] | 2860 | if (vos_mem_compare(pActionHdr->Oui, P2POui, 4)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2861 | { |
| 2862 | /* Forward to the SME to HDD to wpa_supplicant */ |
| 2863 | // type is ACTION |
yeshwanth sriram guntuka | c1046a5 | 2017-04-25 16:34:50 +0530 | [diff] [blame] | 2864 | limSendSmeMgmtFrameInd(pMac, 0, pBd, NULL, |
| 2865 | WDA_GET_RX_RSSI_DB(pBd)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2866 | } |
| 2867 | else |
| 2868 | { |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2869 | limLog( pMac, LOG1, |
| 2870 | FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"), |
| 2871 | pActionHdr->Oui[0], pActionHdr->Oui[1], |
| 2872 | pActionHdr->Oui[2], pActionHdr->Oui[3]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2873 | } |
| 2874 | } |
| 2875 | break; |
| 2876 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2877 | limLog(pMac, LOG1, |
| 2878 | FL("Unhandled public action frame -- %x "), pActionHdr->actionID); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2879 | break; |
| 2880 | } |
| 2881 | break; |
| 2882 | default: |
Abhishek Singh | 9ccfc77 | 2015-10-16 13:57:22 +0530 | [diff] [blame] | 2883 | limLog(pMac, LOG1, |
| 2884 | FL("Unhandled action frame without session -- %x "), |
| 2885 | pActionHdr->category); |
| 2886 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2887 | |
| 2888 | } |
| 2889 | } |