blob: f7a25a4c20cc30146d68d2982c49ff69bc9ac91f [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
Jeff Johnson295189b2012-06-20 16:38:30 -070041/*
42 * Airgo Networks, Inc proprietary. All rights reserved.
43 * This file limProcessActionFrame.cc contains the code
44 * for processing Action Frame.
45 * Author: Michael Lui
46 * Date: 05/23/03
47 * History:-
48 * Date Modified by Modification Information
49 * --------------------------------------------------------------------
50 *
51 */
52#include "palTypes.h"
53#include "wniApi.h"
54#include "sirApi.h"
55#include "aniGlobal.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070056#include "wniCfgSta.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070057#include "schApi.h"
58#include "utilsApi.h"
59#include "limTypes.h"
60#include "limUtils.h"
61#include "limAssocUtils.h"
62#include "limSecurityUtils.h"
63#include "limSerDesUtils.h"
64#include "limSendSmeRspMessages.h"
65#include "parserApi.h"
66#include "limAdmitControl.h"
67#include "wmmApsd.h"
68#include "limSendMessages.h"
69#if defined WLAN_FEATURE_VOWIFI
70#include "rrmApi.h"
71#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070072#include "limSessionUtils.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070073
74#if defined FEATURE_WLAN_CCX
75#include "ccxApi.h"
76#endif
77#include "wlan_qct_wda.h"
78
79
80#define BA_DEFAULT_TX_BUFFER_SIZE 64
81
82typedef enum
83{
84 LIM_ADDBA_RSP = 0,
85 LIM_ADDBA_REQ = 1
86}tLimAddBaValidationReqType;
87
88/* Note: The test passes if the STAUT stops sending any frames, and no further
89 frames are transmitted on this channel by the station when the AP has sent
90 the last 6 beacons, with the channel switch information elements as seen
91 with the sniffer.*/
92#define SIR_CHANSW_TX_STOP_MAX_COUNT 6
93/**-----------------------------------------------------------------
94\fn limStopTxAndSwitchChannel
95\brief Stops the transmission if channel switch mode is silent and
96 starts the channel switch timer.
97
98\param pMac
99\return NONE
100-----------------------------------------------------------------*/
101void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId)
102{
103 tANI_U8 isFullPowerRequested = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -0700104 tpPESession psessionEntry;
105
106 psessionEntry = peFindSessionBySessionId( pMac , sessionId );
107
108 if( NULL == psessionEntry )
109 {
110 limLog(pMac, LOGE, FL("Session %d not active\n "), sessionId);
111 return;
112 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700113
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700114 PELOG1(limLog(pMac, LOG1, FL("Channel switch Mode == %d"),
Jeff Johnsone7245742012-09-05 17:12:55 -0700115 psessionEntry->gLimChannelSwitch.switchMode);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700116
Jeff Johnsone7245742012-09-05 17:12:55 -0700117 if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT ||
118 psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT)
Jeff Johnson295189b2012-06-20 16:38:30 -0700119 {
120 /* Freeze the transmission */
121 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX);
122
123 /*Request for Full power only if the device is in powersave*/
124 if(!limIsSystemInActiveState(pMac))
125 {
126 /* Request Full Power */
127 limSendSmePreChannelSwitchInd(pMac);
128 isFullPowerRequested = 1;
129 }
130 }
131 else
132 {
133 /* Resume the transmission */
134 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX);
135 }
136
Jeff Johnsone7245742012-09-05 17:12:55 -0700137 pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700138 /* change the channel immediatly only if the channel switch count is 0 and the
139 * device is not in powersave
140 * If the device is in powersave channel switch should happen only after the
141 * device comes out of the powersave */
Jeff Johnsone7245742012-09-05 17:12:55 -0700142 if (psessionEntry->gLimChannelSwitch.switchCount == 0)
Jeff Johnson295189b2012-06-20 16:38:30 -0700143 {
144 if(limIsSystemInActiveState(pMac))
145 {
146 limProcessChannelSwitchTimeout(pMac);
147 }
148 else if(!isFullPowerRequested)
149 {
150 /* If the Full power is already not requested
151 * Request Full Power so the channel switch happens
152 * after device comes to full power */
153 limSendSmePreChannelSwitchInd(pMac);
154 }
155 return;
156 }
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -0800157 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700158
Jeff Johnson295189b2012-06-20 16:38:30 -0700159
160 if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS)
161 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700162 limLog(pMac, LOGP, FL("tx_timer_activate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700163 }
164 return;
165}
166
167/**------------------------------------------------------------
168\fn limStartChannelSwitch
169\brief Switches the channel if switch count == 0, otherwise
170 starts the timer for channel switch and stops BG scan
171 and heartbeat timer tempororily.
172
173\param pMac
174\param psessionEntry
175\return NONE
176------------------------------------------------------------*/
177tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
178{
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700179 PELOG1(limLog(pMac, LOG1, FL("Starting the channel switch"));)
Jeff Johnsone7245742012-09-05 17:12:55 -0700180
181 /*If channel switch is already running and it is on a different session, just return*/
182 /*This need to be removed for MCC */
183 if( limIsChanSwitchRunning (pMac) &&
184 psessionEntry->gLimSpecMgmt.dot11hChanSwState != eLIM_11H_CHANSW_RUNNING )
185 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700186 limLog(pMac, LOGW, FL("Ignoring channel switch on session %d"), psessionEntry->peSessionId);
Jeff Johnsone7245742012-09-05 17:12:55 -0700187 return eSIR_SUCCESS;
188 }
189
Jeff Johnson295189b2012-06-20 16:38:30 -0700190 /* Deactivate and change reconfigure the timeout value */
Jeff Johnsone7245742012-09-05 17:12:55 -0700191 //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER);
Varun Reddy Yeturue3bbf6e2013-02-08 18:50:55 -0800192 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnsone7245742012-09-05 17:12:55 -0700193 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
194 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700195 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700196 return eSIR_FAILURE;
197 }
198
199 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
200 psessionEntry->gLimChannelSwitch.switchTimeoutValue,
201 0) != TX_SUCCESS)
202 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700203 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnsone7245742012-09-05 17:12:55 -0700204 return eSIR_FAILURE;
205 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700206
207 /* Follow the channel switch, forget about the previous quiet. */
208 //If quiet is running, chance is there to resume tx on its timeout.
209 //so stop timer for a safer side.
Jeff Johnsone7245742012-09-05 17:12:55 -0700210 if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN)
Jeff Johnson295189b2012-06-20 16:38:30 -0700211 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700212 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700213 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS)
214 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700215 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700216 return eSIR_FAILURE;
217 }
218 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700219 else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING)
Jeff Johnson295189b2012-06-20 16:38:30 -0700220 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700221 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700222 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS)
223 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700224 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700225 return eSIR_FAILURE;
226 }
227 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700228 psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
Jeff Johnson295189b2012-06-20 16:38:30 -0700229
230 /* Prepare for 11h channel switch */
231 limPrepareFor11hChannelSwitch(pMac, psessionEntry);
232
233 /** Dont add any more statements here as we posted finish scan request
234 * to HAL, wait till we get the response
235 */
236 return eSIR_SUCCESS;
237}
238
239
240/**
241 * __limProcessChannelSwitchActionFrame
242 *
243 *FUNCTION:
244 *
245 *LOGIC:
246 *
247 *ASSUMPTIONS:
248 *
249 *NOTE:
250 *
251 * @param pMac - Pointer to Global MAC structure
252 * @param *pRxPacketInfo - A pointer to packet info structure
253 * @return None
254 */
255
256static void
257
258__limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
259{
260
261 tpSirMacMgmtHdr pHdr;
262 tANI_U8 *pBody;
263 tDot11fChannelSwitch *pChannelSwitchFrame;
264 tANI_U16 beaconPeriod;
265 tANI_U32 val;
266 tANI_U32 frameLen;
267 tANI_U32 nStatus;
268 eHalStatus status;
269
270 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
271 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
272 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
273
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700274 PELOG3(limLog(pMac, LOG3, FL("Received Channel switch action frame"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700275 if (!psessionEntry->lim11hEnable)
276 return;
277
278 status = palAllocateMemory( pMac->hHdd, (void **)&pChannelSwitchFrame, sizeof(*pChannelSwitchFrame));
279 if (eHAL_STATUS_SUCCESS != status)
280 {
281 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700282 FL("palAllocateMemory failed, status = %d "), status);
Jeff Johnson295189b2012-06-20 16:38:30 -0700283 return;
284 }
285
286 /* Unpack channel switch frame */
287 nStatus = dot11fUnpackChannelSwitch(pMac, pBody, frameLen, pChannelSwitchFrame);
288
289 if( DOT11F_FAILED( nStatus ))
290 {
291 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700292 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700293 nStatus,
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700294 frameLen);
Jeff Johnson295189b2012-06-20 16:38:30 -0700295 palFreeMemory(pMac->hHdd, pChannelSwitchFrame);
296 return;
297 }
298 else if(DOT11F_WARNED( nStatus ))
299 {
300 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700301 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700302 nStatus,
303 frameLen);
304 }
305
306 if (palEqualMemory( pMac->hHdd,(tANI_U8 *) &psessionEntry->bssId,
307 (tANI_U8 *) &pHdr->sa,
308 sizeof(tSirMacAddr)))
309 {
310 #if 0
311 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS)
312 {
313 palFreeMemory(pMac->hHdd, pChannelSwitchFrame);
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700314 limLog(pMac, LOGP, FL("could not retrieve Beacon interval"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700315 return;
316 }
317 #endif// TO SUPPORT BT-AMP
318
319 /* copy the beacon interval from psessionEntry*/
320 val = psessionEntry->beaconParams.beaconInterval;
321
322 beaconPeriod = (tANI_U16) val;
323
Jeff Johnsone7245742012-09-05 17:12:55 -0700324 psessionEntry->gLimChannelSwitch.primaryChannel = pChannelSwitchFrame->ChanSwitchAnn.newChannel;
325 psessionEntry->gLimChannelSwitch.switchCount = pChannelSwitchFrame->ChanSwitchAnn.switchCount;
326 psessionEntry->gLimChannelSwitch.switchTimeoutValue = SYS_MS_TO_TICKS(beaconPeriod) *
327 psessionEntry->gLimChannelSwitch.switchCount;
328 psessionEntry->gLimChannelSwitch.switchMode = pChannelSwitchFrame->ChanSwitchAnn.switchMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700329#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700330 if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability)
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700331 {
332 psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth;
333 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0;
334 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq1;
335 }
336#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700337
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700338 PELOG3(limLog(pMac, LOG3, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"),
Jeff Johnsone7245742012-09-05 17:12:55 -0700339 psessionEntry->gLimChannelSwitch.switchTimeoutValue);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700340
341 /* Only primary channel switch element is present */
Jeff Johnsone7245742012-09-05 17:12:55 -0700342 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
343 psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -0700344
Jeff Johnsone7245742012-09-05 17:12:55 -0700345 if (psessionEntry->htSupportedChannelWidthSet)
Jeff Johnson295189b2012-06-20 16:38:30 -0700346 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700347 if ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
348 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))
Jeff Johnson295189b2012-06-20 16:38:30 -0700349 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700350 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
351 psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700352 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700353#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700354 if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present)
355 {
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700356 if (pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
357 {
358 if (pChannelSwitchFrame->ExtChanSwitchAnn.present && ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
359 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)))
360 {
361 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700362 psessionEntry->gLimChannelSwitch.secondarySubBand =
363 limGet11ACPhyCBState(pMac,
364 psessionEntry->gLimChannelSwitch.primaryChannel,
365 pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset,
366 pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0,
367 psessionEntry);
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700368 }
369 }
370 }
371#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700372 }
373
374 }
375 else
376 {
377 PELOG1(limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));)
378 }
379
380 if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry))
381 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700382 PELOG1(limLog(pMac, LOG1, FL("Could not start channel switch"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700383 }
384
385 palFreeMemory(pMac->hHdd, pChannelSwitchFrame);
386 return;
387} /*** end limProcessChannelSwitchActionFrame() ***/
388
389
Mohit Khanna4a70d262012-09-11 16:30:12 -0700390#ifdef WLAN_FEATURE_11AC
391static void
392__limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
393{
394
395 tpSirMacMgmtHdr pHdr;
396 tANI_U8 *pBody;
397 tDot11fOperatingMode *pOperatingModeframe;
398 tANI_U32 frameLen;
399 tANI_U32 nStatus;
400 eHalStatus status;
401 tpDphHashNode pSta;
402 tANI_U16 aid;
403 tANI_U8 operMode;
404
405 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
406 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
407 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
408
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700409 PELOG3(limLog(pMac, LOG3, FL("Received Operating Mode action frame"));)
Mohit Khanna4a70d262012-09-11 16:30:12 -0700410 status = palAllocateMemory( pMac->hHdd, (void **)&pOperatingModeframe, sizeof(*pOperatingModeframe));
411 if (eHAL_STATUS_SUCCESS != status)
412 {
413 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700414 FL("palAllocateMemory failed, status = %d "), status);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700415 return;
416 }
417
418 /* Unpack channel switch frame */
419 nStatus = dot11fUnpackOperatingMode(pMac, pBody, frameLen, pOperatingModeframe);
420
421 if( DOT11F_FAILED( nStatus ))
422 {
423 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700424 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700425 nStatus,
426 frameLen);
427 palFreeMemory(pMac->hHdd, pOperatingModeframe);
428 return;
429 }
430 else if(DOT11F_WARNED( nStatus ))
431 {
432 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700433 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700434 nStatus,
435 frameLen);
436 }
437 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
438
439 operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ;
440 if( operMode != pOperatingModeframe->OperatingMode.chanWidth)
441 {
442 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700443 FL(" received Chanwidth %d, staIdx = %d"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700444 (pOperatingModeframe->OperatingMode.chanWidth ),
445 pSta->staIndex);
446
447 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700448 FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700449 pHdr->sa[0],
450 pHdr->sa[1],
451 pHdr->sa[2],
452 pHdr->sa[3],
453 pHdr->sa[4],
454 pHdr->sa[5]);
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700455
Mohit Khanna4a70d262012-09-11 16:30:12 -0700456 if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ)
457 {
458 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
459 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
460 }
461 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ)
462 {
463 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
464 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
465 }
466 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ)
467 {
468 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
469 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ;
470 }
471 limCheckVHTOpModeChange( pMac, psessionEntry,
472 (pOperatingModeframe->OperatingMode.chanWidth), pSta->staIndex);\
473 }
474 palFreeMemory(pMac->hHdd, pOperatingModeframe);
475 return;
476}
477#endif
478
Jeff Johnson295189b2012-06-20 16:38:30 -0700479static void
480__limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
481{
Jeff Johnson295189b2012-06-20 16:38:30 -0700482}
483
484
485static void
486__limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
487{
488 tSirAddtsRspInfo addts;
489 tSirRetStatus retval;
490 tpSirMacMgmtHdr pHdr;
491 tpDphHashNode pSta;
492 tANI_U16 aid;
493 tANI_U32 frameLen;
494 tANI_U8 *pBody;
495 tpLimTspecInfo tspecInfo;
496 tANI_U8 ac;
497 tpDphHashNode pStaDs = NULL;
498 tANI_U8 rspReqd = 1;
499 tANI_U32 cfgLen;
500 tSirMacAddr peerMacAddr;
501
502
503 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
504 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
505 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
506
507
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700508 PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700509 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
510 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700511 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700512 return;
513 }
514
515 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
516 if (pSta == NULL)
517 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700518 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700519 return;
520 }
521
522 retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts);
523 if (retval != eSIR_SUCCESS)
524 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700525 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700526 return;
527 }
528
529 // don't have to check for qos/wme capabilities since we wouldn't have this
530 // flag set otherwise
531 if (! pMac->lim.gLimAddtsSent)
532 {
533 // we never sent an addts request!
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700534 PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700535 return;
536 }
537
538 if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken)
539 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700540 limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring",
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 addts.dialogToken, pMac->lim.gLimAddtsReq.req.dialogToken);
542 return;
543 }
544
545 /*
546 * for successful addts reponse, try to add the classifier.
547 * if this fails for any reason, we should send a delts request to the ap
548 * for now, its ok not to send a delts since we are going to add support for
549 * multiple tclas soon and until then we won't send any addts requests with
550 * multiple tclas elements anyway.
551 * In case of addClassifier failure, we just let the addts timer run out
552 */
553 if (((addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
554 (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) &&
555 (addts.status == eSIR_MAC_SUCCESS_STATUS))
556 {
557 // add the classifier - this should always succeed
558 if (addts.numTclas > 1) // currently no support for multiple tclas elements
559 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700560 limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700561 aid, addts.numTclas);
562 return;
563 }
564 else if (addts.numTclas == 1)
565 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700566 limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!", aid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700567 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
568 }
569 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700570 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700571 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
572 addts.status);
573
574 // deactivate the response timer
575 limDeactivateAndChangeTimer(pMac, eLIM_ADDTS_RSP_TIMER);
576
577 if (addts.status != eSIR_MAC_SUCCESS_STATUS)
578 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700579 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700580 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
581 addts.status);
582 limSendSmeAddtsRsp(pMac, true, addts.status, psessionEntry, addts.tspec,
583 psessionEntry->smeSessionId, psessionEntry->transactionId);
584
585 // clear the addts flag
586 pMac->lim.gLimAddtsSent = false;
587
588 return;
589 }
590#ifdef FEATURE_WLAN_CCX
591 if (addts.tsmPresent)
592 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700593 limLog(pMac, LOGW, "TSM IE Present");
Jeff Johnson295189b2012-06-20 16:38:30 -0700594 psessionEntry->ccxContext.tsm.tid = addts.tspec.tsinfo.traffic.userPrio;
595 vos_mem_copy(&psessionEntry->ccxContext.tsm.tsmInfo,
596 &addts.tsmIE,sizeof(tSirMacCCXTSMIE));
597 limActivateTSMStatsTimer(pMac, psessionEntry);
598 }
599#endif
600 /* Since AddTS response was successful, check for the PSB flag
601 * and directional flag inside the TS Info field.
602 * An AC is trigger enabled AC if the PSB subfield is set to 1
603 * in the uplink direction.
604 * An AC is delivery enabled AC if the PSB subfield is set to 1
605 * in the downlink direction.
606 * An AC is trigger and delivery enabled AC if the PSB subfield
607 * is set to 1 in the bi-direction field.
608 */
609 if (addts.tspec.tsinfo.traffic.psb == 1)
610 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, SET_UAPSD_MASK);
611 else
612 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, CLEAR_UAPSD_MASK);
613
614
615 /* ADDTS success, so AC is now admitted. We shall now use the default
616 * EDCA parameters as advertised by AP and send the updated EDCA params
617 * to HAL.
618 */
619 ac = upToAc(addts.tspec.tsinfo.traffic.userPrio);
620 if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK)
621 {
622 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
623 }
624 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK)
625 {
626 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
627 }
628 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR)
629 {
630 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
631 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
632 }
633
634 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
635
636 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
637 if (pStaDs != NULL)
638 {
639 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
640 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
641 else
642 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
643 }
644 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700645 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700646
647
648 sirCopyMacAddr(peerMacAddr,psessionEntry->bssId);
649
650 //if schedule is not present then add TSPEC with svcInterval as 0.
651 if(!addts.schedulePresent)
652 addts.schedule.svcInterval = 0;
653 if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, &addts.tspec, addts.schedule.svcInterval, &tspecInfo))
654 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700655 PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700656 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
657 psessionEntry);
658 pMac->lim.gLimAddtsSent = false;
659 return; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status.
660 }
661 if((addts.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA) ||
662 ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC) &&
663 (psessionEntry->gLimEdcaParams[upToAc(addts.tspec.tsinfo.traffic.userPrio)].aci.acm)))
664 {
665 retval = limSendHalMsgAddTs(pMac, pSta->staIndex, tspecInfo->idx, addts.tspec, psessionEntry->peSessionId);
666 if(eSIR_SUCCESS != retval)
667 {
668 limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecInfo->idx);
669
670 // Send DELTS action frame to AP
671 cfgLen = sizeof(tSirMacAddr);
672 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
673 psessionEntry);
674 limSendSmeAddtsRsp(pMac, true, retval, psessionEntry, addts.tspec,
675 psessionEntry->smeSessionId, psessionEntry->transactionId);
676 pMac->lim.gLimAddtsSent = false;
677 return;
678 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700679 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700680 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
681 }
682 else
683 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700684 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700685 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700686 PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700687 // Use the smesessionId and smetransactionId from the PE session context
688 limSendSmeAddtsRsp(pMac, true, eSIR_SME_SUCCESS, psessionEntry, addts.tspec,
689 psessionEntry->smeSessionId, psessionEntry->transactionId);
690 }
691
692 // clear the addts flag
693 pMac->lim.gLimAddtsSent = false;
694 return;
695}
696
697
698static void
699__limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
700{
701 tSirRetStatus retval;
702 tSirDeltsReqInfo delts;
703 tpSirMacMgmtHdr pHdr;
704 tpDphHashNode pSta;
705 tANI_U32 frameLen;
706 tANI_U16 aid;
707 tANI_U8 *pBody;
708 tANI_U8 tsStatus;
709 tSirMacTSInfo *tsinfo;
710 tANI_U8 tspecIdx;
711 tANI_U8 ac;
712 tpDphHashNode pStaDs = NULL;
713
714
715 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
716 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
717 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
718
719 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
720 if (pSta == NULL)
721 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700722 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700723 return;
724 }
725
726 // parse the delts request
727 retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts);
728 if (retval != eSIR_SUCCESS)
729 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700730 PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700731 return;
732 }
733
734 if (delts.wmeTspecPresent)
735 {
736 if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
737 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700738 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700739 return;
740 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700741 PELOG2(limLog(pMac, LOG2, FL("WME Delts received"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700742 }
743 else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled)
744 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700745 PELOG2(limLog(pMac, LOG2, FL("11e QoS Delts received"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700746 }
747 else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled)
748 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700749 PELOG2(limLog(pMac, LOG2, FL("WSM Delts received"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700750 }
751 else
752 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700753 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700754 return;
755 }
756
757 tsinfo = delts.wmeTspecPresent ? &delts.tspec.tsinfo : &delts.tsinfo;
758
759 // if no Admit Control, ignore the request
760 if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA))
761 {
762
Jeff Johnson295189b2012-06-20 16:38:30 -0700763 if ((upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC) || (! psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm))
Jeff Johnson295189b2012-06-20 16:38:30 -0700764 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700765 limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700766 tsinfo->traffic.userPrio);
767 return;
768 }
769 }
770
771 // try to delete the TS
772 if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx))
773 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700774 PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700775 return;
776 }
777
778 else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
779 (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH))
780 {
781 //Edca only for now.
782 }
783 else
784 {
785 //send message to HAL to delete TS
Jeff Johnsone7245742012-09-05 17:12:55 -0700786 if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac, pSta->staIndex, tspecIdx, delts, psessionEntry->peSessionId))
Jeff Johnson295189b2012-06-20 16:38:30 -0700787 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700788 limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700789 tsinfo->traffic.userPrio);
790 return;
791 }
792 }
793
794 /* We successfully deleted the TSPEC. Update the dynamic UAPSD Mask.
795 * The AC for this TSPEC is no longer trigger enabled if this Tspec
796 * was set-up in uplink direction only.
797 * The AC for this TSPEC is no longer delivery enabled if this Tspec
798 * was set-up in downlink direction only.
799 * The AC for this TSPEC is no longer triiger enabled and delivery
800 * enabled if this Tspec was a bidirectional TSPEC.
801 */
802 limSetTspecUapsdMask(pMac, tsinfo, CLEAR_UAPSD_MASK);
803
804
805 /* We're deleting the TSPEC.
806 * The AC for this TSPEC is no longer admitted in uplink/downlink direction
807 * if this TSPEC was set-up in uplink/downlink direction only.
808 * The AC for this TSPEC is no longer admitted in both uplink and downlink
809 * directions if this TSPEC was a bi-directional TSPEC.
810 * If ACM is set for this AC and this AC is admitted only in downlink
811 * direction, PE needs to downgrade the EDCA parameter
812 * (for the AC for which TS is being deleted) to the
813 * next best AC for which ACM is not enabled, and send the
814 * updated values to HAL.
815 */
816 ac = upToAc(tsinfo->traffic.userPrio);
817
818 if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK)
819 {
820 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
821 }
822 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK)
823 {
824 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
825 }
826 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR)
827 {
828 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
829 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
830 }
831
832 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
833
834 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
835 if (pStaDs != NULL)
836 {
837 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
838 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
839 else
840 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
841 }
842 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700843 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700844
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700845 PELOG1(limLog(pMac, LOG1, FL("DeleteTS succeeded"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700846 if((psessionEntry->limSystemRole != eLIM_AP_ROLE)&&(psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
847 limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry);
848
849#ifdef FEATURE_WLAN_CCX
850 limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER);
851#endif
852
853}
854
855
856#ifdef ANI_SUPPORT_11H
857/**
858 * limProcessBasicMeasReq
859 *
860 *FUNCTION:
861 * This function is called by limProcessMeasurementRequestFrame()
862 * when it received a Basic measurement Request action frame.
863 * Station/BP receiving this should perform basic measurements
864 * and then send Basic Measurement Report. AP should not perform
865 * any measurements, and send report indicating refusal.
866 *
867 *LOGIC:
868 *
869 *ASSUMPTIONS:
870 *
871 *NOTE:
872 *
873 * @param pMac - Pointer to Global MAC structure
874 * @param pMeasReqFrame - A pointer to Basic Meas. Req structure
875 * @return None
876 */
877static void
878__limProcessBasicMeasReq(tpAniSirGlobal pMac,
879 tpSirMacMeasReqActionFrame pMeasReqFrame,
880 tSirMacAddr peerMacAddr)
881{
882 // TBD - Station shall perform basic measurements
883
884 if (limSendMeasReportFrame(pMac,
885 pMeasReqFrame,
886 peerMacAddr) != eSIR_SUCCESS)
887 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700888 PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700889 return;
890 }
891}
892
893
894/**
895 * limProcessCcaMeasReq
896 *
897 *FUNCTION:
898 * This function is called by limProcessMeasurementRequestFrame()
899 * when it received a CCA measurement Request action frame.
900 * Station/BP receiving this should perform CCA measurements
901 * and then send CCA Measurement Report. AP should not perform
902 * any measurements, and send report indicating refusal.
903 *
904 *LOGIC:
905 *
906 *ASSUMPTIONS:
907 *
908 *NOTE:
909 *
910 * @param pMac - Pointer to Global MAC structure
911 * @param pMeasReqFrame - A pointer to CCA Meas. Req structure
912 * @return None
913 */
914static void
915__limProcessCcaMeasReq(tpAniSirGlobal pMac,
916 tpSirMacMeasReqActionFrame pMeasReqFrame,
917 tSirMacAddr peerMacAddr)
918{
919 // TBD - Station shall perform cca measurements
920
921 if (limSendMeasReportFrame(pMac,
922 pMeasReqFrame,
923 peerMacAddr) != eSIR_SUCCESS)
924 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700925 PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700926 return;
927 }
928}
929
930
931/**
932 * __limProcessRpiMeasReq
933 *
934 *FUNCTION:
935 * This function is called by limProcessMeasurementRequestFrame()
936 * when it received a RPI measurement Request action frame.
937 * Station/BP/AP receiving this shall not perform any measurements,
938 * and send report indicating refusal.
939 *
940 *LOGIC:
941 *
942 *ASSUMPTIONS:
943 *
944 *NOTE:
945 *
946 * @param pMac - Pointer to Global MAC structure
947 * @param pMeasReqFrame - A pointer to RPI Meas. Req structure
948 * @return None
949 */
950static void
951__limProcessRpiMeasReq(tpAniSirGlobal pMac,
952 tpSirMacMeasReqActionFrame pMeasReqFrame,
953 tSirMacAddr peerMacAddr)
954{
955 if (limSendMeasReportFrame(pMac,
956 pMeasReqFrame,
957 peerMacAddr) != eSIR_SUCCESS)
958 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700959 PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700960 return;
961 }
962}
963
964
965/**
966 * __limProcessMeasurementRequestFrame
967 *
968 *FUNCTION:
969 *
970 *LOGIC:
971 *
972 *ASSUMPTIONS:
973 *
974 *NOTE:
975 *
976 * @param pMac - Pointer to Global MAC structure
977 * @param *pRxPacketInfo - A pointer to packet info structure
978 * @return None
979 */
980
981static void
982__limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
983{
984 tpSirMacMgmtHdr pHdr;
985 tANI_U8 *pBody;
986 tpSirMacMeasReqActionFrame pMeasReqFrame;
987 tANI_U32 frameLen;
988
989 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
990 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
991 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
992
993 if ( eHAL_STATUS_SUCCESS !=
994 palAllocateMemory( pMac->hHdd, (void **)&pMeasReqFrame, sizeof( tSirMacMeasReqActionFrame ) ) )
995 {
996 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700997 FL("limProcessMeasurementRequestFrame: palAllocateMemory failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700998 return;
999 }
1000
1001 if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) !=
1002 eSIR_SUCCESS)
1003 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001004 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001005 return;
1006 }
1007
1008
1009 switch(pMeasReqFrame->measReqIE.measType)
1010 {
1011 case SIR_MAC_BASIC_MEASUREMENT_TYPE:
1012 __limProcessBasicMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1013 break;
1014
1015 case SIR_MAC_CCA_MEASUREMENT_TYPE:
1016 __limProcessCcaMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1017 break;
1018
1019 case SIR_MAC_RPI_MEASUREMENT_TYPE:
1020 __limProcessRpiMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1021 break;
1022
1023 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001024 PELOG1(limLog(pMac, LOG1, FL("Unknown Measurement Type %d "),
Jeff Johnson295189b2012-06-20 16:38:30 -07001025 pMeasReqFrame->measReqIE.measType);)
1026 break;
1027 }
1028
1029} /*** end limProcessMeasurementRequestFrame ***/
1030
1031
1032/**
1033 * limProcessTpcRequestFrame
1034 *
1035 *FUNCTION:
1036 * This function is called upon receiving Tpc Request frame.
1037 *
1038 *NOTE:
1039 *
1040 * @param pMac - Pointer to Global MAC structure
1041 * @param *pRxPacketInfo - A pointer to packet info structure
1042 * @return None
1043 */
1044
1045static void
1046__limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1047{
1048 tpSirMacMgmtHdr pHdr;
1049 tANI_U8 *pBody;
1050 tpSirMacTpcReqActionFrame pTpcReqFrame;
1051 tANI_U32 frameLen;
1052
1053 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1054 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1055 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1056
1057 PELOG1(limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));)
1058
1059 if ( eHAL_STATUS_SUCCESS !=
1060 palAllocateMemory( pMac->hHdd, (void **)&pTpcReqFrame, sizeof( tSirMacTpcReqActionFrame ) ) )
1061 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001062 PELOGE(limLog(pMac, LOGE, FL("palAllocateMemory failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001063 return;
1064 }
1065
1066 if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) !=
1067 eSIR_SUCCESS)
1068 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001069 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001070 return;
1071 }
1072
1073 if (limSendTpcReportFrame(pMac,
1074 pTpcReqFrame,
1075 pHdr->sa) != eSIR_SUCCESS)
1076 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001077 PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001078 return;
1079 }
1080}
1081#endif
1082
1083
1084/**
1085 * \brief Validate an ADDBA Req from peer with respect
1086 * to our own BA configuration
1087 *
1088 * \sa __limValidateAddBAParameterSet
1089 *
1090 * \param pMac The global tpAniSirGlobal object
1091 *
1092 * \param baParameterSet The ADDBA Parameter Set.
1093 *
1094 * \param pDelBAFlag this parameter is NULL except for call from processAddBAReq
1095 * delBAFlag is set when entry already exists.
1096 *
1097 * \param reqType ADDBA Req v/s ADDBA Rsp
1098 * 1 - ADDBA Req
1099 * 0 - ADDBA Rsp
1100 *
1101 * \return eSIR_SUCCESS if setup completes successfully
1102 * eSIR_FAILURE is some problem is encountered
1103 */
1104
1105static tSirMacStatusCodes
1106__limValidateAddBAParameterSet( tpAniSirGlobal pMac,
1107 tpDphHashNode pSta,
1108 tDot11fFfAddBAParameterSet baParameterSet,
1109 tANI_U8 dialogueToken,
1110 tLimAddBaValidationReqType reqType ,
1111 tANI_U8* pDelBAFlag /*this parameter is NULL except for call from processAddBAReq*/)
1112{
1113 if(baParameterSet.tid >= STACFG_MAX_TC)
1114 {
1115 return eSIR_MAC_WME_INVALID_PARAMS_STATUS;
1116 }
1117
1118 //check if there is already a BA session setup with this STA/TID while processing AddBaReq
1119 if((true == pSta->tcCfg[baParameterSet.tid].fUseBARx) &&
1120 (LIM_ADDBA_REQ == reqType))
1121 {
1122 //There is already BA session setup for STA/TID.
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001123 limLog( pMac, LOGE,
Jeff Johnson295189b2012-06-20 16:38:30 -07001124 FL( "AddBAReq rcvd when there is already a session for this StaId = %d, tid = %d\n " ),
1125 pSta->staIndex, baParameterSet.tid);
1126 limPrintMacAddr( pMac, pSta->staAddr, LOGW );
1127
1128 if(pDelBAFlag)
1129 *pDelBAFlag = true;
1130 }
1131 return eSIR_MAC_SUCCESS_STATUS;
1132}
1133
1134/**
1135 * \brief Validate a DELBA Ind from peer with respect
1136 * to our own BA configuration
1137 *
1138 * \sa __limValidateDelBAParameterSet
1139 *
1140 * \param pMac The global tpAniSirGlobal object
1141 *
1142 * \param baParameterSet The DELBA Parameter Set.
1143 *
1144 * \param pSta Runtime, STA-related configuration cached
1145 * in the HashNode object
1146 *
1147 * \return eSIR_SUCCESS if setup completes successfully
1148 * eSIR_FAILURE is some problem is encountered
1149 */
1150static tSirMacStatusCodes
1151__limValidateDelBAParameterSet( tpAniSirGlobal pMac,
1152 tDot11fFfDelBAParameterSet baParameterSet,
1153 tpDphHashNode pSta )
1154{
1155tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS;
1156
1157 // Validate if a BA is active for the requested TID
1158 if( pSta->tcCfg[baParameterSet.tid].fUseBATx ||
1159 pSta->tcCfg[baParameterSet.tid].fUseBARx )
1160 {
1161 statusCode = eSIR_MAC_SUCCESS_STATUS;
1162
1163 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001164 FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001165 }
1166 else
1167 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001168 FL("Received an INVALID DELBA Ind for TID %d..."),
Jeff Johnson295189b2012-06-20 16:38:30 -07001169 baParameterSet.tid );
1170
1171 return statusCode;
1172}
1173
1174/**
1175 * \brief Process an ADDBA REQ
1176 *
1177 * \sa limProcessAddBAReq
1178 *
1179 * \param pMac The global tpAniSirGlobal object
1180 *
1181 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1182 *
1183 * \return none
1184 *
1185 */
1186static void
1187__limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1188{
1189 tDot11fAddBAReq frmAddBAReq;
1190 tpSirMacMgmtHdr pHdr;
1191 tpDphHashNode pSta;
1192 tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS;
1193 tANI_U16 aid;
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001194 tANI_U32 frameLen, nStatus,val;
Jeff Johnson295189b2012-06-20 16:38:30 -07001195 tANI_U8 *pBody;
1196 tANI_U8 delBAFlag =0;
1197
1198 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1199 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1200 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1201
1202 // Unpack the received frame
1203 nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq );
1204 if( DOT11F_FAILED( nStatus ))
1205 {
1206 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001207 FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001208 nStatus,
1209 frameLen );
1210
1211 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1212
1213 // Without an unpacked request we cannot respond, so silently ignore the request
1214 return;
1215 }
1216 else if ( DOT11F_WARNED( nStatus ) )
1217 {
1218 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001219 FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001220 nStatus,
1221 frameLen );
1222
1223 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1224 }
1225
Kiran Kumar Lokere2ac471f2013-05-30 16:08:48 -07001226 psessionEntry->amsduSupportedInBA = frmAddBAReq.AddBAParameterSet.amsduSupported;
1227
Jeff Johnson295189b2012-06-20 16:38:30 -07001228 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1229 if( pSta == NULL )
1230 {
1231 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001232 FL( "STA context not found - ignoring ADDBA from " ));
Gopichand Nakkala6a36e142013-06-07 21:23:15 -07001233 limPrintMacAddr( pMac, pHdr->sa, LOGW );
Jeff Johnson295189b2012-06-20 16:38:30 -07001234
1235 // FIXME - Should we do this?
1236 status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS;
1237 goto returnAfterError;
1238 }
1239
1240 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001241 FL( "ADDBA Req from STA with AID %d, tid = %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001242 aid, frmAddBAReq.AddBAParameterSet.tid);
1243
1244#ifdef WLAN_SOFTAP_VSTA_FEATURE
1245 // we can only do BA on "hard" STAs
1246 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1247 {
1248 status = eSIR_MAC_REQ_DECLINED_STATUS;
1249 goto returnAfterError;
1250 }
1251#endif //WLAN_SOFTAP_VSTA_FEATURE
1252
1253
1254 // Now, validate the ADDBA Req
1255 if( eSIR_MAC_SUCCESS_STATUS !=
1256 (status = __limValidateAddBAParameterSet( pMac, pSta,
1257 frmAddBAReq.AddBAParameterSet,
1258 0, //dialogue token is don't care in request validation.
1259 LIM_ADDBA_REQ, &delBAFlag)))
1260 goto returnAfterError;
1261
1262 //BA already set, so we need to delete it before adding new one.
1263 if(delBAFlag)
1264 {
1265 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1266 pSta,
1267 (tANI_U8)frmAddBAReq.AddBAParameterSet.tid,
1268 eBA_RECIPIENT,psessionEntry))
1269 {
1270 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1271 goto returnAfterError;
1272 }
1273 }
1274
1275 // Check if the ADD BA Declined configuration is Disabled
1276 if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001277 limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001278 frmAddBAReq.AddBAParameterSet.tid);
1279 status = eSIR_MAC_REQ_DECLINED_STATUS;
1280 goto returnAfterError;
1281 }
1282
1283 //
1284 // Post WDA_ADDBA_REQ to HAL.
1285 // If HAL/HDD decide to allow this ADDBA Req session,
1286 // then this BA session is termed active
1287 //
1288
1289 // Change the Block Ack state of this STA to wait for
1290 // ADDBA Rsp from HAL
1291 LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001292
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001293 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001294 {
1295 limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001296 return ;
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001297 }
1298
1299
1300 if (frmAddBAReq.AddBAParameterSet.bufferSize)
1301 {
1302 frmAddBAReq.AddBAParameterSet.bufferSize =
1303 VOS_MIN(val, frmAddBAReq.AddBAParameterSet.bufferSize);
1304 }
1305 else
1306 {
1307 frmAddBAReq.AddBAParameterSet.bufferSize = val;
1308 }
Gopichand Nakkala6a36e142013-06-07 21:23:15 -07001309 limLog( pMac, LOGE, FL( "ADDBAREQ NUMBUFF %d" ),
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001310 frmAddBAReq.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001311
1312 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1313 pSta,
1314 (tANI_U8) frmAddBAReq.DialogToken.token,
1315 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1316 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1317 frmAddBAReq.AddBAParameterSet.bufferSize,
1318 frmAddBAReq.BATimeout.timeout,
1319 (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn,
1320 eBA_RECIPIENT,psessionEntry))
1321 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1322 else
1323 return;
1324
1325returnAfterError:
1326
1327 //
1328 // Package LIM_MLM_ADDBA_RSP to MLME, with proper
1329 // status code. MLME will then send an ADDBA RSP
1330 // over the air to the peer MAC entity
1331 //
1332 if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac,
1333 pHdr->sa,
1334 status,
1335 frmAddBAReq.DialogToken.token,
1336 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1337 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1338 frmAddBAReq.AddBAParameterSet.bufferSize,
1339 frmAddBAReq.BATimeout.timeout,psessionEntry))
1340 {
1341 limLog( pMac, LOGW,
1342 FL( "Failed to post LIM_MLM_ADDBA_RSP to " ));
1343 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1344 }
1345
1346}
1347
1348/**
1349 * \brief Process an ADDBA RSP
1350 *
1351 * \sa limProcessAddBARsp
1352 *
1353 * \param pMac The global tpAniSirGlobal object
1354 *
1355 * \param pRxPacketInfo Handle to the packet info structure from HDD
1356 *
1357 * \return none
1358 *
1359 */
1360static void
1361__limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1362{
1363tDot11fAddBARsp frmAddBARsp;
1364tpSirMacMgmtHdr pHdr;
1365tpDphHashNode pSta;
1366tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1367tANI_U16 aid;
1368tANI_U32 frameLen, nStatus;
1369tANI_U8 *pBody;
1370
1371 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1372 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1373 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1374
1375 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1376 if( pSta == NULL )
1377 {
1378 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001379 FL( "STA context not found - ignoring ADDBA from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001380 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1381 return;
1382 }
1383
1384#ifdef WLAN_SOFTAP_VSTA_FEATURE
1385 // We can only do BA on "hard" STAs. We should not have issued an ADDBA
1386 // Request, so we should never be processing a ADDBA Response
1387 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1388 {
1389 return;
1390 }
1391#endif //WLAN_SOFTAP_VSTA_FEATURE
1392
1393 // Unpack the received frame
1394 nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp );
1395 if( DOT11F_FAILED( nStatus ))
1396 {
1397 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001398 FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001399 nStatus,
1400 frameLen );
1401
1402 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1403 goto returnAfterError;
1404 }
1405 else if ( DOT11F_WARNED( nStatus ) )
1406 {
1407 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001408 FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001409 nStatus,
1410 frameLen );
1411
1412 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1413 }
1414
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001415 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001416 FL( "ADDBA Rsp from STA with AID %d, tid = %d, status = %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001417 aid, frmAddBARsp.AddBAParameterSet.tid, frmAddBARsp.Status.status);
1418
1419 //if there is no matchin dialougue token then ignore the response.
1420
1421 if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token,
1422 pSta->assocId, frmAddBARsp.AddBAParameterSet.tid))
1423 {
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001424 PELOGW(limLog(pMac, LOGE, FL("dialogueToken in received addBARsp did not match with outstanding requests"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001425 return;
1426 }
1427
1428 // Check first if the peer accepted the ADDBA Req
1429 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1430 {
1431 //if peer responded with buffer size 0 then we should pick the default.
1432 if(0 == frmAddBARsp.AddBAParameterSet.bufferSize)
1433 frmAddBARsp.AddBAParameterSet.bufferSize = BA_DEFAULT_TX_BUFFER_SIZE;
1434
1435 // Now, validate the ADDBA Rsp
1436 if( eSIR_MAC_SUCCESS_STATUS !=
1437 __limValidateAddBAParameterSet( pMac, pSta,
1438 frmAddBARsp.AddBAParameterSet,
1439 (tANI_U8)frmAddBARsp.DialogToken.token,
1440 LIM_ADDBA_RSP, NULL))
1441 goto returnAfterError;
1442 }
1443 else
1444 goto returnAfterError;
1445
1446 // Change STA state to wait for ADDBA Rsp from HAL
1447 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
1448
1449 //
1450 // Post WDA_ADDBA_REQ to HAL.
1451 // If HAL/HDD decide to allow this ADDBA Rsp session,
1452 // then this BA session is termed active
1453 //
1454
1455 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1456 pSta,
1457 (tANI_U8) frmAddBARsp.DialogToken.token,
1458 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1459 (tANI_U8) frmAddBARsp.AddBAParameterSet.policy,
1460 frmAddBARsp.AddBAParameterSet.bufferSize,
1461 frmAddBARsp.BATimeout.timeout,
1462 0,
1463 eBA_INITIATOR,psessionEntry))
1464 reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1465 else
1466 return;
1467
1468returnAfterError:
1469
1470 // TODO: Do we need to signal an error status to SME,
1471 // if status != eSIR_MAC_SUCCESS_STATUS
1472
1473 // Restore STA "BA" State
1474 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE);
1475 //
1476 // Need to send a DELBA IND to peer, who
1477 // would have setup a BA session with this STA
1478 //
1479 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1480 {
1481 //
1482 // Package LIM_MLM_DELBA_REQ to MLME, with proper
1483 // status code. MLME will then send a DELBA IND
1484 // over the air to the peer MAC entity
1485 //
1486 if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac,
1487 pSta,
1488 eBA_INITIATOR,
1489 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1490 reasonCode, psessionEntry))
1491 {
1492 limLog( pMac, LOGW,
1493 FL( "Failed to post LIM_MLM_DELBA_REQ to " ));
1494 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1495 }
1496 }
1497}
1498
1499/**
1500 * \brief Process a DELBA Indication
1501 *
1502 * \sa limProcessDelBAInd
1503 *
1504 * \param pMac The global tpAniSirGlobal object
1505 *
1506 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1507 *
1508 * \return none
1509 *
1510 */
1511static void
1512__limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1513{
1514tDot11fDelBAInd frmDelBAInd;
1515tpSirMacMgmtHdr pHdr;
1516tpDphHashNode pSta;
1517tANI_U16 aid;
1518tANI_U32 frameLen, nStatus;
1519tANI_U8 *pBody;
1520
1521 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1522 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1523 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1524
1525 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1526 if( pSta == NULL )
1527 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001528 limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001529 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1530 return;
1531 }
1532
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001533 limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid );
Jeff Johnson295189b2012-06-20 16:38:30 -07001534
1535 // Unpack the received frame
1536 nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd );
1537 if( DOT11F_FAILED( nStatus ))
1538 {
1539 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001540 FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001541 nStatus,
1542 frameLen );
1543
1544 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1545 return;
1546 }
1547 else if ( DOT11F_WARNED( nStatus ) )
1548 {
1549 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001550 FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001551 nStatus,
1552 frameLen );
1553
1554 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1555 }
1556
1557 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001558 FL( "Received DELBA for TID %d, Reason code %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001559 frmDelBAInd.DelBAParameterSet.tid,
1560 frmDelBAInd.Reason.code );
1561
1562 // Now, validate the DELBA Ind
1563 if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac,
1564 frmDelBAInd.DelBAParameterSet,
1565 pSta ))
1566 return;
1567
1568 //
1569 // Post WDA_DELBA_IND to HAL and delete the
1570 // existing BA session
1571 //
1572 // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16
1573 // is kind of confusing...
1574 //
1575 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1576 pSta,
1577 (tANI_U8) frmDelBAInd.DelBAParameterSet.tid,
1578 (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)?
1579 eBA_INITIATOR: eBA_RECIPIENT,psessionEntry))
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001580 limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001581
1582 return;
1583
1584}
1585
1586static void
1587__limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry)
1588{
1589
1590#if 0
1591 tpSirMacMgmtHdr pHdr;
1592 tDot11fSMPowerSave frmSMPower;
1593 tSirMacHTMIMOPowerSaveState state;
1594 tpDphHashNode pSta;
1595 tANI_U16 aid;
1596 tANI_U32 frameLen, nStatus;
1597 tANI_U8 *pBody;
1598
1599 pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd );
1600 pBody = SIR_MAC_BD_TO_MPDUDATA( pBd );
1601 frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd );
1602
1603 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1604 if( pSta == NULL ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001605 limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001606 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1607 return;
1608 }
1609
1610 /**Unpack the received frame */
1611 nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower);
1612
1613 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001614 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001615 nStatus, frameLen );
1616 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1617 return;
1618 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001619 limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001620 nStatus, frameLen );
1621 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1622 }
1623
1624 limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d"
1625 "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En,
1626 frmSMPower.SMPowerModeSet.Mode);
1627
1628 /** Update in the DPH Table about the Update in the SM Power Save mode*/
1629 if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode)
1630 state = eSIR_HT_MIMO_PS_DYNAMIC;
1631 else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0))
1632 state = eSIR_HT_MIMO_PS_STATIC;
1633 else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0))
1634 state = eSIR_HT_MIMO_PS_NO_LIMIT;
1635 else {
1636 PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));)
1637 return;
1638 }
1639
1640 if (state == pSta->htMIMOPSState) {
1641 PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));)
1642 return;
1643 }
1644
1645 /** Update in the HAL Station Table for the Update of the Protection Mode */
1646 pSta->htMIMOPSState = state;
1647 limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState);
1648
1649#endif
1650
1651}
1652
1653#if defined WLAN_FEATURE_VOWIFI
1654
1655static void
1656__limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1657{
1658 tpSirMacMgmtHdr pHdr;
1659 tDot11fRadioMeasurementRequest frm;
1660 tANI_U32 frameLen, nStatus;
1661 tANI_U8 *pBody;
1662
1663 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1664 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1665 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1666
1667 if( psessionEntry == NULL )
1668 {
1669 return;
1670 }
1671
1672 /**Unpack the received frame */
1673 nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm );
1674
1675 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001676 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001677 nStatus, frameLen );
1678 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1679 return;
1680 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001681 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001682 nStatus, frameLen );
1683 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1684 }
1685
1686 // Call rrm function to handle the request.
1687
1688 rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry );
1689}
1690
1691static void
1692__limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1693{
1694 tpSirMacMgmtHdr pHdr;
1695 tDot11fLinkMeasurementRequest frm;
1696 tANI_U32 frameLen, nStatus;
1697 tANI_U8 *pBody;
1698
1699 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1700 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1701 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1702
1703 if( psessionEntry == NULL )
1704 {
1705 return;
1706 }
1707
1708 /**Unpack the received frame */
1709 nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm );
1710
1711 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001712 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001713 nStatus, frameLen );
1714 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1715 return;
1716 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001717 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001718 nStatus, frameLen );
1719 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1720 }
1721
1722 // Call rrm function to handle the request.
1723
1724 rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry );
1725
1726}
1727
1728static void
1729__limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1730{
1731 tpSirMacMgmtHdr pHdr;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001732 tDot11fNeighborReportResponse *pFrm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001733 tANI_U32 frameLen, nStatus;
1734 tANI_U8 *pBody;
1735
1736 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1737 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1738 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1739
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001740 if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1741 (void **)&pFrm, sizeof(tDot11fNeighborReportResponse)))
1742 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001743 limLog(pMac, LOGE, FL("Unable to PAL allocate memory in __limProcessNeighborReport") );
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001744 return;
1745 }
1746
Jeff Johnson295189b2012-06-20 16:38:30 -07001747 if( psessionEntry == NULL )
1748 {
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001749 palFreeMemory(pMac->hHdd, pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001750 return;
1751 }
1752
1753 /**Unpack the received frame */
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001754 nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm );
Jeff Johnson295189b2012-06-20 16:38:30 -07001755
1756 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001757 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001758 nStatus, frameLen );
1759 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001760 palFreeMemory(pMac->hHdd, pFrm);
1761 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001762 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001763 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (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 //Call rrm function to handle the request.
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001769 rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry );
1770
1771 palFreeMemory(pMac->hHdd, pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001772}
1773
1774#endif
1775
1776#ifdef WLAN_FEATURE_11W
1777/**
Chet Lanctot186b5732013-03-18 10:26:30 -07001778 * limProcessSAQueryRequestActionFrame
Jeff Johnson295189b2012-06-20 16:38:30 -07001779 *
1780 *FUNCTION:
1781 * This function is called by limProcessActionFrame() upon
1782 * SA query request Action frame reception.
1783 *
1784 *LOGIC:
1785 *
1786 *ASSUMPTIONS:
1787 *
1788 *NOTE:
1789 *
1790 * @param pMac - Pointer to Global MAC structure
Chet Lanctot186b5732013-03-18 10:26:30 -07001791 * @param *pRxPacketInfo - Handle to the Rx packet info
1792 * @param psessionEntry - PE session entry
1793 *
Jeff Johnson295189b2012-06-20 16:38:30 -07001794 * @return None
1795 */
Chet Lanctot186b5732013-03-18 10:26:30 -07001796static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001797{
1798 tpSirMacMgmtHdr pHdr;
1799 tANI_U8 *pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07001800 tANI_U8 transId[2];
Jeff Johnson295189b2012-06-20 16:38:30 -07001801
1802 /* Prima --- Below Macro not available in prima
1803 pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd);
1804 pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */
1805
1806 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1807 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1808
Chet Lanctot186b5732013-03-18 10:26:30 -07001809 /* If this is an unprotected SA Query Request, then ignore it. */
1810 if (pHdr->fc.wep == 0)
1811 return;
1812
Jeff Johnson295189b2012-06-20 16:38:30 -07001813 /*Extract 11w trsansId from SA query request action frame
1814 In SA query response action frame we will send same transId
1815 In SA query request action frame:
1816 Category : 1 byte
1817 Action : 1 byte
Chet Lanctot186b5732013-03-18 10:26:30 -07001818 Transaction ID : 2 bytes */
1819 vos_mem_copy( &transId[0], &pBody[2], 2 );
Jeff Johnson295189b2012-06-20 16:38:30 -07001820
Jeff Johnson295189b2012-06-20 16:38:30 -07001821 //Send 11w SA query response action frame
1822 if (limSendSaQueryResponseFrame(pMac,
1823 transId,
1824 pHdr->sa,psessionEntry) != eSIR_SUCCESS)
1825 {
Chet Lanctot186b5732013-03-18 10:26:30 -07001826 PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001827 return;
1828 }
1829}
1830
Chet Lanctot186b5732013-03-18 10:26:30 -07001831/**
1832 * __limProcessSAQueryResponseActionFrame
1833 *
1834 *FUNCTION:
1835 * This function is called by limProcessActionFrame() upon
1836 * SA query response Action frame reception.
1837 *
1838 *LOGIC:
1839 *
1840 *ASSUMPTIONS:
1841 *
1842 *NOTE:
1843 *
1844 * @param pMac - Pointer to Global MAC structure
1845 * @param *pRxPacketInfo - Handle to the Rx packet info
1846 * @param psessionEntry - PE session entry
1847 * @return None
1848 */
1849static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
1850{
1851 tpSirMacMgmtHdr pHdr;
1852 tANI_U32 frameLen;
1853
1854 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1855 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1856 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
1857 ("SA Query Response received...")) ;
1858 /* Forward to the SME to HDD to wpa_supplicant */
1859 // type is ACTION
1860 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
1861 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
1862 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
1863}
1864
Jeff Johnson295189b2012-06-20 16:38:30 -07001865#endif
1866
1867/**
1868 * limProcessActionFrame
1869 *
1870 *FUNCTION:
1871 * This function is called by limProcessMessageQueue() upon
1872 * Action frame reception.
1873 *
1874 *LOGIC:
1875 *
1876 *ASSUMPTIONS:
1877 *
1878 *NOTE:
1879 *
1880 * @param pMac - Pointer to Global MAC structure
1881 * @param *pRxPacketInfo - A pointer to packet info structure
1882 * @return None
1883 */
1884
1885void
1886limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1887{
1888 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1889 tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07001890#ifdef WLAN_FEATURE_11W
1891 tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1892#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001893
Jeff Johnson295189b2012-06-20 16:38:30 -07001894 switch (pActionHdr->category)
1895 {
1896 case SIR_MAC_ACTION_QOS_MGMT:
Chet Lanctot186b5732013-03-18 10:26:30 -07001897#ifdef WLAN_FEATURE_11W
1898 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
1899 {
1900 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
1901 "since RMF is enabled."), pActionHdr->category);)
1902 break;
1903 }
1904#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001905 if (psessionEntry->limQosEnabled)
1906 {
1907 switch (pActionHdr->actionID)
1908 {
1909 case SIR_MAC_QOS_ADD_TS_REQ:
1910 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1911 break;
1912
1913 case SIR_MAC_QOS_ADD_TS_RSP:
1914 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1915 break;
1916
1917 case SIR_MAC_QOS_DEL_TS_REQ:
1918 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1919 break;
1920
1921 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001922 PELOGE(limLog(pMac, LOGE, FL("Qos action %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001923 break;
1924 }
1925 break ;
1926 }
1927
1928 break;
1929
1930 case SIR_MAC_ACTION_SPECTRUM_MGMT:
Chet Lanctot186b5732013-03-18 10:26:30 -07001931#ifdef WLAN_FEATURE_11W
1932 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
1933 {
1934 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
1935 "since RMF is enabled."), pActionHdr->category);)
1936 break;
1937 }
1938#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001939 switch (pActionHdr->actionID)
1940 {
1941#ifdef ANI_SUPPORT_11H
1942 case SIR_MAC_ACTION_MEASURE_REQUEST_ID:
1943 if(psessionEntry->lim11hEnable)
1944 {
1945 __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo);
1946 }
1947 break;
1948
1949 case SIR_MAC_ACTION_TPC_REQUEST_ID:
1950 if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
1951 (pessionEntry->limSystemRole == eLIM_AP_ROLE))
1952 {
1953 if(psessionEntry->lim11hEnable)
1954 {
1955 __limProcessTpcRequestFrame(pMac, pRxPacketInfo);
1956 }
1957 }
1958 break;
1959
1960#endif
1961 case SIR_MAC_ACTION_CHANNEL_SWITCH_ID:
1962 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
1963 {
1964 __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry);
1965 }
1966 break;
1967 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001968 PELOGE(limLog(pMac, LOGE, FL("Spectrum mgmt action id %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001969 break;
1970 }
1971 break;
1972
1973 case SIR_MAC_ACTION_WME:
1974 if (! psessionEntry->limWmeEnabled)
1975 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001976 limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001977 pActionHdr->actionID);
1978 break;
1979 }
1980 switch(pActionHdr->actionID)
1981 {
1982 case SIR_MAC_QOS_ADD_TS_REQ:
1983 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1984 break;
1985
1986 case SIR_MAC_QOS_ADD_TS_RSP:
1987 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1988 break;
1989
1990 case SIR_MAC_QOS_DEL_TS_REQ:
1991 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1992 break;
1993
1994 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001995 PELOGE(limLog(pMac, LOGE, FL("WME action %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001996 break;
1997 }
1998 break;
1999
2000 case SIR_MAC_ACTION_BLKACK:
2001 // Determine the "type" of BA Action Frame
Chet Lanctot186b5732013-03-18 10:26:30 -07002002#ifdef WLAN_FEATURE_11W
2003 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
2004 {
2005 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2006 "since RMF is enabled."), pActionHdr->category);)
2007 break;
2008 }
2009#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002010 switch(pActionHdr->actionID)
2011 {
2012 case SIR_MAC_BLKACK_ADD_REQ:
2013 __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2014 break;
2015
2016 case SIR_MAC_BLKACK_ADD_RSP:
2017 __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2018 break;
2019
2020 case SIR_MAC_BLKACK_DEL:
2021 __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2022 break;
2023
2024 default:
2025 break;
2026 }
2027
2028 break;
2029 case SIR_MAC_ACTION_HT:
2030 /** Type of HT Action to be performed*/
2031 switch(pActionHdr->actionID) {
2032 case SIR_MAC_SM_POWER_SAVE:
2033 __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2034 break;
2035 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002036 PELOGE(limLog(pMac, LOGE, FL("Action ID %d not handled in HT Action category"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002037 break;
2038 }
2039 break;
2040
2041#if defined WLAN_FEATURE_VOWIFI
2042 case SIR_MAC_ACTION_RRM:
Chet Lanctot186b5732013-03-18 10:26:30 -07002043#ifdef WLAN_FEATURE_11W
2044 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
2045 {
2046 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2047 "since RMF is enabled."), pActionHdr->category);)
2048 break;
2049 }
2050#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002051 if( pMac->rrm.rrmPEContext.rrmEnable )
2052 {
2053 switch(pActionHdr->actionID) {
2054 case SIR_MAC_RRM_RADIO_MEASURE_REQ:
2055 __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2056 break;
2057 case SIR_MAC_RRM_LINK_MEASUREMENT_REQ:
2058 __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2059 break;
2060 case SIR_MAC_RRM_NEIGHBOR_RPT:
2061 __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry );
2062 break;
2063 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002064 PELOGE( limLog( pMac, LOGE, FL("Action ID %d not handled in RRM"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002065 break;
2066
2067 }
2068 }
2069 else
2070 {
2071 // Else we will just ignore the RRM messages.
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002072 PELOGE( limLog( pMac, LOGE, FL("RRM Action frame ignored as RRM is disabled in cfg"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002073 }
2074 break;
2075#endif
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002076#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
2077 case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
2078 {
2079 tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr;
2080 tpSirMacMgmtHdr pHdr;
2081 tANI_U32 frameLen;
2082 tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 };
2083
2084 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2085 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2086
2087 //Check if it is a vendor specific action frame.
2088 if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) &&
2089 (VOS_TRUE == palEqualMemory(pMac->hHdd, psessionEntry->selfMacAddr,
2090 &pHdr->da[0], sizeof(tSirMacAddr))) &&
2091 IS_WES_MODE_ENABLED(pMac) && palEqualMemory( pMac->hHdd, pVendorSpecific->Oui, Oui, 3))
2092 {
2093 PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"),
2094 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);)
2095 /* Forward to the SME to HDD to wpa_supplicant */
2096 // type is ACTION
2097 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2098 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
2099 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
2100 }
2101 else
2102 {
2103 limLog( pMac, LOGE, FL("Dropping the vendor specific action frame because of( "
2104 "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or "
2105 "not received with SelfSta Mac address) system role = %d"),
2106 IS_WES_MODE_ENABLED(pMac),
2107 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1],
2108 pVendorSpecific->Oui[2],
2109 psessionEntry->limSystemRole );
2110 }
2111 }
2112 break;
2113#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002114 case SIR_MAC_ACTION_PUBLIC_USAGE:
2115 switch(pActionHdr->actionID) {
2116 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2117 {
2118 tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr;
2119 tpSirMacMgmtHdr pHdr;
2120 tANI_U32 frameLen;
2121 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2122
2123 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2124 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2125
2126 //Check if it is a P2P public action frame.
2127 if( palEqualMemory( pMac->hHdd, pPubAction->Oui, P2POui, 4 ) )
2128 {
2129 /* Forward to the SME to HDD to wpa_supplicant */
2130 // type is ACTION
2131 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2132 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302133 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002134 }
2135 else
2136 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002137 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002138 pPubAction->Oui[0], pPubAction->Oui[1], pPubAction->Oui[2], pPubAction->Oui[3] );
2139 }
2140 }
2141 break;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002142#ifdef FEATURE_WLAN_TDLS
2143 case SIR_MAC_TDLS_DIS_RSP:
2144 {
2145#ifdef FEATURE_WLAN_TDLS_INTERNAL
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002146 //LIM_LOG_TDLS(printk("Public Action TDLS Discovery RSP ..")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002147 limProcessTdlsPublicActionFrame(pMac, (tANI_U32*)pRxPacketInfo, psessionEntry) ;
2148#else
2149 tpSirMacMgmtHdr pHdr;
2150 tANI_U32 frameLen;
Chilam NG571c65a2013-01-19 12:27:36 +05302151 tANI_S8 rssi;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002152
2153 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2154 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
Chilam NG571c65a2013-01-19 12:27:36 +05302155 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002156 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002157 ("Public Action TDLS Discovery RSP ..")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002158 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2159 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302160 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, rssi);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002161#endif
2162 }
2163 break;
2164#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002165
2166 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002167 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002168 break;
2169 }
2170 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002171
2172#ifdef WLAN_FEATURE_11W
2173 case SIR_MAC_ACTION_SA_QUERY:
2174 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002175 PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);)
2176 switch (pActionHdr->actionID)
2177 {
2178 case SIR_MAC_SA_QUERY_REQ:
2179 /**11w SA query request action frame received**/
2180 /* Respond directly to the incoming request in LIM */
2181 __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2182 break;
2183 case SIR_MAC_SA_QUERY_RSP:
2184 /**11w SA query response action frame received**/
2185 /* Forward to the SME to HDD to wpa_supplicant */
2186 __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2187 break;
2188 default:
2189 break;
2190 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002191 break;
2192 }
2193#endif
Mohit Khanna4a70d262012-09-11 16:30:12 -07002194#ifdef WLAN_FEATURE_11AC
2195 case SIR_MAC_ACTION_VHT:
2196 {
2197 if (psessionEntry->vhtCapability)
2198 {
2199 switch (pActionHdr->actionID)
2200 {
2201 case SIR_MAC_VHT_OPMODE_NOTIFICATION:
2202 __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry);
2203 break;
2204 default:
2205 break;
2206 }
2207 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002208 break;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -07002209 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002210#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002211 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002212 PELOGE(limLog(pMac, LOGE, FL("Action category %d not handled"), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002213 break;
2214 }
2215}
2216
Jeff Johnson295189b2012-06-20 16:38:30 -07002217/**
2218 * limProcessActionFrameNoSession
2219 *
2220 *FUNCTION:
2221 * This function is called by limProcessMessageQueue() upon
2222 * Action frame reception and no session.
2223 * Currently only public action frames can be received from
2224 * a non-associated station.
2225 *
2226 *LOGIC:
2227 *
2228 *ASSUMPTIONS:
2229 *
2230 *NOTE:
2231 *
2232 * @param pMac - Pointer to Global MAC structure
2233 * @param *pBd - A pointer to Buffer descriptor + associated PDUs
2234 * @return None
2235 */
2236
2237void
2238limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd)
2239{
2240 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd);
2241 tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody;
2242
Mohit Khanna23863762012-09-11 17:40:09 -07002243 limLog( pMac, LOG1, "Received a Action frame -- no session");
Jeff Johnson295189b2012-06-20 16:38:30 -07002244
2245 switch ( pActionHdr->category )
2246 {
2247 case SIR_MAC_ACTION_PUBLIC_USAGE:
2248 switch(pActionHdr->actionID) {
2249 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2250 {
2251 tpSirMacMgmtHdr pHdr;
2252 tANI_U32 frameLen;
2253 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2254
2255 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
2256 frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd);
2257
2258 //Check if it is a P2P public action frame.
2259 if( palEqualMemory( pMac->hHdd, pActionHdr->Oui, P2POui, 4 ) )
2260 {
2261 /* Forward to the SME to HDD to wpa_supplicant */
2262 // type is ACTION
2263 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2264 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302265 WDA_GET_RX_CH( pBd ), NULL, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002266 }
2267 else
2268 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002269 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002270 pActionHdr->Oui[0], pActionHdr->Oui[1], pActionHdr->Oui[2], pActionHdr->Oui[3] );
2271 }
2272 }
2273 break;
2274 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002275 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002276 break;
2277 }
2278 break;
2279 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002280 PELOGE(limLog(pMac, LOG1, FL("Unhandled action frame without session -- %x "), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002281 break;
2282
2283 }
2284}