blob: e564e71d4ce206f637eefa8112729879b482f42e [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Satyanarayana Dash6f438272015-03-03 18:01:06 +05302 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
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 Lama7f454d2014-07-24 12:04:06 -070023 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
Jeff Johnson295189b2012-06-20 16:38:30 -070026 */
Kiet Lam842dad02014-02-18 18:44:02 -080027
28
Kiet Lama7f454d2014-07-24 12:04:06 -070029
30
Jeff Johnson295189b2012-06-20 16:38:30 -070031/*
Jeff Johnson295189b2012-06-20 16:38:30 -070032 * 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 Dash6f438272015-03-03 18:01:06 +053045#include "wniCfg.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070046#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 Johnsone7245742012-09-05 17:12:55 -070061#include "limSessionUtils.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070062
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080063#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
64#include "eseApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070065#endif
66#include "wlan_qct_wda.h"
67
68
69#define BA_DEFAULT_TX_BUFFER_SIZE 64
70
71typedef 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-----------------------------------------------------------------*/
90void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId)
91{
92 tANI_U8 isFullPowerRequested = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070093 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 Johnson295189b2012-06-20 16:38:30 -0700102
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530103 limLog(pMac, LOG1, FL("Channel switch Mode == %d"),
104 psessionEntry->gLimChannelSwitch.switchMode);
Jeff Johnson295189b2012-06-20 16:38:30 -0700105
Jeff Johnsone7245742012-09-05 17:12:55 -0700106 if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT ||
107 psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT)
Jeff Johnson295189b2012-06-20 16:38:30 -0700108 {
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 Johnsone7245742012-09-05 17:12:55 -0700126 pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700127 /* 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 Johnsone7245742012-09-05 17:12:55 -0700131 if (psessionEntry->gLimChannelSwitch.switchCount == 0)
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 {
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 Chiralac3b9d382013-01-31 20:49:53 -0800146 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700147
Jeff Johnson295189b2012-06-20 16:38:30 -0700148
149 if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS)
150 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700151 limLog(pMac, LOGP, FL("tx_timer_activate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700152 }
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------------------------------------------------------------*/
166tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
167{
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530168 limLog(pMac, LOG1, FL(" ENTER"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700169
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 Lokere80007262013-03-18 19:45:50 -0700175 limLog(pMac, LOGW, FL("Ignoring channel switch on session %d"), psessionEntry->peSessionId);
Jeff Johnsone7245742012-09-05 17:12:55 -0700176 return eSIR_SUCCESS;
177 }
Sushant Kaushikb97a0082015-08-31 12:36:45 +0530178#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 dhara085c02f2014-02-28 15:32:12 -0800183 psessionEntry->channelChangeCSA = LIM_SWITCH_CHANNEL_CSA;
Jeff Johnson295189b2012-06-20 16:38:30 -0700184 /* Deactivate and change reconfigure the timeout value */
Jeff Johnsone7245742012-09-05 17:12:55 -0700185 //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER);
Varun Reddy Yeturue3bbf6e2013-02-08 18:50:55 -0800186 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnsone7245742012-09-05 17:12:55 -0700187 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
188 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700189 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700190 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 Lokere80007262013-03-18 19:45:50 -0700197 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnsone7245742012-09-05 17:12:55 -0700198 return eSIR_FAILURE;
199 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700200
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 Johnsone7245742012-09-05 17:12:55 -0700204 if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN)
Jeff Johnson295189b2012-06-20 16:38:30 -0700205 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700206 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700207 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS)
208 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700209 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700210 return eSIR_FAILURE;
211 }
212 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700213 else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING)
Jeff Johnson295189b2012-06-20 16:38:30 -0700214 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700215 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700216 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS)
217 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700218 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700219 return eSIR_FAILURE;
220 }
221 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700222 psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
Jeff Johnson295189b2012-06-20 16:38:30 -0700223
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
250static 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 Johnson295189b2012-06-20 16:38:30 -0700262
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 Singh127a8442014-12-15 17:31:27 +0530267 limLog(pMac, LOG1, FL("Received Channel switch action frame"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700268 if (!psessionEntry->lim11hEnable)
269 return;
270
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530271 pChannelSwitchFrame = vos_mem_malloc(sizeof(*pChannelSwitchFrame));
272 if (NULL == pChannelSwitchFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -0700273 {
274 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530275 FL("AllocateMemory failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700276 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 Lokere80007262013-03-18 19:45:50 -0700285 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700286 nStatus,
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700287 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530288 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700289 return;
290 }
291 else if(DOT11F_WARNED( nStatus ))
292 {
293 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700294 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700295 nStatus,
296 frameLen);
297 }
298
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530299 if (vos_mem_compare((tANI_U8 *) &psessionEntry->bssId,
300 (tANI_U8 *) &pHdr->sa,
301 sizeof(tSirMacAddr)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700302 {
303 #if 0
304 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS)
305 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530306 vos_mem_free(pChannelSwitchFrame);
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700307 limLog(pMac, LOGP, FL("could not retrieve Beacon interval"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700308 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 Johnsone7245742012-09-05 17:12:55 -0700317 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 Koyyalamudic6226de2012-09-18 16:33:31 -0700322#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700323 if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability)
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700324 {
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 Johnson295189b2012-06-20 16:38:30 -0700330
Abhishek Singh127a8442014-12-15 17:31:27 +0530331 limLog(pMac, LOG1, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"),
332 psessionEntry->gLimChannelSwitch.switchTimeoutValue);
Jeff Johnson295189b2012-06-20 16:38:30 -0700333
334 /* Only primary channel switch element is present */
Jeff Johnsone7245742012-09-05 17:12:55 -0700335 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
336 psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -0700337
Jeff Johnsone7245742012-09-05 17:12:55 -0700338 if (psessionEntry->htSupportedChannelWidthSet)
Jeff Johnson295189b2012-06-20 16:38:30 -0700339 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700340 if ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
341 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))
Jeff Johnson295189b2012-06-20 16:38:30 -0700342 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700343 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
344 psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700345 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700346#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700347 if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present)
348 {
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700349 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 Koyyalamudi1bed5982012-10-22 14:38:06 -0700355 psessionEntry->gLimChannelSwitch.secondarySubBand =
356 limGet11ACPhyCBState(pMac,
357 psessionEntry->gLimChannelSwitch.primaryChannel,
358 pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset,
359 pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0,
360 psessionEntry);
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700361 }
362 }
363 }
364#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700365 }
366
367 }
368 else
369 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530370 limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));
Jeff Johnson295189b2012-06-20 16:38:30 -0700371 }
372
373 if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry))
374 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530375 limLog(pMac, LOG1, FL("Could not start channel switch"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700376 }
377
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530378 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700379 return;
380} /*** end limProcessChannelSwitchActionFrame() ***/
381
382
Mohit Khanna4a70d262012-09-11 16:30:12 -0700383#ifdef WLAN_FEATURE_11AC
384static 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 Khanna4a70d262012-09-11 16:30:12 -0700393 tpDphHashNode pSta;
394 tANI_U16 aid;
Abhishek Singhdf8eb312014-11-15 00:49:28 +0530395 tANI_U8 operMode;
396 tANI_U32 channelBondingMode;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700397
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 Singhdf8eb312014-11-15 00:49:28 +0530402 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 Kaushikc1123872015-01-07 13:59:20 +0530423 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 Gopalachari2f7395d2013-07-12 11:24:23 +0530431 pOperatingModeframe = vos_mem_malloc(sizeof(*pOperatingModeframe));
432 if (NULL == pOperatingModeframe)
Mohit Khanna4a70d262012-09-11 16:30:12 -0700433 {
434 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530435 FL("AllocateMemory failed"));
Mohit Khanna4a70d262012-09-11 16:30:12 -0700436 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 Lokere80007262013-03-18 19:45:50 -0700445 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700446 nStatus,
447 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530448 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700449 return;
450 }
451 else if(DOT11F_WARNED( nStatus ))
452 {
453 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700454 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700455 nStatus,
456 frameLen);
457 }
458 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
Padma, Santhosh Kumar6a3fdc62015-08-28 17:59:51 +0530459 if (pSta == NULL)
460 {
461 PELOGE(limLog(pMac, LOGE, FL("Station context not found"));)
462 return;
463 }
Mohit Khanna4a70d262012-09-11 16:30:12 -0700464
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 Lokere80007262013-03-18 19:45:50 -0700469 FL(" received Chanwidth %d, staIdx = %d"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700470 (pOperatingModeframe->OperatingMode.chanWidth ),
471 pSta->staIndex);
472
473 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700474 FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700475 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 Koyyalamudi1bed5982012-10-22 14:38:06 -0700481
Mohit Khanna4a70d262012-09-11 16:30:12 -0700482 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 Gopalachari2f7395d2013-07-12 11:24:23 +0530500 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700501 return;
502}
503#endif
504
Jeff Johnson295189b2012-06-20 16:38:30 -0700505static void
506__limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
507{
Jeff Johnson295189b2012-06-20 16:38:30 -0700508}
509
510
511static 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 Lokere80007262013-03-18 19:45:50 -0700534 PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700535 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
536 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700537 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700538 return;
539 }
540
541 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
542 if (pSta == NULL)
543 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700544 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700545 return;
546 }
547
548 retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts);
549 if (retval != eSIR_SUCCESS)
550 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700551 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700552 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 Lokere80007262013-03-18 19:45:50 -0700560 PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700561 return;
562 }
563
564 if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken)
565 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700566 limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring",
Jeff Johnson295189b2012-06-20 16:38:30 -0700567 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 Lokere80007262013-03-18 19:45:50 -0700586 limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700587 aid, addts.numTclas);
588 return;
589 }
590 else if (addts.numTclas == 1)
591 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700592 limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!", aid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700593 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
594 }
595 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700596 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700597 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 Lokere80007262013-03-18 19:45:50 -0700605 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700606 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 Yeturu5d5e2c62014-02-27 13:31:29 -0800616#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700617 if (addts.tsmPresent)
618 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700619 limLog(pMac, LOGW, "TSM IE Present");
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800620 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 Girigowda5cecb202013-10-08 09:13:25 -0700624 limSendSmeTsmIEInd(pMac, psessionEntry, addts.tsmIE.tsid,
625 addts.tsmIE.state, addts.tsmIE.msmt_interval);
626#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700627 limActivateTSMStatsTimer(pMac, psessionEntry);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800628#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700629 }
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 Lokere80007262013-03-18 19:45:50 -0700676 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700677
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 Lokere80007262013-03-18 19:45:50 -0700686 PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700687 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 Koyyalamudi198ade32013-09-29 03:52:25 +0530693 ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700694 {
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 Lokere80007262013-03-18 19:45:50 -0700709 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700710 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
711 }
712 else
713 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700714 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700715 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700716 PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700717 // 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
728static 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 Lokere80007262013-03-18 19:45:50 -0700752 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700753 return;
754 }
755
756 // parse the delts request
757 retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts);
758 if (retval != eSIR_SUCCESS)
759 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700760 PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700761 return;
762 }
763
764 if (delts.wmeTspecPresent)
765 {
766 if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
767 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700768 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700769 return;
770 }
Abhishek Singh525045c2014-12-15 17:18:45 +0530771 limLog(pMac, LOG1, FL("WME Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700772 }
773 else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled)
774 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530775 limLog(pMac, LOG1, FL("11e QoS Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700776 }
777 else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled)
778 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530779 limLog(pMac, LOG1, FL("WSM Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700780 }
781 else
782 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700783 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700784 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 Koyyalamudic0a75a42013-10-07 04:20:49 +0530793 if (upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC)
Jeff Johnson295189b2012-06-20 16:38:30 -0700794 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700795 limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700796 tsinfo->traffic.userPrio);
797 return;
798 }
799 }
800
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530801 if ((psessionEntry->limSystemRole != eLIM_AP_ROLE) &&
802 (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
803 limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry);
804
Jeff Johnson295189b2012-06-20 16:38:30 -0700805 // try to delete the TS
806 if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx))
807 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700808 PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700809 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 Koyyalamudic0a75a42013-10-07 04:20:49 +0530820 if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac,
821 pSta->staIndex,
822 tspecIdx,
823 delts,
824 psessionEntry->peSessionId,
825 psessionEntry->bssId))
Jeff Johnson295189b2012-06-20 16:38:30 -0700826 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700827 limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700828 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 Lokere80007262013-03-18 19:45:50 -0700882 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700883
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530884 limLog(pMac, LOG1, FL("DeleteTS succeeded"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700885
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800886#ifdef FEATURE_WLAN_ESE
887#ifdef FEATURE_WLAN_ESE_UPLOAD
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700888 limSendSmeTsmIEInd(pMac, psessionEntry, 0, 0, 0);
889#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700890 limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800891#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700892#endif
893
894}
895
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700896static 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 Anand82c009f2014-05-29 00:29:42 -0700908 &psessionEntry->QosMapSet);
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700909 if (retval != eSIR_SUCCESS)
910 {
911 PELOGW(limLog(pMac, LOGE,
912 FL("QosMapConfigure frame parsing failed (error %d)"), retval);)
913 return;
914 }
Naveen Rawat71e1a2e2015-07-28 16:11:21 +0530915 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
916 pRxPacketInfo, psessionEntry, 0);
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700917}
Jeff Johnson295189b2012-06-20 16:38:30 -0700918
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 */
940static 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 Lokere80007262013-03-18 19:45:50 -0700951 PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700952 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 */
977static 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 Lokere80007262013-03-18 19:45:50 -0700988 PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700989 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 */
1013static 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 Lokere80007262013-03-18 19:45:50 -07001022 PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001023 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
1044static 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 Gopalachari2f7395d2013-07-12 11:24:23 +05301056 pMeasReqFrame = vos_mem_malloc(sizeof( tSirMacMeasReqActionFrame ));
1057 if (NULL == pMeasReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001058 {
1059 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301060 FL("limProcessMeasurementRequestFrame: AllocateMemory failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001061 return;
1062 }
1063
1064 if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) !=
1065 eSIR_SUCCESS)
1066 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001067 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001068 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 Singh3cbf6052014-12-15 16:46:42 +05301087 limLog(pMac, LOG1, FL("Unknown Measurement Type %d "),
1088 pMeasReqFrame->measReqIE.measType);
Jeff Johnson295189b2012-06-20 16:38:30 -07001089 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
1108static 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 Singh3cbf6052014-12-15 16:46:42 +05301120 limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001121
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301122 pTpcReqFrame = vos_mem_malloc(sizeof( tSirMacTpcReqActionFrame ));
1123 if (NULL == pTpcReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001124 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301125 PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001126 return;
1127 }
1128
1129 if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) !=
1130 eSIR_SUCCESS)
1131 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001132 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001133 return;
1134 }
1135
1136 if (limSendTpcReportFrame(pMac,
1137 pTpcReqFrame,
1138 pHdr->sa) != eSIR_SUCCESS)
1139 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001140 PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001141 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
1168static 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 Lee9af07cf2013-04-24 01:21:58 -07001186 limLog( pMac, LOGE,
Jeff Johnson295189b2012-06-20 16:38:30 -07001187 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 */
1213static tSirMacStatusCodes
1214__limValidateDelBAParameterSet( tpAniSirGlobal pMac,
1215 tDot11fFfDelBAParameterSet baParameterSet,
1216 tpDphHashNode pSta )
1217{
1218tSirMacStatusCodes 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 Lokere80007262013-03-18 19:45:50 -07001227 FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001228 }
1229 else
1230 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001231 FL("Received an INVALID DELBA Ind for TID %d..."),
Jeff Johnson295189b2012-06-20 16:38:30 -07001232 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 */
1249static 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 Koyyalamudidd11eaf2012-11-02 16:04:21 -07001257 tANI_U32 frameLen, nStatus,val;
Jeff Johnson295189b2012-06-20 16:38:30 -07001258 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 Lokere458d7322013-05-29 14:29:43 -07001264 val = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07001265
1266 // Unpack the received frame
1267 nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq );
1268 if( DOT11F_FAILED( nStatus ))
1269 {
1270 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001271 FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001272 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 Lokere80007262013-03-18 19:45:50 -07001283 FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001284 nStatus,
1285 frameLen );
1286
1287 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1288 }
1289
Kiran Kumar Lokere2ac471f2013-05-30 16:08:48 -07001290 psessionEntry->amsduSupportedInBA = frmAddBAReq.AddBAParameterSet.amsduSupported;
1291
Jeff Johnson295189b2012-06-20 16:38:30 -07001292 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1293 if( pSta == NULL )
1294 {
1295 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001296 FL( "STA context not found - ignoring ADDBA from " ));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001297 limPrintMacAddr( pMac, pHdr->sa, LOGE );
Jeff Johnson295189b2012-06-20 16:38:30 -07001298
1299 // FIXME - Should we do this?
1300 status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS;
1301 goto returnAfterError;
1302 }
Abhishek Singh02d9f6c2014-05-12 14:07:53 +05301303 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 Johnson295189b2012-06-20 16:38:30 -07001310
Abhishek Singh1f6e6532014-06-05 17:35:08 +05301311 limLog( pMac, LOG1, FL( "ssn = %d fragNumber = %d" ),
1312 frmAddBAReq.BAStartingSequenceControl.ssn,
1313 frmAddBAReq.BAStartingSequenceControl.fragNumber);
1314
Jeff Johnson295189b2012-06-20 16:38:30 -07001315#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, Narayanraddi04010dc2014-12-16 20:06:11 +05301320 limLog( pMac, LOGE,
1321 FL( "Sta Id is not HW Sta Id, Status code is %d " ), status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001322 goto returnAfterError;
1323 }
1324#endif //WLAN_SOFTAP_VSTA_FEATURE
1325
c_hpothu3ba2a512014-08-06 14:02:54 +05301326 if (wlan_cfgGetInt(pMac, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC, &val) !=
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001327 eSIR_SUCCESS)
1328 {
1329 limLog(pMac, LOGE,
c_hpothu3ba2a512014-08-06 14:02:54 +05301330 FL("Unable to get WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC"));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001331 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 Johnson295189b2012-06-20 16:38:30 -07001343
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, Narayanraddi04010dc2014-12-16 20:06:11 +05301350 {
1351 limLog( pMac, LOGE,
1352 FL( "ADDBA parameters validation failed with status %d" ), status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001353 goto returnAfterError;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301354 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001355
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, Narayanraddi04010dc2014-12-16 20:06:11 +05301365 limLog( pMac, LOGE,
1366 FL( "Deletion of Existing BA session failed with status %d" ),
1367 status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001368 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 Lokere80007262013-03-18 19:45:50 -07001374 limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001375 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 Lokere495c6142013-04-01 20:52:41 -07001389
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001390 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001391 {
1392 limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001393 return ;
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001394 }
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 Lokere458d7322013-05-29 14:29:43 -07001406 limLog( pMac, LOG1, FL( "ADDBAREQ NUMBUFF %d" ),
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001407 frmAddBAReq.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001408
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, Narayanraddi04010dc2014-12-16 20:06:11 +05301418 {
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 Johnson295189b2012-06-20 16:38:30 -07001424 else
1425 return;
1426
1427returnAfterError:
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 */
1462static void
1463__limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1464{
1465tDot11fAddBARsp frmAddBARsp;
1466tpSirMacMgmtHdr pHdr;
1467tpDphHashNode pSta;
1468tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1469tANI_U16 aid;
1470tANI_U32 frameLen, nStatus;
1471tANI_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 Lokere80007262013-03-18 19:45:50 -07001481 FL( "STA context not found - ignoring ADDBA from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001482 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, Narayanraddi04010dc2014-12-16 20:06:11 +05301491 limLog( pMac, LOGE, FL( "Sta Id is not HW Sta Id " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001492 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 Lokere80007262013-03-18 19:45:50 -07001501 FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001502 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 Lokere80007262013-03-18 19:45:50 -07001511 FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001512 nStatus,
1513 frameLen );
1514
1515 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1516 }
1517
Abhishek Singh02d9f6c2014-05-12 14:07:53 +05301518 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 Johnson295189b2012-06-20 16:38:30 -07001527 //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 Lee9af07cf2013-04-24 01:21:58 -07001532 PELOGW(limLog(pMac, LOGE, FL("dialogueToken in received addBARsp did not match with outstanding requests"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001533 return;
1534 }
1535
1536 // Check first if the peer accepted the ADDBA Req
1537 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1538 {
Kaushik, Sushant335328c2014-07-31 19:15:31 +05301539 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 Johnson295189b2012-06-20 16:38:30 -07001553 // 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, Narayanraddi04010dc2014-12-16 20:06:11 +05301559 {
1560 limLog( pMac, LOGE,
1561 FL( "ADDBA parameters validation failed" ));
1562 goto returnAfterError;
1563 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001564 }
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, Narayanraddi04010dc2014-12-16 20:06:11 +05301586 {
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 Johnson295189b2012-06-20 16:38:30 -07001592 else
1593 return;
1594
1595returnAfterError:
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 */
1638static void
1639__limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1640{
1641tDot11fDelBAInd frmDelBAInd;
1642tpSirMacMgmtHdr pHdr;
1643tpDphHashNode pSta;
1644tANI_U16 aid;
1645tANI_U32 frameLen, nStatus;
1646tANI_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 Lokere80007262013-03-18 19:45:50 -07001655 limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001656 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1657 return;
1658 }
1659
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001660 limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid );
Jeff Johnson295189b2012-06-20 16:38:30 -07001661
1662 // Unpack the received frame
1663 nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd );
1664 if( DOT11F_FAILED( nStatus ))
1665 {
1666 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001667 FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001668 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 Lokere80007262013-03-18 19:45:50 -07001677 FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001678 nStatus,
1679 frameLen );
1680
1681 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1682 }
1683
Abhishek Singh1f6e6532014-06-05 17:35:08 +05301684 limLog( pMac, LOG1,
1685 FL( "Received DELBA from: "MAC_ADDRESS_STR" for TID %d, Reason code %d" ),
1686 MAC_ADDR_ARRAY(pHdr->sa),
Jeff Johnson295189b2012-06-20 16:38:30 -07001687 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, Narayanraddi04010dc2014-12-16 20:06:11 +05301694 {
1695 limLog( pMac, LOGE,
1696 FL( "ADDBA parameters validation failed " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001697 return;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301698 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001699 //
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 Lokere80007262013-03-18 19:45:50 -07001711 limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001712
1713 return;
1714
1715}
1716
1717static 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 Lokere80007262013-03-18 19:45:50 -07001736 limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001737 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 Lokere80007262013-03-18 19:45:50 -07001745 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001746 nStatus, frameLen );
1747 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1748 return;
1749 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001750 limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001751 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
1786static 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 Lokere80007262013-03-18 19:45:50 -07001807 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001808 nStatus, frameLen );
1809 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1810 return;
1811 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001812 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001813 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
1822static 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 Lokere80007262013-03-18 19:45:50 -07001843 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001844 nStatus, frameLen );
1845 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1846 return;
1847 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001848 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001849 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
1859static void
1860__limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1861{
1862 tpSirMacMgmtHdr pHdr;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001863 tDot11fNeighborReportResponse *pFrm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001864 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 Gopalachari2f7395d2013-07-12 11:24:23 +05301871 pFrm = vos_mem_malloc(sizeof(tDot11fNeighborReportResponse));
1872 if (NULL == pFrm)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001873 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301874 limLog(pMac, LOGE, FL("Unable to allocate memory in __limProcessNeighborReport") );
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001875 return;
1876 }
1877
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301878 if(psessionEntry == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -07001879 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301880 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001881 return;
1882 }
1883
1884 /**Unpack the received frame */
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001885 nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm );
Jeff Johnson295189b2012-06-20 16:38:30 -07001886
1887 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001888 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001889 nStatus, frameLen );
1890 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301891 vos_mem_free(pFrm);
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001892 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001893 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001894 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001895 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 Koyyalamudi19032762012-10-21 12:42:11 -07001900 rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry );
1901
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301902 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001903}
1904
1905#endif
1906
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08001907#ifdef WLAN_FEATURE_AP_HT40_24G
1908static 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 Johnson295189b2012-06-20 16:38:30 -07002042#ifdef WLAN_FEATURE_11W
2043/**
Chet Lanctot186b5732013-03-18 10:26:30 -07002044 * limProcessSAQueryRequestActionFrame
Jeff Johnson295189b2012-06-20 16:38:30 -07002045 *
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 Lanctot186b5732013-03-18 10:26:30 -07002057 * @param *pRxPacketInfo - Handle to the Rx packet info
2058 * @param psessionEntry - PE session entry
2059 *
Jeff Johnson295189b2012-06-20 16:38:30 -07002060 * @return None
2061 */
Chet Lanctot186b5732013-03-18 10:26:30 -07002062static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002063{
2064 tpSirMacMgmtHdr pHdr;
2065 tANI_U8 *pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07002066 tANI_U8 transId[2];
Jeff Johnson295189b2012-06-20 16:38:30 -07002067
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 Lanctot186b5732013-03-18 10:26:30 -07002075 /* If this is an unprotected SA Query Request, then ignore it. */
2076 if (pHdr->fc.wep == 0)
2077 return;
2078
Jeff Johnson295189b2012-06-20 16:38:30 -07002079 /*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 Lanctot186b5732013-03-18 10:26:30 -07002084 Transaction ID : 2 bytes */
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302085 vos_mem_copy(&transId[0], &pBody[2], 2);
Jeff Johnson295189b2012-06-20 16:38:30 -07002086
Jeff Johnson295189b2012-06-20 16:38:30 -07002087 //Send 11w SA query response action frame
2088 if (limSendSaQueryResponseFrame(pMac,
2089 transId,
2090 pHdr->sa,psessionEntry) != eSIR_SUCCESS)
2091 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002092 PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002093 return;
2094 }
2095}
2096
Chet Lanctot186b5732013-03-18 10:26:30 -07002097/**
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 */
2115static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
2116{
2117 tpSirMacMgmtHdr pHdr;
Chet Lanctot8cecea22014-02-11 19:09:36 -08002118 tANI_U8 *pBody;
2119 tpDphHashNode pSta;
2120 tANI_U16 aid;
2121 tANI_U16 transId;
2122 tANI_U8 retryNum;
Chet Lanctot186b5732013-03-18 10:26:30 -07002123
2124 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Chet Lanctot8cecea22014-02-11 19:09:36 -08002125 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
Chet Lanctot186b5732013-03-18 10:26:30 -07002126 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
2127 ("SA Query Response received...")) ;
Chet Lanctot186b5732013-03-18 10:26:30 -07002128
Chet Lanctotdd6beeb2014-04-22 11:51:29 -07002129 /* 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 Rawat71e1a2e2015-07-28 16:11:21 +05302133 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2134 pRxPacketInfo, psessionEntry, 0);
Chet Lanctotdd6beeb2014-04-22 11:51:29 -07002135 return;
2136 }
2137
Chet Lanctot8cecea22014-02-11 19:09:36 -08002138 /* 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 Johnson295189b2012-06-20 16:38:30 -07002176#endif
2177
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002178#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
2200static tANI_BOOLEAN
2201limDropUnprotectedActionFrame (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 Johnson295189b2012-06-20 16:38:30 -07002230/**
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
2248void
2249limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
2250{
2251 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2252 tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07002253#ifdef WLAN_FEATURE_11W
2254 tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2255#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002256
Jeff Johnson295189b2012-06-20 16:38:30 -07002257 switch (pActionHdr->category)
2258 {
2259 case SIR_MAC_ACTION_QOS_MGMT:
Chet Lanctot186b5732013-03-18 10:26:30 -07002260#ifdef WLAN_FEATURE_11W
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002261 if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category))
Chet Lanctot186b5732013-03-18 10:26:30 -07002262 break;
Chet Lanctot186b5732013-03-18 10:26:30 -07002263#endif
Leela Venkata Kiran Kumar Reddy Chiralac7c4e7e2014-04-29 10:50:16 -07002264 if ( (psessionEntry->limQosEnabled) ||
2265 (pActionHdr->actionID == SIR_MAC_QOS_MAP_CONFIGURE) )
Jeff Johnson295189b2012-06-20 16:38:30 -07002266 {
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 Chirala8e69fbc2013-10-30 18:51:13 -07002281 case SIR_MAC_QOS_MAP_CONFIGURE:
2282 __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2283 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002284 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002285 PELOGE(limLog(pMac, LOGE, FL("Qos action %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002286 break;
2287 }
2288 break ;
2289 }
2290
2291 break;
2292
2293 case SIR_MAC_ACTION_SPECTRUM_MGMT:
Chet Lanctot186b5732013-03-18 10:26:30 -07002294#ifdef WLAN_FEATURE_11W
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002295 if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category))
Chet Lanctot186b5732013-03-18 10:26:30 -07002296 break;
Chet Lanctot186b5732013-03-18 10:26:30 -07002297#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002298 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 Lokere80007262013-03-18 19:45:50 -07002327 PELOGE(limLog(pMac, LOGE, FL("Spectrum mgmt action id %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002328 break;
2329 }
2330 break;
2331
2332 case SIR_MAC_ACTION_WME:
2333 if (! psessionEntry->limWmeEnabled)
2334 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002335 limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002336 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 Chirala8e69fbc2013-10-30 18:51:13 -07002353 case SIR_MAC_QOS_MAP_CONFIGURE:
2354 __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2355 break;
2356
Jeff Johnson295189b2012-06-20 16:38:30 -07002357 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002358 PELOGE(limLog(pMac, LOGE, FL("WME action %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002359 break;
2360 }
2361 break;
2362
2363 case SIR_MAC_ACTION_BLKACK:
2364 // Determine the "type" of BA Action Frame
Chet Lanctot186b5732013-03-18 10:26:30 -07002365#ifdef WLAN_FEATURE_11W
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002366 if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category))
Chet Lanctot186b5732013-03-18 10:26:30 -07002367 break;
Chet Lanctot186b5732013-03-18 10:26:30 -07002368#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002369 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 Lokere80007262013-03-18 19:45:50 -07002395 PELOGE(limLog(pMac, LOGE, FL("Action ID %d not handled in HT Action category"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002396 break;
2397 }
2398 break;
2399
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002400 case SIR_MAC_ACTION_WNM:
2401 {
2402#ifdef WLAN_FEATURE_11W
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002403 if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category))
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002404 break;
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002405#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 Rawat71e1a2e2015-07-28 16:11:21 +05302420 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2421 pRxPacketInfo,
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002422 psessionEntry, rssi);
2423 break;
2424 }
2425 }
2426 break;
2427 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002428#if defined WLAN_FEATURE_VOWIFI
2429 case SIR_MAC_ACTION_RRM:
Chet Lanctot186b5732013-03-18 10:26:30 -07002430#ifdef WLAN_FEATURE_11W
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002431 if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category))
2432 break;
Chet Lanctot186b5732013-03-18 10:26:30 -07002433#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002434 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 Lokere80007262013-03-18 19:45:50 -07002447 PELOGE( limLog( pMac, LOGE, FL("Action ID %d not handled in RRM"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002448 break;
2449
2450 }
2451 }
2452 else
2453 {
2454 // Else we will just ignore the RRM messages.
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002455 PELOGE( limLog( pMac, LOGE, FL("RRM Action frame ignored as RRM is disabled in cfg"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002456 }
2457 break;
2458#endif
Kiet Lam47325522014-03-10 11:50:46 -07002459#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002460 case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
2461 {
2462 tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr;
2463 tpSirMacMgmtHdr pHdr;
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002464 tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 };
2465
2466 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002467
2468 //Check if it is a vendor specific action frame.
2469 if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) &&
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302470 (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr,
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002471 &pHdr->da[0], sizeof(tSirMacAddr))) &&
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002472 IS_WES_MODE_ENABLED(pMac) &&
2473 vos_mem_compare(pVendorSpecific->Oui, Oui, 3))
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002474 {
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 Rawat71e1a2e2015-07-28 16:11:21 +05302479 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2480 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302481 psessionEntry, 0);
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002482 }
2483 else
2484 {
2485 limLog( pMac, LOGE, FL("Dropping the vendor specific action frame because of( "
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002486 "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or "
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002487 "not received with SelfSta Mac address) system role = %d"),
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002488 IS_WES_MODE_ENABLED(pMac),
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002489 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1],
2490 pVendorSpecific->Oui[2],
2491 psessionEntry->limSystemRole );
2492 }
2493 }
2494 break;
2495#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002496 case SIR_MAC_ACTION_PUBLIC_USAGE:
2497 switch(pActionHdr->actionID) {
2498 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2499 {
2500 tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002501 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2502
Jeff Johnson295189b2012-06-20 16:38:30 -07002503 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302504 if (vos_mem_compare(pPubAction->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002505 {
2506 /* Forward to the SME to HDD to wpa_supplicant */
2507 // type is ACTION
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302508 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2509 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302510 psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002511 }
2512 else
2513 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002514 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002515 pPubAction->Oui[0], pPubAction->Oui[1], pPubAction->Oui[2], pPubAction->Oui[3] );
2516 }
2517 }
2518 break;
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08002519#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 Khanna698ba2a2012-12-04 15:08:18 -08002534#ifdef FEATURE_WLAN_TDLS
2535 case SIR_MAC_TDLS_DIS_RSP:
2536 {
Chilam NG571c65a2013-01-19 12:27:36 +05302537 tANI_S8 rssi;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002538
Chilam NG571c65a2013-01-19 12:27:36 +05302539 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002540 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002541 ("Public Action TDLS Discovery RSP ..")) ;
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302542 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2543 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302544 psessionEntry, rssi);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002545 }
2546 break;
2547#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002548
2549 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002550 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002551 break;
2552 }
2553 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002554
2555#ifdef WLAN_FEATURE_11W
2556 case SIR_MAC_ACTION_SA_QUERY:
2557 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002558 PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);)
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002559 if (limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr, pActionHdr->category))
2560 break;
Chet Lanctot186b5732013-03-18 10:26:30 -07002561 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 Lanctot8cecea22014-02-11 19:09:36 -08002570 /* Handle based on the current SA Query state */
Chet Lanctot186b5732013-03-18 10:26:30 -07002571 __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2572 break;
2573 default:
2574 break;
2575 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002576 break;
2577 }
2578#endif
Mohit Khanna4a70d262012-09-11 16:30:12 -07002579#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 Lanctot186b5732013-03-18 10:26:30 -07002593 break;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -07002594 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002595#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002596 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002597 PELOGE(limLog(pMac, LOGE, FL("Action category %d not handled"), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002598 break;
2599 }
2600}
2601
Jeff Johnson295189b2012-06-20 16:38:30 -07002602/**
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
2622void
2623limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd)
2624{
2625 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd);
2626 tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody;
2627
Mohit Khanna23863762012-09-11 17:40:09 -07002628 limLog( pMac, LOG1, "Received a Action frame -- no session");
Jeff Johnson295189b2012-06-20 16:38:30 -07002629
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 Johnson295189b2012-06-20 16:38:30 -07002636 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2637
Jeff Johnson295189b2012-06-20 16:38:30 -07002638 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302639 if (vos_mem_compare(pActionHdr->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002640 {
2641 /* Forward to the SME to HDD to wpa_supplicant */
2642 // type is ACTION
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302643 limSendSmeMgmtFrameInd(pMac, 0, pBd, NULL, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002644 }
2645 else
2646 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002647 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002648 pActionHdr->Oui[0], pActionHdr->Oui[1], pActionHdr->Oui[2], pActionHdr->Oui[3] );
2649 }
2650 }
2651 break;
2652 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002653 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002654 break;
2655 }
2656 break;
2657 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002658 PELOGE(limLog(pMac, LOG1, FL("Unhandled action frame without session -- %x "), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002659 break;
2660
2661 }
2662}