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