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