blob: 635d5ceeacb78a727c1e0b1ef009c79f97bf178f [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Padma, Santhosh Kumar071de2d2017-02-02 20:38:03 +05302 * Copyright (c) 2012-2017 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"
Abhishek Singh00b71972016-01-07 10:51:04 +053062#ifdef WLAN_FEATURE_RMC
63#include "limRMC.h"
64#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070065
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080066#if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD)
67#include "eseApi.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070068#endif
69#include "wlan_qct_wda.h"
70
Padma, Santhosh Kumar071de2d2017-02-02 20:38:03 +053071#ifdef WLAN_FEATURE_LFR_MBB
72#include "lim_mbb.h"
73#endif
74
Jeff Johnson295189b2012-06-20 16:38:30 -070075
76#define BA_DEFAULT_TX_BUFFER_SIZE 64
77
78typedef enum
79{
80 LIM_ADDBA_RSP = 0,
81 LIM_ADDBA_REQ = 1
82}tLimAddBaValidationReqType;
83
84/* Note: The test passes if the STAUT stops sending any frames, and no further
85 frames are transmitted on this channel by the station when the AP has sent
86 the last 6 beacons, with the channel switch information elements as seen
87 with the sniffer.*/
88#define SIR_CHANSW_TX_STOP_MAX_COUNT 6
89/**-----------------------------------------------------------------
90\fn limStopTxAndSwitchChannel
91\brief Stops the transmission if channel switch mode is silent and
92 starts the channel switch timer.
93
94\param pMac
95\return NONE
96-----------------------------------------------------------------*/
97void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId)
98{
99 tANI_U8 isFullPowerRequested = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700100 tpPESession psessionEntry;
101
102 psessionEntry = peFindSessionBySessionId( pMac , sessionId );
103
104 if( NULL == psessionEntry )
105 {
106 limLog(pMac, LOGE, FL("Session %d not active\n "), sessionId);
107 return;
108 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700109
Padma, Santhosh Kumara60416c2017-03-09 19:23:54 +0530110 if(pMac->ft.ftPEContext.pFTPreAuthReq)
111 {
112 limLog(pMac, LOGE,
113 FL("Avoid Switch Channel req during pre auth"));
114 return;
115 }
116
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530117 limLog(pMac, LOG1, FL("Channel switch Mode == %d"),
118 psessionEntry->gLimChannelSwitch.switchMode);
Jeff Johnson295189b2012-06-20 16:38:30 -0700119
Jeff Johnsone7245742012-09-05 17:12:55 -0700120 if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT ||
121 psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT)
Jeff Johnson295189b2012-06-20 16:38:30 -0700122 {
123 /* Freeze the transmission */
124 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX);
125
126 /*Request for Full power only if the device is in powersave*/
127 if(!limIsSystemInActiveState(pMac))
128 {
129 /* Request Full Power */
130 limSendSmePreChannelSwitchInd(pMac);
131 isFullPowerRequested = 1;
132 }
133 }
134 else
135 {
136 /* Resume the transmission */
137 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX);
138 }
139
Jeff Johnsone7245742012-09-05 17:12:55 -0700140 pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700141 /* change the channel immediatly only if the channel switch count is 0 and the
142 * device is not in powersave
143 * If the device is in powersave channel switch should happen only after the
144 * device comes out of the powersave */
Jeff Johnsone7245742012-09-05 17:12:55 -0700145 if (psessionEntry->gLimChannelSwitch.switchCount == 0)
Jeff Johnson295189b2012-06-20 16:38:30 -0700146 {
147 if(limIsSystemInActiveState(pMac))
148 {
149 limProcessChannelSwitchTimeout(pMac);
150 }
151 else if(!isFullPowerRequested)
152 {
153 /* If the Full power is already not requested
154 * Request Full Power so the channel switch happens
155 * after device comes to full power */
156 limSendSmePreChannelSwitchInd(pMac);
157 }
158 return;
159 }
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -0800160 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700161
Jeff Johnson295189b2012-06-20 16:38:30 -0700162
163 if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS)
164 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700165 limLog(pMac, LOGP, FL("tx_timer_activate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700166 }
167 return;
168}
169
170/**------------------------------------------------------------
171\fn limStartChannelSwitch
172\brief Switches the channel if switch count == 0, otherwise
173 starts the timer for channel switch and stops BG scan
174 and heartbeat timer tempororily.
175
176\param pMac
177\param psessionEntry
178\return NONE
179------------------------------------------------------------*/
180tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
181{
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530182 limLog(pMac, LOG1, FL(" ENTER"));
Padma, Santhosh Kumar071de2d2017-02-02 20:38:03 +0530183
184#ifdef WLAN_FEATURE_LFR_MBB
185 if (lim_is_mbb_reassoc_in_progress(pMac, psessionEntry))
186 {
187 limLog(pMac, LOGE,
188 FL("Ignore channel switch as LFR MBB in progress"));
189 return eSIR_SUCCESS;
190 }
191#endif
192
Jeff Johnsone7245742012-09-05 17:12:55 -0700193 /*If channel switch is already running and it is on a different session, just return*/
194 /*This need to be removed for MCC */
195 if( limIsChanSwitchRunning (pMac) &&
196 psessionEntry->gLimSpecMgmt.dot11hChanSwState != eLIM_11H_CHANSW_RUNNING )
197 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700198 limLog(pMac, LOGW, FL("Ignoring channel switch on session %d"), psessionEntry->peSessionId);
Jeff Johnsone7245742012-09-05 17:12:55 -0700199 return eSIR_SUCCESS;
200 }
Sushant Kaushikb97a0082015-08-31 12:36:45 +0530201#ifdef FEATURE_WLAN_DIAG_SUPPORT
202 limDiagEventReport(pMac, WLAN_PE_DIAG_CHANNEL_SWITCH_ANOUNCEMENT,
203 psessionEntry, eSIR_SUCCESS, LIM_SWITCH_CHANNEL_CSA);
204#endif
205
Kalikinkar dhara085c02f2014-02-28 15:32:12 -0800206 psessionEntry->channelChangeCSA = LIM_SWITCH_CHANNEL_CSA;
Jeff Johnson295189b2012-06-20 16:38:30 -0700207 /* Deactivate and change reconfigure the timeout value */
Jeff Johnsone7245742012-09-05 17:12:55 -0700208 //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER);
Varun Reddy Yeturue3bbf6e2013-02-08 18:50:55 -0800209 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnsone7245742012-09-05 17:12:55 -0700210 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
211 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700212 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700213 return eSIR_FAILURE;
214 }
215
216 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
217 psessionEntry->gLimChannelSwitch.switchTimeoutValue,
218 0) != TX_SUCCESS)
219 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700220 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnsone7245742012-09-05 17:12:55 -0700221 return eSIR_FAILURE;
222 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700223
224 /* Follow the channel switch, forget about the previous quiet. */
225 //If quiet is running, chance is there to resume tx on its timeout.
226 //so stop timer for a safer side.
Jeff Johnsone7245742012-09-05 17:12:55 -0700227 if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN)
Jeff Johnson295189b2012-06-20 16:38:30 -0700228 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700229 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700230 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS)
231 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700232 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700233 return eSIR_FAILURE;
234 }
235 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700236 else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING)
Jeff Johnson295189b2012-06-20 16:38:30 -0700237 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700238 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700239 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS)
240 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700241 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700242 return eSIR_FAILURE;
243 }
244 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700245 psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
Jeff Johnson295189b2012-06-20 16:38:30 -0700246
247 /* Prepare for 11h channel switch */
248 limPrepareFor11hChannelSwitch(pMac, psessionEntry);
249
250 /** Dont add any more statements here as we posted finish scan request
251 * to HAL, wait till we get the response
252 */
253 return eSIR_SUCCESS;
254}
255
256
257/**
258 * __limProcessChannelSwitchActionFrame
259 *
260 *FUNCTION:
261 *
262 *LOGIC:
263 *
264 *ASSUMPTIONS:
265 *
266 *NOTE:
267 *
268 * @param pMac - Pointer to Global MAC structure
269 * @param *pRxPacketInfo - A pointer to packet info structure
270 * @return None
271 */
272
273static void
274
275__limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
276{
277
278 tpSirMacMgmtHdr pHdr;
279 tANI_U8 *pBody;
280 tDot11fChannelSwitch *pChannelSwitchFrame;
281 tANI_U16 beaconPeriod;
282 tANI_U32 val;
283 tANI_U32 frameLen;
284 tANI_U32 nStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -0700285
286 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
287 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
288 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
289
Abhishek Singh127a8442014-12-15 17:31:27 +0530290 limLog(pMac, LOG1, FL("Received Channel switch action frame"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700291 if (!psessionEntry->lim11hEnable)
292 return;
293
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530294 pChannelSwitchFrame = vos_mem_malloc(sizeof(*pChannelSwitchFrame));
295 if (NULL == pChannelSwitchFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -0700296 {
297 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530298 FL("AllocateMemory failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700299 return;
300 }
301
302 /* Unpack channel switch frame */
303 nStatus = dot11fUnpackChannelSwitch(pMac, pBody, frameLen, pChannelSwitchFrame);
304
305 if( DOT11F_FAILED( nStatus ))
306 {
307 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700308 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700309 nStatus,
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700310 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530311 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700312 return;
313 }
314 else if(DOT11F_WARNED( nStatus ))
315 {
316 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700317 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700318 nStatus,
319 frameLen);
320 }
321
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530322 if (vos_mem_compare((tANI_U8 *) &psessionEntry->bssId,
323 (tANI_U8 *) &pHdr->sa,
324 sizeof(tSirMacAddr)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700325 {
326 #if 0
327 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS)
328 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530329 vos_mem_free(pChannelSwitchFrame);
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700330 limLog(pMac, LOGP, FL("could not retrieve Beacon interval"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700331 return;
332 }
333 #endif// TO SUPPORT BT-AMP
334
335 /* copy the beacon interval from psessionEntry*/
336 val = psessionEntry->beaconParams.beaconInterval;
337
338 beaconPeriod = (tANI_U16) val;
339
Jeff Johnsone7245742012-09-05 17:12:55 -0700340 psessionEntry->gLimChannelSwitch.primaryChannel = pChannelSwitchFrame->ChanSwitchAnn.newChannel;
341 psessionEntry->gLimChannelSwitch.switchCount = pChannelSwitchFrame->ChanSwitchAnn.switchCount;
342 psessionEntry->gLimChannelSwitch.switchTimeoutValue = SYS_MS_TO_TICKS(beaconPeriod) *
343 psessionEntry->gLimChannelSwitch.switchCount;
344 psessionEntry->gLimChannelSwitch.switchMode = pChannelSwitchFrame->ChanSwitchAnn.switchMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700345#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700346 if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability)
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700347 {
348 psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth;
349 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0;
350 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq1;
351 }
352#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700353
Abhishek Singh127a8442014-12-15 17:31:27 +0530354 limLog(pMac, LOG1, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"),
355 psessionEntry->gLimChannelSwitch.switchTimeoutValue);
Jeff Johnson295189b2012-06-20 16:38:30 -0700356
357 /* Only primary channel switch element is present */
Jeff Johnsone7245742012-09-05 17:12:55 -0700358 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
359 psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -0700360
Jeff Johnsone7245742012-09-05 17:12:55 -0700361 if (psessionEntry->htSupportedChannelWidthSet)
Jeff Johnson295189b2012-06-20 16:38:30 -0700362 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700363 if ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
364 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))
Jeff Johnson295189b2012-06-20 16:38:30 -0700365 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700366 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
367 psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700368 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700369#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700370 if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present)
371 {
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700372 if (pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
373 {
374 if (pChannelSwitchFrame->ExtChanSwitchAnn.present && ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
375 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)))
376 {
377 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700378 psessionEntry->gLimChannelSwitch.secondarySubBand =
379 limGet11ACPhyCBState(pMac,
380 psessionEntry->gLimChannelSwitch.primaryChannel,
381 pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset,
382 pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0,
383 psessionEntry);
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700384 }
385 }
386 }
387#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700388 }
389
390 }
391 else
392 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530393 limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));
Jeff Johnson295189b2012-06-20 16:38:30 -0700394 }
395
396 if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry))
397 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530398 limLog(pMac, LOG1, FL("Could not start channel switch"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700399 }
400
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530401 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700402 return;
403} /*** end limProcessChannelSwitchActionFrame() ***/
404
405
Mohit Khanna4a70d262012-09-11 16:30:12 -0700406#ifdef WLAN_FEATURE_11AC
407static void
408__limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
409{
410
411 tpSirMacMgmtHdr pHdr;
412 tANI_U8 *pBody;
413 tDot11fOperatingMode *pOperatingModeframe;
414 tANI_U32 frameLen;
415 tANI_U32 nStatus;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700416 tpDphHashNode pSta;
417 tANI_U16 aid;
Abhishek Singhdf8eb312014-11-15 00:49:28 +0530418 tANI_U8 operMode;
419 tANI_U32 channelBondingMode;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700420
421 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
422 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
423 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
424
Abhishek Singhdf8eb312014-11-15 00:49:28 +0530425 limLog(pMac, LOG1, FL("Received Operating Mode action frame"));
426
427 if( RF_CHAN_14 >= psessionEntry->currentOperChannel )
428 {
429 channelBondingMode = pMac->roam.configParam.channelBondingMode24GHz;
430 }
431 else
432 {
433 channelBondingMode = pMac->roam.configParam.channelBondingMode5GHz;
434 }
435
436 /* Do not update the channel bonding mode if channel bonding
437 * mode is disabled in INI.
438 */
439 if(WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == channelBondingMode)
440 {
441 limLog(pMac, LOGW,
442 FL("channel bonding disabled"));
443 return;
444 }
445
Sushant Kaushikc1123872015-01-07 13:59:20 +0530446 if (( RF_CHAN_14 >= psessionEntry->currentOperChannel )&&
447 !IS_HT40_OBSS_SCAN_FEATURE_ENABLE)
448 {
449 limLog(pMac, LOGW,
450 FL("channel bonding disabled as FW doesn't supoort CB in 2.4gz"));
451 return;
452 }
453
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530454 pOperatingModeframe = vos_mem_malloc(sizeof(*pOperatingModeframe));
455 if (NULL == pOperatingModeframe)
Mohit Khanna4a70d262012-09-11 16:30:12 -0700456 {
457 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530458 FL("AllocateMemory failed"));
Mohit Khanna4a70d262012-09-11 16:30:12 -0700459 return;
460 }
461
462 /* Unpack channel switch frame */
463 nStatus = dot11fUnpackOperatingMode(pMac, pBody, frameLen, pOperatingModeframe);
464
465 if( DOT11F_FAILED( nStatus ))
466 {
467 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700468 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700469 nStatus,
470 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530471 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700472 return;
473 }
474 else if(DOT11F_WARNED( nStatus ))
475 {
476 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700477 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700478 nStatus,
479 frameLen);
480 }
481 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
Padma, Santhosh Kumar6a3fdc62015-08-28 17:59:51 +0530482 if (pSta == NULL)
483 {
484 PELOGE(limLog(pMac, LOGE, FL("Station context not found"));)
485 return;
486 }
Mohit Khanna4a70d262012-09-11 16:30:12 -0700487
488 operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ;
489 if( operMode != pOperatingModeframe->OperatingMode.chanWidth)
490 {
491 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700492 FL(" received Chanwidth %d, staIdx = %d"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700493 (pOperatingModeframe->OperatingMode.chanWidth ),
494 pSta->staIndex);
495
496 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700497 FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700498 pHdr->sa[0],
499 pHdr->sa[1],
500 pHdr->sa[2],
501 pHdr->sa[3],
502 pHdr->sa[4],
503 pHdr->sa[5]);
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700504
Mohit Khanna4a70d262012-09-11 16:30:12 -0700505 if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ)
506 {
507 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
508 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
509 }
510 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ)
511 {
512 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
513 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
514 }
515 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ)
516 {
517 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
518 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ;
519 }
520 limCheckVHTOpModeChange( pMac, psessionEntry,
521 (pOperatingModeframe->OperatingMode.chanWidth), pSta->staIndex);\
522 }
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530523 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700524 return;
525}
526#endif
527
Jeff Johnson295189b2012-06-20 16:38:30 -0700528static void
529__limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
530{
Jeff Johnson295189b2012-06-20 16:38:30 -0700531}
532
533
534static void
535__limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
536{
537 tSirAddtsRspInfo addts;
538 tSirRetStatus retval;
539 tpSirMacMgmtHdr pHdr;
540 tpDphHashNode pSta;
541 tANI_U16 aid;
542 tANI_U32 frameLen;
543 tANI_U8 *pBody;
544 tpLimTspecInfo tspecInfo;
545 tANI_U8 ac;
546 tpDphHashNode pStaDs = NULL;
547 tANI_U8 rspReqd = 1;
548 tANI_U32 cfgLen;
549 tSirMacAddr peerMacAddr;
550
551
552 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
553 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
554 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
555
556
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700557 PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700558 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
559 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700560 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700561 return;
562 }
563
564 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
565 if (pSta == NULL)
566 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700567 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700568 return;
569 }
570
571 retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts);
572 if (retval != eSIR_SUCCESS)
573 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700574 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700575 return;
576 }
577
578 // don't have to check for qos/wme capabilities since we wouldn't have this
579 // flag set otherwise
580 if (! pMac->lim.gLimAddtsSent)
581 {
582 // we never sent an addts request!
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700583 PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700584 return;
585 }
586
587 if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken)
588 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700589 limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring",
Jeff Johnson295189b2012-06-20 16:38:30 -0700590 addts.dialogToken, pMac->lim.gLimAddtsReq.req.dialogToken);
591 return;
592 }
593
594 /*
595 * for successful addts reponse, try to add the classifier.
596 * if this fails for any reason, we should send a delts request to the ap
597 * for now, its ok not to send a delts since we are going to add support for
598 * multiple tclas soon and until then we won't send any addts requests with
599 * multiple tclas elements anyway.
600 * In case of addClassifier failure, we just let the addts timer run out
601 */
602 if (((addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
603 (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) &&
604 (addts.status == eSIR_MAC_SUCCESS_STATUS))
605 {
606 // add the classifier - this should always succeed
607 if (addts.numTclas > 1) // currently no support for multiple tclas elements
608 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700609 limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700610 aid, addts.numTclas);
611 return;
612 }
613 else if (addts.numTclas == 1)
614 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700615 limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!", aid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700616 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
617 }
618 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700619 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700620 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
621 addts.status);
622
623 // deactivate the response timer
624 limDeactivateAndChangeTimer(pMac, eLIM_ADDTS_RSP_TIMER);
625
626 if (addts.status != eSIR_MAC_SUCCESS_STATUS)
627 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700628 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700629 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
630 addts.status);
631 limSendSmeAddtsRsp(pMac, true, addts.status, psessionEntry, addts.tspec,
632 psessionEntry->smeSessionId, psessionEntry->transactionId);
633
634 // clear the addts flag
635 pMac->lim.gLimAddtsSent = false;
636
637 return;
638 }
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800639#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700640 if (addts.tsmPresent)
641 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700642 limLog(pMac, LOGW, "TSM IE Present");
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800643 psessionEntry->eseContext.tsm.tid = addts.tspec.tsinfo.traffic.userPrio;
644 vos_mem_copy(&psessionEntry->eseContext.tsm.tsmInfo,
645 &addts.tsmIE,sizeof(tSirMacESETSMIE));
646#ifdef FEATURE_WLAN_ESE_UPLOAD
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700647 limSendSmeTsmIEInd(pMac, psessionEntry, addts.tsmIE.tsid,
648 addts.tsmIE.state, addts.tsmIE.msmt_interval);
649#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700650 limActivateTSMStatsTimer(pMac, psessionEntry);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800651#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700652 }
653#endif
654 /* Since AddTS response was successful, check for the PSB flag
655 * and directional flag inside the TS Info field.
656 * An AC is trigger enabled AC if the PSB subfield is set to 1
657 * in the uplink direction.
658 * An AC is delivery enabled AC if the PSB subfield is set to 1
659 * in the downlink direction.
660 * An AC is trigger and delivery enabled AC if the PSB subfield
661 * is set to 1 in the bi-direction field.
662 */
663 if (addts.tspec.tsinfo.traffic.psb == 1)
664 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, SET_UAPSD_MASK);
665 else
666 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, CLEAR_UAPSD_MASK);
667
668
669 /* ADDTS success, so AC is now admitted. We shall now use the default
670 * EDCA parameters as advertised by AP and send the updated EDCA params
671 * to HAL.
672 */
673 ac = upToAc(addts.tspec.tsinfo.traffic.userPrio);
674 if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK)
675 {
676 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
677 }
678 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK)
679 {
680 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
681 }
682 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR)
683 {
684 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
685 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
686 }
687
688 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
689
690 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
691 if (pStaDs != NULL)
692 {
693 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
694 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
695 else
696 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
697 }
698 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700699 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700700
701
702 sirCopyMacAddr(peerMacAddr,psessionEntry->bssId);
703
704 //if schedule is not present then add TSPEC with svcInterval as 0.
705 if(!addts.schedulePresent)
706 addts.schedule.svcInterval = 0;
707 if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, &addts.tspec, addts.schedule.svcInterval, &tspecInfo))
708 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700709 PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700710 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
711 psessionEntry);
712 pMac->lim.gLimAddtsSent = false;
713 return; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status.
714 }
715 if((addts.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA) ||
Madan Mohan Koyyalamudi198ade32013-09-29 03:52:25 +0530716 ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700717 {
718 retval = limSendHalMsgAddTs(pMac, pSta->staIndex, tspecInfo->idx, addts.tspec, psessionEntry->peSessionId);
719 if(eSIR_SUCCESS != retval)
720 {
721 limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecInfo->idx);
722
723 // Send DELTS action frame to AP
724 cfgLen = sizeof(tSirMacAddr);
725 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
726 psessionEntry);
727 limSendSmeAddtsRsp(pMac, true, retval, psessionEntry, addts.tspec,
728 psessionEntry->smeSessionId, psessionEntry->transactionId);
729 pMac->lim.gLimAddtsSent = false;
730 return;
731 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700732 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700733 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
734 }
735 else
736 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700737 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700738 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700739 PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700740 // Use the smesessionId and smetransactionId from the PE session context
741 limSendSmeAddtsRsp(pMac, true, eSIR_SME_SUCCESS, psessionEntry, addts.tspec,
742 psessionEntry->smeSessionId, psessionEntry->transactionId);
743 }
744
745 // clear the addts flag
746 pMac->lim.gLimAddtsSent = false;
747 return;
748}
749
750
751static void
752__limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
753{
754 tSirRetStatus retval;
755 tSirDeltsReqInfo delts;
756 tpSirMacMgmtHdr pHdr;
757 tpDphHashNode pSta;
758 tANI_U32 frameLen;
759 tANI_U16 aid;
760 tANI_U8 *pBody;
761 tANI_U8 tsStatus;
762 tSirMacTSInfo *tsinfo;
763 tANI_U8 tspecIdx;
764 tANI_U8 ac;
765 tpDphHashNode pStaDs = NULL;
766
767
768 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
769 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
770 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
771
772 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
773 if (pSta == NULL)
774 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700775 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700776 return;
777 }
778
779 // parse the delts request
780 retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts);
781 if (retval != eSIR_SUCCESS)
782 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700783 PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700784 return;
785 }
786
787 if (delts.wmeTspecPresent)
788 {
789 if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
790 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700791 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700792 return;
793 }
Abhishek Singh525045c2014-12-15 17:18:45 +0530794 limLog(pMac, LOG1, FL("WME Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700795 }
796 else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled)
797 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530798 limLog(pMac, LOG1, FL("11e QoS Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700799 }
800 else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled)
801 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530802 limLog(pMac, LOG1, FL("WSM Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700803 }
804 else
805 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700806 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700807 return;
808 }
809
810 tsinfo = delts.wmeTspecPresent ? &delts.tspec.tsinfo : &delts.tsinfo;
811
812 // if no Admit Control, ignore the request
813 if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA))
814 {
815
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530816 if (upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC)
Jeff Johnson295189b2012-06-20 16:38:30 -0700817 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700818 limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700819 tsinfo->traffic.userPrio);
820 return;
821 }
822 }
823
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530824 if ((psessionEntry->limSystemRole != eLIM_AP_ROLE) &&
825 (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
826 limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry);
827
Jeff Johnson295189b2012-06-20 16:38:30 -0700828 // try to delete the TS
829 if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx))
830 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700831 PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700832 return;
833 }
834
835 else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
836 (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH))
837 {
838 //Edca only for now.
839 }
840 else
841 {
842 //send message to HAL to delete TS
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530843 if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac,
844 pSta->staIndex,
845 tspecIdx,
846 delts,
847 psessionEntry->peSessionId,
848 psessionEntry->bssId))
Jeff Johnson295189b2012-06-20 16:38:30 -0700849 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700850 limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700851 tsinfo->traffic.userPrio);
852 return;
853 }
854 }
855
856 /* We successfully deleted the TSPEC. Update the dynamic UAPSD Mask.
857 * The AC for this TSPEC is no longer trigger enabled if this Tspec
858 * was set-up in uplink direction only.
859 * The AC for this TSPEC is no longer delivery enabled if this Tspec
860 * was set-up in downlink direction only.
861 * The AC for this TSPEC is no longer triiger enabled and delivery
862 * enabled if this Tspec was a bidirectional TSPEC.
863 */
864 limSetTspecUapsdMask(pMac, tsinfo, CLEAR_UAPSD_MASK);
865
866
867 /* We're deleting the TSPEC.
868 * The AC for this TSPEC is no longer admitted in uplink/downlink direction
869 * if this TSPEC was set-up in uplink/downlink direction only.
870 * The AC for this TSPEC is no longer admitted in both uplink and downlink
871 * directions if this TSPEC was a bi-directional TSPEC.
872 * If ACM is set for this AC and this AC is admitted only in downlink
873 * direction, PE needs to downgrade the EDCA parameter
874 * (for the AC for which TS is being deleted) to the
875 * next best AC for which ACM is not enabled, and send the
876 * updated values to HAL.
877 */
878 ac = upToAc(tsinfo->traffic.userPrio);
879
880 if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK)
881 {
882 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
883 }
884 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK)
885 {
886 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
887 }
888 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR)
889 {
890 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
891 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
892 }
893
894 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
895
896 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
897 if (pStaDs != NULL)
898 {
899 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
900 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
901 else
902 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
903 }
904 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700905 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700906
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530907 limLog(pMac, LOG1, FL("DeleteTS succeeded"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700908
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800909#ifdef FEATURE_WLAN_ESE
910#ifdef FEATURE_WLAN_ESE_UPLOAD
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700911 limSendSmeTsmIEInd(pMac, psessionEntry, 0, 0, 0);
912#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700913 limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800914#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700915#endif
916
917}
918
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700919static void
920__limProcessQosMapConfigureFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,
921 tpPESession psessionEntry)
922{
923 tpSirMacMgmtHdr pHdr;
924 tANI_U32 frameLen;
925 tANI_U8 *pBody;
926 tSirRetStatus retval;
927 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
928 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
929 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
930 retval = sirConvertQosMapConfigureFrame2Struct(pMac, pBody, frameLen,
Kumar Anand82c009f2014-05-29 00:29:42 -0700931 &psessionEntry->QosMapSet);
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700932 if (retval != eSIR_SUCCESS)
933 {
934 PELOGW(limLog(pMac, LOGE,
935 FL("QosMapConfigure frame parsing failed (error %d)"), retval);)
936 return;
937 }
Naveen Rawat71e1a2e2015-07-28 16:11:21 +0530938 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
939 pRxPacketInfo, psessionEntry, 0);
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700940}
Jeff Johnson295189b2012-06-20 16:38:30 -0700941
942#ifdef ANI_SUPPORT_11H
943/**
944 * limProcessBasicMeasReq
945 *
946 *FUNCTION:
947 * This function is called by limProcessMeasurementRequestFrame()
948 * when it received a Basic measurement Request action frame.
949 * Station/BP receiving this should perform basic measurements
950 * and then send Basic Measurement Report. AP should not perform
951 * any measurements, and send report indicating refusal.
952 *
953 *LOGIC:
954 *
955 *ASSUMPTIONS:
956 *
957 *NOTE:
958 *
959 * @param pMac - Pointer to Global MAC structure
960 * @param pMeasReqFrame - A pointer to Basic Meas. Req structure
961 * @return None
962 */
963static void
964__limProcessBasicMeasReq(tpAniSirGlobal pMac,
965 tpSirMacMeasReqActionFrame pMeasReqFrame,
966 tSirMacAddr peerMacAddr)
967{
968 // TBD - Station shall perform basic measurements
969
970 if (limSendMeasReportFrame(pMac,
971 pMeasReqFrame,
972 peerMacAddr) != eSIR_SUCCESS)
973 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700974 PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700975 return;
976 }
977}
978
979
980/**
981 * limProcessCcaMeasReq
982 *
983 *FUNCTION:
984 * This function is called by limProcessMeasurementRequestFrame()
985 * when it received a CCA measurement Request action frame.
986 * Station/BP receiving this should perform CCA measurements
987 * and then send CCA Measurement Report. AP should not perform
988 * any measurements, and send report indicating refusal.
989 *
990 *LOGIC:
991 *
992 *ASSUMPTIONS:
993 *
994 *NOTE:
995 *
996 * @param pMac - Pointer to Global MAC structure
997 * @param pMeasReqFrame - A pointer to CCA Meas. Req structure
998 * @return None
999 */
1000static void
1001__limProcessCcaMeasReq(tpAniSirGlobal pMac,
1002 tpSirMacMeasReqActionFrame pMeasReqFrame,
1003 tSirMacAddr peerMacAddr)
1004{
1005 // TBD - Station shall perform cca measurements
1006
1007 if (limSendMeasReportFrame(pMac,
1008 pMeasReqFrame,
1009 peerMacAddr) != eSIR_SUCCESS)
1010 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001011 PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001012 return;
1013 }
1014}
1015
1016
1017/**
1018 * __limProcessRpiMeasReq
1019 *
1020 *FUNCTION:
1021 * This function is called by limProcessMeasurementRequestFrame()
1022 * when it received a RPI measurement Request action frame.
1023 * Station/BP/AP receiving this shall not perform any measurements,
1024 * and send report indicating refusal.
1025 *
1026 *LOGIC:
1027 *
1028 *ASSUMPTIONS:
1029 *
1030 *NOTE:
1031 *
1032 * @param pMac - Pointer to Global MAC structure
1033 * @param pMeasReqFrame - A pointer to RPI Meas. Req structure
1034 * @return None
1035 */
1036static void
1037__limProcessRpiMeasReq(tpAniSirGlobal pMac,
1038 tpSirMacMeasReqActionFrame pMeasReqFrame,
1039 tSirMacAddr peerMacAddr)
1040{
1041 if (limSendMeasReportFrame(pMac,
1042 pMeasReqFrame,
1043 peerMacAddr) != eSIR_SUCCESS)
1044 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001045 PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001046 return;
1047 }
1048}
1049
1050
1051/**
1052 * __limProcessMeasurementRequestFrame
1053 *
1054 *FUNCTION:
1055 *
1056 *LOGIC:
1057 *
1058 *ASSUMPTIONS:
1059 *
1060 *NOTE:
1061 *
1062 * @param pMac - Pointer to Global MAC structure
1063 * @param *pRxPacketInfo - A pointer to packet info structure
1064 * @return None
1065 */
1066
1067static void
1068__limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1069{
1070 tpSirMacMgmtHdr pHdr;
1071 tANI_U8 *pBody;
1072 tpSirMacMeasReqActionFrame pMeasReqFrame;
1073 tANI_U32 frameLen;
1074
1075 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1076 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1077 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1078
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301079 pMeasReqFrame = vos_mem_malloc(sizeof( tSirMacMeasReqActionFrame ));
1080 if (NULL == pMeasReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001081 {
1082 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301083 FL("limProcessMeasurementRequestFrame: AllocateMemory failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001084 return;
1085 }
1086
1087 if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) !=
1088 eSIR_SUCCESS)
1089 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001090 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001091 return;
1092 }
1093
1094
1095 switch(pMeasReqFrame->measReqIE.measType)
1096 {
1097 case SIR_MAC_BASIC_MEASUREMENT_TYPE:
1098 __limProcessBasicMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1099 break;
1100
1101 case SIR_MAC_CCA_MEASUREMENT_TYPE:
1102 __limProcessCcaMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1103 break;
1104
1105 case SIR_MAC_RPI_MEASUREMENT_TYPE:
1106 __limProcessRpiMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1107 break;
1108
1109 default:
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301110 limLog(pMac, LOG1, FL("Unknown Measurement Type %d "),
1111 pMeasReqFrame->measReqIE.measType);
Jeff Johnson295189b2012-06-20 16:38:30 -07001112 break;
1113 }
1114
1115} /*** end limProcessMeasurementRequestFrame ***/
1116
1117
1118/**
1119 * limProcessTpcRequestFrame
1120 *
1121 *FUNCTION:
1122 * This function is called upon receiving Tpc Request frame.
1123 *
1124 *NOTE:
1125 *
1126 * @param pMac - Pointer to Global MAC structure
1127 * @param *pRxPacketInfo - A pointer to packet info structure
1128 * @return None
1129 */
1130
1131static void
1132__limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1133{
1134 tpSirMacMgmtHdr pHdr;
1135 tANI_U8 *pBody;
1136 tpSirMacTpcReqActionFrame pTpcReqFrame;
1137 tANI_U32 frameLen;
1138
1139 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1140 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1141 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1142
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301143 limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001144
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301145 pTpcReqFrame = vos_mem_malloc(sizeof( tSirMacTpcReqActionFrame ));
1146 if (NULL == pTpcReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001147 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301148 PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001149 return;
1150 }
1151
1152 if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) !=
1153 eSIR_SUCCESS)
1154 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001155 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001156 return;
1157 }
1158
1159 if (limSendTpcReportFrame(pMac,
1160 pTpcReqFrame,
1161 pHdr->sa) != eSIR_SUCCESS)
1162 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001163 PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001164 return;
1165 }
1166}
1167#endif
1168
1169
1170/**
1171 * \brief Validate an ADDBA Req from peer with respect
1172 * to our own BA configuration
1173 *
1174 * \sa __limValidateAddBAParameterSet
1175 *
1176 * \param pMac The global tpAniSirGlobal object
1177 *
1178 * \param baParameterSet The ADDBA Parameter Set.
1179 *
1180 * \param pDelBAFlag this parameter is NULL except for call from processAddBAReq
1181 * delBAFlag is set when entry already exists.
1182 *
1183 * \param reqType ADDBA Req v/s ADDBA Rsp
1184 * 1 - ADDBA Req
1185 * 0 - ADDBA Rsp
1186 *
1187 * \return eSIR_SUCCESS if setup completes successfully
1188 * eSIR_FAILURE is some problem is encountered
1189 */
1190
1191static tSirMacStatusCodes
1192__limValidateAddBAParameterSet( tpAniSirGlobal pMac,
1193 tpDphHashNode pSta,
1194 tDot11fFfAddBAParameterSet baParameterSet,
1195 tANI_U8 dialogueToken,
1196 tLimAddBaValidationReqType reqType ,
1197 tANI_U8* pDelBAFlag /*this parameter is NULL except for call from processAddBAReq*/)
1198{
1199 if(baParameterSet.tid >= STACFG_MAX_TC)
1200 {
1201 return eSIR_MAC_WME_INVALID_PARAMS_STATUS;
1202 }
1203
1204 //check if there is already a BA session setup with this STA/TID while processing AddBaReq
1205 if((true == pSta->tcCfg[baParameterSet.tid].fUseBARx) &&
1206 (LIM_ADDBA_REQ == reqType))
1207 {
1208 //There is already BA session setup for STA/TID.
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001209 limLog( pMac, LOGE,
Jeff Johnson295189b2012-06-20 16:38:30 -07001210 FL( "AddBAReq rcvd when there is already a session for this StaId = %d, tid = %d\n " ),
1211 pSta->staIndex, baParameterSet.tid);
1212 limPrintMacAddr( pMac, pSta->staAddr, LOGW );
1213
1214 if(pDelBAFlag)
1215 *pDelBAFlag = true;
1216 }
1217 return eSIR_MAC_SUCCESS_STATUS;
1218}
1219
1220/**
1221 * \brief Validate a DELBA Ind from peer with respect
1222 * to our own BA configuration
1223 *
1224 * \sa __limValidateDelBAParameterSet
1225 *
1226 * \param pMac The global tpAniSirGlobal object
1227 *
1228 * \param baParameterSet The DELBA Parameter Set.
1229 *
1230 * \param pSta Runtime, STA-related configuration cached
1231 * in the HashNode object
1232 *
1233 * \return eSIR_SUCCESS if setup completes successfully
1234 * eSIR_FAILURE is some problem is encountered
1235 */
1236static tSirMacStatusCodes
1237__limValidateDelBAParameterSet( tpAniSirGlobal pMac,
1238 tDot11fFfDelBAParameterSet baParameterSet,
1239 tpDphHashNode pSta )
1240{
1241tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS;
1242
1243 // Validate if a BA is active for the requested TID
1244 if( pSta->tcCfg[baParameterSet.tid].fUseBATx ||
1245 pSta->tcCfg[baParameterSet.tid].fUseBARx )
1246 {
1247 statusCode = eSIR_MAC_SUCCESS_STATUS;
1248
1249 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001250 FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001251 }
1252 else
1253 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001254 FL("Received an INVALID DELBA Ind for TID %d..."),
Jeff Johnson295189b2012-06-20 16:38:30 -07001255 baParameterSet.tid );
1256
1257 return statusCode;
1258}
1259
1260/**
1261 * \brief Process an ADDBA REQ
1262 *
1263 * \sa limProcessAddBAReq
1264 *
1265 * \param pMac The global tpAniSirGlobal object
1266 *
1267 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1268 *
1269 * \return none
1270 *
1271 */
1272static void
1273__limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1274{
1275 tDot11fAddBAReq frmAddBAReq;
1276 tpSirMacMgmtHdr pHdr;
1277 tpDphHashNode pSta;
1278 tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS;
1279 tANI_U16 aid;
SaidiReddy Yenugac341fbf2017-02-01 20:22:45 +05301280 tANI_U32 frameLen, nStatus,val, val1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001281 tANI_U8 *pBody;
1282 tANI_U8 delBAFlag =0;
1283
1284 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1285 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1286 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001287 val = 0;
SaidiReddy Yenugac341fbf2017-02-01 20:22:45 +05301288 val1 = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07001289
1290 // Unpack the received frame
1291 nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq );
1292 if( DOT11F_FAILED( nStatus ))
1293 {
1294 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001295 FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001296 nStatus,
1297 frameLen );
1298
1299 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1300
1301 // Without an unpacked request we cannot respond, so silently ignore the request
1302 return;
1303 }
1304 else if ( DOT11F_WARNED( nStatus ) )
1305 {
1306 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001307 FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001308 nStatus,
1309 frameLen );
1310
1311 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1312 }
1313
Kiran Kumar Lokere2ac471f2013-05-30 16:08:48 -07001314 psessionEntry->amsduSupportedInBA = frmAddBAReq.AddBAParameterSet.amsduSupported;
1315
Jeff Johnson295189b2012-06-20 16:38:30 -07001316 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1317 if( pSta == NULL )
1318 {
1319 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001320 FL( "STA context not found - ignoring ADDBA from " ));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001321 limPrintMacAddr( pMac, pHdr->sa, LOGE );
Jeff Johnson295189b2012-06-20 16:38:30 -07001322
1323 // FIXME - Should we do this?
1324 status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS;
1325 goto returnAfterError;
1326 }
Abhishek Singh02d9f6c2014-05-12 14:07:53 +05301327 limLog( pMac, LOG1, FL( "ADDBA Req from STA "MAC_ADDRESS_STR " with AID %d"
1328 " tid = %d policy = %d buffsize = %d"
1329 " amsduSupported = %d"), MAC_ADDR_ARRAY(pHdr->sa),
1330 aid, frmAddBAReq.AddBAParameterSet.tid,
1331 frmAddBAReq.AddBAParameterSet.policy,
1332 frmAddBAReq.AddBAParameterSet.bufferSize,
1333 frmAddBAReq.AddBAParameterSet.amsduSupported);
Jeff Johnson295189b2012-06-20 16:38:30 -07001334
Abhishek Singh1f6e6532014-06-05 17:35:08 +05301335 limLog( pMac, LOG1, FL( "ssn = %d fragNumber = %d" ),
1336 frmAddBAReq.BAStartingSequenceControl.ssn,
1337 frmAddBAReq.BAStartingSequenceControl.fragNumber);
1338
Jeff Johnson295189b2012-06-20 16:38:30 -07001339#ifdef WLAN_SOFTAP_VSTA_FEATURE
1340 // we can only do BA on "hard" STAs
1341 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1342 {
1343 status = eSIR_MAC_REQ_DECLINED_STATUS;
Sravan Kumar Kairamcebb2182016-01-25 20:50:11 +05301344 limLog( pMac, LOG1,
1345 FL( "ta Id is not HW Sta Id, Status code is %d " ), status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001346 goto returnAfterError;
1347 }
1348#endif //WLAN_SOFTAP_VSTA_FEATURE
1349
SaidiReddy Yenugac341fbf2017-02-01 20:22:45 +05301350 if (wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_TX_RX_AGGREGATION, &val1) !=
1351 eSIR_SUCCESS)
1352 {
1353 limLog(pMac, LOGE,
1354 FL("Unable to get WNI_CFG_ENABLE_TX_RX_AGGREGATION"));
1355 val1 = 1;
1356 }
1357 if (!val1)
1358 {
1359 limLog(pMac, LOGE,
1360 FL("aggregation disabled - ignoring ADDBA"));
1361 goto returnAfterError;
1362 }
1363
c_hpothu3ba2a512014-08-06 14:02:54 +05301364 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 -07001365 eSIR_SUCCESS)
1366 {
1367 limLog(pMac, LOGE,
c_hpothu3ba2a512014-08-06 14:02:54 +05301368 FL("Unable to get WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC"));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001369 val = 0;
1370 }
1371 if ((SIR_BAND_2_4_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) &&
1372 val)
1373 {
1374 limLog( pMac, LOGW,
1375 FL( "BTC disabled aggregation - ignoring ADDBA from " ));
1376 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1377
1378 status = eSIR_MAC_REQ_DECLINED_STATUS;
1379 goto returnAfterError;
1380 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001381
1382 // Now, validate the ADDBA Req
1383 if( eSIR_MAC_SUCCESS_STATUS !=
1384 (status = __limValidateAddBAParameterSet( pMac, pSta,
1385 frmAddBAReq.AddBAParameterSet,
1386 0, //dialogue token is don't care in request validation.
1387 LIM_ADDBA_REQ, &delBAFlag)))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301388 {
1389 limLog( pMac, LOGE,
1390 FL( "ADDBA parameters validation failed with status %d" ), status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001391 goto returnAfterError;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301392 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001393
1394 //BA already set, so we need to delete it before adding new one.
1395 if(delBAFlag)
1396 {
1397 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1398 pSta,
1399 (tANI_U8)frmAddBAReq.AddBAParameterSet.tid,
1400 eBA_RECIPIENT,psessionEntry))
1401 {
1402 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301403 limLog( pMac, LOGE,
1404 FL( "Deletion of Existing BA session failed with status %d" ),
1405 status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001406 goto returnAfterError;
1407 }
1408 }
1409
1410 // Check if the ADD BA Declined configuration is Disabled
1411 if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001412 limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001413 frmAddBAReq.AddBAParameterSet.tid);
1414 status = eSIR_MAC_REQ_DECLINED_STATUS;
1415 goto returnAfterError;
1416 }
1417
1418 //
1419 // Post WDA_ADDBA_REQ to HAL.
1420 // If HAL/HDD decide to allow this ADDBA Req session,
1421 // then this BA session is termed active
1422 //
1423
1424 // Change the Block Ack state of this STA to wait for
1425 // ADDBA Rsp from HAL
1426 LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001427
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001428 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001429 {
1430 limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001431 return ;
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001432 }
1433
1434
1435 if (frmAddBAReq.AddBAParameterSet.bufferSize)
1436 {
1437 frmAddBAReq.AddBAParameterSet.bufferSize =
1438 VOS_MIN(val, frmAddBAReq.AddBAParameterSet.bufferSize);
1439 }
1440 else
1441 {
1442 frmAddBAReq.AddBAParameterSet.bufferSize = val;
1443 }
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001444 limLog( pMac, LOG1, FL( "ADDBAREQ NUMBUFF %d" ),
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001445 frmAddBAReq.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001446
1447 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1448 pSta,
1449 (tANI_U8) frmAddBAReq.DialogToken.token,
1450 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1451 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1452 frmAddBAReq.AddBAParameterSet.bufferSize,
1453 frmAddBAReq.BATimeout.timeout,
1454 (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn,
1455 eBA_RECIPIENT,psessionEntry))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301456 {
1457 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1458 limLog( pMac, LOGE,
1459 FL( "Request to setup new BA session with peer "
1460 " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr));
1461 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001462 else
1463 return;
1464
1465returnAfterError:
1466
1467 //
1468 // Package LIM_MLM_ADDBA_RSP to MLME, with proper
1469 // status code. MLME will then send an ADDBA RSP
1470 // over the air to the peer MAC entity
1471 //
1472 if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac,
1473 pHdr->sa,
1474 status,
1475 frmAddBAReq.DialogToken.token,
1476 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1477 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1478 frmAddBAReq.AddBAParameterSet.bufferSize,
1479 frmAddBAReq.BATimeout.timeout,psessionEntry))
1480 {
1481 limLog( pMac, LOGW,
1482 FL( "Failed to post LIM_MLM_ADDBA_RSP to " ));
1483 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1484 }
1485
1486}
1487
1488/**
1489 * \brief Process an ADDBA RSP
1490 *
1491 * \sa limProcessAddBARsp
1492 *
1493 * \param pMac The global tpAniSirGlobal object
1494 *
1495 * \param pRxPacketInfo Handle to the packet info structure from HDD
1496 *
1497 * \return none
1498 *
1499 */
1500static void
1501__limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1502{
1503tDot11fAddBARsp frmAddBARsp;
1504tpSirMacMgmtHdr pHdr;
1505tpDphHashNode pSta;
1506tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1507tANI_U16 aid;
1508tANI_U32 frameLen, nStatus;
1509tANI_U8 *pBody;
1510
1511 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1512 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1513 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1514
1515 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1516 if( pSta == NULL )
1517 {
1518 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001519 FL( "STA context not found - ignoring ADDBA from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001520 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1521 return;
1522 }
1523
1524#ifdef WLAN_SOFTAP_VSTA_FEATURE
1525 // We can only do BA on "hard" STAs. We should not have issued an ADDBA
1526 // Request, so we should never be processing a ADDBA Response
1527 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1528 {
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301529 limLog( pMac, LOGE, FL( "Sta Id is not HW Sta Id " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001530 return;
1531 }
1532#endif //WLAN_SOFTAP_VSTA_FEATURE
1533
1534 // Unpack the received frame
1535 nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp );
1536 if( DOT11F_FAILED( nStatus ))
1537 {
1538 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001539 FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001540 nStatus,
1541 frameLen );
1542
1543 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1544 goto returnAfterError;
1545 }
1546 else if ( DOT11F_WARNED( nStatus ) )
1547 {
1548 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001549 FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001550 nStatus,
1551 frameLen );
1552
1553 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1554 }
1555
Abhishek Singh02d9f6c2014-05-12 14:07:53 +05301556 limLog( pMac, LOG1, FL( "ADDBA Rsp from STA "MAC_ADDRESS_STR " with AID %d "
1557 "tid = %d policy = %d buffsize = %d "
1558 "amsduSupported = %d status = %d"),
1559 MAC_ADDR_ARRAY(pHdr->sa), aid,
1560 frmAddBARsp.AddBAParameterSet.tid,
1561 frmAddBARsp.AddBAParameterSet.policy,
1562 frmAddBARsp.AddBAParameterSet.bufferSize,
1563 frmAddBARsp.AddBAParameterSet.amsduSupported,
1564 frmAddBARsp.Status.status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001565 //if there is no matchin dialougue token then ignore the response.
1566
1567 if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token,
1568 pSta->assocId, frmAddBARsp.AddBAParameterSet.tid))
1569 {
Abhishek Singh6f09e702016-01-28 15:15:04 +05301570 limLog(pMac, LOGE,
1571 FL("dialogueToken in received addBARsp did not match with outstanding requests"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001572 return;
1573 }
1574
1575 // Check first if the peer accepted the ADDBA Req
1576 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1577 {
Kaushik, Sushant335328c2014-07-31 19:15:31 +05301578 tANI_U32 val;
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301579 pMac->lim.staBaInfo[pSta->staIndex].
1580 failed_count[frmAddBARsp.AddBAParameterSet.tid] = 0;
1581 pMac->lim.staBaInfo[pSta->staIndex].
1582 failed_timestamp[frmAddBARsp.AddBAParameterSet.tid] = 0;
Kaushik, Sushant335328c2014-07-31 19:15:31 +05301583 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
1584 {
1585 limLog(pMac, LOG1, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
1586 goto returnAfterError;
1587 }
1588 if (0 == frmAddBARsp.AddBAParameterSet.bufferSize)
1589 frmAddBARsp.AddBAParameterSet.bufferSize = val;
1590 else
1591 frmAddBARsp.AddBAParameterSet.bufferSize =
1592 VOS_MIN(val, frmAddBARsp.AddBAParameterSet.bufferSize);
1593 limLog( pMac, LOG1,
1594 FL( "ADDBA RSP Buffsize = %d" ),
1595 frmAddBARsp.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001596 // Now, validate the ADDBA Rsp
1597 if( eSIR_MAC_SUCCESS_STATUS !=
1598 __limValidateAddBAParameterSet( pMac, pSta,
1599 frmAddBARsp.AddBAParameterSet,
1600 (tANI_U8)frmAddBARsp.DialogToken.token,
1601 LIM_ADDBA_RSP, NULL))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301602 {
1603 limLog( pMac, LOGE,
1604 FL( "ADDBA parameters validation failed" ));
1605 goto returnAfterError;
1606 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001607 }
1608 else
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301609 {
1610 pMac->lim.staBaInfo[pSta->staIndex].
1611 failed_count[frmAddBARsp.AddBAParameterSet.tid]++;
1612 pMac->lim.staBaInfo[pSta->staIndex].failed_timestamp[
1613 frmAddBARsp.AddBAParameterSet.tid] = jiffies_to_msecs(jiffies);
Jeff Johnson295189b2012-06-20 16:38:30 -07001614 goto returnAfterError;
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301615 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001616 // Change STA state to wait for ADDBA Rsp from HAL
1617 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
1618
1619 //
1620 // Post WDA_ADDBA_REQ to HAL.
1621 // If HAL/HDD decide to allow this ADDBA Rsp session,
1622 // then this BA session is termed active
1623 //
1624
1625 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1626 pSta,
1627 (tANI_U8) frmAddBARsp.DialogToken.token,
1628 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1629 (tANI_U8) frmAddBARsp.AddBAParameterSet.policy,
1630 frmAddBARsp.AddBAParameterSet.bufferSize,
1631 frmAddBARsp.BATimeout.timeout,
1632 0,
1633 eBA_INITIATOR,psessionEntry))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301634 {
1635 reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1636 limLog( pMac, LOGE,
1637 FL( "Request to setup new BA session with peer "
1638 " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr));
1639 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001640 else
1641 return;
1642
1643returnAfterError:
1644
1645 // TODO: Do we need to signal an error status to SME,
1646 // if status != eSIR_MAC_SUCCESS_STATUS
1647
1648 // Restore STA "BA" State
1649 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE);
1650 //
1651 // Need to send a DELBA IND to peer, who
1652 // would have setup a BA session with this STA
1653 //
1654 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1655 {
1656 //
1657 // Package LIM_MLM_DELBA_REQ to MLME, with proper
1658 // status code. MLME will then send a DELBA IND
1659 // over the air to the peer MAC entity
1660 //
1661 if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac,
1662 pSta,
1663 eBA_INITIATOR,
1664 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1665 reasonCode, psessionEntry))
1666 {
1667 limLog( pMac, LOGW,
1668 FL( "Failed to post LIM_MLM_DELBA_REQ to " ));
1669 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1670 }
1671 }
1672}
1673
1674/**
1675 * \brief Process a DELBA Indication
1676 *
1677 * \sa limProcessDelBAInd
1678 *
1679 * \param pMac The global tpAniSirGlobal object
1680 *
1681 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1682 *
1683 * \return none
1684 *
1685 */
1686static void
1687__limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1688{
1689tDot11fDelBAInd frmDelBAInd;
1690tpSirMacMgmtHdr pHdr;
1691tpDphHashNode pSta;
1692tANI_U16 aid;
1693tANI_U32 frameLen, nStatus;
1694tANI_U8 *pBody;
1695
1696 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1697 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1698 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1699
1700 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1701 if( pSta == NULL )
1702 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001703 limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001704 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1705 return;
1706 }
1707
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001708 limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid );
Jeff Johnson295189b2012-06-20 16:38:30 -07001709
1710 // Unpack the received frame
1711 nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd );
1712 if( DOT11F_FAILED( nStatus ))
1713 {
1714 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001715 FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001716 nStatus,
1717 frameLen );
1718
1719 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1720 return;
1721 }
1722 else if ( DOT11F_WARNED( nStatus ) )
1723 {
1724 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001725 FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001726 nStatus,
1727 frameLen );
1728
1729 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1730 }
1731
Abhishek Singh1f6e6532014-06-05 17:35:08 +05301732 limLog( pMac, LOG1,
1733 FL( "Received DELBA from: "MAC_ADDRESS_STR" for TID %d, Reason code %d" ),
1734 MAC_ADDR_ARRAY(pHdr->sa),
Jeff Johnson295189b2012-06-20 16:38:30 -07001735 frmDelBAInd.DelBAParameterSet.tid,
1736 frmDelBAInd.Reason.code );
1737
1738 // Now, validate the DELBA Ind
1739 if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac,
1740 frmDelBAInd.DelBAParameterSet,
1741 pSta ))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301742 {
1743 limLog( pMac, LOGE,
1744 FL( "ADDBA parameters validation failed " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001745 return;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301746 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001747 //
1748 // Post WDA_DELBA_IND to HAL and delete the
1749 // existing BA session
1750 //
1751 // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16
1752 // is kind of confusing...
1753 //
1754 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1755 pSta,
1756 (tANI_U8) frmDelBAInd.DelBAParameterSet.tid,
1757 (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)?
1758 eBA_INITIATOR: eBA_RECIPIENT,psessionEntry))
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001759 limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001760
1761 return;
1762
1763}
1764
1765static void
1766__limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry)
1767{
1768
1769#if 0
1770 tpSirMacMgmtHdr pHdr;
1771 tDot11fSMPowerSave frmSMPower;
1772 tSirMacHTMIMOPowerSaveState state;
1773 tpDphHashNode pSta;
1774 tANI_U16 aid;
1775 tANI_U32 frameLen, nStatus;
1776 tANI_U8 *pBody;
1777
1778 pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd );
1779 pBody = SIR_MAC_BD_TO_MPDUDATA( pBd );
1780 frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd );
1781
1782 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1783 if( pSta == NULL ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001784 limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001785 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1786 return;
1787 }
1788
1789 /**Unpack the received frame */
1790 nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower);
1791
1792 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001793 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001794 nStatus, frameLen );
1795 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1796 return;
1797 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001798 limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001799 nStatus, frameLen );
1800 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1801 }
1802
1803 limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d"
1804 "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En,
1805 frmSMPower.SMPowerModeSet.Mode);
1806
1807 /** Update in the DPH Table about the Update in the SM Power Save mode*/
1808 if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode)
1809 state = eSIR_HT_MIMO_PS_DYNAMIC;
1810 else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0))
1811 state = eSIR_HT_MIMO_PS_STATIC;
1812 else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0))
1813 state = eSIR_HT_MIMO_PS_NO_LIMIT;
1814 else {
1815 PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));)
1816 return;
1817 }
1818
1819 if (state == pSta->htMIMOPSState) {
1820 PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));)
1821 return;
1822 }
1823
1824 /** Update in the HAL Station Table for the Update of the Protection Mode */
1825 pSta->htMIMOPSState = state;
1826 limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState);
1827
1828#endif
1829
1830}
1831
1832#if defined WLAN_FEATURE_VOWIFI
1833
1834static void
1835__limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1836{
1837 tpSirMacMgmtHdr pHdr;
1838 tDot11fRadioMeasurementRequest frm;
1839 tANI_U32 frameLen, nStatus;
1840 tANI_U8 *pBody;
1841
1842 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1843 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1844 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1845
1846 if( psessionEntry == NULL )
1847 {
1848 return;
1849 }
1850
1851 /**Unpack the received frame */
1852 nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm );
1853
1854 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001855 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001856 nStatus, frameLen );
1857 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1858 return;
1859 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001860 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001861 nStatus, frameLen );
1862 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1863 }
1864
1865 // Call rrm function to handle the request.
1866
1867 rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry );
1868}
1869
1870static void
1871__limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1872{
1873 tpSirMacMgmtHdr pHdr;
1874 tDot11fLinkMeasurementRequest frm;
1875 tANI_U32 frameLen, nStatus;
1876 tANI_U8 *pBody;
1877
1878 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1879 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1880 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1881
1882 if( psessionEntry == NULL )
1883 {
1884 return;
1885 }
1886
1887 /**Unpack the received frame */
1888 nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm );
1889
1890 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001891 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001892 nStatus, frameLen );
1893 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1894 return;
1895 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001896 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001897 nStatus, frameLen );
1898 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1899 }
1900
1901 // Call rrm function to handle the request.
1902
1903 rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry );
1904
1905}
1906
1907static void
1908__limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1909{
1910 tpSirMacMgmtHdr pHdr;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001911 tDot11fNeighborReportResponse *pFrm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001912 tANI_U32 frameLen, nStatus;
1913 tANI_U8 *pBody;
1914
1915 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1916 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1917 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1918
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301919 pFrm = vos_mem_malloc(sizeof(tDot11fNeighborReportResponse));
1920 if (NULL == pFrm)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001921 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301922 limLog(pMac, LOGE, FL("Unable to allocate memory in __limProcessNeighborReport") );
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001923 return;
1924 }
1925
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301926 if(psessionEntry == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -07001927 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301928 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001929 return;
1930 }
1931
1932 /**Unpack the received frame */
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001933 nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm );
Jeff Johnson295189b2012-06-20 16:38:30 -07001934
1935 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001936 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001937 nStatus, frameLen );
1938 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301939 vos_mem_free(pFrm);
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001940 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001941 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001942 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001943 nStatus, frameLen );
1944 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1945 }
1946
1947 //Call rrm function to handle the request.
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001948 rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry );
1949
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301950 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001951}
1952
1953#endif
1954
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08001955#ifdef WLAN_FEATURE_AP_HT40_24G
1956static void
1957__limProcess2040bssCoexistenceActionFrame(tpAniSirGlobal pMac,
1958 tANI_U16 sessionId, tANI_U8 *pRxPacketInfo,
1959 tpPESession psessionEntry)
1960{
1961 tpSirMacMgmtHdr pHdr;
1962 tANI_U8 *pBody , i;
1963 tANI_U32 frameLen, nStatus;
1964 tDot11fHT2040BSSCoexistenceManagementActionFrame *pFrm;
1965 tpSirHT2040CoexInfoInd pSirSmeHT2040CoexInfoInd = NULL;
1966 tANI_U16 length;
1967 tSirMsgQ mmhMsg;
1968 tANI_U8 num_channelList;
1969
1970 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1971 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1972 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1973
1974 pFrm =
1975 vos_mem_malloc(sizeof(tDot11fHT2040BSSCoexistenceManagementActionFrame));
1976
1977 if (NULL == pFrm)
1978 {
1979 limLog(pMac, LOGE, FL("Unable to allocate memory"));
1980 return;
1981 }
1982
1983 if(psessionEntry == NULL)
1984 {
1985 vos_mem_free(pFrm);
1986 return;
1987 }
1988
1989 /**Unpack the received frame */
1990 nStatus = dot11fUnpackHT2040BSSCoexistenceManagementActionFrame( pMac,
1991 pBody, frameLen, pFrm );
1992
1993 if( DOT11F_FAILED( nStatus ))
1994 {
1995 limLog( pMac, LOGE, FL( "Failed to unpack and parse a 20/40"
1996 "Coex Action Frame (0x%08x, %d bytes):"),
1997 nStatus, frameLen );
1998 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1999 vos_mem_free(pFrm);
2000 return;
2001 }
2002 else if ( DOT11F_WARNED( nStatus ))
2003 {
2004 limLog(pMac, LOGW, FL( "There were warnings while unpacking a"
2005 " 20/40 Coex Action Frame (0x%08x, %d bytes):"),
2006 nStatus, frameLen );
2007 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
2008 }
2009
2010 num_channelList = pFrm->HT2040BSSIntolerantReport.num_channelList;
2011
2012 if (num_channelList > 0)
2013 {
2014 length = (sizeof(tSirHT2040CoexInfoInd) - sizeof(tANI_U8) +
2015 (num_channelList * sizeof(tANI_U8)));
2016 }
2017 else
2018 length = sizeof(tSirHT2040CoexInfoInd);
2019
2020 limLog(pMac, LOGW,FL("tSirHT2040CoexInfoInd: Length: %d"),length);
2021
2022 pSirSmeHT2040CoexInfoInd = vos_mem_malloc(length);
2023
2024 if (NULL == pSirSmeHT2040CoexInfoInd)
2025 {
2026 limLog(pMac, LOGP,
2027 FL("AllocateMemory failed for eWNI_SME_2040_COEX_IND"));
2028 vos_mem_free(pFrm);
2029 return;
2030 }
2031
2032 vos_mem_set((void*)pSirSmeHT2040CoexInfoInd, length, 0);
2033
2034 pSirSmeHT2040CoexInfoInd->messageType = eWNI_SME_2040_COEX_IND;
2035 pSirSmeHT2040CoexInfoInd->sessionId = sessionId;
2036 pSirSmeHT2040CoexInfoInd->length = length;
2037
2038 if (pFrm->HT2040BSSCoexistence.present)
2039 {
2040
2041 limLog(pMac, LOGW, FL("infoRequest: %d fortyMHzIntolerant: %d"
2042 " twentyMHzBssWidthReq: %d obssScanExemptionReq: %d"
2043 " obssScanExemptionGrant: %d "),
2044 pFrm->HT2040BSSCoexistence.infoRequest,
2045 pFrm->HT2040BSSCoexistence.fortyMHzIntolerant,
2046 pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq,
2047 pFrm->HT2040BSSCoexistence.obssScanExemptionReq,
2048 pFrm->HT2040BSSCoexistence.obssScanExemptionGrant);
2049
2050 pSirSmeHT2040CoexInfoInd->HT40MHzIntolerant =
2051 pFrm->HT2040BSSCoexistence.fortyMHzIntolerant;
2052 pSirSmeHT2040CoexInfoInd->HT20MHzBssWidthReq =
2053 pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq;
2054 }
2055
2056 if (pFrm->HT2040BSSIntolerantReport.present)
2057 {
2058 limLog(pMac, LOGW, FL("operatingClass: %d num_channelList: %d "),
2059 pFrm->HT2040BSSIntolerantReport.operatingClass,
2060 num_channelList);
2061
2062 if (num_channelList > 0)
2063 {
2064 vos_mem_zero(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport,
2065 num_channelList);
2066 vos_mem_copy(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport,
2067 pFrm->HT2040BSSIntolerantReport.channelList,
2068 num_channelList);
2069
2070 pSirSmeHT2040CoexInfoInd->channel_num = num_channelList;
2071 }
2072
2073 for(i=0; i < num_channelList; i++)
2074 {
2075 limLog(pMac, LOGW, FL("Channel : %d "),
2076 pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i]);
2077 }
2078 }
2079
2080 mmhMsg.type = eWNI_SME_2040_COEX_IND;
2081 mmhMsg.bodyptr = pSirSmeHT2040CoexInfoInd;
2082 mmhMsg.bodyval = 0;
Sushant Kaushik87787972015-09-11 16:05:00 +05302083 limLog(pMac, LOGW, FL("Posting eWNI_SME_2040_COEX_IND Message to SME "));
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08002084 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2085
2086 vos_mem_free(pFrm);
2087}
2088#endif
2089
Jeff Johnson295189b2012-06-20 16:38:30 -07002090#ifdef WLAN_FEATURE_11W
2091/**
Chet Lanctot186b5732013-03-18 10:26:30 -07002092 * limProcessSAQueryRequestActionFrame
Jeff Johnson295189b2012-06-20 16:38:30 -07002093 *
2094 *FUNCTION:
2095 * This function is called by limProcessActionFrame() upon
2096 * SA query request Action frame reception.
2097 *
2098 *LOGIC:
2099 *
2100 *ASSUMPTIONS:
2101 *
2102 *NOTE:
2103 *
2104 * @param pMac - Pointer to Global MAC structure
Chet Lanctot186b5732013-03-18 10:26:30 -07002105 * @param *pRxPacketInfo - Handle to the Rx packet info
2106 * @param psessionEntry - PE session entry
2107 *
Jeff Johnson295189b2012-06-20 16:38:30 -07002108 * @return None
2109 */
Chet Lanctot186b5732013-03-18 10:26:30 -07002110static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002111{
2112 tpSirMacMgmtHdr pHdr;
2113 tANI_U8 *pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07002114 tANI_U8 transId[2];
Jeff Johnson295189b2012-06-20 16:38:30 -07002115
2116 /* Prima --- Below Macro not available in prima
2117 pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd);
2118 pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */
2119
2120 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2121 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2122
Chet Lanctot186b5732013-03-18 10:26:30 -07002123 /* If this is an unprotected SA Query Request, then ignore it. */
2124 if (pHdr->fc.wep == 0)
2125 return;
2126
Jeff Johnson295189b2012-06-20 16:38:30 -07002127 /*Extract 11w trsansId from SA query request action frame
2128 In SA query response action frame we will send same transId
2129 In SA query request action frame:
2130 Category : 1 byte
2131 Action : 1 byte
Chet Lanctot186b5732013-03-18 10:26:30 -07002132 Transaction ID : 2 bytes */
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302133 vos_mem_copy(&transId[0], &pBody[2], 2);
Jeff Johnson295189b2012-06-20 16:38:30 -07002134
Jeff Johnson295189b2012-06-20 16:38:30 -07002135 //Send 11w SA query response action frame
2136 if (limSendSaQueryResponseFrame(pMac,
2137 transId,
2138 pHdr->sa,psessionEntry) != eSIR_SUCCESS)
2139 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002140 PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002141 return;
2142 }
2143}
2144
Chet Lanctot186b5732013-03-18 10:26:30 -07002145/**
2146 * __limProcessSAQueryResponseActionFrame
2147 *
2148 *FUNCTION:
2149 * This function is called by limProcessActionFrame() upon
2150 * SA query response Action frame reception.
2151 *
2152 *LOGIC:
2153 *
2154 *ASSUMPTIONS:
2155 *
2156 *NOTE:
2157 *
2158 * @param pMac - Pointer to Global MAC structure
2159 * @param *pRxPacketInfo - Handle to the Rx packet info
2160 * @param psessionEntry - PE session entry
2161 * @return None
2162 */
2163static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
2164{
2165 tpSirMacMgmtHdr pHdr;
Chet Lanctot8cecea22014-02-11 19:09:36 -08002166 tANI_U8 *pBody;
2167 tpDphHashNode pSta;
2168 tANI_U16 aid;
2169 tANI_U16 transId;
2170 tANI_U8 retryNum;
Chet Lanctot186b5732013-03-18 10:26:30 -07002171
2172 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Chet Lanctot8cecea22014-02-11 19:09:36 -08002173 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
Chet Lanctot186b5732013-03-18 10:26:30 -07002174 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
2175 ("SA Query Response received...")) ;
Chet Lanctot186b5732013-03-18 10:26:30 -07002176
Chet Lanctotdd6beeb2014-04-22 11:51:29 -07002177 /* When a station, supplicant handles SA Query Response.
2178 Forward to SME to HDD to wpa_supplicant. */
2179 if (eLIM_STA_ROLE == psessionEntry->limSystemRole)
2180 {
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302181 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2182 pRxPacketInfo, psessionEntry, 0);
Chet Lanctotdd6beeb2014-04-22 11:51:29 -07002183 return;
2184 }
2185
Chet Lanctot8cecea22014-02-11 19:09:36 -08002186 /* If this is an unprotected SA Query Response, then ignore it. */
2187 if (pHdr->fc.wep == 0)
2188 return;
2189
2190 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
2191 if (NULL == pSta)
2192 return;
2193
2194 limLog(pMac, LOG1,
2195 FL("SA Query Response source addr - %0x:%0x:%0x:%0x:%0x:%0x"),
2196 pHdr->sa[0], pHdr->sa[1], pHdr->sa[2], pHdr->sa[3],
2197 pHdr->sa[4], pHdr->sa[5]);
2198 limLog(pMac, LOG1,
2199 FL("SA Query state for station - %d"), pSta->pmfSaQueryState);
2200
2201 if (DPH_SA_QUERY_IN_PROGRESS != pSta->pmfSaQueryState)
2202 return;
2203
2204 /* Extract 11w trsansId from SA query reponse action frame
2205 In SA query response action frame:
2206 Category : 1 byte
2207 Action : 1 byte
2208 Transaction ID : 2 bytes */
2209 vos_mem_copy(&transId, &pBody[2], 2);
2210
2211 /* If SA Query is in progress with the station and the station
2212 responds then the association request that triggered the SA
2213 query is from a rogue station, just go back to initial state. */
2214 for (retryNum = 0; retryNum <= pSta->pmfSaQueryRetryCount; retryNum++)
2215 if (transId == pSta->pmfSaQueryStartTransId + retryNum)
2216 {
2217 limLog(pMac, LOG1,
2218 FL("Found matching SA Query Request - transaction ID %d"), transId);
2219 tx_timer_deactivate(&pSta->pmfSaQueryTimer);
2220 pSta->pmfSaQueryState = DPH_SA_QUERY_NOT_IN_PROGRESS;
2221 break;
2222 }
2223}
Jeff Johnson295189b2012-06-20 16:38:30 -07002224#endif
2225
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002226#ifdef WLAN_FEATURE_11W
2227/**
2228 * limDropUnprotectedActionFrame
2229 *
2230 *FUNCTION:
2231 * This function checks if an Action frame should be dropped since it is
2232 * a Robust Managment Frame, it is unprotected, and it is received on a
2233 * connection where PMF is enabled.
2234 *
2235 *LOGIC:
2236 *
2237 *ASSUMPTIONS:
2238 *
2239 *NOTE:
2240 *
2241 * @param pMac - Global MAC structure
2242 * @param psessionEntry - PE session entry
2243 * @param pHdr - Frame header
2244 * @param category - Action frame category
2245 * @return TRUE if frame should be dropped
2246 */
2247
2248static tANI_BOOLEAN
2249limDropUnprotectedActionFrame (tpAniSirGlobal pMac, tpPESession psessionEntry,
2250 tpSirMacMgmtHdr pHdr, tANI_U8 category)
2251{
2252 tANI_U16 aid;
2253 tpDphHashNode pStaDs;
2254 tANI_BOOLEAN rmfConnection = eANI_BOOLEAN_FALSE;
2255
2256 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) ||
2257 (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
2258 {
2259 pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
2260 if (pStaDs != NULL)
2261 if (pStaDs->rmfEnabled)
2262 rmfConnection = eANI_BOOLEAN_TRUE;
2263 }
2264 else if (psessionEntry->limRmfEnabled)
2265 rmfConnection = eANI_BOOLEAN_TRUE;
2266
2267 if (rmfConnection && (pHdr->fc.wep == 0))
2268 {
2269 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2270 "since RMF is enabled."), category);)
2271 return eANI_BOOLEAN_TRUE;
2272 }
2273 else
2274 return eANI_BOOLEAN_FALSE;
2275}
2276#endif
2277
Jeff Johnson295189b2012-06-20 16:38:30 -07002278/**
2279 * limProcessActionFrame
2280 *
2281 *FUNCTION:
2282 * This function is called by limProcessMessageQueue() upon
2283 * Action frame reception.
2284 *
2285 *LOGIC:
2286 *
2287 *ASSUMPTIONS:
2288 *
2289 *NOTE:
2290 *
2291 * @param pMac - Pointer to Global MAC structure
2292 * @param *pRxPacketInfo - A pointer to packet info structure
2293 * @return None
2294 */
2295
2296void
2297limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
2298{
2299 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2300 tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07002301#ifdef WLAN_FEATURE_11W
2302 tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Abhishek Singh09d4e4a2016-01-12 11:20:22 +05302303
2304 if (lim_is_robust_mgmt_action_frame(pActionHdr->category) &&
2305 limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr,
2306 pActionHdr->category)) {
2307 limLog(pMac, LOGE,
2308 FL("Don't send unprotect action frame to upper layer categ %d "),
2309 pActionHdr->category);
2310 return;
2311 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002312#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002313
Jeff Johnson295189b2012-06-20 16:38:30 -07002314 switch (pActionHdr->category)
2315 {
Selvaraj, Sridharc045b8b2016-04-06 12:22:35 +05302316
2317 /*
2318 * WARNING: If you add Action frame category case here, set the
2319 * corresponding bit to 1 in sme_set_allowed_action_frames() for
2320 * the FW to hand over that frame to host without dropping itself
2321 */
Jeff Johnson295189b2012-06-20 16:38:30 -07002322 case SIR_MAC_ACTION_QOS_MGMT:
Leela Venkata Kiran Kumar Reddy Chiralac7c4e7e2014-04-29 10:50:16 -07002323 if ( (psessionEntry->limQosEnabled) ||
2324 (pActionHdr->actionID == SIR_MAC_QOS_MAP_CONFIGURE) )
Jeff Johnson295189b2012-06-20 16:38:30 -07002325 {
2326 switch (pActionHdr->actionID)
2327 {
2328 case SIR_MAC_QOS_ADD_TS_REQ:
2329 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2330 break;
2331
2332 case SIR_MAC_QOS_ADD_TS_RSP:
2333 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2334 break;
2335
2336 case SIR_MAC_QOS_DEL_TS_REQ:
2337 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2338 break;
2339
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -07002340 case SIR_MAC_QOS_MAP_CONFIGURE:
2341 __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2342 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002343 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302344 limLog(pMac, LOG1,
2345 FL("Qos action %d not handled"),
2346 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002347 break;
2348 }
2349 break ;
2350 }
2351
2352 break;
2353
2354 case SIR_MAC_ACTION_SPECTRUM_MGMT:
2355 switch (pActionHdr->actionID)
2356 {
2357#ifdef ANI_SUPPORT_11H
2358 case SIR_MAC_ACTION_MEASURE_REQUEST_ID:
2359 if(psessionEntry->lim11hEnable)
2360 {
2361 __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo);
2362 }
2363 break;
2364
2365 case SIR_MAC_ACTION_TPC_REQUEST_ID:
2366 if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
2367 (pessionEntry->limSystemRole == eLIM_AP_ROLE))
2368 {
2369 if(psessionEntry->lim11hEnable)
2370 {
2371 __limProcessTpcRequestFrame(pMac, pRxPacketInfo);
2372 }
2373 }
2374 break;
2375
2376#endif
2377 case SIR_MAC_ACTION_CHANNEL_SWITCH_ID:
2378 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
2379 {
2380 __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry);
2381 }
2382 break;
2383 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302384 limLog(pMac, LOG1,
2385 FL("Spectrum mgmt action id %d not handled"),
2386 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002387 break;
2388 }
2389 break;
2390
2391 case SIR_MAC_ACTION_WME:
2392 if (! psessionEntry->limWmeEnabled)
2393 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002394 limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002395 pActionHdr->actionID);
2396 break;
2397 }
2398 switch(pActionHdr->actionID)
2399 {
2400 case SIR_MAC_QOS_ADD_TS_REQ:
2401 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2402 break;
2403
2404 case SIR_MAC_QOS_ADD_TS_RSP:
2405 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2406 break;
2407
2408 case SIR_MAC_QOS_DEL_TS_REQ:
2409 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2410 break;
2411
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -07002412 case SIR_MAC_QOS_MAP_CONFIGURE:
2413 __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2414 break;
2415
Jeff Johnson295189b2012-06-20 16:38:30 -07002416 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302417 limLog(pMac, LOG1, FL("WME action %d not handled"),
2418 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002419 break;
2420 }
2421 break;
2422
2423 case SIR_MAC_ACTION_BLKACK:
2424 // Determine the "type" of BA Action Frame
2425 switch(pActionHdr->actionID)
2426 {
2427 case SIR_MAC_BLKACK_ADD_REQ:
2428 __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2429 break;
2430
2431 case SIR_MAC_BLKACK_ADD_RSP:
2432 __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2433 break;
2434
2435 case SIR_MAC_BLKACK_DEL:
2436 __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2437 break;
2438
2439 default:
2440 break;
2441 }
2442
2443 break;
2444 case SIR_MAC_ACTION_HT:
2445 /** Type of HT Action to be performed*/
2446 switch(pActionHdr->actionID) {
2447 case SIR_MAC_SM_POWER_SAVE:
2448 __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2449 break;
2450 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302451 limLog(pMac, LOG1,
2452 FL("Action ID %d not handled in HT Action category"),
2453 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002454 break;
2455 }
2456 break;
2457
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002458 case SIR_MAC_ACTION_WNM:
2459 {
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002460 PELOGE(limLog(pMac, LOG1, FL("WNM Action category %d action %d."),
2461 pActionHdr->category, pActionHdr->actionID);)
2462 switch (pActionHdr->actionID)
2463 {
2464 case SIR_MAC_WNM_BSS_TM_QUERY:
2465 case SIR_MAC_WNM_BSS_TM_REQUEST:
2466 case SIR_MAC_WNM_BSS_TM_RESPONSE:
2467 case SIR_MAC_WNM_NOTIF_REQUEST:
2468 case SIR_MAC_WNM_NOTIF_RESPONSE:
2469 {
2470 tpSirMacMgmtHdr pHdr;
2471 tANI_S8 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
2472 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2473 /* Forward to the SME to HDD to wpa_supplicant */
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302474 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2475 pRxPacketInfo,
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002476 psessionEntry, rssi);
2477 break;
2478 }
2479 }
2480 break;
2481 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002482#if defined WLAN_FEATURE_VOWIFI
2483 case SIR_MAC_ACTION_RRM:
Abhishek Singhe0bc0992016-05-20 17:58:18 +05302484 /* Ignore RRM measurement request until DHCP is set */
2485 if(pMac->rrm.rrmPEContext.rrmEnable &&
2486 pMac->roam.roamSession[psessionEntry->smeSessionId].dhcp_done)
Jeff Johnson295189b2012-06-20 16:38:30 -07002487 {
2488 switch(pActionHdr->actionID) {
2489 case SIR_MAC_RRM_RADIO_MEASURE_REQ:
2490 __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2491 break;
2492 case SIR_MAC_RRM_LINK_MEASUREMENT_REQ:
2493 __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2494 break;
2495 case SIR_MAC_RRM_NEIGHBOR_RPT:
2496 __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry );
2497 break;
2498 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302499 limLog( pMac, LOG1, FL("Action ID %d not handled in RRM"),
2500 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002501 break;
2502
2503 }
2504 }
2505 else
2506 {
2507 // Else we will just ignore the RRM messages.
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302508 limLog( pMac, LOG1,
Abhishek Singhe0bc0992016-05-20 17:58:18 +05302509 FL("RRM Action frame ignored as rrmEnable is %d or DHCP not completed %d"),
2510 pMac->rrm.rrmPEContext.rrmEnable,
2511 pMac->roam.roamSession[psessionEntry->smeSessionId].dhcp_done);
Jeff Johnson295189b2012-06-20 16:38:30 -07002512 }
2513 break;
2514#endif
Abhishek Singh00b71972016-01-07 10:51:04 +05302515#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) \
2516 || defined (WLAN_FEATURE_RMC)
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002517 case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
2518 {
2519 tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr;
2520 tpSirMacMgmtHdr pHdr;
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002521 tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 };
2522
2523 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002524
2525 //Check if it is a vendor specific action frame.
2526 if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) &&
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302527 (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr,
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002528 &pHdr->da[0], sizeof(tSirMacAddr))) &&
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002529 IS_WES_MODE_ENABLED(pMac) &&
2530 vos_mem_compare(pVendorSpecific->Oui, Oui, 3))
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002531 {
2532 PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"),
2533 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);)
2534 /* Forward to the SME to HDD to wpa_supplicant */
2535 // type is ACTION
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302536 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2537 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302538 psessionEntry, 0);
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002539 }
Abhishek Singh00b71972016-01-07 10:51:04 +05302540#if defined (WLAN_FEATURE_RMC)
2541 else if ((eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) &&
2542 ((VOS_TRUE == vos_mem_compare(SIR_MAC_RMC_MCAST_ADDRESS,
2543 &pHdr->da[0], sizeof(tSirMacAddr))) ||
2544 (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr,
2545 &pHdr->da[0], sizeof(tSirMacAddr)))) &&
2546 vos_mem_compare(pVendorSpecific->Oui, SIR_MAC_RMC_OUI, 3))
2547 {
2548 tANI_U8 MagicCode[] =
2549 { 0x4f, 0x58, 0x59, 0x47, 0x45, 0x4e };
2550 tpSirMacIbssExtNetworkFrameHdr pIbssExtHdr =
2551 (tpSirMacIbssExtNetworkFrameHdr) pActionHdr;
2552
2553 if (vos_mem_compare(pIbssExtHdr->MagicCode,
2554 MagicCode, sizeof(MagicCode)) &&
2555 pIbssExtHdr->version == SIR_MAC_RMC_VER )
2556 {
2557 switch (pIbssExtHdr->actionID)
2558 {
2559 default:
2560 PELOGE(limLog(pMac, LOGE,
2561 FL("Action RMC actionID %d not handled"),
2562 pIbssExtHdr->actionID);)
2563 break;
2564 case SIR_MAC_RMC_RULER_INFORM_SELECTED:
2565 limLog(pMac, LOG1,
2566 FL("Action RMC RULER_INFORM_SELECTED."));
2567 limProcessRMCMessages(pMac,
2568 eLIM_RMC_OTA_RULER_INFORM_SELECTED,
2569 (tANI_U32 *)pRxPacketInfo);
2570 break;
2571 case SIR_MAC_RMC_RULER_INFORM_CANCELLED:
2572 limLog(pMac, LOG1,
2573 FL("Action RMC RULER_INFORM_CANCELLED."));
2574 limProcessRMCMessages(pMac,
2575 eLIM_RMC_OTA_RULER_INFORM_CANCELLED,
2576 (tANI_U32 *)pRxPacketInfo);
2577 break;
2578 }
2579 }
2580 else
2581 {
2582 limLog( pMac, LOG1,
2583 FL("Dropping the vendor specific action frame in IBSS "
2584 "mode because of Ibss Ext Magic mismatch "
2585 MAC_ADDRESS_STR " or Version mismatch = %d"),
2586 MAC_ADDR_ARRAY(pIbssExtHdr->MagicCode),
2587 pIbssExtHdr->version );
2588 }
2589 }
2590#endif /* WLAN_FEATURE_RMC */
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002591 else
2592 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302593 limLog( pMac, LOG1,
2594 FL("Dropping the vendor specific action frame because of( "
2595 "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or "
2596 "not received with SelfSta Mac address) system role = %d"),
2597 IS_WES_MODE_ENABLED(pMac),
2598 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1],
2599 pVendorSpecific->Oui[2],
2600 psessionEntry->limSystemRole );
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002601 }
2602 }
2603 break;
Abhishek Singh00b71972016-01-07 10:51:04 +05302604#endif /* WLAN_FEATURE_VOWIFI_11R || FEATURE_WLAN_ESE ||
2605 FEATURE_WLAN_LFR || WLAN_FEATURE_RMC */
Jeff Johnson295189b2012-06-20 16:38:30 -07002606 case SIR_MAC_ACTION_PUBLIC_USAGE:
2607 switch(pActionHdr->actionID) {
2608 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2609 {
2610 tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002611 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2612
Jeff Johnson295189b2012-06-20 16:38:30 -07002613 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302614 if (vos_mem_compare(pPubAction->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002615 {
2616 /* Forward to the SME to HDD to wpa_supplicant */
2617 // type is ACTION
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302618 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2619 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302620 psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002621 }
2622 else
2623 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302624 limLog( pMac, LOG1,
2625 FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
2626 pPubAction->Oui[0], pPubAction->Oui[1],
2627 pPubAction->Oui[2], pPubAction->Oui[3] );
Jeff Johnson295189b2012-06-20 16:38:30 -07002628 }
2629 }
2630 break;
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08002631#ifdef WLAN_FEATURE_AP_HT40_24G
2632 case SIR_MAC_ACTION_2040_BSS_COEXISTENCE:
2633 {
2634 if (pMac->roam.configParam.apHT40_24GEnabled)
2635 {
2636 limLog( pMac, LOGW, FL("Public Action 20/40 BSS"
2637 "Coexistence Management frame"));
2638
2639 __limProcess2040bssCoexistenceActionFrame(pMac,
2640 psessionEntry->smeSessionId, (tANI_U8 *) pRxPacketInfo,
2641 psessionEntry);
2642 }
2643 break;
2644 }
2645#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002646#ifdef FEATURE_WLAN_TDLS
2647 case SIR_MAC_TDLS_DIS_RSP:
2648 {
Chilam NG571c65a2013-01-19 12:27:36 +05302649 tANI_S8 rssi;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002650
Chilam NG571c65a2013-01-19 12:27:36 +05302651 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002652 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002653 ("Public Action TDLS Discovery RSP ..")) ;
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302654 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2655 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302656 psessionEntry, rssi);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002657 }
2658 break;
2659#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002660
2661 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302662 limLog(pMac, LOG1, FL("Unhandled public action frame -- %x "),
2663 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002664 break;
2665 }
2666 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002667
2668#ifdef WLAN_FEATURE_11W
2669 case SIR_MAC_ACTION_SA_QUERY:
2670 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002671 PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);)
2672 switch (pActionHdr->actionID)
2673 {
2674 case SIR_MAC_SA_QUERY_REQ:
2675 /**11w SA query request action frame received**/
2676 /* Respond directly to the incoming request in LIM */
2677 __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2678 break;
2679 case SIR_MAC_SA_QUERY_RSP:
2680 /**11w SA query response action frame received**/
Chet Lanctot8cecea22014-02-11 19:09:36 -08002681 /* Handle based on the current SA Query state */
Chet Lanctot186b5732013-03-18 10:26:30 -07002682 __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2683 break;
2684 default:
2685 break;
2686 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002687 break;
2688 }
2689#endif
Mohit Khanna4a70d262012-09-11 16:30:12 -07002690#ifdef WLAN_FEATURE_11AC
2691 case SIR_MAC_ACTION_VHT:
2692 {
2693 if (psessionEntry->vhtCapability)
2694 {
2695 switch (pActionHdr->actionID)
2696 {
2697 case SIR_MAC_VHT_OPMODE_NOTIFICATION:
2698 __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry);
2699 break;
2700 default:
2701 break;
2702 }
2703 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002704 break;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -07002705 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002706#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002707 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302708 limLog(pMac, LOG1,
2709 FL("Action category %d not handled"), pActionHdr->category);
Jeff Johnson295189b2012-06-20 16:38:30 -07002710 break;
2711 }
2712}
2713
Jeff Johnson295189b2012-06-20 16:38:30 -07002714/**
2715 * limProcessActionFrameNoSession
2716 *
2717 *FUNCTION:
2718 * This function is called by limProcessMessageQueue() upon
2719 * Action frame reception and no session.
2720 * Currently only public action frames can be received from
2721 * a non-associated station.
2722 *
2723 *LOGIC:
2724 *
2725 *ASSUMPTIONS:
2726 *
2727 *NOTE:
2728 *
2729 * @param pMac - Pointer to Global MAC structure
2730 * @param *pBd - A pointer to Buffer descriptor + associated PDUs
2731 * @return None
2732 */
2733
2734void
2735limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd)
2736{
2737 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd);
2738 tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody;
2739
Mohit Khanna23863762012-09-11 17:40:09 -07002740 limLog( pMac, LOG1, "Received a Action frame -- no session");
Jeff Johnson295189b2012-06-20 16:38:30 -07002741
2742 switch ( pActionHdr->category )
2743 {
2744 case SIR_MAC_ACTION_PUBLIC_USAGE:
2745 switch(pActionHdr->actionID) {
2746 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2747 {
Jeff Johnson295189b2012-06-20 16:38:30 -07002748 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2749
Jeff Johnson295189b2012-06-20 16:38:30 -07002750 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302751 if (vos_mem_compare(pActionHdr->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002752 {
2753 /* Forward to the SME to HDD to wpa_supplicant */
2754 // type is ACTION
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302755 limSendSmeMgmtFrameInd(pMac, 0, pBd, NULL, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002756 }
2757 else
2758 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302759 limLog( pMac, LOG1,
2760 FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
2761 pActionHdr->Oui[0], pActionHdr->Oui[1],
2762 pActionHdr->Oui[2], pActionHdr->Oui[3]);
Jeff Johnson295189b2012-06-20 16:38:30 -07002763 }
2764 }
2765 break;
2766 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302767 limLog(pMac, LOG1,
2768 FL("Unhandled public action frame -- %x "), pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002769 break;
2770 }
2771 break;
2772 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302773 limLog(pMac, LOG1,
2774 FL("Unhandled action frame without session -- %x "),
2775 pActionHdr->category);
2776 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002777
2778 }
2779}