blob: ab54e41c0f37a58078b6518787687e7cc0f0c0cc [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Abhishek Singh09d4e4a2016-01-12 11:20:22 +05302 * Copyright (c) 2012-2016 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
71
72#define BA_DEFAULT_TX_BUFFER_SIZE 64
73
74typedef enum
75{
76 LIM_ADDBA_RSP = 0,
77 LIM_ADDBA_REQ = 1
78}tLimAddBaValidationReqType;
79
80/* Note: The test passes if the STAUT stops sending any frames, and no further
81 frames are transmitted on this channel by the station when the AP has sent
82 the last 6 beacons, with the channel switch information elements as seen
83 with the sniffer.*/
84#define SIR_CHANSW_TX_STOP_MAX_COUNT 6
85/**-----------------------------------------------------------------
86\fn limStopTxAndSwitchChannel
87\brief Stops the transmission if channel switch mode is silent and
88 starts the channel switch timer.
89
90\param pMac
91\return NONE
92-----------------------------------------------------------------*/
93void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId)
94{
95 tANI_U8 isFullPowerRequested = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070096 tpPESession psessionEntry;
97
98 psessionEntry = peFindSessionBySessionId( pMac , sessionId );
99
100 if( NULL == psessionEntry )
101 {
102 limLog(pMac, LOGE, FL("Session %d not active\n "), sessionId);
103 return;
104 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700105
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530106 limLog(pMac, LOG1, FL("Channel switch Mode == %d"),
107 psessionEntry->gLimChannelSwitch.switchMode);
Jeff Johnson295189b2012-06-20 16:38:30 -0700108
Jeff Johnsone7245742012-09-05 17:12:55 -0700109 if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT ||
110 psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT)
Jeff Johnson295189b2012-06-20 16:38:30 -0700111 {
112 /* Freeze the transmission */
113 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX);
114
115 /*Request for Full power only if the device is in powersave*/
116 if(!limIsSystemInActiveState(pMac))
117 {
118 /* Request Full Power */
119 limSendSmePreChannelSwitchInd(pMac);
120 isFullPowerRequested = 1;
121 }
122 }
123 else
124 {
125 /* Resume the transmission */
126 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX);
127 }
128
Jeff Johnsone7245742012-09-05 17:12:55 -0700129 pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700130 /* change the channel immediatly only if the channel switch count is 0 and the
131 * device is not in powersave
132 * If the device is in powersave channel switch should happen only after the
133 * device comes out of the powersave */
Jeff Johnsone7245742012-09-05 17:12:55 -0700134 if (psessionEntry->gLimChannelSwitch.switchCount == 0)
Jeff Johnson295189b2012-06-20 16:38:30 -0700135 {
136 if(limIsSystemInActiveState(pMac))
137 {
138 limProcessChannelSwitchTimeout(pMac);
139 }
140 else if(!isFullPowerRequested)
141 {
142 /* If the Full power is already not requested
143 * Request Full Power so the channel switch happens
144 * after device comes to full power */
145 limSendSmePreChannelSwitchInd(pMac);
146 }
147 return;
148 }
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -0800149 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700150
Jeff Johnson295189b2012-06-20 16:38:30 -0700151
152 if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS)
153 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700154 limLog(pMac, LOGP, FL("tx_timer_activate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700155 }
156 return;
157}
158
159/**------------------------------------------------------------
160\fn limStartChannelSwitch
161\brief Switches the channel if switch count == 0, otherwise
162 starts the timer for channel switch and stops BG scan
163 and heartbeat timer tempororily.
164
165\param pMac
166\param psessionEntry
167\return NONE
168------------------------------------------------------------*/
169tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
170{
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530171 limLog(pMac, LOG1, FL(" ENTER"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700172
173 /*If channel switch is already running and it is on a different session, just return*/
174 /*This need to be removed for MCC */
175 if( limIsChanSwitchRunning (pMac) &&
176 psessionEntry->gLimSpecMgmt.dot11hChanSwState != eLIM_11H_CHANSW_RUNNING )
177 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700178 limLog(pMac, LOGW, FL("Ignoring channel switch on session %d"), psessionEntry->peSessionId);
Jeff Johnsone7245742012-09-05 17:12:55 -0700179 return eSIR_SUCCESS;
180 }
Sushant Kaushikb97a0082015-08-31 12:36:45 +0530181#ifdef FEATURE_WLAN_DIAG_SUPPORT
182 limDiagEventReport(pMac, WLAN_PE_DIAG_CHANNEL_SWITCH_ANOUNCEMENT,
183 psessionEntry, eSIR_SUCCESS, LIM_SWITCH_CHANNEL_CSA);
184#endif
185
Kalikinkar dhara085c02f2014-02-28 15:32:12 -0800186 psessionEntry->channelChangeCSA = LIM_SWITCH_CHANNEL_CSA;
Jeff Johnson295189b2012-06-20 16:38:30 -0700187 /* Deactivate and change reconfigure the timeout value */
Jeff Johnsone7245742012-09-05 17:12:55 -0700188 //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER);
Varun Reddy Yeturue3bbf6e2013-02-08 18:50:55 -0800189 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnsone7245742012-09-05 17:12:55 -0700190 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
191 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700192 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700193 return eSIR_FAILURE;
194 }
195
196 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
197 psessionEntry->gLimChannelSwitch.switchTimeoutValue,
198 0) != TX_SUCCESS)
199 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700200 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnsone7245742012-09-05 17:12:55 -0700201 return eSIR_FAILURE;
202 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700203
204 /* Follow the channel switch, forget about the previous quiet. */
205 //If quiet is running, chance is there to resume tx on its timeout.
206 //so stop timer for a safer side.
Jeff Johnsone7245742012-09-05 17:12:55 -0700207 if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN)
Jeff Johnson295189b2012-06-20 16:38:30 -0700208 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700209 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700210 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS)
211 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700212 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700213 return eSIR_FAILURE;
214 }
215 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700216 else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING)
Jeff Johnson295189b2012-06-20 16:38:30 -0700217 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700218 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700219 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS)
220 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700221 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700222 return eSIR_FAILURE;
223 }
224 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700225 psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
Jeff Johnson295189b2012-06-20 16:38:30 -0700226
227 /* Prepare for 11h channel switch */
228 limPrepareFor11hChannelSwitch(pMac, psessionEntry);
229
230 /** Dont add any more statements here as we posted finish scan request
231 * to HAL, wait till we get the response
232 */
233 return eSIR_SUCCESS;
234}
235
236
237/**
238 * __limProcessChannelSwitchActionFrame
239 *
240 *FUNCTION:
241 *
242 *LOGIC:
243 *
244 *ASSUMPTIONS:
245 *
246 *NOTE:
247 *
248 * @param pMac - Pointer to Global MAC structure
249 * @param *pRxPacketInfo - A pointer to packet info structure
250 * @return None
251 */
252
253static void
254
255__limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
256{
257
258 tpSirMacMgmtHdr pHdr;
259 tANI_U8 *pBody;
260 tDot11fChannelSwitch *pChannelSwitchFrame;
261 tANI_U16 beaconPeriod;
262 tANI_U32 val;
263 tANI_U32 frameLen;
264 tANI_U32 nStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -0700265
266 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
267 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
268 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
269
Abhishek Singh127a8442014-12-15 17:31:27 +0530270 limLog(pMac, LOG1, FL("Received Channel switch action frame"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700271 if (!psessionEntry->lim11hEnable)
272 return;
273
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530274 pChannelSwitchFrame = vos_mem_malloc(sizeof(*pChannelSwitchFrame));
275 if (NULL == pChannelSwitchFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -0700276 {
277 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530278 FL("AllocateMemory failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700279 return;
280 }
281
282 /* Unpack channel switch frame */
283 nStatus = dot11fUnpackChannelSwitch(pMac, pBody, frameLen, pChannelSwitchFrame);
284
285 if( DOT11F_FAILED( nStatus ))
286 {
287 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700288 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700289 nStatus,
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700290 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530291 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700292 return;
293 }
294 else if(DOT11F_WARNED( nStatus ))
295 {
296 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700297 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700298 nStatus,
299 frameLen);
300 }
301
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530302 if (vos_mem_compare((tANI_U8 *) &psessionEntry->bssId,
303 (tANI_U8 *) &pHdr->sa,
304 sizeof(tSirMacAddr)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700305 {
306 #if 0
307 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS)
308 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530309 vos_mem_free(pChannelSwitchFrame);
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700310 limLog(pMac, LOGP, FL("could not retrieve Beacon interval"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700311 return;
312 }
313 #endif// TO SUPPORT BT-AMP
314
315 /* copy the beacon interval from psessionEntry*/
316 val = psessionEntry->beaconParams.beaconInterval;
317
318 beaconPeriod = (tANI_U16) val;
319
Jeff Johnsone7245742012-09-05 17:12:55 -0700320 psessionEntry->gLimChannelSwitch.primaryChannel = pChannelSwitchFrame->ChanSwitchAnn.newChannel;
321 psessionEntry->gLimChannelSwitch.switchCount = pChannelSwitchFrame->ChanSwitchAnn.switchCount;
322 psessionEntry->gLimChannelSwitch.switchTimeoutValue = SYS_MS_TO_TICKS(beaconPeriod) *
323 psessionEntry->gLimChannelSwitch.switchCount;
324 psessionEntry->gLimChannelSwitch.switchMode = pChannelSwitchFrame->ChanSwitchAnn.switchMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700325#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700326 if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability)
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700327 {
328 psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth;
329 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0;
330 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq1;
331 }
332#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700333
Abhishek Singh127a8442014-12-15 17:31:27 +0530334 limLog(pMac, LOG1, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"),
335 psessionEntry->gLimChannelSwitch.switchTimeoutValue);
Jeff Johnson295189b2012-06-20 16:38:30 -0700336
337 /* Only primary channel switch element is present */
Jeff Johnsone7245742012-09-05 17:12:55 -0700338 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
339 psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -0700340
Jeff Johnsone7245742012-09-05 17:12:55 -0700341 if (psessionEntry->htSupportedChannelWidthSet)
Jeff Johnson295189b2012-06-20 16:38:30 -0700342 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700343 if ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
344 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))
Jeff Johnson295189b2012-06-20 16:38:30 -0700345 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700346 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
347 psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700348 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700349#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700350 if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present)
351 {
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700352 if (pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
353 {
354 if (pChannelSwitchFrame->ExtChanSwitchAnn.present && ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
355 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)))
356 {
357 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700358 psessionEntry->gLimChannelSwitch.secondarySubBand =
359 limGet11ACPhyCBState(pMac,
360 psessionEntry->gLimChannelSwitch.primaryChannel,
361 pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset,
362 pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0,
363 psessionEntry);
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700364 }
365 }
366 }
367#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700368 }
369
370 }
371 else
372 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530373 limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));
Jeff Johnson295189b2012-06-20 16:38:30 -0700374 }
375
376 if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry))
377 {
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530378 limLog(pMac, LOG1, FL("Could not start channel switch"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700379 }
380
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530381 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700382 return;
383} /*** end limProcessChannelSwitchActionFrame() ***/
384
385
Mohit Khanna4a70d262012-09-11 16:30:12 -0700386#ifdef WLAN_FEATURE_11AC
387static void
388__limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
389{
390
391 tpSirMacMgmtHdr pHdr;
392 tANI_U8 *pBody;
393 tDot11fOperatingMode *pOperatingModeframe;
394 tANI_U32 frameLen;
395 tANI_U32 nStatus;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700396 tpDphHashNode pSta;
397 tANI_U16 aid;
Abhishek Singhdf8eb312014-11-15 00:49:28 +0530398 tANI_U8 operMode;
399 tANI_U32 channelBondingMode;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700400
401 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
402 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
403 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
404
Abhishek Singhdf8eb312014-11-15 00:49:28 +0530405 limLog(pMac, LOG1, FL("Received Operating Mode action frame"));
406
407 if( RF_CHAN_14 >= psessionEntry->currentOperChannel )
408 {
409 channelBondingMode = pMac->roam.configParam.channelBondingMode24GHz;
410 }
411 else
412 {
413 channelBondingMode = pMac->roam.configParam.channelBondingMode5GHz;
414 }
415
416 /* Do not update the channel bonding mode if channel bonding
417 * mode is disabled in INI.
418 */
419 if(WNI_CFG_CHANNEL_BONDING_MODE_DISABLE == channelBondingMode)
420 {
421 limLog(pMac, LOGW,
422 FL("channel bonding disabled"));
423 return;
424 }
425
Sushant Kaushikc1123872015-01-07 13:59:20 +0530426 if (( RF_CHAN_14 >= psessionEntry->currentOperChannel )&&
427 !IS_HT40_OBSS_SCAN_FEATURE_ENABLE)
428 {
429 limLog(pMac, LOGW,
430 FL("channel bonding disabled as FW doesn't supoort CB in 2.4gz"));
431 return;
432 }
433
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530434 pOperatingModeframe = vos_mem_malloc(sizeof(*pOperatingModeframe));
435 if (NULL == pOperatingModeframe)
Mohit Khanna4a70d262012-09-11 16:30:12 -0700436 {
437 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530438 FL("AllocateMemory failed"));
Mohit Khanna4a70d262012-09-11 16:30:12 -0700439 return;
440 }
441
442 /* Unpack channel switch frame */
443 nStatus = dot11fUnpackOperatingMode(pMac, pBody, frameLen, pOperatingModeframe);
444
445 if( DOT11F_FAILED( nStatus ))
446 {
447 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700448 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700449 nStatus,
450 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530451 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700452 return;
453 }
454 else if(DOT11F_WARNED( nStatus ))
455 {
456 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700457 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700458 nStatus,
459 frameLen);
460 }
461 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
Padma, Santhosh Kumar6a3fdc62015-08-28 17:59:51 +0530462 if (pSta == NULL)
463 {
464 PELOGE(limLog(pMac, LOGE, FL("Station context not found"));)
465 return;
466 }
Mohit Khanna4a70d262012-09-11 16:30:12 -0700467
468 operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ;
469 if( operMode != pOperatingModeframe->OperatingMode.chanWidth)
470 {
471 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700472 FL(" received Chanwidth %d, staIdx = %d"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700473 (pOperatingModeframe->OperatingMode.chanWidth ),
474 pSta->staIndex);
475
476 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700477 FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700478 pHdr->sa[0],
479 pHdr->sa[1],
480 pHdr->sa[2],
481 pHdr->sa[3],
482 pHdr->sa[4],
483 pHdr->sa[5]);
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700484
Mohit Khanna4a70d262012-09-11 16:30:12 -0700485 if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ)
486 {
487 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
488 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
489 }
490 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ)
491 {
492 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
493 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
494 }
495 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ)
496 {
497 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
498 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ;
499 }
500 limCheckVHTOpModeChange( pMac, psessionEntry,
501 (pOperatingModeframe->OperatingMode.chanWidth), pSta->staIndex);\
502 }
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530503 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700504 return;
505}
506#endif
507
Jeff Johnson295189b2012-06-20 16:38:30 -0700508static void
509__limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
510{
Jeff Johnson295189b2012-06-20 16:38:30 -0700511}
512
513
514static void
515__limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
516{
517 tSirAddtsRspInfo addts;
518 tSirRetStatus retval;
519 tpSirMacMgmtHdr pHdr;
520 tpDphHashNode pSta;
521 tANI_U16 aid;
522 tANI_U32 frameLen;
523 tANI_U8 *pBody;
524 tpLimTspecInfo tspecInfo;
525 tANI_U8 ac;
526 tpDphHashNode pStaDs = NULL;
527 tANI_U8 rspReqd = 1;
528 tANI_U32 cfgLen;
529 tSirMacAddr peerMacAddr;
530
531
532 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
533 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
534 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
535
536
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700537 PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700538 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
539 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700540 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 return;
542 }
543
544 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
545 if (pSta == NULL)
546 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700547 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700548 return;
549 }
550
551 retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts);
552 if (retval != eSIR_SUCCESS)
553 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700554 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700555 return;
556 }
557
558 // don't have to check for qos/wme capabilities since we wouldn't have this
559 // flag set otherwise
560 if (! pMac->lim.gLimAddtsSent)
561 {
562 // we never sent an addts request!
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700563 PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700564 return;
565 }
566
567 if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken)
568 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700569 limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring",
Jeff Johnson295189b2012-06-20 16:38:30 -0700570 addts.dialogToken, pMac->lim.gLimAddtsReq.req.dialogToken);
571 return;
572 }
573
574 /*
575 * for successful addts reponse, try to add the classifier.
576 * if this fails for any reason, we should send a delts request to the ap
577 * for now, its ok not to send a delts since we are going to add support for
578 * multiple tclas soon and until then we won't send any addts requests with
579 * multiple tclas elements anyway.
580 * In case of addClassifier failure, we just let the addts timer run out
581 */
582 if (((addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
583 (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) &&
584 (addts.status == eSIR_MAC_SUCCESS_STATUS))
585 {
586 // add the classifier - this should always succeed
587 if (addts.numTclas > 1) // currently no support for multiple tclas elements
588 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700589 limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700590 aid, addts.numTclas);
591 return;
592 }
593 else if (addts.numTclas == 1)
594 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700595 limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!", aid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700596 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
597 }
598 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700599 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700600 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
601 addts.status);
602
603 // deactivate the response timer
604 limDeactivateAndChangeTimer(pMac, eLIM_ADDTS_RSP_TIMER);
605
606 if (addts.status != eSIR_MAC_SUCCESS_STATUS)
607 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700608 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700609 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
610 addts.status);
611 limSendSmeAddtsRsp(pMac, true, addts.status, psessionEntry, addts.tspec,
612 psessionEntry->smeSessionId, psessionEntry->transactionId);
613
614 // clear the addts flag
615 pMac->lim.gLimAddtsSent = false;
616
617 return;
618 }
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800619#ifdef FEATURE_WLAN_ESE
Jeff Johnson295189b2012-06-20 16:38:30 -0700620 if (addts.tsmPresent)
621 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700622 limLog(pMac, LOGW, "TSM IE Present");
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800623 psessionEntry->eseContext.tsm.tid = addts.tspec.tsinfo.traffic.userPrio;
624 vos_mem_copy(&psessionEntry->eseContext.tsm.tsmInfo,
625 &addts.tsmIE,sizeof(tSirMacESETSMIE));
626#ifdef FEATURE_WLAN_ESE_UPLOAD
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700627 limSendSmeTsmIEInd(pMac, psessionEntry, addts.tsmIE.tsid,
628 addts.tsmIE.state, addts.tsmIE.msmt_interval);
629#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700630 limActivateTSMStatsTimer(pMac, psessionEntry);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800631#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700632 }
633#endif
634 /* Since AddTS response was successful, check for the PSB flag
635 * and directional flag inside the TS Info field.
636 * An AC is trigger enabled AC if the PSB subfield is set to 1
637 * in the uplink direction.
638 * An AC is delivery enabled AC if the PSB subfield is set to 1
639 * in the downlink direction.
640 * An AC is trigger and delivery enabled AC if the PSB subfield
641 * is set to 1 in the bi-direction field.
642 */
643 if (addts.tspec.tsinfo.traffic.psb == 1)
644 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, SET_UAPSD_MASK);
645 else
646 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, CLEAR_UAPSD_MASK);
647
648
649 /* ADDTS success, so AC is now admitted. We shall now use the default
650 * EDCA parameters as advertised by AP and send the updated EDCA params
651 * to HAL.
652 */
653 ac = upToAc(addts.tspec.tsinfo.traffic.userPrio);
654 if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK)
655 {
656 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
657 }
658 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK)
659 {
660 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
661 }
662 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR)
663 {
664 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
665 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
666 }
667
668 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
669
670 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
671 if (pStaDs != NULL)
672 {
673 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
674 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
675 else
676 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
677 }
678 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700679 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700680
681
682 sirCopyMacAddr(peerMacAddr,psessionEntry->bssId);
683
684 //if schedule is not present then add TSPEC with svcInterval as 0.
685 if(!addts.schedulePresent)
686 addts.schedule.svcInterval = 0;
687 if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, &addts.tspec, addts.schedule.svcInterval, &tspecInfo))
688 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700689 PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700690 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
691 psessionEntry);
692 pMac->lim.gLimAddtsSent = false;
693 return; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status.
694 }
695 if((addts.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA) ||
Madan Mohan Koyyalamudi198ade32013-09-29 03:52:25 +0530696 ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700697 {
698 retval = limSendHalMsgAddTs(pMac, pSta->staIndex, tspecInfo->idx, addts.tspec, psessionEntry->peSessionId);
699 if(eSIR_SUCCESS != retval)
700 {
701 limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecInfo->idx);
702
703 // Send DELTS action frame to AP
704 cfgLen = sizeof(tSirMacAddr);
705 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
706 psessionEntry);
707 limSendSmeAddtsRsp(pMac, true, retval, psessionEntry, addts.tspec,
708 psessionEntry->smeSessionId, psessionEntry->transactionId);
709 pMac->lim.gLimAddtsSent = false;
710 return;
711 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700712 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700713 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
714 }
715 else
716 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700717 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700718 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700719 PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700720 // Use the smesessionId and smetransactionId from the PE session context
721 limSendSmeAddtsRsp(pMac, true, eSIR_SME_SUCCESS, psessionEntry, addts.tspec,
722 psessionEntry->smeSessionId, psessionEntry->transactionId);
723 }
724
725 // clear the addts flag
726 pMac->lim.gLimAddtsSent = false;
727 return;
728}
729
730
731static void
732__limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
733{
734 tSirRetStatus retval;
735 tSirDeltsReqInfo delts;
736 tpSirMacMgmtHdr pHdr;
737 tpDphHashNode pSta;
738 tANI_U32 frameLen;
739 tANI_U16 aid;
740 tANI_U8 *pBody;
741 tANI_U8 tsStatus;
742 tSirMacTSInfo *tsinfo;
743 tANI_U8 tspecIdx;
744 tANI_U8 ac;
745 tpDphHashNode pStaDs = NULL;
746
747
748 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
749 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
750 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
751
752 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
753 if (pSta == NULL)
754 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700755 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700756 return;
757 }
758
759 // parse the delts request
760 retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts);
761 if (retval != eSIR_SUCCESS)
762 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700763 PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700764 return;
765 }
766
767 if (delts.wmeTspecPresent)
768 {
769 if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
770 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700771 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700772 return;
773 }
Abhishek Singh525045c2014-12-15 17:18:45 +0530774 limLog(pMac, LOG1, FL("WME Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700775 }
776 else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled)
777 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530778 limLog(pMac, LOG1, FL("11e QoS Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700779 }
780 else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled)
781 {
Abhishek Singh525045c2014-12-15 17:18:45 +0530782 limLog(pMac, LOG1, FL("WSM Delts received"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700783 }
784 else
785 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700786 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700787 return;
788 }
789
790 tsinfo = delts.wmeTspecPresent ? &delts.tspec.tsinfo : &delts.tsinfo;
791
792 // if no Admit Control, ignore the request
793 if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA))
794 {
795
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530796 if (upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC)
Jeff Johnson295189b2012-06-20 16:38:30 -0700797 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700798 limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700799 tsinfo->traffic.userPrio);
800 return;
801 }
802 }
803
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530804 if ((psessionEntry->limSystemRole != eLIM_AP_ROLE) &&
805 (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
806 limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry);
807
Jeff Johnson295189b2012-06-20 16:38:30 -0700808 // try to delete the TS
809 if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx))
810 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700811 PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700812 return;
813 }
814
815 else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
816 (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH))
817 {
818 //Edca only for now.
819 }
820 else
821 {
822 //send message to HAL to delete TS
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530823 if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac,
824 pSta->staIndex,
825 tspecIdx,
826 delts,
827 psessionEntry->peSessionId,
828 psessionEntry->bssId))
Jeff Johnson295189b2012-06-20 16:38:30 -0700829 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700830 limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700831 tsinfo->traffic.userPrio);
832 return;
833 }
834 }
835
836 /* We successfully deleted the TSPEC. Update the dynamic UAPSD Mask.
837 * The AC for this TSPEC is no longer trigger enabled if this Tspec
838 * was set-up in uplink direction only.
839 * The AC for this TSPEC is no longer delivery enabled if this Tspec
840 * was set-up in downlink direction only.
841 * The AC for this TSPEC is no longer triiger enabled and delivery
842 * enabled if this Tspec was a bidirectional TSPEC.
843 */
844 limSetTspecUapsdMask(pMac, tsinfo, CLEAR_UAPSD_MASK);
845
846
847 /* We're deleting the TSPEC.
848 * The AC for this TSPEC is no longer admitted in uplink/downlink direction
849 * if this TSPEC was set-up in uplink/downlink direction only.
850 * The AC for this TSPEC is no longer admitted in both uplink and downlink
851 * directions if this TSPEC was a bi-directional TSPEC.
852 * If ACM is set for this AC and this AC is admitted only in downlink
853 * direction, PE needs to downgrade the EDCA parameter
854 * (for the AC for which TS is being deleted) to the
855 * next best AC for which ACM is not enabled, and send the
856 * updated values to HAL.
857 */
858 ac = upToAc(tsinfo->traffic.userPrio);
859
860 if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK)
861 {
862 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
863 }
864 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK)
865 {
866 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
867 }
868 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR)
869 {
870 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
871 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
872 }
873
874 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
875
876 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
877 if (pStaDs != NULL)
878 {
879 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
880 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
881 else
882 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
883 }
884 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700885 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700886
Abhishek Singh3cbf6052014-12-15 16:46:42 +0530887 limLog(pMac, LOG1, FL("DeleteTS succeeded"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700888
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800889#ifdef FEATURE_WLAN_ESE
890#ifdef FEATURE_WLAN_ESE_UPLOAD
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700891 limSendSmeTsmIEInd(pMac, psessionEntry, 0, 0, 0);
892#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700893 limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER);
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800894#endif /* FEATURE_WLAN_ESE_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700895#endif
896
897}
898
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700899static void
900__limProcessQosMapConfigureFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,
901 tpPESession psessionEntry)
902{
903 tpSirMacMgmtHdr pHdr;
904 tANI_U32 frameLen;
905 tANI_U8 *pBody;
906 tSirRetStatus retval;
907 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
908 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
909 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
910 retval = sirConvertQosMapConfigureFrame2Struct(pMac, pBody, frameLen,
Kumar Anand82c009f2014-05-29 00:29:42 -0700911 &psessionEntry->QosMapSet);
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700912 if (retval != eSIR_SUCCESS)
913 {
914 PELOGW(limLog(pMac, LOGE,
915 FL("QosMapConfigure frame parsing failed (error %d)"), retval);)
916 return;
917 }
Naveen Rawat71e1a2e2015-07-28 16:11:21 +0530918 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
919 pRxPacketInfo, psessionEntry, 0);
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -0700920}
Jeff Johnson295189b2012-06-20 16:38:30 -0700921
922#ifdef ANI_SUPPORT_11H
923/**
924 * limProcessBasicMeasReq
925 *
926 *FUNCTION:
927 * This function is called by limProcessMeasurementRequestFrame()
928 * when it received a Basic measurement Request action frame.
929 * Station/BP receiving this should perform basic measurements
930 * and then send Basic Measurement Report. AP should not perform
931 * any measurements, and send report indicating refusal.
932 *
933 *LOGIC:
934 *
935 *ASSUMPTIONS:
936 *
937 *NOTE:
938 *
939 * @param pMac - Pointer to Global MAC structure
940 * @param pMeasReqFrame - A pointer to Basic Meas. Req structure
941 * @return None
942 */
943static void
944__limProcessBasicMeasReq(tpAniSirGlobal pMac,
945 tpSirMacMeasReqActionFrame pMeasReqFrame,
946 tSirMacAddr peerMacAddr)
947{
948 // TBD - Station shall perform basic measurements
949
950 if (limSendMeasReportFrame(pMac,
951 pMeasReqFrame,
952 peerMacAddr) != eSIR_SUCCESS)
953 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700954 PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700955 return;
956 }
957}
958
959
960/**
961 * limProcessCcaMeasReq
962 *
963 *FUNCTION:
964 * This function is called by limProcessMeasurementRequestFrame()
965 * when it received a CCA measurement Request action frame.
966 * Station/BP receiving this should perform CCA measurements
967 * and then send CCA Measurement Report. AP should not perform
968 * any measurements, and send report indicating refusal.
969 *
970 *LOGIC:
971 *
972 *ASSUMPTIONS:
973 *
974 *NOTE:
975 *
976 * @param pMac - Pointer to Global MAC structure
977 * @param pMeasReqFrame - A pointer to CCA Meas. Req structure
978 * @return None
979 */
980static void
981__limProcessCcaMeasReq(tpAniSirGlobal pMac,
982 tpSirMacMeasReqActionFrame pMeasReqFrame,
983 tSirMacAddr peerMacAddr)
984{
985 // TBD - Station shall perform cca measurements
986
987 if (limSendMeasReportFrame(pMac,
988 pMeasReqFrame,
989 peerMacAddr) != eSIR_SUCCESS)
990 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700991 PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700992 return;
993 }
994}
995
996
997/**
998 * __limProcessRpiMeasReq
999 *
1000 *FUNCTION:
1001 * This function is called by limProcessMeasurementRequestFrame()
1002 * when it received a RPI measurement Request action frame.
1003 * Station/BP/AP receiving this shall not perform any measurements,
1004 * and send report indicating refusal.
1005 *
1006 *LOGIC:
1007 *
1008 *ASSUMPTIONS:
1009 *
1010 *NOTE:
1011 *
1012 * @param pMac - Pointer to Global MAC structure
1013 * @param pMeasReqFrame - A pointer to RPI Meas. Req structure
1014 * @return None
1015 */
1016static void
1017__limProcessRpiMeasReq(tpAniSirGlobal pMac,
1018 tpSirMacMeasReqActionFrame pMeasReqFrame,
1019 tSirMacAddr peerMacAddr)
1020{
1021 if (limSendMeasReportFrame(pMac,
1022 pMeasReqFrame,
1023 peerMacAddr) != eSIR_SUCCESS)
1024 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001025 PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001026 return;
1027 }
1028}
1029
1030
1031/**
1032 * __limProcessMeasurementRequestFrame
1033 *
1034 *FUNCTION:
1035 *
1036 *LOGIC:
1037 *
1038 *ASSUMPTIONS:
1039 *
1040 *NOTE:
1041 *
1042 * @param pMac - Pointer to Global MAC structure
1043 * @param *pRxPacketInfo - A pointer to packet info structure
1044 * @return None
1045 */
1046
1047static void
1048__limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1049{
1050 tpSirMacMgmtHdr pHdr;
1051 tANI_U8 *pBody;
1052 tpSirMacMeasReqActionFrame pMeasReqFrame;
1053 tANI_U32 frameLen;
1054
1055 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1056 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1057 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1058
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301059 pMeasReqFrame = vos_mem_malloc(sizeof( tSirMacMeasReqActionFrame ));
1060 if (NULL == pMeasReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001061 {
1062 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301063 FL("limProcessMeasurementRequestFrame: AllocateMemory failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001064 return;
1065 }
1066
1067 if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) !=
1068 eSIR_SUCCESS)
1069 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001070 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001071 return;
1072 }
1073
1074
1075 switch(pMeasReqFrame->measReqIE.measType)
1076 {
1077 case SIR_MAC_BASIC_MEASUREMENT_TYPE:
1078 __limProcessBasicMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1079 break;
1080
1081 case SIR_MAC_CCA_MEASUREMENT_TYPE:
1082 __limProcessCcaMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1083 break;
1084
1085 case SIR_MAC_RPI_MEASUREMENT_TYPE:
1086 __limProcessRpiMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1087 break;
1088
1089 default:
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301090 limLog(pMac, LOG1, FL("Unknown Measurement Type %d "),
1091 pMeasReqFrame->measReqIE.measType);
Jeff Johnson295189b2012-06-20 16:38:30 -07001092 break;
1093 }
1094
1095} /*** end limProcessMeasurementRequestFrame ***/
1096
1097
1098/**
1099 * limProcessTpcRequestFrame
1100 *
1101 *FUNCTION:
1102 * This function is called upon receiving Tpc Request frame.
1103 *
1104 *NOTE:
1105 *
1106 * @param pMac - Pointer to Global MAC structure
1107 * @param *pRxPacketInfo - A pointer to packet info structure
1108 * @return None
1109 */
1110
1111static void
1112__limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1113{
1114 tpSirMacMgmtHdr pHdr;
1115 tANI_U8 *pBody;
1116 tpSirMacTpcReqActionFrame pTpcReqFrame;
1117 tANI_U32 frameLen;
1118
1119 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1120 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1121 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1122
Abhishek Singh3cbf6052014-12-15 16:46:42 +05301123 limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001124
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301125 pTpcReqFrame = vos_mem_malloc(sizeof( tSirMacTpcReqActionFrame ));
1126 if (NULL == pTpcReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001127 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301128 PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001129 return;
1130 }
1131
1132 if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) !=
1133 eSIR_SUCCESS)
1134 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001135 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001136 return;
1137 }
1138
1139 if (limSendTpcReportFrame(pMac,
1140 pTpcReqFrame,
1141 pHdr->sa) != eSIR_SUCCESS)
1142 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001143 PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001144 return;
1145 }
1146}
1147#endif
1148
1149
1150/**
1151 * \brief Validate an ADDBA Req from peer with respect
1152 * to our own BA configuration
1153 *
1154 * \sa __limValidateAddBAParameterSet
1155 *
1156 * \param pMac The global tpAniSirGlobal object
1157 *
1158 * \param baParameterSet The ADDBA Parameter Set.
1159 *
1160 * \param pDelBAFlag this parameter is NULL except for call from processAddBAReq
1161 * delBAFlag is set when entry already exists.
1162 *
1163 * \param reqType ADDBA Req v/s ADDBA Rsp
1164 * 1 - ADDBA Req
1165 * 0 - ADDBA Rsp
1166 *
1167 * \return eSIR_SUCCESS if setup completes successfully
1168 * eSIR_FAILURE is some problem is encountered
1169 */
1170
1171static tSirMacStatusCodes
1172__limValidateAddBAParameterSet( tpAniSirGlobal pMac,
1173 tpDphHashNode pSta,
1174 tDot11fFfAddBAParameterSet baParameterSet,
1175 tANI_U8 dialogueToken,
1176 tLimAddBaValidationReqType reqType ,
1177 tANI_U8* pDelBAFlag /*this parameter is NULL except for call from processAddBAReq*/)
1178{
1179 if(baParameterSet.tid >= STACFG_MAX_TC)
1180 {
1181 return eSIR_MAC_WME_INVALID_PARAMS_STATUS;
1182 }
1183
1184 //check if there is already a BA session setup with this STA/TID while processing AddBaReq
1185 if((true == pSta->tcCfg[baParameterSet.tid].fUseBARx) &&
1186 (LIM_ADDBA_REQ == reqType))
1187 {
1188 //There is already BA session setup for STA/TID.
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001189 limLog( pMac, LOGE,
Jeff Johnson295189b2012-06-20 16:38:30 -07001190 FL( "AddBAReq rcvd when there is already a session for this StaId = %d, tid = %d\n " ),
1191 pSta->staIndex, baParameterSet.tid);
1192 limPrintMacAddr( pMac, pSta->staAddr, LOGW );
1193
1194 if(pDelBAFlag)
1195 *pDelBAFlag = true;
1196 }
1197 return eSIR_MAC_SUCCESS_STATUS;
1198}
1199
1200/**
1201 * \brief Validate a DELBA Ind from peer with respect
1202 * to our own BA configuration
1203 *
1204 * \sa __limValidateDelBAParameterSet
1205 *
1206 * \param pMac The global tpAniSirGlobal object
1207 *
1208 * \param baParameterSet The DELBA Parameter Set.
1209 *
1210 * \param pSta Runtime, STA-related configuration cached
1211 * in the HashNode object
1212 *
1213 * \return eSIR_SUCCESS if setup completes successfully
1214 * eSIR_FAILURE is some problem is encountered
1215 */
1216static tSirMacStatusCodes
1217__limValidateDelBAParameterSet( tpAniSirGlobal pMac,
1218 tDot11fFfDelBAParameterSet baParameterSet,
1219 tpDphHashNode pSta )
1220{
1221tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS;
1222
1223 // Validate if a BA is active for the requested TID
1224 if( pSta->tcCfg[baParameterSet.tid].fUseBATx ||
1225 pSta->tcCfg[baParameterSet.tid].fUseBARx )
1226 {
1227 statusCode = eSIR_MAC_SUCCESS_STATUS;
1228
1229 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001230 FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001231 }
1232 else
1233 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001234 FL("Received an INVALID DELBA Ind for TID %d..."),
Jeff Johnson295189b2012-06-20 16:38:30 -07001235 baParameterSet.tid );
1236
1237 return statusCode;
1238}
1239
1240/**
1241 * \brief Process an ADDBA REQ
1242 *
1243 * \sa limProcessAddBAReq
1244 *
1245 * \param pMac The global tpAniSirGlobal object
1246 *
1247 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1248 *
1249 * \return none
1250 *
1251 */
1252static void
1253__limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1254{
1255 tDot11fAddBAReq frmAddBAReq;
1256 tpSirMacMgmtHdr pHdr;
1257 tpDphHashNode pSta;
1258 tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS;
1259 tANI_U16 aid;
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001260 tANI_U32 frameLen, nStatus,val;
Jeff Johnson295189b2012-06-20 16:38:30 -07001261 tANI_U8 *pBody;
1262 tANI_U8 delBAFlag =0;
1263
1264 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1265 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1266 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001267 val = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07001268
1269 // Unpack the received frame
1270 nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq );
1271 if( DOT11F_FAILED( nStatus ))
1272 {
1273 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001274 FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001275 nStatus,
1276 frameLen );
1277
1278 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1279
1280 // Without an unpacked request we cannot respond, so silently ignore the request
1281 return;
1282 }
1283 else if ( DOT11F_WARNED( nStatus ) )
1284 {
1285 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001286 FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001287 nStatus,
1288 frameLen );
1289
1290 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1291 }
1292
Kiran Kumar Lokere2ac471f2013-05-30 16:08:48 -07001293 psessionEntry->amsduSupportedInBA = frmAddBAReq.AddBAParameterSet.amsduSupported;
1294
Jeff Johnson295189b2012-06-20 16:38:30 -07001295 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1296 if( pSta == NULL )
1297 {
1298 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001299 FL( "STA context not found - ignoring ADDBA from " ));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001300 limPrintMacAddr( pMac, pHdr->sa, LOGE );
Jeff Johnson295189b2012-06-20 16:38:30 -07001301
1302 // FIXME - Should we do this?
1303 status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS;
1304 goto returnAfterError;
1305 }
Abhishek Singh02d9f6c2014-05-12 14:07:53 +05301306 limLog( pMac, LOG1, FL( "ADDBA Req from STA "MAC_ADDRESS_STR " with AID %d"
1307 " tid = %d policy = %d buffsize = %d"
1308 " amsduSupported = %d"), MAC_ADDR_ARRAY(pHdr->sa),
1309 aid, frmAddBAReq.AddBAParameterSet.tid,
1310 frmAddBAReq.AddBAParameterSet.policy,
1311 frmAddBAReq.AddBAParameterSet.bufferSize,
1312 frmAddBAReq.AddBAParameterSet.amsduSupported);
Jeff Johnson295189b2012-06-20 16:38:30 -07001313
Abhishek Singh1f6e6532014-06-05 17:35:08 +05301314 limLog( pMac, LOG1, FL( "ssn = %d fragNumber = %d" ),
1315 frmAddBAReq.BAStartingSequenceControl.ssn,
1316 frmAddBAReq.BAStartingSequenceControl.fragNumber);
1317
Jeff Johnson295189b2012-06-20 16:38:30 -07001318#ifdef WLAN_SOFTAP_VSTA_FEATURE
1319 // we can only do BA on "hard" STAs
1320 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1321 {
1322 status = eSIR_MAC_REQ_DECLINED_STATUS;
Sravan Kumar Kairamcebb2182016-01-25 20:50:11 +05301323 limLog( pMac, LOG1,
1324 FL( "ta Id is not HW Sta Id, Status code is %d " ), status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001325 goto returnAfterError;
1326 }
1327#endif //WLAN_SOFTAP_VSTA_FEATURE
1328
c_hpothu3ba2a512014-08-06 14:02:54 +05301329 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 -07001330 eSIR_SUCCESS)
1331 {
1332 limLog(pMac, LOGE,
c_hpothu3ba2a512014-08-06 14:02:54 +05301333 FL("Unable to get WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC"));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001334 val = 0;
1335 }
1336 if ((SIR_BAND_2_4_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) &&
1337 val)
1338 {
1339 limLog( pMac, LOGW,
1340 FL( "BTC disabled aggregation - ignoring ADDBA from " ));
1341 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1342
1343 status = eSIR_MAC_REQ_DECLINED_STATUS;
1344 goto returnAfterError;
1345 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001346
1347 // Now, validate the ADDBA Req
1348 if( eSIR_MAC_SUCCESS_STATUS !=
1349 (status = __limValidateAddBAParameterSet( pMac, pSta,
1350 frmAddBAReq.AddBAParameterSet,
1351 0, //dialogue token is don't care in request validation.
1352 LIM_ADDBA_REQ, &delBAFlag)))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301353 {
1354 limLog( pMac, LOGE,
1355 FL( "ADDBA parameters validation failed with status %d" ), status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001356 goto returnAfterError;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301357 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001358
1359 //BA already set, so we need to delete it before adding new one.
1360 if(delBAFlag)
1361 {
1362 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1363 pSta,
1364 (tANI_U8)frmAddBAReq.AddBAParameterSet.tid,
1365 eBA_RECIPIENT,psessionEntry))
1366 {
1367 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301368 limLog( pMac, LOGE,
1369 FL( "Deletion of Existing BA session failed with status %d" ),
1370 status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001371 goto returnAfterError;
1372 }
1373 }
1374
1375 // Check if the ADD BA Declined configuration is Disabled
1376 if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001377 limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001378 frmAddBAReq.AddBAParameterSet.tid);
1379 status = eSIR_MAC_REQ_DECLINED_STATUS;
1380 goto returnAfterError;
1381 }
1382
1383 //
1384 // Post WDA_ADDBA_REQ to HAL.
1385 // If HAL/HDD decide to allow this ADDBA Req session,
1386 // then this BA session is termed active
1387 //
1388
1389 // Change the Block Ack state of this STA to wait for
1390 // ADDBA Rsp from HAL
1391 LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001392
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001393 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001394 {
1395 limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001396 return ;
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001397 }
1398
1399
1400 if (frmAddBAReq.AddBAParameterSet.bufferSize)
1401 {
1402 frmAddBAReq.AddBAParameterSet.bufferSize =
1403 VOS_MIN(val, frmAddBAReq.AddBAParameterSet.bufferSize);
1404 }
1405 else
1406 {
1407 frmAddBAReq.AddBAParameterSet.bufferSize = val;
1408 }
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001409 limLog( pMac, LOG1, FL( "ADDBAREQ NUMBUFF %d" ),
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001410 frmAddBAReq.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001411
1412 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1413 pSta,
1414 (tANI_U8) frmAddBAReq.DialogToken.token,
1415 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1416 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1417 frmAddBAReq.AddBAParameterSet.bufferSize,
1418 frmAddBAReq.BATimeout.timeout,
1419 (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn,
1420 eBA_RECIPIENT,psessionEntry))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301421 {
1422 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1423 limLog( pMac, LOGE,
1424 FL( "Request to setup new BA session with peer "
1425 " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr));
1426 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001427 else
1428 return;
1429
1430returnAfterError:
1431
1432 //
1433 // Package LIM_MLM_ADDBA_RSP to MLME, with proper
1434 // status code. MLME will then send an ADDBA RSP
1435 // over the air to the peer MAC entity
1436 //
1437 if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac,
1438 pHdr->sa,
1439 status,
1440 frmAddBAReq.DialogToken.token,
1441 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1442 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1443 frmAddBAReq.AddBAParameterSet.bufferSize,
1444 frmAddBAReq.BATimeout.timeout,psessionEntry))
1445 {
1446 limLog( pMac, LOGW,
1447 FL( "Failed to post LIM_MLM_ADDBA_RSP to " ));
1448 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1449 }
1450
1451}
1452
1453/**
1454 * \brief Process an ADDBA RSP
1455 *
1456 * \sa limProcessAddBARsp
1457 *
1458 * \param pMac The global tpAniSirGlobal object
1459 *
1460 * \param pRxPacketInfo Handle to the packet info structure from HDD
1461 *
1462 * \return none
1463 *
1464 */
1465static void
1466__limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1467{
1468tDot11fAddBARsp frmAddBARsp;
1469tpSirMacMgmtHdr pHdr;
1470tpDphHashNode pSta;
1471tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1472tANI_U16 aid;
1473tANI_U32 frameLen, nStatus;
1474tANI_U8 *pBody;
1475
1476 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1477 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1478 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1479
1480 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1481 if( pSta == NULL )
1482 {
1483 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001484 FL( "STA context not found - ignoring ADDBA from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001485 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1486 return;
1487 }
1488
1489#ifdef WLAN_SOFTAP_VSTA_FEATURE
1490 // We can only do BA on "hard" STAs. We should not have issued an ADDBA
1491 // Request, so we should never be processing a ADDBA Response
1492 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1493 {
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301494 limLog( pMac, LOGE, FL( "Sta Id is not HW Sta Id " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001495 return;
1496 }
1497#endif //WLAN_SOFTAP_VSTA_FEATURE
1498
1499 // Unpack the received frame
1500 nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp );
1501 if( DOT11F_FAILED( nStatus ))
1502 {
1503 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001504 FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001505 nStatus,
1506 frameLen );
1507
1508 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1509 goto returnAfterError;
1510 }
1511 else if ( DOT11F_WARNED( nStatus ) )
1512 {
1513 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001514 FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001515 nStatus,
1516 frameLen );
1517
1518 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1519 }
1520
Abhishek Singh02d9f6c2014-05-12 14:07:53 +05301521 limLog( pMac, LOG1, FL( "ADDBA Rsp from STA "MAC_ADDRESS_STR " with AID %d "
1522 "tid = %d policy = %d buffsize = %d "
1523 "amsduSupported = %d status = %d"),
1524 MAC_ADDR_ARRAY(pHdr->sa), aid,
1525 frmAddBARsp.AddBAParameterSet.tid,
1526 frmAddBARsp.AddBAParameterSet.policy,
1527 frmAddBARsp.AddBAParameterSet.bufferSize,
1528 frmAddBARsp.AddBAParameterSet.amsduSupported,
1529 frmAddBARsp.Status.status);
Jeff Johnson295189b2012-06-20 16:38:30 -07001530 //if there is no matchin dialougue token then ignore the response.
1531
1532 if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token,
1533 pSta->assocId, frmAddBARsp.AddBAParameterSet.tid))
1534 {
Abhishek Singh6f09e702016-01-28 15:15:04 +05301535 limLog(pMac, LOGE,
1536 FL("dialogueToken in received addBARsp did not match with outstanding requests"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001537 return;
1538 }
1539
1540 // Check first if the peer accepted the ADDBA Req
1541 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1542 {
Kaushik, Sushant335328c2014-07-31 19:15:31 +05301543 tANI_U32 val;
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301544 pMac->lim.staBaInfo[pSta->staIndex].
1545 failed_count[frmAddBARsp.AddBAParameterSet.tid] = 0;
1546 pMac->lim.staBaInfo[pSta->staIndex].
1547 failed_timestamp[frmAddBARsp.AddBAParameterSet.tid] = 0;
Kaushik, Sushant335328c2014-07-31 19:15:31 +05301548 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
1549 {
1550 limLog(pMac, LOG1, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
1551 goto returnAfterError;
1552 }
1553 if (0 == frmAddBARsp.AddBAParameterSet.bufferSize)
1554 frmAddBARsp.AddBAParameterSet.bufferSize = val;
1555 else
1556 frmAddBARsp.AddBAParameterSet.bufferSize =
1557 VOS_MIN(val, frmAddBARsp.AddBAParameterSet.bufferSize);
1558 limLog( pMac, LOG1,
1559 FL( "ADDBA RSP Buffsize = %d" ),
1560 frmAddBARsp.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001561 // Now, validate the ADDBA Rsp
1562 if( eSIR_MAC_SUCCESS_STATUS !=
1563 __limValidateAddBAParameterSet( pMac, pSta,
1564 frmAddBARsp.AddBAParameterSet,
1565 (tANI_U8)frmAddBARsp.DialogToken.token,
1566 LIM_ADDBA_RSP, NULL))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301567 {
1568 limLog( pMac, LOGE,
1569 FL( "ADDBA parameters validation failed" ));
1570 goto returnAfterError;
1571 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001572 }
1573 else
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301574 {
1575 pMac->lim.staBaInfo[pSta->staIndex].
1576 failed_count[frmAddBARsp.AddBAParameterSet.tid]++;
1577 pMac->lim.staBaInfo[pSta->staIndex].failed_timestamp[
1578 frmAddBARsp.AddBAParameterSet.tid] = jiffies_to_msecs(jiffies);
Jeff Johnson295189b2012-06-20 16:38:30 -07001579 goto returnAfterError;
Sreelakshmi Konamki60ccfb32016-07-08 12:53:12 +05301580 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001581 // Change STA state to wait for ADDBA Rsp from HAL
1582 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
1583
1584 //
1585 // Post WDA_ADDBA_REQ to HAL.
1586 // If HAL/HDD decide to allow this ADDBA Rsp session,
1587 // then this BA session is termed active
1588 //
1589
1590 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1591 pSta,
1592 (tANI_U8) frmAddBARsp.DialogToken.token,
1593 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1594 (tANI_U8) frmAddBARsp.AddBAParameterSet.policy,
1595 frmAddBARsp.AddBAParameterSet.bufferSize,
1596 frmAddBARsp.BATimeout.timeout,
1597 0,
1598 eBA_INITIATOR,psessionEntry))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301599 {
1600 reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1601 limLog( pMac, LOGE,
1602 FL( "Request to setup new BA session with peer "
1603 " "MAC_ADDRESS_STR " failed" ), MAC_ADDR_ARRAY(pSta->staAddr));
1604 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001605 else
1606 return;
1607
1608returnAfterError:
1609
1610 // TODO: Do we need to signal an error status to SME,
1611 // if status != eSIR_MAC_SUCCESS_STATUS
1612
1613 // Restore STA "BA" State
1614 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE);
1615 //
1616 // Need to send a DELBA IND to peer, who
1617 // would have setup a BA session with this STA
1618 //
1619 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1620 {
1621 //
1622 // Package LIM_MLM_DELBA_REQ to MLME, with proper
1623 // status code. MLME will then send a DELBA IND
1624 // over the air to the peer MAC entity
1625 //
1626 if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac,
1627 pSta,
1628 eBA_INITIATOR,
1629 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1630 reasonCode, psessionEntry))
1631 {
1632 limLog( pMac, LOGW,
1633 FL( "Failed to post LIM_MLM_DELBA_REQ to " ));
1634 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1635 }
1636 }
1637}
1638
1639/**
1640 * \brief Process a DELBA Indication
1641 *
1642 * \sa limProcessDelBAInd
1643 *
1644 * \param pMac The global tpAniSirGlobal object
1645 *
1646 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1647 *
1648 * \return none
1649 *
1650 */
1651static void
1652__limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1653{
1654tDot11fDelBAInd frmDelBAInd;
1655tpSirMacMgmtHdr pHdr;
1656tpDphHashNode pSta;
1657tANI_U16 aid;
1658tANI_U32 frameLen, nStatus;
1659tANI_U8 *pBody;
1660
1661 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1662 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1663 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1664
1665 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1666 if( pSta == NULL )
1667 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001668 limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001669 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1670 return;
1671 }
1672
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001673 limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid );
Jeff Johnson295189b2012-06-20 16:38:30 -07001674
1675 // Unpack the received frame
1676 nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd );
1677 if( DOT11F_FAILED( nStatus ))
1678 {
1679 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001680 FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001681 nStatus,
1682 frameLen );
1683
1684 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1685 return;
1686 }
1687 else if ( DOT11F_WARNED( nStatus ) )
1688 {
1689 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001690 FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001691 nStatus,
1692 frameLen );
1693
1694 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1695 }
1696
Abhishek Singh1f6e6532014-06-05 17:35:08 +05301697 limLog( pMac, LOG1,
1698 FL( "Received DELBA from: "MAC_ADDRESS_STR" for TID %d, Reason code %d" ),
1699 MAC_ADDR_ARRAY(pHdr->sa),
Jeff Johnson295189b2012-06-20 16:38:30 -07001700 frmDelBAInd.DelBAParameterSet.tid,
1701 frmDelBAInd.Reason.code );
1702
1703 // Now, validate the DELBA Ind
1704 if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac,
1705 frmDelBAInd.DelBAParameterSet,
1706 pSta ))
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301707 {
1708 limLog( pMac, LOGE,
1709 FL( "ADDBA parameters validation failed " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001710 return;
Masti, Narayanraddi04010dc2014-12-16 20:06:11 +05301711 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001712 //
1713 // Post WDA_DELBA_IND to HAL and delete the
1714 // existing BA session
1715 //
1716 // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16
1717 // is kind of confusing...
1718 //
1719 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1720 pSta,
1721 (tANI_U8) frmDelBAInd.DelBAParameterSet.tid,
1722 (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)?
1723 eBA_INITIATOR: eBA_RECIPIENT,psessionEntry))
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001724 limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001725
1726 return;
1727
1728}
1729
1730static void
1731__limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry)
1732{
1733
1734#if 0
1735 tpSirMacMgmtHdr pHdr;
1736 tDot11fSMPowerSave frmSMPower;
1737 tSirMacHTMIMOPowerSaveState state;
1738 tpDphHashNode pSta;
1739 tANI_U16 aid;
1740 tANI_U32 frameLen, nStatus;
1741 tANI_U8 *pBody;
1742
1743 pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd );
1744 pBody = SIR_MAC_BD_TO_MPDUDATA( pBd );
1745 frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd );
1746
1747 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1748 if( pSta == NULL ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001749 limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001750 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1751 return;
1752 }
1753
1754 /**Unpack the received frame */
1755 nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower);
1756
1757 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001758 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001759 nStatus, frameLen );
1760 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1761 return;
1762 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001763 limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001764 nStatus, frameLen );
1765 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1766 }
1767
1768 limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d"
1769 "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En,
1770 frmSMPower.SMPowerModeSet.Mode);
1771
1772 /** Update in the DPH Table about the Update in the SM Power Save mode*/
1773 if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode)
1774 state = eSIR_HT_MIMO_PS_DYNAMIC;
1775 else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0))
1776 state = eSIR_HT_MIMO_PS_STATIC;
1777 else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0))
1778 state = eSIR_HT_MIMO_PS_NO_LIMIT;
1779 else {
1780 PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));)
1781 return;
1782 }
1783
1784 if (state == pSta->htMIMOPSState) {
1785 PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));)
1786 return;
1787 }
1788
1789 /** Update in the HAL Station Table for the Update of the Protection Mode */
1790 pSta->htMIMOPSState = state;
1791 limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState);
1792
1793#endif
1794
1795}
1796
1797#if defined WLAN_FEATURE_VOWIFI
1798
1799static void
1800__limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1801{
1802 tpSirMacMgmtHdr pHdr;
1803 tDot11fRadioMeasurementRequest frm;
1804 tANI_U32 frameLen, nStatus;
1805 tANI_U8 *pBody;
1806
1807 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1808 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1809 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1810
1811 if( psessionEntry == NULL )
1812 {
1813 return;
1814 }
1815
1816 /**Unpack the received frame */
1817 nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm );
1818
1819 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001820 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001821 nStatus, frameLen );
1822 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1823 return;
1824 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001825 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001826 nStatus, frameLen );
1827 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1828 }
1829
1830 // Call rrm function to handle the request.
1831
1832 rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry );
1833}
1834
1835static void
1836__limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1837{
1838 tpSirMacMgmtHdr pHdr;
1839 tDot11fLinkMeasurementRequest frm;
1840 tANI_U32 frameLen, nStatus;
1841 tANI_U8 *pBody;
1842
1843 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1844 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1845 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1846
1847 if( psessionEntry == NULL )
1848 {
1849 return;
1850 }
1851
1852 /**Unpack the received frame */
1853 nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm );
1854
1855 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001856 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001857 nStatus, frameLen );
1858 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1859 return;
1860 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001861 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001862 nStatus, frameLen );
1863 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1864 }
1865
1866 // Call rrm function to handle the request.
1867
1868 rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry );
1869
1870}
1871
1872static void
1873__limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1874{
1875 tpSirMacMgmtHdr pHdr;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001876 tDot11fNeighborReportResponse *pFrm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001877 tANI_U32 frameLen, nStatus;
1878 tANI_U8 *pBody;
1879
1880 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1881 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1882 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1883
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301884 pFrm = vos_mem_malloc(sizeof(tDot11fNeighborReportResponse));
1885 if (NULL == pFrm)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001886 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301887 limLog(pMac, LOGE, FL("Unable to allocate memory in __limProcessNeighborReport") );
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001888 return;
1889 }
1890
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301891 if(psessionEntry == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -07001892 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301893 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001894 return;
1895 }
1896
1897 /**Unpack the received frame */
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001898 nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm );
Jeff Johnson295189b2012-06-20 16:38:30 -07001899
1900 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001901 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001902 nStatus, frameLen );
1903 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301904 vos_mem_free(pFrm);
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001905 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001906 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001907 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001908 nStatus, frameLen );
1909 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1910 }
1911
1912 //Call rrm function to handle the request.
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001913 rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry );
1914
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301915 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001916}
1917
1918#endif
1919
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08001920#ifdef WLAN_FEATURE_AP_HT40_24G
1921static void
1922__limProcess2040bssCoexistenceActionFrame(tpAniSirGlobal pMac,
1923 tANI_U16 sessionId, tANI_U8 *pRxPacketInfo,
1924 tpPESession psessionEntry)
1925{
1926 tpSirMacMgmtHdr pHdr;
1927 tANI_U8 *pBody , i;
1928 tANI_U32 frameLen, nStatus;
1929 tDot11fHT2040BSSCoexistenceManagementActionFrame *pFrm;
1930 tpSirHT2040CoexInfoInd pSirSmeHT2040CoexInfoInd = NULL;
1931 tANI_U16 length;
1932 tSirMsgQ mmhMsg;
1933 tANI_U8 num_channelList;
1934
1935 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1936 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1937 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1938
1939 pFrm =
1940 vos_mem_malloc(sizeof(tDot11fHT2040BSSCoexistenceManagementActionFrame));
1941
1942 if (NULL == pFrm)
1943 {
1944 limLog(pMac, LOGE, FL("Unable to allocate memory"));
1945 return;
1946 }
1947
1948 if(psessionEntry == NULL)
1949 {
1950 vos_mem_free(pFrm);
1951 return;
1952 }
1953
1954 /**Unpack the received frame */
1955 nStatus = dot11fUnpackHT2040BSSCoexistenceManagementActionFrame( pMac,
1956 pBody, frameLen, pFrm );
1957
1958 if( DOT11F_FAILED( nStatus ))
1959 {
1960 limLog( pMac, LOGE, FL( "Failed to unpack and parse a 20/40"
1961 "Coex Action Frame (0x%08x, %d bytes):"),
1962 nStatus, frameLen );
1963 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1964 vos_mem_free(pFrm);
1965 return;
1966 }
1967 else if ( DOT11F_WARNED( nStatus ))
1968 {
1969 limLog(pMac, LOGW, FL( "There were warnings while unpacking a"
1970 " 20/40 Coex Action Frame (0x%08x, %d bytes):"),
1971 nStatus, frameLen );
1972 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1973 }
1974
1975 num_channelList = pFrm->HT2040BSSIntolerantReport.num_channelList;
1976
1977 if (num_channelList > 0)
1978 {
1979 length = (sizeof(tSirHT2040CoexInfoInd) - sizeof(tANI_U8) +
1980 (num_channelList * sizeof(tANI_U8)));
1981 }
1982 else
1983 length = sizeof(tSirHT2040CoexInfoInd);
1984
1985 limLog(pMac, LOGW,FL("tSirHT2040CoexInfoInd: Length: %d"),length);
1986
1987 pSirSmeHT2040CoexInfoInd = vos_mem_malloc(length);
1988
1989 if (NULL == pSirSmeHT2040CoexInfoInd)
1990 {
1991 limLog(pMac, LOGP,
1992 FL("AllocateMemory failed for eWNI_SME_2040_COEX_IND"));
1993 vos_mem_free(pFrm);
1994 return;
1995 }
1996
1997 vos_mem_set((void*)pSirSmeHT2040CoexInfoInd, length, 0);
1998
1999 pSirSmeHT2040CoexInfoInd->messageType = eWNI_SME_2040_COEX_IND;
2000 pSirSmeHT2040CoexInfoInd->sessionId = sessionId;
2001 pSirSmeHT2040CoexInfoInd->length = length;
2002
2003 if (pFrm->HT2040BSSCoexistence.present)
2004 {
2005
2006 limLog(pMac, LOGW, FL("infoRequest: %d fortyMHzIntolerant: %d"
2007 " twentyMHzBssWidthReq: %d obssScanExemptionReq: %d"
2008 " obssScanExemptionGrant: %d "),
2009 pFrm->HT2040BSSCoexistence.infoRequest,
2010 pFrm->HT2040BSSCoexistence.fortyMHzIntolerant,
2011 pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq,
2012 pFrm->HT2040BSSCoexistence.obssScanExemptionReq,
2013 pFrm->HT2040BSSCoexistence.obssScanExemptionGrant);
2014
2015 pSirSmeHT2040CoexInfoInd->HT40MHzIntolerant =
2016 pFrm->HT2040BSSCoexistence.fortyMHzIntolerant;
2017 pSirSmeHT2040CoexInfoInd->HT20MHzBssWidthReq =
2018 pFrm->HT2040BSSCoexistence.twentyMHzBssWidthReq;
2019 }
2020
2021 if (pFrm->HT2040BSSIntolerantReport.present)
2022 {
2023 limLog(pMac, LOGW, FL("operatingClass: %d num_channelList: %d "),
2024 pFrm->HT2040BSSIntolerantReport.operatingClass,
2025 num_channelList);
2026
2027 if (num_channelList > 0)
2028 {
2029 vos_mem_zero(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport,
2030 num_channelList);
2031 vos_mem_copy(pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport,
2032 pFrm->HT2040BSSIntolerantReport.channelList,
2033 num_channelList);
2034
2035 pSirSmeHT2040CoexInfoInd->channel_num = num_channelList;
2036 }
2037
2038 for(i=0; i < num_channelList; i++)
2039 {
2040 limLog(pMac, LOGW, FL("Channel : %d "),
2041 pSirSmeHT2040CoexInfoInd->HT2040BssIntoChanReport[i]);
2042 }
2043 }
2044
2045 mmhMsg.type = eWNI_SME_2040_COEX_IND;
2046 mmhMsg.bodyptr = pSirSmeHT2040CoexInfoInd;
2047 mmhMsg.bodyval = 0;
Sushant Kaushik87787972015-09-11 16:05:00 +05302048 limLog(pMac, LOGW, FL("Posting eWNI_SME_2040_COEX_IND Message to SME "));
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08002049 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
2050
2051 vos_mem_free(pFrm);
2052}
2053#endif
2054
Jeff Johnson295189b2012-06-20 16:38:30 -07002055#ifdef WLAN_FEATURE_11W
2056/**
Chet Lanctot186b5732013-03-18 10:26:30 -07002057 * limProcessSAQueryRequestActionFrame
Jeff Johnson295189b2012-06-20 16:38:30 -07002058 *
2059 *FUNCTION:
2060 * This function is called by limProcessActionFrame() upon
2061 * SA query request Action frame reception.
2062 *
2063 *LOGIC:
2064 *
2065 *ASSUMPTIONS:
2066 *
2067 *NOTE:
2068 *
2069 * @param pMac - Pointer to Global MAC structure
Chet Lanctot186b5732013-03-18 10:26:30 -07002070 * @param *pRxPacketInfo - Handle to the Rx packet info
2071 * @param psessionEntry - PE session entry
2072 *
Jeff Johnson295189b2012-06-20 16:38:30 -07002073 * @return None
2074 */
Chet Lanctot186b5732013-03-18 10:26:30 -07002075static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07002076{
2077 tpSirMacMgmtHdr pHdr;
2078 tANI_U8 *pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07002079 tANI_U8 transId[2];
Jeff Johnson295189b2012-06-20 16:38:30 -07002080
2081 /* Prima --- Below Macro not available in prima
2082 pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd);
2083 pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */
2084
2085 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2086 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2087
Chet Lanctot186b5732013-03-18 10:26:30 -07002088 /* If this is an unprotected SA Query Request, then ignore it. */
2089 if (pHdr->fc.wep == 0)
2090 return;
2091
Jeff Johnson295189b2012-06-20 16:38:30 -07002092 /*Extract 11w trsansId from SA query request action frame
2093 In SA query response action frame we will send same transId
2094 In SA query request action frame:
2095 Category : 1 byte
2096 Action : 1 byte
Chet Lanctot186b5732013-03-18 10:26:30 -07002097 Transaction ID : 2 bytes */
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302098 vos_mem_copy(&transId[0], &pBody[2], 2);
Jeff Johnson295189b2012-06-20 16:38:30 -07002099
Jeff Johnson295189b2012-06-20 16:38:30 -07002100 //Send 11w SA query response action frame
2101 if (limSendSaQueryResponseFrame(pMac,
2102 transId,
2103 pHdr->sa,psessionEntry) != eSIR_SUCCESS)
2104 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002105 PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002106 return;
2107 }
2108}
2109
Chet Lanctot186b5732013-03-18 10:26:30 -07002110/**
2111 * __limProcessSAQueryResponseActionFrame
2112 *
2113 *FUNCTION:
2114 * This function is called by limProcessActionFrame() upon
2115 * SA query response Action frame reception.
2116 *
2117 *LOGIC:
2118 *
2119 *ASSUMPTIONS:
2120 *
2121 *NOTE:
2122 *
2123 * @param pMac - Pointer to Global MAC structure
2124 * @param *pRxPacketInfo - Handle to the Rx packet info
2125 * @param psessionEntry - PE session entry
2126 * @return None
2127 */
2128static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
2129{
2130 tpSirMacMgmtHdr pHdr;
Chet Lanctot8cecea22014-02-11 19:09:36 -08002131 tANI_U8 *pBody;
2132 tpDphHashNode pSta;
2133 tANI_U16 aid;
2134 tANI_U16 transId;
2135 tANI_U8 retryNum;
Chet Lanctot186b5732013-03-18 10:26:30 -07002136
2137 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Chet Lanctot8cecea22014-02-11 19:09:36 -08002138 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
Chet Lanctot186b5732013-03-18 10:26:30 -07002139 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
2140 ("SA Query Response received...")) ;
Chet Lanctot186b5732013-03-18 10:26:30 -07002141
Chet Lanctotdd6beeb2014-04-22 11:51:29 -07002142 /* When a station, supplicant handles SA Query Response.
2143 Forward to SME to HDD to wpa_supplicant. */
2144 if (eLIM_STA_ROLE == psessionEntry->limSystemRole)
2145 {
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302146 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2147 pRxPacketInfo, psessionEntry, 0);
Chet Lanctotdd6beeb2014-04-22 11:51:29 -07002148 return;
2149 }
2150
Chet Lanctot8cecea22014-02-11 19:09:36 -08002151 /* If this is an unprotected SA Query Response, then ignore it. */
2152 if (pHdr->fc.wep == 0)
2153 return;
2154
2155 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
2156 if (NULL == pSta)
2157 return;
2158
2159 limLog(pMac, LOG1,
2160 FL("SA Query Response source addr - %0x:%0x:%0x:%0x:%0x:%0x"),
2161 pHdr->sa[0], pHdr->sa[1], pHdr->sa[2], pHdr->sa[3],
2162 pHdr->sa[4], pHdr->sa[5]);
2163 limLog(pMac, LOG1,
2164 FL("SA Query state for station - %d"), pSta->pmfSaQueryState);
2165
2166 if (DPH_SA_QUERY_IN_PROGRESS != pSta->pmfSaQueryState)
2167 return;
2168
2169 /* Extract 11w trsansId from SA query reponse action frame
2170 In SA query response action frame:
2171 Category : 1 byte
2172 Action : 1 byte
2173 Transaction ID : 2 bytes */
2174 vos_mem_copy(&transId, &pBody[2], 2);
2175
2176 /* If SA Query is in progress with the station and the station
2177 responds then the association request that triggered the SA
2178 query is from a rogue station, just go back to initial state. */
2179 for (retryNum = 0; retryNum <= pSta->pmfSaQueryRetryCount; retryNum++)
2180 if (transId == pSta->pmfSaQueryStartTransId + retryNum)
2181 {
2182 limLog(pMac, LOG1,
2183 FL("Found matching SA Query Request - transaction ID %d"), transId);
2184 tx_timer_deactivate(&pSta->pmfSaQueryTimer);
2185 pSta->pmfSaQueryState = DPH_SA_QUERY_NOT_IN_PROGRESS;
2186 break;
2187 }
2188}
Jeff Johnson295189b2012-06-20 16:38:30 -07002189#endif
2190
Chet Lanctotf7abfd42014-05-23 12:42:15 -07002191#ifdef WLAN_FEATURE_11W
2192/**
2193 * limDropUnprotectedActionFrame
2194 *
2195 *FUNCTION:
2196 * This function checks if an Action frame should be dropped since it is
2197 * a Robust Managment Frame, it is unprotected, and it is received on a
2198 * connection where PMF is enabled.
2199 *
2200 *LOGIC:
2201 *
2202 *ASSUMPTIONS:
2203 *
2204 *NOTE:
2205 *
2206 * @param pMac - Global MAC structure
2207 * @param psessionEntry - PE session entry
2208 * @param pHdr - Frame header
2209 * @param category - Action frame category
2210 * @return TRUE if frame should be dropped
2211 */
2212
2213static tANI_BOOLEAN
2214limDropUnprotectedActionFrame (tpAniSirGlobal pMac, tpPESession psessionEntry,
2215 tpSirMacMgmtHdr pHdr, tANI_U8 category)
2216{
2217 tANI_U16 aid;
2218 tpDphHashNode pStaDs;
2219 tANI_BOOLEAN rmfConnection = eANI_BOOLEAN_FALSE;
2220
2221 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) ||
2222 (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
2223 {
2224 pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
2225 if (pStaDs != NULL)
2226 if (pStaDs->rmfEnabled)
2227 rmfConnection = eANI_BOOLEAN_TRUE;
2228 }
2229 else if (psessionEntry->limRmfEnabled)
2230 rmfConnection = eANI_BOOLEAN_TRUE;
2231
2232 if (rmfConnection && (pHdr->fc.wep == 0))
2233 {
2234 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2235 "since RMF is enabled."), category);)
2236 return eANI_BOOLEAN_TRUE;
2237 }
2238 else
2239 return eANI_BOOLEAN_FALSE;
2240}
2241#endif
2242
Jeff Johnson295189b2012-06-20 16:38:30 -07002243/**
2244 * limProcessActionFrame
2245 *
2246 *FUNCTION:
2247 * This function is called by limProcessMessageQueue() upon
2248 * Action frame reception.
2249 *
2250 *LOGIC:
2251 *
2252 *ASSUMPTIONS:
2253 *
2254 *NOTE:
2255 *
2256 * @param pMac - Pointer to Global MAC structure
2257 * @param *pRxPacketInfo - A pointer to packet info structure
2258 * @return None
2259 */
2260
2261void
2262limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
2263{
2264 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
2265 tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07002266#ifdef WLAN_FEATURE_11W
2267 tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Abhishek Singh09d4e4a2016-01-12 11:20:22 +05302268
2269 if (lim_is_robust_mgmt_action_frame(pActionHdr->category) &&
2270 limDropUnprotectedActionFrame(pMac, psessionEntry, pHdr,
2271 pActionHdr->category)) {
2272 limLog(pMac, LOGE,
2273 FL("Don't send unprotect action frame to upper layer categ %d "),
2274 pActionHdr->category);
2275 return;
2276 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002277#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002278
Jeff Johnson295189b2012-06-20 16:38:30 -07002279 switch (pActionHdr->category)
2280 {
Selvaraj, Sridharc045b8b2016-04-06 12:22:35 +05302281
2282 /*
2283 * WARNING: If you add Action frame category case here, set the
2284 * corresponding bit to 1 in sme_set_allowed_action_frames() for
2285 * the FW to hand over that frame to host without dropping itself
2286 */
Jeff Johnson295189b2012-06-20 16:38:30 -07002287 case SIR_MAC_ACTION_QOS_MGMT:
Leela Venkata Kiran Kumar Reddy Chiralac7c4e7e2014-04-29 10:50:16 -07002288 if ( (psessionEntry->limQosEnabled) ||
2289 (pActionHdr->actionID == SIR_MAC_QOS_MAP_CONFIGURE) )
Jeff Johnson295189b2012-06-20 16:38:30 -07002290 {
2291 switch (pActionHdr->actionID)
2292 {
2293 case SIR_MAC_QOS_ADD_TS_REQ:
2294 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2295 break;
2296
2297 case SIR_MAC_QOS_ADD_TS_RSP:
2298 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2299 break;
2300
2301 case SIR_MAC_QOS_DEL_TS_REQ:
2302 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2303 break;
2304
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -07002305 case SIR_MAC_QOS_MAP_CONFIGURE:
2306 __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2307 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002308 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302309 limLog(pMac, LOG1,
2310 FL("Qos action %d not handled"),
2311 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002312 break;
2313 }
2314 break ;
2315 }
2316
2317 break;
2318
2319 case SIR_MAC_ACTION_SPECTRUM_MGMT:
2320 switch (pActionHdr->actionID)
2321 {
2322#ifdef ANI_SUPPORT_11H
2323 case SIR_MAC_ACTION_MEASURE_REQUEST_ID:
2324 if(psessionEntry->lim11hEnable)
2325 {
2326 __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo);
2327 }
2328 break;
2329
2330 case SIR_MAC_ACTION_TPC_REQUEST_ID:
2331 if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
2332 (pessionEntry->limSystemRole == eLIM_AP_ROLE))
2333 {
2334 if(psessionEntry->lim11hEnable)
2335 {
2336 __limProcessTpcRequestFrame(pMac, pRxPacketInfo);
2337 }
2338 }
2339 break;
2340
2341#endif
2342 case SIR_MAC_ACTION_CHANNEL_SWITCH_ID:
2343 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
2344 {
2345 __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry);
2346 }
2347 break;
2348 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302349 limLog(pMac, LOG1,
2350 FL("Spectrum mgmt action id %d not handled"),
2351 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002352 break;
2353 }
2354 break;
2355
2356 case SIR_MAC_ACTION_WME:
2357 if (! psessionEntry->limWmeEnabled)
2358 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002359 limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002360 pActionHdr->actionID);
2361 break;
2362 }
2363 switch(pActionHdr->actionID)
2364 {
2365 case SIR_MAC_QOS_ADD_TS_REQ:
2366 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2367 break;
2368
2369 case SIR_MAC_QOS_ADD_TS_RSP:
2370 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2371 break;
2372
2373 case SIR_MAC_QOS_DEL_TS_REQ:
2374 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2375 break;
2376
Leela Venkata Kiran Kumar Reddy Chirala8e69fbc2013-10-30 18:51:13 -07002377 case SIR_MAC_QOS_MAP_CONFIGURE:
2378 __limProcessQosMapConfigureFrame(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2379 break;
2380
Jeff Johnson295189b2012-06-20 16:38:30 -07002381 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302382 limLog(pMac, LOG1, FL("WME action %d not handled"),
2383 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002384 break;
2385 }
2386 break;
2387
2388 case SIR_MAC_ACTION_BLKACK:
2389 // Determine the "type" of BA Action Frame
2390 switch(pActionHdr->actionID)
2391 {
2392 case SIR_MAC_BLKACK_ADD_REQ:
2393 __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2394 break;
2395
2396 case SIR_MAC_BLKACK_ADD_RSP:
2397 __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2398 break;
2399
2400 case SIR_MAC_BLKACK_DEL:
2401 __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2402 break;
2403
2404 default:
2405 break;
2406 }
2407
2408 break;
2409 case SIR_MAC_ACTION_HT:
2410 /** Type of HT Action to be performed*/
2411 switch(pActionHdr->actionID) {
2412 case SIR_MAC_SM_POWER_SAVE:
2413 __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2414 break;
2415 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302416 limLog(pMac, LOG1,
2417 FL("Action ID %d not handled in HT Action category"),
2418 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002419 break;
2420 }
2421 break;
2422
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002423 case SIR_MAC_ACTION_WNM:
2424 {
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002425 PELOGE(limLog(pMac, LOG1, FL("WNM Action category %d action %d."),
2426 pActionHdr->category, pActionHdr->actionID);)
2427 switch (pActionHdr->actionID)
2428 {
2429 case SIR_MAC_WNM_BSS_TM_QUERY:
2430 case SIR_MAC_WNM_BSS_TM_REQUEST:
2431 case SIR_MAC_WNM_BSS_TM_RESPONSE:
2432 case SIR_MAC_WNM_NOTIF_REQUEST:
2433 case SIR_MAC_WNM_NOTIF_RESPONSE:
2434 {
2435 tpSirMacMgmtHdr pHdr;
2436 tANI_S8 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
2437 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2438 /* Forward to the SME to HDD to wpa_supplicant */
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302439 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2440 pRxPacketInfo,
Leela Venkata Kiran Kumar Reddy Chiralae8e62c82013-10-29 18:23:26 -07002441 psessionEntry, rssi);
2442 break;
2443 }
2444 }
2445 break;
2446 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002447#if defined WLAN_FEATURE_VOWIFI
2448 case SIR_MAC_ACTION_RRM:
Abhishek Singhe0bc0992016-05-20 17:58:18 +05302449 /* Ignore RRM measurement request until DHCP is set */
2450 if(pMac->rrm.rrmPEContext.rrmEnable &&
2451 pMac->roam.roamSession[psessionEntry->smeSessionId].dhcp_done)
Jeff Johnson295189b2012-06-20 16:38:30 -07002452 {
2453 switch(pActionHdr->actionID) {
2454 case SIR_MAC_RRM_RADIO_MEASURE_REQ:
2455 __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2456 break;
2457 case SIR_MAC_RRM_LINK_MEASUREMENT_REQ:
2458 __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2459 break;
2460 case SIR_MAC_RRM_NEIGHBOR_RPT:
2461 __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry );
2462 break;
2463 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302464 limLog( pMac, LOG1, FL("Action ID %d not handled in RRM"),
2465 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002466 break;
2467
2468 }
2469 }
2470 else
2471 {
2472 // Else we will just ignore the RRM messages.
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302473 limLog( pMac, LOG1,
Abhishek Singhe0bc0992016-05-20 17:58:18 +05302474 FL("RRM Action frame ignored as rrmEnable is %d or DHCP not completed %d"),
2475 pMac->rrm.rrmPEContext.rrmEnable,
2476 pMac->roam.roamSession[psessionEntry->smeSessionId].dhcp_done);
Jeff Johnson295189b2012-06-20 16:38:30 -07002477 }
2478 break;
2479#endif
Abhishek Singh00b71972016-01-07 10:51:04 +05302480#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) \
2481 || defined (WLAN_FEATURE_RMC)
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002482 case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
2483 {
2484 tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr;
2485 tpSirMacMgmtHdr pHdr;
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002486 tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 };
2487
2488 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002489
2490 //Check if it is a vendor specific action frame.
2491 if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) &&
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302492 (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr,
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002493 &pHdr->da[0], sizeof(tSirMacAddr))) &&
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002494 IS_WES_MODE_ENABLED(pMac) &&
2495 vos_mem_compare(pVendorSpecific->Oui, Oui, 3))
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002496 {
2497 PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"),
2498 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);)
2499 /* Forward to the SME to HDD to wpa_supplicant */
2500 // type is ACTION
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302501 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2502 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302503 psessionEntry, 0);
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002504 }
Abhishek Singh00b71972016-01-07 10:51:04 +05302505#if defined (WLAN_FEATURE_RMC)
2506 else if ((eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) &&
2507 ((VOS_TRUE == vos_mem_compare(SIR_MAC_RMC_MCAST_ADDRESS,
2508 &pHdr->da[0], sizeof(tSirMacAddr))) ||
2509 (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr,
2510 &pHdr->da[0], sizeof(tSirMacAddr)))) &&
2511 vos_mem_compare(pVendorSpecific->Oui, SIR_MAC_RMC_OUI, 3))
2512 {
2513 tANI_U8 MagicCode[] =
2514 { 0x4f, 0x58, 0x59, 0x47, 0x45, 0x4e };
2515 tpSirMacIbssExtNetworkFrameHdr pIbssExtHdr =
2516 (tpSirMacIbssExtNetworkFrameHdr) pActionHdr;
2517
2518 if (vos_mem_compare(pIbssExtHdr->MagicCode,
2519 MagicCode, sizeof(MagicCode)) &&
2520 pIbssExtHdr->version == SIR_MAC_RMC_VER )
2521 {
2522 switch (pIbssExtHdr->actionID)
2523 {
2524 default:
2525 PELOGE(limLog(pMac, LOGE,
2526 FL("Action RMC actionID %d not handled"),
2527 pIbssExtHdr->actionID);)
2528 break;
2529 case SIR_MAC_RMC_RULER_INFORM_SELECTED:
2530 limLog(pMac, LOG1,
2531 FL("Action RMC RULER_INFORM_SELECTED."));
2532 limProcessRMCMessages(pMac,
2533 eLIM_RMC_OTA_RULER_INFORM_SELECTED,
2534 (tANI_U32 *)pRxPacketInfo);
2535 break;
2536 case SIR_MAC_RMC_RULER_INFORM_CANCELLED:
2537 limLog(pMac, LOG1,
2538 FL("Action RMC RULER_INFORM_CANCELLED."));
2539 limProcessRMCMessages(pMac,
2540 eLIM_RMC_OTA_RULER_INFORM_CANCELLED,
2541 (tANI_U32 *)pRxPacketInfo);
2542 break;
2543 }
2544 }
2545 else
2546 {
2547 limLog( pMac, LOG1,
2548 FL("Dropping the vendor specific action frame in IBSS "
2549 "mode because of Ibss Ext Magic mismatch "
2550 MAC_ADDRESS_STR " or Version mismatch = %d"),
2551 MAC_ADDR_ARRAY(pIbssExtHdr->MagicCode),
2552 pIbssExtHdr->version );
2553 }
2554 }
2555#endif /* WLAN_FEATURE_RMC */
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002556 else
2557 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302558 limLog( pMac, LOG1,
2559 FL("Dropping the vendor specific action frame because of( "
2560 "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or "
2561 "not received with SelfSta Mac address) system role = %d"),
2562 IS_WES_MODE_ENABLED(pMac),
2563 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1],
2564 pVendorSpecific->Oui[2],
2565 psessionEntry->limSystemRole );
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002566 }
2567 }
2568 break;
Abhishek Singh00b71972016-01-07 10:51:04 +05302569#endif /* WLAN_FEATURE_VOWIFI_11R || FEATURE_WLAN_ESE ||
2570 FEATURE_WLAN_LFR || WLAN_FEATURE_RMC */
Jeff Johnson295189b2012-06-20 16:38:30 -07002571 case SIR_MAC_ACTION_PUBLIC_USAGE:
2572 switch(pActionHdr->actionID) {
2573 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2574 {
2575 tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr;
Jeff Johnson295189b2012-06-20 16:38:30 -07002576 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2577
Jeff Johnson295189b2012-06-20 16:38:30 -07002578 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302579 if (vos_mem_compare(pPubAction->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002580 {
2581 /* Forward to the SME to HDD to wpa_supplicant */
2582 // type is ACTION
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302583 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2584 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302585 psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002586 }
2587 else
2588 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302589 limLog( pMac, LOG1,
2590 FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
2591 pPubAction->Oui[0], pPubAction->Oui[1],
2592 pPubAction->Oui[2], pPubAction->Oui[3] );
Jeff Johnson295189b2012-06-20 16:38:30 -07002593 }
2594 }
2595 break;
Hardik Kantilal Patel81f76342014-11-14 12:45:26 -08002596#ifdef WLAN_FEATURE_AP_HT40_24G
2597 case SIR_MAC_ACTION_2040_BSS_COEXISTENCE:
2598 {
2599 if (pMac->roam.configParam.apHT40_24GEnabled)
2600 {
2601 limLog( pMac, LOGW, FL("Public Action 20/40 BSS"
2602 "Coexistence Management frame"));
2603
2604 __limProcess2040bssCoexistenceActionFrame(pMac,
2605 psessionEntry->smeSessionId, (tANI_U8 *) pRxPacketInfo,
2606 psessionEntry);
2607 }
2608 break;
2609 }
2610#endif
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002611#ifdef FEATURE_WLAN_TDLS
2612 case SIR_MAC_TDLS_DIS_RSP:
2613 {
Chilam NG571c65a2013-01-19 12:27:36 +05302614 tANI_S8 rssi;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002615
Chilam NG571c65a2013-01-19 12:27:36 +05302616 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002617 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002618 ("Public Action TDLS Discovery RSP ..")) ;
Naveen Rawat71e1a2e2015-07-28 16:11:21 +05302619 limSendSmeMgmtFrameInd(pMac, psessionEntry->smeSessionId,
2620 pRxPacketInfo,
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302621 psessionEntry, rssi);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002622 }
2623 break;
2624#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002625
2626 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302627 limLog(pMac, LOG1, FL("Unhandled public action frame -- %x "),
2628 pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002629 break;
2630 }
2631 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002632
2633#ifdef WLAN_FEATURE_11W
2634 case SIR_MAC_ACTION_SA_QUERY:
2635 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002636 PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);)
2637 switch (pActionHdr->actionID)
2638 {
2639 case SIR_MAC_SA_QUERY_REQ:
2640 /**11w SA query request action frame received**/
2641 /* Respond directly to the incoming request in LIM */
2642 __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2643 break;
2644 case SIR_MAC_SA_QUERY_RSP:
2645 /**11w SA query response action frame received**/
Chet Lanctot8cecea22014-02-11 19:09:36 -08002646 /* Handle based on the current SA Query state */
Chet Lanctot186b5732013-03-18 10:26:30 -07002647 __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2648 break;
2649 default:
2650 break;
2651 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002652 break;
2653 }
2654#endif
Mohit Khanna4a70d262012-09-11 16:30:12 -07002655#ifdef WLAN_FEATURE_11AC
2656 case SIR_MAC_ACTION_VHT:
2657 {
2658 if (psessionEntry->vhtCapability)
2659 {
2660 switch (pActionHdr->actionID)
2661 {
2662 case SIR_MAC_VHT_OPMODE_NOTIFICATION:
2663 __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry);
2664 break;
2665 default:
2666 break;
2667 }
2668 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002669 break;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -07002670 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002671#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002672 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302673 limLog(pMac, LOG1,
2674 FL("Action category %d not handled"), pActionHdr->category);
Jeff Johnson295189b2012-06-20 16:38:30 -07002675 break;
2676 }
2677}
2678
Jeff Johnson295189b2012-06-20 16:38:30 -07002679/**
2680 * limProcessActionFrameNoSession
2681 *
2682 *FUNCTION:
2683 * This function is called by limProcessMessageQueue() upon
2684 * Action frame reception and no session.
2685 * Currently only public action frames can be received from
2686 * a non-associated station.
2687 *
2688 *LOGIC:
2689 *
2690 *ASSUMPTIONS:
2691 *
2692 *NOTE:
2693 *
2694 * @param pMac - Pointer to Global MAC structure
2695 * @param *pBd - A pointer to Buffer descriptor + associated PDUs
2696 * @return None
2697 */
2698
2699void
2700limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd)
2701{
2702 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd);
2703 tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody;
2704
Mohit Khanna23863762012-09-11 17:40:09 -07002705 limLog( pMac, LOG1, "Received a Action frame -- no session");
Jeff Johnson295189b2012-06-20 16:38:30 -07002706
2707 switch ( pActionHdr->category )
2708 {
2709 case SIR_MAC_ACTION_PUBLIC_USAGE:
2710 switch(pActionHdr->actionID) {
2711 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2712 {
Jeff Johnson295189b2012-06-20 16:38:30 -07002713 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2714
Jeff Johnson295189b2012-06-20 16:38:30 -07002715 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302716 if (vos_mem_compare(pActionHdr->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002717 {
2718 /* Forward to the SME to HDD to wpa_supplicant */
2719 // type is ACTION
Rashmi Ramanna0d0adec2014-02-05 20:35:37 +05302720 limSendSmeMgmtFrameInd(pMac, 0, pBd, NULL, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002721 }
2722 else
2723 {
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302724 limLog( pMac, LOG1,
2725 FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
2726 pActionHdr->Oui[0], pActionHdr->Oui[1],
2727 pActionHdr->Oui[2], pActionHdr->Oui[3]);
Jeff Johnson295189b2012-06-20 16:38:30 -07002728 }
2729 }
2730 break;
2731 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302732 limLog(pMac, LOG1,
2733 FL("Unhandled public action frame -- %x "), pActionHdr->actionID);
Jeff Johnson295189b2012-06-20 16:38:30 -07002734 break;
2735 }
2736 break;
2737 default:
Abhishek Singh9ccfc772015-10-16 13:57:22 +05302738 limLog(pMac, LOG1,
2739 FL("Unhandled action frame without session -- %x "),
2740 pActionHdr->category);
2741 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002742
2743 }
2744}