blob: 8b402d13fd3a86a2b246fa17058329614a795153 [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
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530110 limLog(pMac, LOG1, FL("Channel switch Mode == %d"),
111 psessionEntry->gLimChannelSwitch.switchMode);
Jeff Johnson295189b2012-06-20 16:38:30 -0700112
Jeff Johnsone7245742012-09-05 17:12:55 -0700113 if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT ||
114 psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT)
Jeff Johnson295189b2012-06-20 16:38:30 -0700115 {
116 /* Freeze the transmission */
117 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX);
118
119 /*Request for Full power only if the device is in powersave*/
120 if(!limIsSystemInActiveState(pMac))
121 {
122 /* Request Full Power */
123 limSendSmePreChannelSwitchInd(pMac);
124 isFullPowerRequested = 1;
125 }
126 }
127 else
128 {
129 /* Resume the transmission */
130 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX);
131 }
132
Jeff Johnsone7245742012-09-05 17:12:55 -0700133 pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700134 /* change the channel immediatly only if the channel switch count is 0 and the
135 * device is not in powersave
136 * If the device is in powersave channel switch should happen only after the
137 * device comes out of the powersave */
Jeff Johnsone7245742012-09-05 17:12:55 -0700138 if (psessionEntry->gLimChannelSwitch.switchCount == 0)
Jeff Johnson295189b2012-06-20 16:38:30 -0700139 {
140 if(limIsSystemInActiveState(pMac))
141 {
142 limProcessChannelSwitchTimeout(pMac);
143 }
144 else if(!isFullPowerRequested)
145 {
146 /* If the Full power is already not requested
147 * Request Full Power so the channel switch happens
148 * after device comes to full power */
149 limSendSmePreChannelSwitchInd(pMac);
150 }
151 return;
152 }
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -0800153 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700154
Jeff Johnson295189b2012-06-20 16:38:30 -0700155
156 if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS)
157 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700158 limLog(pMac, LOGP, FL("tx_timer_activate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700159 }
160 return;
161}
162
163/**------------------------------------------------------------
164\fn limStartChannelSwitch
165\brief Switches the channel if switch count == 0, otherwise
166 starts the timer for channel switch and stops BG scan
167 and heartbeat timer tempororily.
168
169\param pMac
170\param psessionEntry
171\return NONE
172------------------------------------------------------------*/
173tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
174{
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530175 limLog(pMac, LOG1, FL(" ENTER"));
Padma, Santhosh Kumar071de2d2017-02-02 20:38:03 +0530176
177#ifdef WLAN_FEATURE_LFR_MBB
178 if (lim_is_mbb_reassoc_in_progress(pMac, psessionEntry))
179 {
180 limLog(pMac, LOGE,
181 FL("Ignore channel switch as LFR MBB in progress"));
182 return eSIR_SUCCESS;
183 }
184#endif
185
Jeff Johnsone7245742012-09-05 17:12:55 -0700186 /*If channel switch is already running and it is on a different session, just return*/
187 /*This need to be removed for MCC */
188 if( limIsChanSwitchRunning (pMac) &&
189 psessionEntry->gLimSpecMgmt.dot11hChanSwState != eLIM_11H_CHANSW_RUNNING )
190 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700191 limLog(pMac, LOGW, FL("Ignoring channel switch on session %d"), psessionEntry->peSessionId);
Jeff Johnsone7245742012-09-05 17:12:55 -0700192 return eSIR_SUCCESS;
193 }
Sushant Kaushikb97a0082015-08-31 12:36:45 +0530194#ifdef FEATURE_WLAN_DIAG_SUPPORT
195 limDiagEventReport(pMac, WLAN_PE_DIAG_CHANNEL_SWITCH_ANOUNCEMENT,
196 psessionEntry, eSIR_SUCCESS, LIM_SWITCH_CHANNEL_CSA);
197#endif
198
Kalikinkar dhara085c02f2014-02-28 15:32:12 -0800199 psessionEntry->channelChangeCSA = LIM_SWITCH_CHANNEL_CSA;
Jeff Johnson295189b2012-06-20 16:38:30 -0700200 /* Deactivate and change reconfigure the timeout value */
Jeff Johnsone7245742012-09-05 17:12:55 -0700201 //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER);
Varun Reddy Yeturue3bbf6e2013-02-08 18:50:55 -0800202 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnsone7245742012-09-05 17:12:55 -0700203 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
204 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700205 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700206 return eSIR_FAILURE;
207 }
208
209 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
210 psessionEntry->gLimChannelSwitch.switchTimeoutValue,
211 0) != TX_SUCCESS)
212 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700213 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnsone7245742012-09-05 17:12:55 -0700214 return eSIR_FAILURE;
215 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700216
217 /* Follow the channel switch, forget about the previous quiet. */
218 //If quiet is running, chance is there to resume tx on its timeout.
219 //so stop timer for a safer side.
Jeff Johnsone7245742012-09-05 17:12:55 -0700220 if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN)
Jeff Johnson295189b2012-06-20 16:38:30 -0700221 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700222 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700223 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS)
224 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700225 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700226 return eSIR_FAILURE;
227 }
228 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700229 else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING)
Jeff Johnson295189b2012-06-20 16:38:30 -0700230 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700231 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700232 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS)
233 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700234 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700235 return eSIR_FAILURE;
236 }
237 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700238 psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
Jeff Johnson295189b2012-06-20 16:38:30 -0700239
240 /* Prepare for 11h channel switch */
241 limPrepareFor11hChannelSwitch(pMac, psessionEntry);
242
243 /** Dont add any more statements here as we posted finish scan request
244 * to HAL, wait till we get the response
245 */
246 return eSIR_SUCCESS;
247}
248
249
250/**
251 * __limProcessChannelSwitchActionFrame
252 *
253 *FUNCTION:
254 *
255 *LOGIC:
256 *
257 *ASSUMPTIONS:
258 *
259 *NOTE:
260 *
261 * @param pMac - Pointer to Global MAC structure
262 * @param *pRxPacketInfo - A pointer to packet info structure
263 * @return None
264 */
265
266static void
267
268__limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
269{
270
271 tpSirMacMgmtHdr pHdr;
272 tANI_U8 *pBody;
273 tDot11fChannelSwitch *pChannelSwitchFrame;
274 tANI_U16 beaconPeriod;
275 tANI_U32 val;
276 tANI_U32 frameLen;
277 tANI_U32 nStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -0700278
279 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
280 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
281 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
282
Abhishek Singh127a8442014-12-15 17:31:27 +0530283 limLog(pMac, LOG1, FL("Received Channel switch action frame"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700284 if (!psessionEntry->lim11hEnable)
285 return;
286
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530287 pChannelSwitchFrame = vos_mem_malloc(sizeof(*pChannelSwitchFrame));
288 if (NULL == pChannelSwitchFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -0700289 {
290 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530291 FL("AllocateMemory failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700292 return;
293 }
294
295 /* Unpack channel switch frame */
296 nStatus = dot11fUnpackChannelSwitch(pMac, pBody, frameLen, pChannelSwitchFrame);
297
298 if( DOT11F_FAILED( nStatus ))
299 {
300 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700301 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700302 nStatus,
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700303 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530304 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700305 return;
306 }
307 else if(DOT11F_WARNED( nStatus ))
308 {
309 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700310 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700311 nStatus,
312 frameLen);
313 }
314
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530315 if (vos_mem_compare((tANI_U8 *) &psessionEntry->bssId,
316 (tANI_U8 *) &pHdr->sa,
317 sizeof(tSirMacAddr)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700318 {
319 #if 0
320 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS)
321 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530322 vos_mem_free(pChannelSwitchFrame);
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700323 limLog(pMac, LOGP, FL("could not retrieve Beacon interval"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700324 return;
325 }
326 #endif// TO SUPPORT BT-AMP
327
328 /* copy the beacon interval from psessionEntry*/
329 val = psessionEntry->beaconParams.beaconInterval;
330
331 beaconPeriod = (tANI_U16) val;
332
Jeff Johnsone7245742012-09-05 17:12:55 -0700333 psessionEntry->gLimChannelSwitch.primaryChannel = pChannelSwitchFrame->ChanSwitchAnn.newChannel;
334 psessionEntry->gLimChannelSwitch.switchCount = pChannelSwitchFrame->ChanSwitchAnn.switchCount;
335 psessionEntry->gLimChannelSwitch.switchTimeoutValue = SYS_MS_TO_TICKS(beaconPeriod) *
336 psessionEntry->gLimChannelSwitch.switchCount;
337 psessionEntry->gLimChannelSwitch.switchMode = pChannelSwitchFrame->ChanSwitchAnn.switchMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700338#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700339 if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability)
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700340 {
341 psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth;
342 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0;
343 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq1;
344 }
345#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700346
Abhishek Singh127a8442014-12-15 17:31:27 +0530347 limLog(pMac, LOG1, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"),
348 psessionEntry->gLimChannelSwitch.switchTimeoutValue);
Jeff Johnson295189b2012-06-20 16:38:30 -0700349
350 /* Only primary channel switch element is present */
Jeff Johnsone7245742012-09-05 17:12:55 -0700351 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
352 psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -0700353
Jeff Johnsone7245742012-09-05 17:12:55 -0700354 if (psessionEntry->htSupportedChannelWidthSet)
Jeff Johnson295189b2012-06-20 16:38:30 -0700355 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700356 if ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
357 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))
Jeff Johnson295189b2012-06-20 16:38:30 -0700358 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700359 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
360 psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700361 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700362#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700363 if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present)
364 {
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700365 if (pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
366 {
367 if (pChannelSwitchFrame->ExtChanSwitchAnn.present && ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
368 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)))
369 {
370 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700371 psessionEntry->gLimChannelSwitch.secondarySubBand =
372 limGet11ACPhyCBState(pMac,
373 psessionEntry->gLimChannelSwitch.primaryChannel,
374 pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset,
375 pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0,
376 psessionEntry);
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700377 }
378 }
379 }
380#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700381 }
382
383 }
384 else
385 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530386 limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));
Jeff Johnson295189b2012-06-20 16:38:30 -0700387 }
388
389 if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry))
390 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530391 limLog(pMac, LOG1, FL("Could not start channel switch"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700392 }
393
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530394 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700395 return;
396} /*** end limProcessChannelSwitchActionFrame() ***/
397
398
Mohit Khanna4a70d262012-09-11 16:30:12 -0700399#ifdef WLAN_FEATURE_11AC
400static void
401__limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
402{
403
404 tpSirMacMgmtHdr pHdr;
405 tANI_U8 *pBody;
406 tDot11fOperatingMode *pOperatingModeframe;
407 tANI_U32 frameLen;
408 tANI_U32 nStatus;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700409 tpDphHashNode pSta;
410 tANI_U16 aid;
Abhishek Singhdf8eb312014-11-15 00:49:28 +0530411 tANI_U8 operMode;
412 tANI_U32 channelBondingMode;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700413
414 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
415 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
416 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
417
Abhishek Singhdf8eb312014-11-15 00:49:28 +0530418 limLog(pMac, LOG1, FL("Received Operating Mode action frame"));
419
420 if( RF_CHAN_14 >= psessionEntry->currentOperChannel )
421 {
422 channelBondingMode = pMac->roam.configParam.channelBondingMode24GHz;
423 }
424 else
425 {
426 channelBondingMode = pMac->roam.configParam.channelBondingMode5GHz;
427 }
428
429 /* Do not update the channel bonding mode if channel bonding
430 * mode is disabled in INI.
431 */
432 if(WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == channelBondingMode)
433 {
434 limLog(pMac, LOGW,
435 FL("channel bonding disabled"));
436 return;
437 }
438
Sushant Kaushikc1123872015-01-07 13:59:20 +0530439 if (( RF_CHAN_14 >= psessionEntry->currentOperChannel )&&
440 !IS_HT40_OBSS_SCAN_FEATURE_ENABLE)
441 {
442 limLog(pMac, LOGW,
443 FL("channel bonding disabled as FW doesn't supoort CB in 2.4gz"));
444 return;
445 }
446
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530447 pOperatingModeframe = vos_mem_malloc(sizeof(*pOperatingModeframe));
448 if (NULL == pOperatingModeframe)
Mohit Khanna4a70d262012-09-11 16:30:12 -0700449 {
450 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530451 FL("AllocateMemory failed"));
Mohit Khanna4a70d262012-09-11 16:30:12 -0700452 return;
453 }
454
455 /* Unpack channel switch frame */
456 nStatus = dot11fUnpackOperatingMode(pMac, pBody, frameLen, pOperatingModeframe);
457
458 if( DOT11F_FAILED( nStatus ))
459 {
460 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700461 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700462 nStatus,
463 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530464 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700465 return;
466 }
467 else if(DOT11F_WARNED( nStatus ))
468 {
469 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700470 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700471 nStatus,
472 frameLen);
473 }
474 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
Padma, Santhosh Kumar6a3fdc62015-08-28 17:59:51 +0530475 if (pSta == NULL)
476 {
477 PELOGE(limLog(pMac, LOGE, FL("Station context not found"));)
478 return;
479 }
Mohit Khanna4a70d262012-09-11 16:30:12 -0700480
481 operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ;
482 if( operMode != pOperatingModeframe->OperatingMode.chanWidth)
483 {
484 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700485 FL(" received Chanwidth %d, staIdx = %d"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700486 (pOperatingModeframe->OperatingMode.chanWidth ),
487 pSta->staIndex);
488
489 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700490 FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700491 pHdr->sa[0],
492 pHdr->sa[1],
493 pHdr->sa[2],
494 pHdr->sa[3],
495 pHdr->sa[4],
496 pHdr->sa[5]);
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700497
Mohit Khanna4a70d262012-09-11 16:30:12 -0700498 if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ)
499 {
500 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
501 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
502 }
503 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ)
504 {
505 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
506 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
507 }
508 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ)
509 {
510 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
511 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ;
512 }
513 limCheckVHTOpModeChange( pMac, psessionEntry,
514 (pOperatingModeframe->OperatingMode.chanWidth), pSta->staIndex);\
515 }
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530516 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700517 return;
518}
519#endif
520
Jeff Johnson295189b2012-06-20 16:38:30 -0700521static void
522__limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
523{
Jeff Johnson295189b2012-06-20 16:38:30 -0700524}
525
526
527static void
528__limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
529{
530 tSirAddtsRspInfo addts;
531 tSirRetStatus retval;
532 tpSirMacMgmtHdr pHdr;
533 tpDphHashNode pSta;
534 tANI_U16 aid;
535 tANI_U32 frameLen;
536 tANI_U8 *pBody;
537 tpLimTspecInfo tspecInfo;
538 tANI_U8 ac;
539 tpDphHashNode pStaDs = NULL;
540 tANI_U8 rspReqd = 1;
541 tANI_U32 cfgLen;
542 tSirMacAddr peerMacAddr;
543
544
545 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
546 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
547 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
548
549
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700550 PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700551 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
552 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700553 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700554 return;
555 }
556
557 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
558 if (pSta == NULL)
559 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700560 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700561 return;
562 }
563
564 retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts);
565 if (retval != eSIR_SUCCESS)
566 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700567 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700568 return;
569 }
570
571 // don't have to check for qos/wme capabilities since we wouldn't have this
572 // flag set otherwise
573 if (! pMac->lim.gLimAddtsSent)
574 {
575 // we never sent an addts request!
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700576 PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700577 return;
578 }
579
580 if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken)
581 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700582 limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring",
Jeff Johnson295189b2012-06-20 16:38:30 -0700583 addts.dialogToken, pMac->lim.gLimAddtsReq.req.dialogToken);
584 return;
585 }
586
587 /*
588 * for successful addts reponse, try to add the classifier.
589 * if this fails for any reason, we should send a delts request to the ap
590 * for now, its ok not to send a delts since we are going to add support for
591 * multiple tclas soon and until then we won't send any addts requests with
592 * multiple tclas elements anyway.
593 * In case of addClassifier failure, we just let the addts timer run out
594 */
595 if (((addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
596 (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) &&
597 (addts.status == eSIR_MAC_SUCCESS_STATUS))
598 {
599 // add the classifier - this should always succeed
600 if (addts.numTclas > 1) // currently no support for multiple tclas elements
601 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700602 limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700603 aid, addts.numTclas);
604 return;
605 }
606 else if (addts.numTclas == 1)
607 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700608 limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!", aid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700609 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
610 }
611 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700612 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700613 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
614 addts.status);
615
616 // deactivate the response timer
617 limDeactivateAndChangeTimer(pMac, eLIM_ADDTS_RSP_TIMER);
618
619 if (addts.status != eSIR_MAC_SUCCESS_STATUS)
620 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700621 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700622 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
623 addts.status);
624 limSendSmeAddtsRsp(pMac, true, addts.status, psessionEntry, addts.tspec,
625 psessionEntry->smeSessionId, psessionEntry->transactionId);
626
627 // clear the addts flag
628 pMac->lim.gLimAddtsSent = false;
629
630 return;
631 }
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800632#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700633 if (addts.tsmPresent)
634 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700635 limLog(pMac, LOGW, "TSM IE Present");
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800636 psessionEntry->eseContext.tsm.tid = addts.tspec.tsinfo.traffic.userPrio;
637 vos_mem_copy(&psessionEntry->eseContext.tsm.tsmInfo,
638 &addts.tsmIE,sizeof(tSirMacESETSMIE));
639#ifdef FEATURE_WLAN_ESE_UPLOAD
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700640 limSendSmeTsmIEInd(pMac, psessionEntry, addts.tsmIE.tsid,
641 addts.tsmIE.state, addts.tsmIE.msmt_interval);
642#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700643 limActivateTSMStatsTimer(pMac, psessionEntry);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800644#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700645 }
646#endif
647 /* Since AddTS response was successful, check for the PSB flag
648 * and directional flag inside the TS Info field.
649 * An AC is trigger enabled AC if the PSB subfield is set to 1
650 * in the uplink direction.
651 * An AC is delivery enabled AC if the PSB subfield is set to 1
652 * in the downlink direction.
653 * An AC is trigger and delivery enabled AC if the PSB subfield
654 * is set to 1 in the bi-direction field.
655 */
656 if (addts.tspec.tsinfo.traffic.psb == 1)
657 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, SET_UAPSD_MASK);
658 else
659 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, CLEAR_UAPSD_MASK);
660
661
662 /* ADDTS success, so AC is now admitted. We shall now use the default
663 * EDCA parameters as advertised by AP and send the updated EDCA params
664 * to HAL.
665 */
666 ac = upToAc(addts.tspec.tsinfo.traffic.userPrio);
667 if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK)
668 {
669 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
670 }
671 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK)
672 {
673 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
674 }
675 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR)
676 {
677 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
678 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
679 }
680
681 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
682
683 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
684 if (pStaDs != NULL)
685 {
686 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
687 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
688 else
689 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
690 }
691 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700692 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700693
694
695 sirCopyMacAddr(peerMacAddr,psessionEntry->bssId);
696
697 //if schedule is not present then add TSPEC with svcInterval as 0.
698 if(!addts.schedulePresent)
699 addts.schedule.svcInterval = 0;
700 if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, &addts.tspec, addts.schedule.svcInterval, &tspecInfo))
701 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700702 PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700703 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
704 psessionEntry);
705 pMac->lim.gLimAddtsSent = false;
706 return; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status.
707 }
708 if((addts.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA) ||
Madan Mohan Koyyalamudi198ade32013-09-29 03:52:25 +0530709 ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700710 {
711 retval = limSendHalMsgAddTs(pMac, pSta->staIndex, tspecInfo->idx, addts.tspec, psessionEntry->peSessionId);
712 if(eSIR_SUCCESS != retval)
713 {
714 limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecInfo->idx);
715
716 // Send DELTS action frame to AP
717 cfgLen = sizeof(tSirMacAddr);
718 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
719 psessionEntry);
720 limSendSmeAddtsRsp(pMac, true, retval, psessionEntry, addts.tspec,
721 psessionEntry->smeSessionId, psessionEntry->transactionId);
722 pMac->lim.gLimAddtsSent = false;
723 return;
724 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700725 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700726 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
727 }
728 else
729 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700730 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700731 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700732 PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700733 // Use the smesessionId and smetransactionId from the PE session context
734 limSendSmeAddtsRsp(pMac, true, eSIR_SME_SUCCESS, psessionEntry, addts.tspec,
735 psessionEntry->smeSessionId, psessionEntry->transactionId);
736 }
737
738 // clear the addts flag
739 pMac->lim.gLimAddtsSent = false;
740 return;
741}
742
743
744static void
745__limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
746{
747 tSirRetStatus retval;
748 tSirDeltsReqInfo delts;
749 tpSirMacMgmtHdr pHdr;
750 tpDphHashNode pSta;
751 tANI_U32 frameLen;
752 tANI_U16 aid;
753 tANI_U8 *pBody;
754 tANI_U8 tsStatus;
755 tSirMacTSInfo *tsinfo;
756 tANI_U8 tspecIdx;
757 tANI_U8 ac;
758 tpDphHashNode pStaDs = NULL;
759
760
761 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
762 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
763 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
764
765 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
766 if (pSta == NULL)
767 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700768 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700769 return;
770 }
771
772 // parse the delts request
773 retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts);
774 if (retval != eSIR_SUCCESS)
775 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700776 PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700777 return;
778 }
779
780 if (delts.wmeTspecPresent)
781 {
782 if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
783 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700784 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700785 return;
786 }
Abhishek Singh525045c2014-12-15 17:18:45 +0530787 limLog(pMac, LOG1, FL("WME Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700788 }
789 else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled)
790 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530791 limLog(pMac, LOG1, FL("11e QoS Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700792 }
793 else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled)
794 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530795 limLog(pMac, LOG1, FL("WSM Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700796 }
797 else
798 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700799 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700800 return;
801 }
802
803 tsinfo = delts.wmeTspecPresent ? &delts.tspec.tsinfo : &delts.tsinfo;
804
805 // if no Admit Control, ignore the request
806 if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA))
807 {
808
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530809 if (upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC)
Jeff Johnson295189b2012-06-20 16:38:30 -0700810 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700811 limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700812 tsinfo->traffic.userPrio);
813 return;
814 }
815 }
816
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530817 if ((psessionEntry->limSystemRole != eLIM_AP_ROLE) &&
818 (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
819 limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry);
820
Jeff Johnson295189b2012-06-20 16:38:30 -0700821 // try to delete the TS
822 if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx))
823 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700824 PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700825 return;
826 }
827
828 else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
829 (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH))
830 {
831 //Edca only for now.
832 }
833 else
834 {
835 //send message to HAL to delete TS
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530836 if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac,
837 pSta->staIndex,
838 tspecIdx,
839 delts,
840 psessionEntry->peSessionId,
841 psessionEntry->bssId))
Jeff Johnson295189b2012-06-20 16:38:30 -0700842 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700843 limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700844 tsinfo->traffic.userPrio);
845 return;
846 }
847 }
848
849 /* We successfully deleted the TSPEC. Update the dynamic UAPSD Mask.
850 * The AC for this TSPEC is no longer trigger enabled if this Tspec
851 * was set-up in uplink direction only.
852 * The AC for this TSPEC is no longer delivery enabled if this Tspec
853 * was set-up in downlink direction only.
854 * The AC for this TSPEC is no longer triiger enabled and delivery
855 * enabled if this Tspec was a bidirectional TSPEC.
856 */
857 limSetTspecUapsdMask(pMac, tsinfo, CLEAR_UAPSD_MASK);
858
859
860 /* We're deleting the TSPEC.
861 * The AC for this TSPEC is no longer admitted in uplink/downlink direction
862 * if this TSPEC was set-up in uplink/downlink direction only.
863 * The AC for this TSPEC is no longer admitted in both uplink and downlink
864 * directions if this TSPEC was a bi-directional TSPEC.
865 * If ACM is set for this AC and this AC is admitted only in downlink
866 * direction, PE needs to downgrade the EDCA parameter
867 * (for the AC for which TS is being deleted) to the
868 * next best AC for which ACM is not enabled, and send the
869 * updated values to HAL.
870 */
871 ac = upToAc(tsinfo->traffic.userPrio);
872
873 if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK)
874 {
875 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
876 }
877 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK)
878 {
879 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
880 }
881 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR)
882 {
883 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
884 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
885 }
886
887 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
888
889 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
890 if (pStaDs != NULL)
891 {
892 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
893 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
894 else
895 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
896 }
897 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700898 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700899
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530900 limLog(pMac, LOG1, FL("DeleteTS succeeded"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700901
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800902#ifdef FEATURE_WLAN_ESE
903#ifdef FEATURE_WLAN_ESE_UPLOAD
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700904 limSendSmeTsmIEInd(pMac, psessionEntry, 0, 0, 0);
905#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700906 limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800907#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700908#endif
909
910}
911
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700912static void
913__limProcessQosMapConfigureFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,
914 tpPESession psessionEntry)
915{
916 tpSirMacMgmtHdr pHdr;
917 tANI_U32 frameLen;
918 tANI_U8 *pBody;
919 tSirRetStatus retval;
920 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
921 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
922 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
923 retval = sirConvertQosMapConfigureFrame2Struct(pMac, pBody, frameLen,
Kumar Anand82c009f2014-05-29 00:29:42 -0700924 &psessionEntry->QosMapSet);
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700925 if (retval != eSIR_SUCCESS)
926 {
927 PELOGW(limLog(pMac, LOGE,
928 FL("QosMapConfigure frame parsing failed (error %d)"), retval);)
929 return;
930 }
Naveen Rawat71e1a2e2015-07-28 16:11:21 +0530931 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
932 pRxPacketInfo, psessionEntry, 0);
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700933}
Jeff Johnson295189b2012-06-20 16:38:30 -0700934
935#ifdef ANI_SUPPORT_11H
936/**
937 * limProcessBasicMeasReq
938 *
939 *FUNCTION:
940 * This function is called by limProcessMeasurementRequestFrame()
941 * when it received a Basic measurement Request action frame.
942 * Station/BP receiving this should perform basic measurements
943 * and then send Basic Measurement Report. AP should not perform
944 * any measurements, and send report indicating refusal.
945 *
946 *LOGIC:
947 *
948 *ASSUMPTIONS:
949 *
950 *NOTE:
951 *
952 * @param pMac - Pointer to Global MAC structure
953 * @param pMeasReqFrame - A pointer to Basic Meas. Req structure
954 * @return None
955 */
956static void
957__limProcessBasicMeasReq(tpAniSirGlobal pMac,
958 tpSirMacMeasReqActionFrame pMeasReqFrame,
959 tSirMacAddr peerMacAddr)
960{
961 // TBD - Station shall perform basic measurements
962
963 if (limSendMeasReportFrame(pMac,
964 pMeasReqFrame,
965 peerMacAddr) != eSIR_SUCCESS)
966 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700967 PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700968 return;
969 }
970}
971
972
973/**
974 * limProcessCcaMeasReq
975 *
976 *FUNCTION:
977 * This function is called by limProcessMeasurementRequestFrame()
978 * when it received a CCA measurement Request action frame.
979 * Station/BP receiving this should perform CCA measurements
980 * and then send CCA Measurement Report. AP should not perform
981 * any measurements, and send report indicating refusal.
982 *
983 *LOGIC:
984 *
985 *ASSUMPTIONS:
986 *
987 *NOTE:
988 *
989 * @param pMac - Pointer to Global MAC structure
990 * @param pMeasReqFrame - A pointer to CCA Meas. Req structure
991 * @return None
992 */
993static void
994__limProcessCcaMeasReq(tpAniSirGlobal pMac,
995 tpSirMacMeasReqActionFrame pMeasReqFrame,
996 tSirMacAddr peerMacAddr)
997{
998 // TBD - Station shall perform cca measurements
999
1000 if (limSendMeasReportFrame(pMac,
1001 pMeasReqFrame,
1002 peerMacAddr) != eSIR_SUCCESS)
1003 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001004 PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001005 return;
1006 }
1007}
1008
1009
1010/**
1011 * __limProcessRpiMeasReq
1012 *
1013 *FUNCTION:
1014 * This function is called by limProcessMeasurementRequestFrame()
1015 * when it received a RPI measurement Request action frame.
1016 * Station/BP/AP receiving this shall not perform any measurements,
1017 * and send report indicating refusal.
1018 *
1019 *LOGIC:
1020 *
1021 *ASSUMPTIONS:
1022 *
1023 *NOTE:
1024 *
1025 * @param pMac - Pointer to Global MAC structure
1026 * @param pMeasReqFrame - A pointer to RPI Meas. Req structure
1027 * @return None
1028 */
1029static void
1030__limProcessRpiMeasReq(tpAniSirGlobal pMac,
1031 tpSirMacMeasReqActionFrame pMeasReqFrame,
1032 tSirMacAddr peerMacAddr)
1033{
1034 if (limSendMeasReportFrame(pMac,
1035 pMeasReqFrame,
1036 peerMacAddr) != eSIR_SUCCESS)
1037 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001038 PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001039 return;
1040 }
1041}
1042
1043
1044/**
1045 * __limProcessMeasurementRequestFrame
1046 *
1047 *FUNCTION:
1048 *
1049 *LOGIC:
1050 *
1051 *ASSUMPTIONS:
1052 *
1053 *NOTE:
1054 *
1055 * @param pMac - Pointer to Global MAC structure
1056 * @param *pRxPacketInfo - A pointer to packet info structure
1057 * @return None
1058 */
1059
1060static void
1061__limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1062{
1063 tpSirMacMgmtHdr pHdr;
1064 tANI_U8 *pBody;
1065 tpSirMacMeasReqActionFrame pMeasReqFrame;
1066 tANI_U32 frameLen;
1067
1068 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1069 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1070 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1071
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301072 pMeasReqFrame = vos_mem_malloc(sizeof( tSirMacMeasReqActionFrame ));
1073 if (NULL == pMeasReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001074 {
1075 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301076 FL("limProcessMeasurementRequestFrame: AllocateMemory failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001077 return;
1078 }
1079
1080 if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) !=
1081 eSIR_SUCCESS)
1082 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001083 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001084 return;
1085 }
1086
1087
1088 switch(pMeasReqFrame->measReqIE.measType)
1089 {
1090 case SIR_MAC_BASIC_MEASUREMENT_TYPE:
1091 __limProcessBasicMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1092 break;
1093
1094 case SIR_MAC_CCA_MEASUREMENT_TYPE:
1095 __limProcessCcaMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1096 break;
1097
1098 case SIR_MAC_RPI_MEASUREMENT_TYPE:
1099 __limProcessRpiMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1100 break;
1101
1102 default:
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301103 limLog(pMac, LOG1, FL("Unknown Measurement Type %d "),
1104 pMeasReqFrame->measReqIE.measType);
Jeff Johnson295189b2012-06-20 16:38:30 -07001105 break;
1106 }
1107
1108} /*** end limProcessMeasurementRequestFrame ***/
1109
1110
1111/**
1112 * limProcessTpcRequestFrame
1113 *
1114 *FUNCTION:
1115 * This function is called upon receiving Tpc Request frame.
1116 *
1117 *NOTE:
1118 *
1119 * @param pMac - Pointer to Global MAC structure
1120 * @param *pRxPacketInfo - A pointer to packet info structure
1121 * @return None
1122 */
1123
1124static void
1125__limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1126{
1127 tpSirMacMgmtHdr pHdr;
1128 tANI_U8 *pBody;
1129 tpSirMacTpcReqActionFrame pTpcReqFrame;
1130 tANI_U32 frameLen;
1131
1132 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1133 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1134 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1135
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301136 limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001137
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301138 pTpcReqFrame = vos_mem_malloc(sizeof( tSirMacTpcReqActionFrame ));
1139 if (NULL == pTpcReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001140 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301141 PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001142 return;
1143 }
1144
1145 if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) !=
1146 eSIR_SUCCESS)
1147 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001148 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001149 return;
1150 }
1151
1152 if (limSendTpcReportFrame(pMac,
1153 pTpcReqFrame,
1154 pHdr->sa) != eSIR_SUCCESS)
1155 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001156 PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001157 return;
1158 }
1159}
1160#endif
1161
1162
1163/**
1164 * \brief Validate an ADDBA Req from peer with respect
1165 * to our own BA configuration
1166 *
1167 * \sa __limValidateAddBAParameterSet
1168 *
1169 * \param pMac The global tpAniSirGlobal object
1170 *
1171 * \param baParameterSet The ADDBA Parameter Set.
1172 *
1173 * \param pDelBAFlag this parameter is NULL except for call from processAddBAReq
1174 * delBAFlag is set when entry already exists.
1175 *
1176 * \param reqType ADDBA Req v/s ADDBA Rsp
1177 * 1 - ADDBA Req
1178 * 0 - ADDBA Rsp
1179 *
1180 * \return eSIR_SUCCESS if setup completes successfully
1181 * eSIR_FAILURE is some problem is encountered
1182 */
1183
1184static tSirMacStatusCodes
1185__limValidateAddBAParameterSet( tpAniSirGlobal pMac,
1186 tpDphHashNode pSta,
1187 tDot11fFfAddBAParameterSet baParameterSet,
1188 tANI_U8 dialogueToken,
1189 tLimAddBaValidationReqType reqType ,
1190 tANI_U8* pDelBAFlag /*this parameter is NULL except for call from processAddBAReq*/)
1191{
1192 if(baParameterSet.tid >= STACFG_MAX_TC)
1193 {
1194 return eSIR_MAC_WME_INVALID_PARAMS_STATUS;
1195 }
1196
1197 //check if there is already a BA session setup with this STA/TID while processing AddBaReq
1198 if((true == pSta->tcCfg[baParameterSet.tid].fUseBARx) &&
1199 (LIM_ADDBA_REQ == reqType))
1200 {
1201 //There is already BA session setup for STA/TID.
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001202 limLog( pMac, LOGE,
Jeff Johnson295189b2012-06-20 16:38:30 -07001203 FL( "AddBAReq rcvd when there is already a session for this StaId = %d, tid = %d\n " ),
1204 pSta->staIndex, baParameterSet.tid);
1205 limPrintMacAddr( pMac, pSta->staAddr, LOGW );
1206
1207 if(pDelBAFlag)
1208 *pDelBAFlag = true;
1209 }
1210 return eSIR_MAC_SUCCESS_STATUS;
1211}
1212
1213/**
1214 * \brief Validate a DELBA Ind from peer with respect
1215 * to our own BA configuration
1216 *
1217 * \sa __limValidateDelBAParameterSet
1218 *
1219 * \param pMac The global tpAniSirGlobal object
1220 *
1221 * \param baParameterSet The DELBA Parameter Set.
1222 *
1223 * \param pSta Runtime, STA-related configuration cached
1224 * in the HashNode object
1225 *
1226 * \return eSIR_SUCCESS if setup completes successfully
1227 * eSIR_FAILURE is some problem is encountered
1228 */
1229static tSirMacStatusCodes
1230__limValidateDelBAParameterSet( tpAniSirGlobal pMac,
1231 tDot11fFfDelBAParameterSet baParameterSet,
1232 tpDphHashNode pSta )
1233{
1234tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS;
1235
1236 // Validate if a BA is active for the requested TID
1237 if( pSta->tcCfg[baParameterSet.tid].fUseBATx ||
1238 pSta->tcCfg[baParameterSet.tid].fUseBARx )
1239 {
1240 statusCode = eSIR_MAC_SUCCESS_STATUS;
1241
1242 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001243 FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001244 }
1245 else
1246 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001247 FL("Received an INVALID DELBA Ind for TID %d..."),
Jeff Johnson295189b2012-06-20 16:38:30 -07001248 baParameterSet.tid );
1249
1250 return statusCode;
1251}
1252
1253/**
1254 * \brief Process an ADDBA REQ
1255 *
1256 * \sa limProcessAddBAReq
1257 *
1258 * \param pMac The global tpAniSirGlobal object
1259 *
1260 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1261 *
1262 * \return none
1263 *
1264 */
1265static void
1266__limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1267{
1268 tDot11fAddBAReq frmAddBAReq;
1269 tpSirMacMgmtHdr pHdr;
1270 tpDphHashNode pSta;
1271 tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS;
1272 tANI_U16 aid;
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001273 tANI_U32 frameLen, nStatus,val;
Jeff Johnson295189b2012-06-20 16:38:30 -07001274 tANI_U8 *pBody;
1275 tANI_U8 delBAFlag =0;
1276
1277 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1278 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1279 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001280 val = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07001281
1282 // Unpack the received frame
1283 nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq );
1284 if( DOT11F_FAILED( nStatus ))
1285 {
1286 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001287 FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001288 nStatus,
1289 frameLen );
1290
1291 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1292
1293 // Without an unpacked request we cannot respond, so silently ignore the request
1294 return;
1295 }
1296 else if ( DOT11F_WARNED( nStatus ) )
1297 {
1298 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001299 FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001300 nStatus,
1301 frameLen );
1302
1303 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1304 }
1305
Kiran Kumar Lokere2ac471f2013-05-30 16:08:48 -07001306 psessionEntry->amsduSupportedInBA = frmAddBAReq.AddBAParameterSet.amsduSupported;
1307
Jeff Johnson295189b2012-06-20 16:38:30 -07001308 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1309 if( pSta == NULL )
1310 {
1311 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001312 FL( "STA context not found - ignoring ADDBA from " ));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001313 limPrintMacAddr( pMac, pHdr->sa, LOGE );
Jeff Johnson295189b2012-06-20 16:38:30 -07001314
1315 // FIXME - Should we do this?
1316 status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS;
1317 goto returnAfterError;
1318 }
Abhishek Singh02d9f6c2014-05-12 14:07:53 +05301319 limLog( pMac, LOG1, FL( "ADDBA Req from STA "MAC_ADDRESS_STR " with AID %d"
1320 " tid = %d policy = %d buffsize = %d"
1321 " amsduSupported = %d"), MAC_ADDR_ARRAY(pHdr->sa),
1322 aid, frmAddBAReq.AddBAParameterSet.tid,
1323 frmAddBAReq.AddBAParameterSet.policy,
1324 frmAddBAReq.AddBAParameterSet.bufferSize,
1325 frmAddBAReq.AddBAParameterSet.amsduSupported);
Jeff Johnson295189b2012-06-20 16:38:30 -07001326
Abhishek Singh1f6e6532014-06-05 17:35:08 +05301327 limLog( pMac, LOG1, FL( "ssn = %d fragNumber = %d" ),
1328 frmAddBAReq.BAStartingSequenceControl.ssn,
1329 frmAddBAReq.BAStartingSequenceControl.fragNumber);
1330
Jeff Johnson295189b2012-06-20 16:38:30 -07001331#ifdef WLAN_SOFTAP_VSTA_FEATURE
1332 // we can only do BA on "hard" STAs
1333 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1334 {
1335 status = eSIR_MAC_REQ_DECLINED_STATUS;
Sravan Kumar Kairamcebb2182016-01-25 20:50:11 +05301336 limLog( pMac, LOG1,
1337 FL( "ta Id is not HW Sta Id, Status code is %d " ), status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001338 goto returnAfterError;
1339 }
1340#endif //WLAN_SOFTAP_VSTA_FEATURE
1341
c_hpothu3ba2a512014-08-06 14:02:54 +05301342 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 -07001343 eSIR_SUCCESS)
1344 {
1345 limLog(pMac, LOGE,
c_hpothu3ba2a512014-08-06 14:02:54 +05301346 FL("Unable to get WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC"));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001347 val = 0;
1348 }
1349 if ((SIR_BAND_2_4_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) &&
1350 val)
1351 {
1352 limLog( pMac, LOGW,
1353 FL( "BTC disabled aggregation - ignoring ADDBA from " ));
1354 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1355
1356 status = eSIR_MAC_REQ_DECLINED_STATUS;
1357 goto returnAfterError;
1358 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001359
1360 // Now, validate the ADDBA Req
1361 if( eSIR_MAC_SUCCESS_STATUS !=
1362 (status = __limValidateAddBAParameterSet( pMac, pSta,
1363 frmAddBAReq.AddBAParameterSet,
1364 0, //dialogue token is don't care in request validation.
1365 LIM_ADDBA_REQ, &delBAFlag)))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301366 {
1367 limLog( pMac, LOGE,
1368 FL( "ADDBA parameters validation failed with status %d" ), status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001369 goto returnAfterError;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301370 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001371
1372 //BA already set, so we need to delete it before adding new one.
1373 if(delBAFlag)
1374 {
1375 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1376 pSta,
1377 (tANI_U8)frmAddBAReq.AddBAParameterSet.tid,
1378 eBA_RECIPIENT,psessionEntry))
1379 {
1380 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301381 limLog( pMac, LOGE,
1382 FL( "Deletion of Existing BA session failed with status %d" ),
1383 status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001384 goto returnAfterError;
1385 }
1386 }
1387
1388 // Check if the ADD BA Declined configuration is Disabled
1389 if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001390 limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001391 frmAddBAReq.AddBAParameterSet.tid);
1392 status = eSIR_MAC_REQ_DECLINED_STATUS;
1393 goto returnAfterError;
1394 }
1395
1396 //
1397 // Post WDA_ADDBA_REQ to HAL.
1398 // If HAL/HDD decide to allow this ADDBA Req session,
1399 // then this BA session is termed active
1400 //
1401
1402 // Change the Block Ack state of this STA to wait for
1403 // ADDBA Rsp from HAL
1404 LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001405
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001406 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001407 {
1408 limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001409 return ;
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001410 }
1411
1412
1413 if (frmAddBAReq.AddBAParameterSet.bufferSize)
1414 {
1415 frmAddBAReq.AddBAParameterSet.bufferSize =
1416 VOS_MIN(val, frmAddBAReq.AddBAParameterSet.bufferSize);
1417 }
1418 else
1419 {
1420 frmAddBAReq.AddBAParameterSet.bufferSize = val;
1421 }
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001422 limLog( pMac, LOG1, FL( "ADDBAREQ NUMBUFF %d" ),
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001423 frmAddBAReq.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001424
1425 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1426 pSta,
1427 (tANI_U8) frmAddBAReq.DialogToken.token,
1428 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1429 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1430 frmAddBAReq.AddBAParameterSet.bufferSize,
1431 frmAddBAReq.BATimeout.timeout,
1432 (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn,
1433 eBA_RECIPIENT,psessionEntry))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301434 {
1435 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1436 limLog( pMac, LOGE,
1437 FL( "Request to setup new BA session with peer "
1438 " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr));
1439 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001440 else
1441 return;
1442
1443returnAfterError:
1444
1445 //
1446 // Package LIM_MLM_ADDBA_RSP to MLME, with proper
1447 // status code. MLME will then send an ADDBA RSP
1448 // over the air to the peer MAC entity
1449 //
1450 if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac,
1451 pHdr->sa,
1452 status,
1453 frmAddBAReq.DialogToken.token,
1454 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1455 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1456 frmAddBAReq.AddBAParameterSet.bufferSize,
1457 frmAddBAReq.BATimeout.timeout,psessionEntry))
1458 {
1459 limLog( pMac, LOGW,
1460 FL( "Failed to post LIM_MLM_ADDBA_RSP to " ));
1461 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1462 }
1463
1464}
1465
1466/**
1467 * \brief Process an ADDBA RSP
1468 *
1469 * \sa limProcessAddBARsp
1470 *
1471 * \param pMac The global tpAniSirGlobal object
1472 *
1473 * \param pRxPacketInfo Handle to the packet info structure from HDD
1474 *
1475 * \return none
1476 *
1477 */
1478static void
1479__limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1480{
1481tDot11fAddBARsp frmAddBARsp;
1482tpSirMacMgmtHdr pHdr;
1483tpDphHashNode pSta;
1484tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1485tANI_U16 aid;
1486tANI_U32 frameLen, nStatus;
1487tANI_U8 *pBody;
1488
1489 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1490 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1491 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1492
1493 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1494 if( pSta == NULL )
1495 {
1496 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001497 FL( "STA context not found - ignoring ADDBA from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001498 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1499 return;
1500 }
1501
1502#ifdef WLAN_SOFTAP_VSTA_FEATURE
1503 // We can only do BA on "hard" STAs. We should not have issued an ADDBA
1504 // Request, so we should never be processing a ADDBA Response
1505 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1506 {
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301507 limLog( pMac, LOGE, FL( "Sta Id is not HW Sta Id " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001508 return;
1509 }
1510#endif //WLAN_SOFTAP_VSTA_FEATURE
1511
1512 // Unpack the received frame
1513 nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp );
1514 if( DOT11F_FAILED( nStatus ))
1515 {
1516 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001517 FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001518 nStatus,
1519 frameLen );
1520
1521 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1522 goto returnAfterError;
1523 }
1524 else if ( DOT11F_WARNED( nStatus ) )
1525 {
1526 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001527 FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001528 nStatus,
1529 frameLen );
1530
1531 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1532 }
1533
Abhishek Singh02d9f6c2014-05-12 14:07:53 +05301534 limLog( pMac, LOG1, FL( "ADDBA Rsp from STA "MAC_ADDRESS_STR " with AID %d "
1535 "tid = %d policy = %d buffsize = %d "
1536 "amsduSupported = %d status = %d"),
1537 MAC_ADDR_ARRAY(pHdr->sa), aid,
1538 frmAddBARsp.AddBAParameterSet.tid,
1539 frmAddBARsp.AddBAParameterSet.policy,
1540 frmAddBARsp.AddBAParameterSet.bufferSize,
1541 frmAddBARsp.AddBAParameterSet.amsduSupported,
1542 frmAddBARsp.Status.status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001543 //if there is no matchin dialougue token then ignore the response.
1544
1545 if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token,
1546 pSta->assocId, frmAddBARsp.AddBAParameterSet.tid))
1547 {
Abhishek Singh6f09e702016-01-28 15:15:04 +05301548 limLog(pMac, LOGE,
1549 FL("dialogueToken in received addBARsp did not match with outstanding requests"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001550 return;
1551 }
1552
1553 // Check first if the peer accepted the ADDBA Req
1554 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1555 {
Kaushik, Sushant335328c2014-07-31 19:15:31 +05301556 tANI_U32 val;
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301557 pMac->lim.staBaInfo[pSta->staIndex].
1558 failed_count[frmAddBARsp.AddBAParameterSet.tid] = 0;
1559 pMac->lim.staBaInfo[pSta->staIndex].
1560 failed_timestamp[frmAddBARsp.AddBAParameterSet.tid] = 0;
Kaushik, Sushant335328c2014-07-31 19:15:31 +05301561 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
1562 {
1563 limLog(pMac, LOG1, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
1564 goto returnAfterError;
1565 }
1566 if (0 == frmAddBARsp.AddBAParameterSet.bufferSize)
1567 frmAddBARsp.AddBAParameterSet.bufferSize = val;
1568 else
1569 frmAddBARsp.AddBAParameterSet.bufferSize =
1570 VOS_MIN(val, frmAddBARsp.AddBAParameterSet.bufferSize);
1571 limLog( pMac, LOG1,
1572 FL( "ADDBA RSP Buffsize = %d" ),
1573 frmAddBARsp.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001574 // Now, validate the ADDBA Rsp
1575 if( eSIR_MAC_SUCCESS_STATUS !=
1576 __limValidateAddBAParameterSet( pMac, pSta,
1577 frmAddBARsp.AddBAParameterSet,
1578 (tANI_U8)frmAddBARsp.DialogToken.token,
1579 LIM_ADDBA_RSP, NULL))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301580 {
1581 limLog( pMac, LOGE,
1582 FL( "ADDBA parameters validation failed" ));
1583 goto returnAfterError;
1584 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001585 }
1586 else
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301587 {
1588 pMac->lim.staBaInfo[pSta->staIndex].
1589 failed_count[frmAddBARsp.AddBAParameterSet.tid]++;
1590 pMac->lim.staBaInfo[pSta->staIndex].failed_timestamp[
1591 frmAddBARsp.AddBAParameterSet.tid] = jiffies_to_msecs(jiffies);
Jeff Johnson295189b2012-06-20 16:38:30 -07001592 goto returnAfterError;
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301593 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001594 // Change STA state to wait for ADDBA Rsp from HAL
1595 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
1596
1597 //
1598 // Post WDA_ADDBA_REQ to HAL.
1599 // If HAL/HDD decide to allow this ADDBA Rsp session,
1600 // then this BA session is termed active
1601 //
1602
1603 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1604 pSta,
1605 (tANI_U8) frmAddBARsp.DialogToken.token,
1606 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1607 (tANI_U8) frmAddBARsp.AddBAParameterSet.policy,
1608 frmAddBARsp.AddBAParameterSet.bufferSize,
1609 frmAddBARsp.BATimeout.timeout,
1610 0,
1611 eBA_INITIATOR,psessionEntry))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301612 {
1613 reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1614 limLog( pMac, LOGE,
1615 FL( "Request to setup new BA session with peer "
1616 " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr));
1617 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001618 else
1619 return;
1620
1621returnAfterError:
1622
1623 // TODO: Do we need to signal an error status to SME,
1624 // if status != eSIR_MAC_SUCCESS_STATUS
1625
1626 // Restore STA "BA" State
1627 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE);
1628 //
1629 // Need to send a DELBA IND to peer, who
1630 // would have setup a BA session with this STA
1631 //
1632 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1633 {
1634 //
1635 // Package LIM_MLM_DELBA_REQ to MLME, with proper
1636 // status code. MLME will then send a DELBA IND
1637 // over the air to the peer MAC entity
1638 //
1639 if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac,
1640 pSta,
1641 eBA_INITIATOR,
1642 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1643 reasonCode, psessionEntry))
1644 {
1645 limLog( pMac, LOGW,
1646 FL( "Failed to post LIM_MLM_DELBA_REQ to " ));
1647 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1648 }
1649 }
1650}
1651
1652/**
1653 * \brief Process a DELBA Indication
1654 *
1655 * \sa limProcessDelBAInd
1656 *
1657 * \param pMac The global tpAniSirGlobal object
1658 *
1659 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1660 *
1661 * \return none
1662 *
1663 */
1664static void
1665__limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1666{
1667tDot11fDelBAInd frmDelBAInd;
1668tpSirMacMgmtHdr pHdr;
1669tpDphHashNode pSta;
1670tANI_U16 aid;
1671tANI_U32 frameLen, nStatus;
1672tANI_U8 *pBody;
1673
1674 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1675 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1676 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1677
1678 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1679 if( pSta == NULL )
1680 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001681 limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001682 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1683 return;
1684 }
1685
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001686 limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid );
Jeff Johnson295189b2012-06-20 16:38:30 -07001687
1688 // Unpack the received frame
1689 nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd );
1690 if( DOT11F_FAILED( nStatus ))
1691 {
1692 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001693 FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001694 nStatus,
1695 frameLen );
1696
1697 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1698 return;
1699 }
1700 else if ( DOT11F_WARNED( nStatus ) )
1701 {
1702 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001703 FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001704 nStatus,
1705 frameLen );
1706
1707 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1708 }
1709
Abhishek Singh1f6e6532014-06-05 17:35:08 +05301710 limLog( pMac, LOG1,
1711 FL( "Received DELBA from: "MAC_ADDRESS_STR" for TID %d, Reason code %d" ),
1712 MAC_ADDR_ARRAY(pHdr->sa),
Jeff Johnson295189b2012-06-20 16:38:30 -07001713 frmDelBAInd.DelBAParameterSet.tid,
1714 frmDelBAInd.Reason.code );
1715
1716 // Now, validate the DELBA Ind
1717 if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac,
1718 frmDelBAInd.DelBAParameterSet,
1719 pSta ))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301720 {
1721 limLog( pMac, LOGE,
1722 FL( "ADDBA parameters validation failed " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001723 return;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301724 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001725 //
1726 // Post WDA_DELBA_IND to HAL and delete the
1727 // existing BA session
1728 //
1729 // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16
1730 // is kind of confusing...
1731 //
1732 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1733 pSta,
1734 (tANI_U8) frmDelBAInd.DelBAParameterSet.tid,
1735 (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)?
1736 eBA_INITIATOR: eBA_RECIPIENT,psessionEntry))
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001737 limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001738
1739 return;
1740
1741}
1742
1743static void
1744__limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry)
1745{
1746
1747#if 0
1748 tpSirMacMgmtHdr pHdr;
1749 tDot11fSMPowerSave frmSMPower;
1750 tSirMacHTMIMOPowerSaveState state;
1751 tpDphHashNode pSta;
1752 tANI_U16 aid;
1753 tANI_U32 frameLen, nStatus;
1754 tANI_U8 *pBody;
1755
1756 pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd );
1757 pBody = SIR_MAC_BD_TO_MPDUDATA( pBd );
1758 frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd );
1759
1760 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1761 if( pSta == NULL ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001762 limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001763 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1764 return;
1765 }
1766
1767 /**Unpack the received frame */
1768 nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower);
1769
1770 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001771 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001772 nStatus, frameLen );
1773 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1774 return;
1775 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001776 limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001777 nStatus, frameLen );
1778 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1779 }
1780
1781 limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d"
1782 "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En,
1783 frmSMPower.SMPowerModeSet.Mode);
1784
1785 /** Update in the DPH Table about the Update in the SM Power Save mode*/
1786 if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode)
1787 state = eSIR_HT_MIMO_PS_DYNAMIC;
1788 else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0))
1789 state = eSIR_HT_MIMO_PS_STATIC;
1790 else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0))
1791 state = eSIR_HT_MIMO_PS_NO_LIMIT;
1792 else {
1793 PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));)
1794 return;
1795 }
1796
1797 if (state == pSta->htMIMOPSState) {
1798 PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));)
1799 return;
1800 }
1801
1802 /** Update in the HAL Station Table for the Update of the Protection Mode */
1803 pSta->htMIMOPSState = state;
1804 limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState);
1805
1806#endif
1807
1808}
1809
1810#if defined WLAN_FEATURE_VOWIFI
1811
1812static void
1813__limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1814{
1815 tpSirMacMgmtHdr pHdr;
1816 tDot11fRadioMeasurementRequest frm;
1817 tANI_U32 frameLen, nStatus;
1818 tANI_U8 *pBody;
1819
1820 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1821 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1822 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1823
1824 if( psessionEntry == NULL )
1825 {
1826 return;
1827 }
1828
1829 /**Unpack the received frame */
1830 nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm );
1831
1832 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001833 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001834 nStatus, frameLen );
1835 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1836 return;
1837 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001838 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001839 nStatus, frameLen );
1840 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1841 }
1842
1843 // Call rrm function to handle the request.
1844
1845 rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry );
1846}
1847
1848static void
1849__limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1850{
1851 tpSirMacMgmtHdr pHdr;
1852 tDot11fLinkMeasurementRequest frm;
1853 tANI_U32 frameLen, nStatus;
1854 tANI_U8 *pBody;
1855
1856 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1857 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1858 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1859
1860 if( psessionEntry == NULL )
1861 {
1862 return;
1863 }
1864
1865 /**Unpack the received frame */
1866 nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm );
1867
1868 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001869 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001870 nStatus, frameLen );
1871 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1872 return;
1873 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001874 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001875 nStatus, frameLen );
1876 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1877 }
1878
1879 // Call rrm function to handle the request.
1880
1881 rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry );
1882
1883}
1884
1885static void
1886__limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1887{
1888 tpSirMacMgmtHdr pHdr;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001889 tDot11fNeighborReportResponse *pFrm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001890 tANI_U32 frameLen, nStatus;
1891 tANI_U8 *pBody;
1892
1893 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1894 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1895 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1896
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301897 pFrm = vos_mem_malloc(sizeof(tDot11fNeighborReportResponse));
1898 if (NULL == pFrm)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001899 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301900 limLog(pMac, LOGE, FL("Unable to allocate memory in __limProcessNeighborReport") );
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001901 return;
1902 }
1903
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301904 if(psessionEntry == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -07001905 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301906 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001907 return;
1908 }
1909
1910 /**Unpack the received frame */
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001911 nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm );
Jeff Johnson295189b2012-06-20 16:38:30 -07001912
1913 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001914 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001915 nStatus, frameLen );
1916 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301917 vos_mem_free(pFrm);
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001918 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001919 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001920 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001921 nStatus, frameLen );
1922 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1923 }
1924
1925 //Call rrm function to handle the request.
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001926 rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry );
1927
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301928 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001929}
1930
1931#endif
1932
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08001933#ifdef WLAN_FEATURE_AP_HT40_24G
1934static void
1935__limProcess2040bssCoexistenceActionFrame(tpAniSirGlobal pMac,
1936 tANI_U16 sessionId, tANI_U8 *pRxPacketInfo,
1937 tpPESession psessionEntry)
1938{
1939 tpSirMacMgmtHdr pHdr;
1940 tANI_U8 *pBody , i;
1941 tANI_U32 frameLen, nStatus;
1942 tDot11fHT2040BSSCoexistenceManagementActionFrame *pFrm;
1943 tpSirHT2040CoexInfoInd pSirSmeHT2040CoexInfoInd = NULL;
1944 tANI_U16 length;
1945 tSirMsgQ mmhMsg;
1946 tANI_U8 num_channelList;
1947
1948 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1949 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1950 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1951
1952 pFrm =
1953 vos_mem_malloc(sizeof(tDot11fHT2040BSSCoexistenceManagementActionFrame));
1954
1955 if (NULL == pFrm)
1956 {
1957 limLog(pMac, LOGE, FL("Unable to allocate memory"));
1958 return;
1959 }
1960
1961 if(psessionEntry == NULL)
1962 {
1963 vos_mem_free(pFrm);
1964 return;
1965 }
1966
1967 /**Unpack the received frame */
1968 nStatus = dot11fUnpackHT2040BSSCoexistenceManagementActionFrame( pMac,
1969 pBody, frameLen, pFrm );
1970
1971 if( DOT11F_FAILED( nStatus ))
1972 {
1973 limLog( pMac, LOGE, FL( "Failed to unpack and parse a 20/40"
1974 "Coex Action Frame (0x%08x, %d bytes):"),
1975 nStatus, frameLen );
1976 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1977 vos_mem_free(pFrm);
1978 return;
1979 }
1980 else if ( DOT11F_WARNED( nStatus ))
1981 {
1982 limLog(pMac, LOGW, FL( "There were warnings while unpacking a"
1983 " 20/40 Coex Action Frame (0x%08x, %d bytes):"),
1984 nStatus, frameLen );
1985 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1986 }
1987
1988 num_channelList = pFrm->HT2040BSSIntolerantReport.num_channelList;
1989
1990 if (num_channelList > 0)
1991 {
1992 length = (sizeof(tSirHT2040CoexInfoInd) - sizeof(tANI_U8) +
1993 (num_channelList * sizeof(tANI_U8)));
1994 }
1995 else
1996 length = sizeof(tSirHT2040CoexInfoInd);
1997
1998 limLog(pMac, LOGW,FL("tSirHT2040CoexInfoInd: Length: %d"),length);
1999
2000 pSirSmeHT2040CoexInfoInd = vos_mem_malloc(length);
2001
2002 if (NULL == pSirSmeHT2040CoexInfoInd)
2003 {
2004 limLog(pMac, LOGP,
2005 FL("AllocateMemory failed for eWNI_SME_2040_COEX_IND"));
2006 vos_mem_free(pFrm);
2007 return;
2008 }
2009
2010 vos_mem_set((void*)pSirSmeHT2040CoexInfoInd, length, 0);
2011
2012 pSirSmeHT2040CoexInfoInd->messageType = eWNI_SME_2040_COEX_IND;
2013 pSirSmeHT2040CoexInfoInd->sessionId = sessionId;
2014 pSirSmeHT2040CoexInfoInd->length = length;
2015
2016 if (pFrm->HT2040BSSCoexistence.present)
2017 {
2018
2019 limLog(pMac, LOGW, FL("infoRequest: %d fortyMHzIntolerant: %d"
2020 " twentyMHzBssWidthReq: %d obssScanExemptionReq: %d"
2021 " obssScanExemptionGrant: %d "),
2022 pFrm->HT2040BSSCoexistence.infoRequest,
2023 pFrm->HT2040BSSCoexistence.fortyMHzIntolerant,
2024 pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq,
2025 pFrm->HT2040BSSCoexistence.obssScanExemptionReq,
2026 pFrm->HT2040BSSCoexistence.obssScanExemptionGrant);
2027
2028 pSirSmeHT2040CoexInfoInd->HT40MHzIntolerant =
2029 pFrm->HT2040BSSCoexistence.fortyMHzIntolerant;
2030 pSirSmeHT2040CoexInfoInd->HT20MHzBssWidthReq =
2031 pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq;
2032 }
2033
2034 if (pFrm->HT2040BSSIntolerantReport.present)
2035 {
2036 limLog(pMac, LOGW, FL("operatingClass: %d num_channelList: %d "),
2037 pFrm->HT2040BSSIntolerantReport.operatingClass,
2038 num_channelList);
2039
2040 if (num_channelList > 0)
2041 {
2042 vos_mem_zero(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport,
2043 num_channelList);
2044 vos_mem_copy(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport,
2045 pFrm->HT2040BSSIntolerantReport.channelList,
2046 num_channelList);
2047
2048 pSirSmeHT2040CoexInfoInd->channel_num = num_channelList;
2049 }
2050
2051 for(i=0; i < num_channelList; i++)
2052 {
2053 limLog(pMac, LOGW, FL("Channel : %d "),
2054 pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i]);
2055 }
2056 }
2057
2058 mmhMsg.type = eWNI_SME_2040_COEX_IND;
2059 mmhMsg.bodyptr = pSirSmeHT2040CoexInfoInd;
2060 mmhMsg.bodyval = 0;
Sushant Kaushik87787972015-09-11 16:05:00 +05302061 limLog(pMac, LOGW, FL("Posting eWNI_SME_2040_COEX_IND Message to SME "));
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08002062 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2063
2064 vos_mem_free(pFrm);
2065}
2066#endif
2067
Jeff Johnson295189b2012-06-20 16:38:30 -07002068#ifdef WLAN_FEATURE_11W
2069/**
Chet Lanctot186b5732013-03-18 10:26:30 -07002070 * limProcessSAQueryRequestActionFrame
Jeff Johnson295189b2012-06-20 16:38:30 -07002071 *
2072 *FUNCTION:
2073 * This function is called by limProcessActionFrame() upon
2074 * SA query request Action frame reception.
2075 *
2076 *LOGIC:
2077 *
2078 *ASSUMPTIONS:
2079 *
2080 *NOTE:
2081 *
2082 * @param pMac - Pointer to Global MAC structure
Chet Lanctot186b5732013-03-18 10:26:30 -07002083 * @param *pRxPacketInfo - Handle to the Rx packet info
2084 * @param psessionEntry - PE session entry
2085 *
Jeff Johnson295189b2012-06-20 16:38:30 -07002086 * @return None
2087 */
Chet Lanctot186b5732013-03-18 10:26:30 -07002088static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002089{
2090 tpSirMacMgmtHdr pHdr;
2091 tANI_U8 *pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07002092 tANI_U8 transId[2];
Jeff Johnson295189b2012-06-20 16:38:30 -07002093
2094 /* Prima --- Below Macro not available in prima
2095 pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd);
2096 pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */
2097
2098 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2099 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2100
Chet Lanctot186b5732013-03-18 10:26:30 -07002101 /* If this is an unprotected SA Query Request, then ignore it. */
2102 if (pHdr->fc.wep == 0)
2103 return;
2104
Jeff Johnson295189b2012-06-20 16:38:30 -07002105 /*Extract 11w trsansId from SA query request action frame
2106 In SA query response action frame we will send same transId
2107 In SA query request action frame:
2108 Category : 1 byte
2109 Action : 1 byte
Chet Lanctot186b5732013-03-18 10:26:30 -07002110 Transaction ID : 2 bytes */
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302111 vos_mem_copy(&transId[0], &pBody[2], 2);
Jeff Johnson295189b2012-06-20 16:38:30 -07002112
Jeff Johnson295189b2012-06-20 16:38:30 -07002113 //Send 11w SA query response action frame
2114 if (limSendSaQueryResponseFrame(pMac,
2115 transId,
2116 pHdr->sa,psessionEntry) != eSIR_SUCCESS)
2117 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002118 PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002119 return;
2120 }
2121}
2122
Chet Lanctot186b5732013-03-18 10:26:30 -07002123/**
2124 * __limProcessSAQueryResponseActionFrame
2125 *
2126 *FUNCTION:
2127 * This function is called by limProcessActionFrame() upon
2128 * SA query response Action frame reception.
2129 *
2130 *LOGIC:
2131 *
2132 *ASSUMPTIONS:
2133 *
2134 *NOTE:
2135 *
2136 * @param pMac - Pointer to Global MAC structure
2137 * @param *pRxPacketInfo - Handle to the Rx packet info
2138 * @param psessionEntry - PE session entry
2139 * @return None
2140 */
2141static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
2142{
2143 tpSirMacMgmtHdr pHdr;
Chet Lanctot8cecea22014-02-11 19:09:36 -08002144 tANI_U8 *pBody;
2145 tpDphHashNode pSta;
2146 tANI_U16 aid;
2147 tANI_U16 transId;
2148 tANI_U8 retryNum;
Chet Lanctot186b5732013-03-18 10:26:30 -07002149
2150 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Chet Lanctot8cecea22014-02-11 19:09:36 -08002151 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
Chet Lanctot186b5732013-03-18 10:26:30 -07002152 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
2153 ("SA Query Response received...")) ;
Chet Lanctot186b5732013-03-18 10:26:30 -07002154
Chet Lanctotdd6beeb2014-04-22 11:51:29 -07002155 /* When a station, supplicant handles SA Query Response.
2156 Forward to SME to HDD to wpa_supplicant. */
2157 if (eLIM_STA_ROLE == psessionEntry->limSystemRole)
2158 {
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302159 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2160 pRxPacketInfo, psessionEntry, 0);
Chet Lanctotdd6beeb2014-04-22 11:51:29 -07002161 return;
2162 }
2163
Chet Lanctot8cecea22014-02-11 19:09:36 -08002164 /* If this is an unprotected SA Query Response, then ignore it. */
2165 if (pHdr->fc.wep == 0)
2166 return;
2167
2168 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
2169 if (NULL == pSta)
2170 return;
2171
2172 limLog(pMac, LOG1,
2173 FL("SA Query Response source addr - %0x:%0x:%0x:%0x:%0x:%0x"),
2174 pHdr->sa[0], pHdr->sa[1], pHdr->sa[2], pHdr->sa[3],
2175 pHdr->sa[4], pHdr->sa[5]);
2176 limLog(pMac, LOG1,
2177 FL("SA Query state for station - %d"), pSta->pmfSaQueryState);
2178
2179 if (DPH_SA_QUERY_IN_PROGRESS != pSta->pmfSaQueryState)
2180 return;
2181
2182 /* Extract 11w trsansId from SA query reponse action frame
2183 In SA query response action frame:
2184 Category : 1 byte
2185 Action : 1 byte
2186 Transaction ID : 2 bytes */
2187 vos_mem_copy(&transId, &pBody[2], 2);
2188
2189 /* If SA Query is in progress with the station and the station
2190 responds then the association request that triggered the SA
2191 query is from a rogue station, just go back to initial state. */
2192 for (retryNum = 0; retryNum <= pSta->pmfSaQueryRetryCount; retryNum++)
2193 if (transId == pSta->pmfSaQueryStartTransId + retryNum)
2194 {
2195 limLog(pMac, LOG1,
2196 FL("Found matching SA Query Request - transaction ID %d"), transId);
2197 tx_timer_deactivate(&pSta->pmfSaQueryTimer);
2198 pSta->pmfSaQueryState = DPH_SA_QUERY_NOT_IN_PROGRESS;
2199 break;
2200 }
2201}
Jeff Johnson295189b2012-06-20 16:38:30 -07002202#endif
2203
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002204#ifdef WLAN_FEATURE_11W
2205/**
2206 * limDropUnprotectedActionFrame
2207 *
2208 *FUNCTION:
2209 * This function checks if an Action frame should be dropped since it is
2210 * a Robust Managment Frame, it is unprotected, and it is received on a
2211 * connection where PMF is enabled.
2212 *
2213 *LOGIC:
2214 *
2215 *ASSUMPTIONS:
2216 *
2217 *NOTE:
2218 *
2219 * @param pMac - Global MAC structure
2220 * @param psessionEntry - PE session entry
2221 * @param pHdr - Frame header
2222 * @param category - Action frame category
2223 * @return TRUE if frame should be dropped
2224 */
2225
2226static tANI_BOOLEAN
2227limDropUnprotectedActionFrame (tpAniSirGlobal pMac, tpPESession psessionEntry,
2228 tpSirMacMgmtHdr pHdr, tANI_U8 category)
2229{
2230 tANI_U16 aid;
2231 tpDphHashNode pStaDs;
2232 tANI_BOOLEAN rmfConnection = eANI_BOOLEAN_FALSE;
2233
2234 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) ||
2235 (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
2236 {
2237 pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
2238 if (pStaDs != NULL)
2239 if (pStaDs->rmfEnabled)
2240 rmfConnection = eANI_BOOLEAN_TRUE;
2241 }
2242 else if (psessionEntry->limRmfEnabled)
2243 rmfConnection = eANI_BOOLEAN_TRUE;
2244
2245 if (rmfConnection && (pHdr->fc.wep == 0))
2246 {
2247 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2248 "since RMF is enabled."), category);)
2249 return eANI_BOOLEAN_TRUE;
2250 }
2251 else
2252 return eANI_BOOLEAN_FALSE;
2253}
2254#endif
2255
Jeff Johnson295189b2012-06-20 16:38:30 -07002256/**
2257 * limProcessActionFrame
2258 *
2259 *FUNCTION:
2260 * This function is called by limProcessMessageQueue() upon
2261 * Action frame reception.
2262 *
2263 *LOGIC:
2264 *
2265 *ASSUMPTIONS:
2266 *
2267 *NOTE:
2268 *
2269 * @param pMac - Pointer to Global MAC structure
2270 * @param *pRxPacketInfo - A pointer to packet info structure
2271 * @return None
2272 */
2273
2274void
2275limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
2276{
2277 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2278 tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07002279#ifdef WLAN_FEATURE_11W
2280 tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Abhishek Singh09d4e4a2016-01-12 11:20:22 +05302281
2282 if (lim_is_robust_mgmt_action_frame(pActionHdr->category) &&
2283 limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr,
2284 pActionHdr->category)) {
2285 limLog(pMac, LOGE,
2286 FL("Don't send unprotect action frame to upper layer categ %d "),
2287 pActionHdr->category);
2288 return;
2289 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002290#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002291
Jeff Johnson295189b2012-06-20 16:38:30 -07002292 switch (pActionHdr->category)
2293 {
Selvaraj, Sridharc045b8b2016-04-06 12:22:35 +05302294
2295 /*
2296 * WARNING: If you add Action frame category case here, set the
2297 * corresponding bit to 1 in sme_set_allowed_action_frames() for
2298 * the FW to hand over that frame to host without dropping itself
2299 */
Jeff Johnson295189b2012-06-20 16:38:30 -07002300 case SIR_MAC_ACTION_QOS_MGMT:
Leela Venkata Kiran Kumar Reddy Chiralac7c4e7e2014-04-29 10:50:16 -07002301 if ( (psessionEntry->limQosEnabled) ||
2302 (pActionHdr->actionID == SIR_MAC_QOS_MAP_CONFIGURE) )
Jeff Johnson295189b2012-06-20 16:38:30 -07002303 {
2304 switch (pActionHdr->actionID)
2305 {
2306 case SIR_MAC_QOS_ADD_TS_REQ:
2307 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2308 break;
2309
2310 case SIR_MAC_QOS_ADD_TS_RSP:
2311 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2312 break;
2313
2314 case SIR_MAC_QOS_DEL_TS_REQ:
2315 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2316 break;
2317
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -07002318 case SIR_MAC_QOS_MAP_CONFIGURE:
2319 __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2320 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002321 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302322 limLog(pMac, LOG1,
2323 FL("Qos action %d not handled"),
2324 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002325 break;
2326 }
2327 break ;
2328 }
2329
2330 break;
2331
2332 case SIR_MAC_ACTION_SPECTRUM_MGMT:
2333 switch (pActionHdr->actionID)
2334 {
2335#ifdef ANI_SUPPORT_11H
2336 case SIR_MAC_ACTION_MEASURE_REQUEST_ID:
2337 if(psessionEntry->lim11hEnable)
2338 {
2339 __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo);
2340 }
2341 break;
2342
2343 case SIR_MAC_ACTION_TPC_REQUEST_ID:
2344 if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
2345 (pessionEntry->limSystemRole == eLIM_AP_ROLE))
2346 {
2347 if(psessionEntry->lim11hEnable)
2348 {
2349 __limProcessTpcRequestFrame(pMac, pRxPacketInfo);
2350 }
2351 }
2352 break;
2353
2354#endif
2355 case SIR_MAC_ACTION_CHANNEL_SWITCH_ID:
2356 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
2357 {
2358 __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry);
2359 }
2360 break;
2361 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302362 limLog(pMac, LOG1,
2363 FL("Spectrum mgmt action id %d not handled"),
2364 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002365 break;
2366 }
2367 break;
2368
2369 case SIR_MAC_ACTION_WME:
2370 if (! psessionEntry->limWmeEnabled)
2371 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002372 limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002373 pActionHdr->actionID);
2374 break;
2375 }
2376 switch(pActionHdr->actionID)
2377 {
2378 case SIR_MAC_QOS_ADD_TS_REQ:
2379 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2380 break;
2381
2382 case SIR_MAC_QOS_ADD_TS_RSP:
2383 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2384 break;
2385
2386 case SIR_MAC_QOS_DEL_TS_REQ:
2387 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2388 break;
2389
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -07002390 case SIR_MAC_QOS_MAP_CONFIGURE:
2391 __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2392 break;
2393
Jeff Johnson295189b2012-06-20 16:38:30 -07002394 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302395 limLog(pMac, LOG1, FL("WME action %d not handled"),
2396 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002397 break;
2398 }
2399 break;
2400
2401 case SIR_MAC_ACTION_BLKACK:
2402 // Determine the "type" of BA Action Frame
2403 switch(pActionHdr->actionID)
2404 {
2405 case SIR_MAC_BLKACK_ADD_REQ:
2406 __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2407 break;
2408
2409 case SIR_MAC_BLKACK_ADD_RSP:
2410 __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2411 break;
2412
2413 case SIR_MAC_BLKACK_DEL:
2414 __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2415 break;
2416
2417 default:
2418 break;
2419 }
2420
2421 break;
2422 case SIR_MAC_ACTION_HT:
2423 /** Type of HT Action to be performed*/
2424 switch(pActionHdr->actionID) {
2425 case SIR_MAC_SM_POWER_SAVE:
2426 __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2427 break;
2428 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302429 limLog(pMac, LOG1,
2430 FL("Action ID %d not handled in HT Action category"),
2431 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002432 break;
2433 }
2434 break;
2435
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002436 case SIR_MAC_ACTION_WNM:
2437 {
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002438 PELOGE(limLog(pMac, LOG1, FL("WNM Action category %d action %d."),
2439 pActionHdr->category, pActionHdr->actionID);)
2440 switch (pActionHdr->actionID)
2441 {
2442 case SIR_MAC_WNM_BSS_TM_QUERY:
2443 case SIR_MAC_WNM_BSS_TM_REQUEST:
2444 case SIR_MAC_WNM_BSS_TM_RESPONSE:
2445 case SIR_MAC_WNM_NOTIF_REQUEST:
2446 case SIR_MAC_WNM_NOTIF_RESPONSE:
2447 {
2448 tpSirMacMgmtHdr pHdr;
2449 tANI_S8 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
2450 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2451 /* Forward to the SME to HDD to wpa_supplicant */
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302452 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2453 pRxPacketInfo,
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002454 psessionEntry, rssi);
2455 break;
2456 }
2457 }
2458 break;
2459 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002460#if defined WLAN_FEATURE_VOWIFI
2461 case SIR_MAC_ACTION_RRM:
Abhishek Singhe0bc0992016-05-20 17:58:18 +05302462 /* Ignore RRM measurement request until DHCP is set */
2463 if(pMac->rrm.rrmPEContext.rrmEnable &&
2464 pMac->roam.roamSession[psessionEntry->smeSessionId].dhcp_done)
Jeff Johnson295189b2012-06-20 16:38:30 -07002465 {
2466 switch(pActionHdr->actionID) {
2467 case SIR_MAC_RRM_RADIO_MEASURE_REQ:
2468 __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2469 break;
2470 case SIR_MAC_RRM_LINK_MEASUREMENT_REQ:
2471 __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2472 break;
2473 case SIR_MAC_RRM_NEIGHBOR_RPT:
2474 __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry );
2475 break;
2476 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302477 limLog( pMac, LOG1, FL("Action ID %d not handled in RRM"),
2478 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002479 break;
2480
2481 }
2482 }
2483 else
2484 {
2485 // Else we will just ignore the RRM messages.
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302486 limLog( pMac, LOG1,
Abhishek Singhe0bc0992016-05-20 17:58:18 +05302487 FL("RRM Action frame ignored as rrmEnable is %d or DHCP not completed %d"),
2488 pMac->rrm.rrmPEContext.rrmEnable,
2489 pMac->roam.roamSession[psessionEntry->smeSessionId].dhcp_done);
Jeff Johnson295189b2012-06-20 16:38:30 -07002490 }
2491 break;
2492#endif
Abhishek Singh00b71972016-01-07 10:51:04 +05302493#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) \
2494 || defined (WLAN_FEATURE_RMC)
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002495 case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
2496 {
2497 tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr;
2498 tpSirMacMgmtHdr pHdr;
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002499 tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 };
2500
2501 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002502
2503 //Check if it is a vendor specific action frame.
2504 if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) &&
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302505 (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr,
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002506 &pHdr->da[0], sizeof(tSirMacAddr))) &&
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002507 IS_WES_MODE_ENABLED(pMac) &&
2508 vos_mem_compare(pVendorSpecific->Oui, Oui, 3))
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002509 {
2510 PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"),
2511 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);)
2512 /* Forward to the SME to HDD to wpa_supplicant */
2513 // type is ACTION
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302514 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2515 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302516 psessionEntry, 0);
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002517 }
Abhishek Singh00b71972016-01-07 10:51:04 +05302518#if defined (WLAN_FEATURE_RMC)
2519 else if ((eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) &&
2520 ((VOS_TRUE == vos_mem_compare(SIR_MAC_RMC_MCAST_ADDRESS,
2521 &pHdr->da[0], sizeof(tSirMacAddr))) ||
2522 (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr,
2523 &pHdr->da[0], sizeof(tSirMacAddr)))) &&
2524 vos_mem_compare(pVendorSpecific->Oui, SIR_MAC_RMC_OUI, 3))
2525 {
2526 tANI_U8 MagicCode[] =
2527 { 0x4f, 0x58, 0x59, 0x47, 0x45, 0x4e };
2528 tpSirMacIbssExtNetworkFrameHdr pIbssExtHdr =
2529 (tpSirMacIbssExtNetworkFrameHdr) pActionHdr;
2530
2531 if (vos_mem_compare(pIbssExtHdr->MagicCode,
2532 MagicCode, sizeof(MagicCode)) &&
2533 pIbssExtHdr->version == SIR_MAC_RMC_VER )
2534 {
2535 switch (pIbssExtHdr->actionID)
2536 {
2537 default:
2538 PELOGE(limLog(pMac, LOGE,
2539 FL("Action RMC actionID %d not handled"),
2540 pIbssExtHdr->actionID);)
2541 break;
2542 case SIR_MAC_RMC_RULER_INFORM_SELECTED:
2543 limLog(pMac, LOG1,
2544 FL("Action RMC RULER_INFORM_SELECTED."));
2545 limProcessRMCMessages(pMac,
2546 eLIM_RMC_OTA_RULER_INFORM_SELECTED,
2547 (tANI_U32 *)pRxPacketInfo);
2548 break;
2549 case SIR_MAC_RMC_RULER_INFORM_CANCELLED:
2550 limLog(pMac, LOG1,
2551 FL("Action RMC RULER_INFORM_CANCELLED."));
2552 limProcessRMCMessages(pMac,
2553 eLIM_RMC_OTA_RULER_INFORM_CANCELLED,
2554 (tANI_U32 *)pRxPacketInfo);
2555 break;
2556 }
2557 }
2558 else
2559 {
2560 limLog( pMac, LOG1,
2561 FL("Dropping the vendor specific action frame in IBSS "
2562 "mode because of Ibss Ext Magic mismatch "
2563 MAC_ADDRESS_STR " or Version mismatch = %d"),
2564 MAC_ADDR_ARRAY(pIbssExtHdr->MagicCode),
2565 pIbssExtHdr->version );
2566 }
2567 }
2568#endif /* WLAN_FEATURE_RMC */
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002569 else
2570 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302571 limLog( pMac, LOG1,
2572 FL("Dropping the vendor specific action frame because of( "
2573 "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or "
2574 "not received with SelfSta Mac address) system role = %d"),
2575 IS_WES_MODE_ENABLED(pMac),
2576 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1],
2577 pVendorSpecific->Oui[2],
2578 psessionEntry->limSystemRole );
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002579 }
2580 }
2581 break;
Abhishek Singh00b71972016-01-07 10:51:04 +05302582#endif /* WLAN_FEATURE_VOWIFI_11R || FEATURE_WLAN_ESE ||
2583 FEATURE_WLAN_LFR || WLAN_FEATURE_RMC */
Jeff Johnson295189b2012-06-20 16:38:30 -07002584 case SIR_MAC_ACTION_PUBLIC_USAGE:
2585 switch(pActionHdr->actionID) {
2586 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2587 {
2588 tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002589 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2590
Jeff Johnson295189b2012-06-20 16:38:30 -07002591 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302592 if (vos_mem_compare(pPubAction->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002593 {
2594 /* Forward to the SME to HDD to wpa_supplicant */
2595 // type is ACTION
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302596 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2597 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302598 psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002599 }
2600 else
2601 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302602 limLog( pMac, LOG1,
2603 FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
2604 pPubAction->Oui[0], pPubAction->Oui[1],
2605 pPubAction->Oui[2], pPubAction->Oui[3] );
Jeff Johnson295189b2012-06-20 16:38:30 -07002606 }
2607 }
2608 break;
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08002609#ifdef WLAN_FEATURE_AP_HT40_24G
2610 case SIR_MAC_ACTION_2040_BSS_COEXISTENCE:
2611 {
2612 if (pMac->roam.configParam.apHT40_24GEnabled)
2613 {
2614 limLog( pMac, LOGW, FL("Public Action 20/40 BSS"
2615 "Coexistence Management frame"));
2616
2617 __limProcess2040bssCoexistenceActionFrame(pMac,
2618 psessionEntry->smeSessionId, (tANI_U8 *) pRxPacketInfo,
2619 psessionEntry);
2620 }
2621 break;
2622 }
2623#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002624#ifdef FEATURE_WLAN_TDLS
2625 case SIR_MAC_TDLS_DIS_RSP:
2626 {
Chilam NG571c65a2013-01-19 12:27:36 +05302627 tANI_S8 rssi;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002628
Chilam NG571c65a2013-01-19 12:27:36 +05302629 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002630 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002631 ("Public Action TDLS Discovery RSP ..")) ;
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302632 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2633 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302634 psessionEntry, rssi);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002635 }
2636 break;
2637#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002638
2639 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302640 limLog(pMac, LOG1, FL("Unhandled public action frame -- %x "),
2641 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002642 break;
2643 }
2644 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002645
2646#ifdef WLAN_FEATURE_11W
2647 case SIR_MAC_ACTION_SA_QUERY:
2648 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002649 PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);)
2650 switch (pActionHdr->actionID)
2651 {
2652 case SIR_MAC_SA_QUERY_REQ:
2653 /**11w SA query request action frame received**/
2654 /* Respond directly to the incoming request in LIM */
2655 __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2656 break;
2657 case SIR_MAC_SA_QUERY_RSP:
2658 /**11w SA query response action frame received**/
Chet Lanctot8cecea22014-02-11 19:09:36 -08002659 /* Handle based on the current SA Query state */
Chet Lanctot186b5732013-03-18 10:26:30 -07002660 __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2661 break;
2662 default:
2663 break;
2664 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002665 break;
2666 }
2667#endif
Mohit Khanna4a70d262012-09-11 16:30:12 -07002668#ifdef WLAN_FEATURE_11AC
2669 case SIR_MAC_ACTION_VHT:
2670 {
2671 if (psessionEntry->vhtCapability)
2672 {
2673 switch (pActionHdr->actionID)
2674 {
2675 case SIR_MAC_VHT_OPMODE_NOTIFICATION:
2676 __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry);
2677 break;
2678 default:
2679 break;
2680 }
2681 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002682 break;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -07002683 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002684#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002685 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302686 limLog(pMac, LOG1,
2687 FL("Action category %d not handled"), pActionHdr->category);
Jeff Johnson295189b2012-06-20 16:38:30 -07002688 break;
2689 }
2690}
2691
Jeff Johnson295189b2012-06-20 16:38:30 -07002692/**
2693 * limProcessActionFrameNoSession
2694 *
2695 *FUNCTION:
2696 * This function is called by limProcessMessageQueue() upon
2697 * Action frame reception and no session.
2698 * Currently only public action frames can be received from
2699 * a non-associated station.
2700 *
2701 *LOGIC:
2702 *
2703 *ASSUMPTIONS:
2704 *
2705 *NOTE:
2706 *
2707 * @param pMac - Pointer to Global MAC structure
2708 * @param *pBd - A pointer to Buffer descriptor + associated PDUs
2709 * @return None
2710 */
2711
2712void
2713limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd)
2714{
2715 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd);
2716 tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody;
2717
Mohit Khanna23863762012-09-11 17:40:09 -07002718 limLog( pMac, LOG1, "Received a Action frame -- no session");
Jeff Johnson295189b2012-06-20 16:38:30 -07002719
2720 switch ( pActionHdr->category )
2721 {
2722 case SIR_MAC_ACTION_PUBLIC_USAGE:
2723 switch(pActionHdr->actionID) {
2724 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2725 {
Jeff Johnson295189b2012-06-20 16:38:30 -07002726 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2727
Jeff Johnson295189b2012-06-20 16:38:30 -07002728 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302729 if (vos_mem_compare(pActionHdr->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002730 {
2731 /* Forward to the SME to HDD to wpa_supplicant */
2732 // type is ACTION
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302733 limSendSmeMgmtFrameInd(pMac, 0, pBd, NULL, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002734 }
2735 else
2736 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302737 limLog( pMac, LOG1,
2738 FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
2739 pActionHdr->Oui[0], pActionHdr->Oui[1],
2740 pActionHdr->Oui[2], pActionHdr->Oui[3]);
Jeff Johnson295189b2012-06-20 16:38:30 -07002741 }
2742 }
2743 break;
2744 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302745 limLog(pMac, LOG1,
2746 FL("Unhandled public action frame -- %x "), pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002747 break;
2748 }
2749 break;
2750 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302751 limLog(pMac, LOG1,
2752 FL("Unhandled action frame without session -- %x "),
2753 pActionHdr->category);
2754 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002755
2756 }
2757}