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