blob: fbc323657f79eb8bc922b821f2a7b6de64cd6da0 [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
1226 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1227 if( pSta == NULL )
1228 {
1229 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001230 FL( "STA context not found - ignoring ADDBA from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001231 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1232
1233 // FIXME - Should we do this?
1234 status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS;
1235 goto returnAfterError;
1236 }
1237
1238 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001239 FL( "ADDBA Req from STA with AID %d, tid = %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001240 aid, frmAddBAReq.AddBAParameterSet.tid);
1241
1242#ifdef WLAN_SOFTAP_VSTA_FEATURE
1243 // we can only do BA on "hard" STAs
1244 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1245 {
1246 status = eSIR_MAC_REQ_DECLINED_STATUS;
1247 goto returnAfterError;
1248 }
1249#endif //WLAN_SOFTAP_VSTA_FEATURE
1250
1251
1252 // Now, validate the ADDBA Req
1253 if( eSIR_MAC_SUCCESS_STATUS !=
1254 (status = __limValidateAddBAParameterSet( pMac, pSta,
1255 frmAddBAReq.AddBAParameterSet,
1256 0, //dialogue token is don't care in request validation.
1257 LIM_ADDBA_REQ, &delBAFlag)))
1258 goto returnAfterError;
1259
1260 //BA already set, so we need to delete it before adding new one.
1261 if(delBAFlag)
1262 {
1263 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1264 pSta,
1265 (tANI_U8)frmAddBAReq.AddBAParameterSet.tid,
1266 eBA_RECIPIENT,psessionEntry))
1267 {
1268 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1269 goto returnAfterError;
1270 }
1271 }
1272
1273 // Check if the ADD BA Declined configuration is Disabled
1274 if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001275 limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001276 frmAddBAReq.AddBAParameterSet.tid);
1277 status = eSIR_MAC_REQ_DECLINED_STATUS;
1278 goto returnAfterError;
1279 }
1280
1281 //
1282 // Post WDA_ADDBA_REQ to HAL.
1283 // If HAL/HDD decide to allow this ADDBA Req session,
1284 // then this BA session is termed active
1285 //
1286
1287 // Change the Block Ack state of this STA to wait for
1288 // ADDBA Rsp from HAL
1289 LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001290
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001291 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001292 {
1293 limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001294 return ;
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001295 }
1296
1297
1298 if (frmAddBAReq.AddBAParameterSet.bufferSize)
1299 {
1300 frmAddBAReq.AddBAParameterSet.bufferSize =
1301 VOS_MIN(val, frmAddBAReq.AddBAParameterSet.bufferSize);
1302 }
1303 else
1304 {
1305 frmAddBAReq.AddBAParameterSet.bufferSize = val;
1306 }
1307 limLog( pMac, LOGE, FL( "ADDBAREQ NUMBUFF %d" ),
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001308 frmAddBAReq.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001309
1310 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1311 pSta,
1312 (tANI_U8) frmAddBAReq.DialogToken.token,
1313 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1314 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1315 frmAddBAReq.AddBAParameterSet.bufferSize,
1316 frmAddBAReq.BATimeout.timeout,
1317 (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn,
1318 eBA_RECIPIENT,psessionEntry))
1319 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1320 else
1321 return;
1322
1323returnAfterError:
1324
1325 //
1326 // Package LIM_MLM_ADDBA_RSP to MLME, with proper
1327 // status code. MLME will then send an ADDBA RSP
1328 // over the air to the peer MAC entity
1329 //
1330 if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac,
1331 pHdr->sa,
1332 status,
1333 frmAddBAReq.DialogToken.token,
1334 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1335 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1336 frmAddBAReq.AddBAParameterSet.bufferSize,
1337 frmAddBAReq.BATimeout.timeout,psessionEntry))
1338 {
1339 limLog( pMac, LOGW,
1340 FL( "Failed to post LIM_MLM_ADDBA_RSP to " ));
1341 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1342 }
1343
1344}
1345
1346/**
1347 * \brief Process an ADDBA RSP
1348 *
1349 * \sa limProcessAddBARsp
1350 *
1351 * \param pMac The global tpAniSirGlobal object
1352 *
1353 * \param pRxPacketInfo Handle to the packet info structure from HDD
1354 *
1355 * \return none
1356 *
1357 */
1358static void
1359__limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1360{
1361tDot11fAddBARsp frmAddBARsp;
1362tpSirMacMgmtHdr pHdr;
1363tpDphHashNode pSta;
1364tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1365tANI_U16 aid;
1366tANI_U32 frameLen, nStatus;
1367tANI_U8 *pBody;
1368
1369 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1370 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1371 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1372
1373 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1374 if( pSta == NULL )
1375 {
1376 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001377 FL( "STA context not found - ignoring ADDBA from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001378 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1379 return;
1380 }
1381
1382#ifdef WLAN_SOFTAP_VSTA_FEATURE
1383 // We can only do BA on "hard" STAs. We should not have issued an ADDBA
1384 // Request, so we should never be processing a ADDBA Response
1385 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1386 {
1387 return;
1388 }
1389#endif //WLAN_SOFTAP_VSTA_FEATURE
1390
1391 // Unpack the received frame
1392 nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp );
1393 if( DOT11F_FAILED( nStatus ))
1394 {
1395 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001396 FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001397 nStatus,
1398 frameLen );
1399
1400 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1401 goto returnAfterError;
1402 }
1403 else if ( DOT11F_WARNED( nStatus ) )
1404 {
1405 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001406 FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001407 nStatus,
1408 frameLen );
1409
1410 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1411 }
1412
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001413 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001414 FL( "ADDBA Rsp from STA with AID %d, tid = %d, status = %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001415 aid, frmAddBARsp.AddBAParameterSet.tid, frmAddBARsp.Status.status);
1416
1417 //if there is no matchin dialougue token then ignore the response.
1418
1419 if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token,
1420 pSta->assocId, frmAddBARsp.AddBAParameterSet.tid))
1421 {
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001422 PELOGW(limLog(pMac, LOGE, FL("dialogueToken in received addBARsp did not match with outstanding requests"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001423 return;
1424 }
1425
1426 // Check first if the peer accepted the ADDBA Req
1427 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1428 {
1429 //if peer responded with buffer size 0 then we should pick the default.
1430 if(0 == frmAddBARsp.AddBAParameterSet.bufferSize)
1431 frmAddBARsp.AddBAParameterSet.bufferSize = BA_DEFAULT_TX_BUFFER_SIZE;
1432
1433 // Now, validate the ADDBA Rsp
1434 if( eSIR_MAC_SUCCESS_STATUS !=
1435 __limValidateAddBAParameterSet( pMac, pSta,
1436 frmAddBARsp.AddBAParameterSet,
1437 (tANI_U8)frmAddBARsp.DialogToken.token,
1438 LIM_ADDBA_RSP, NULL))
1439 goto returnAfterError;
1440 }
1441 else
1442 goto returnAfterError;
1443
1444 // Change STA state to wait for ADDBA Rsp from HAL
1445 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
1446
1447 //
1448 // Post WDA_ADDBA_REQ to HAL.
1449 // If HAL/HDD decide to allow this ADDBA Rsp session,
1450 // then this BA session is termed active
1451 //
1452
1453 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1454 pSta,
1455 (tANI_U8) frmAddBARsp.DialogToken.token,
1456 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1457 (tANI_U8) frmAddBARsp.AddBAParameterSet.policy,
1458 frmAddBARsp.AddBAParameterSet.bufferSize,
1459 frmAddBARsp.BATimeout.timeout,
1460 0,
1461 eBA_INITIATOR,psessionEntry))
1462 reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1463 else
1464 return;
1465
1466returnAfterError:
1467
1468 // TODO: Do we need to signal an error status to SME,
1469 // if status != eSIR_MAC_SUCCESS_STATUS
1470
1471 // Restore STA "BA" State
1472 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE);
1473 //
1474 // Need to send a DELBA IND to peer, who
1475 // would have setup a BA session with this STA
1476 //
1477 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1478 {
1479 //
1480 // Package LIM_MLM_DELBA_REQ to MLME, with proper
1481 // status code. MLME will then send a DELBA IND
1482 // over the air to the peer MAC entity
1483 //
1484 if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac,
1485 pSta,
1486 eBA_INITIATOR,
1487 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1488 reasonCode, psessionEntry))
1489 {
1490 limLog( pMac, LOGW,
1491 FL( "Failed to post LIM_MLM_DELBA_REQ to " ));
1492 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1493 }
1494 }
1495}
1496
1497/**
1498 * \brief Process a DELBA Indication
1499 *
1500 * \sa limProcessDelBAInd
1501 *
1502 * \param pMac The global tpAniSirGlobal object
1503 *
1504 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1505 *
1506 * \return none
1507 *
1508 */
1509static void
1510__limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1511{
1512tDot11fDelBAInd frmDelBAInd;
1513tpSirMacMgmtHdr pHdr;
1514tpDphHashNode pSta;
1515tANI_U16 aid;
1516tANI_U32 frameLen, nStatus;
1517tANI_U8 *pBody;
1518
1519 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1520 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1521 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1522
1523 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1524 if( pSta == NULL )
1525 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001526 limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001527 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1528 return;
1529 }
1530
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001531 limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid );
Jeff Johnson295189b2012-06-20 16:38:30 -07001532
1533 // Unpack the received frame
1534 nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd );
1535 if( DOT11F_FAILED( nStatus ))
1536 {
1537 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001538 FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001539 nStatus,
1540 frameLen );
1541
1542 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1543 return;
1544 }
1545 else if ( DOT11F_WARNED( nStatus ) )
1546 {
1547 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001548 FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001549 nStatus,
1550 frameLen );
1551
1552 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1553 }
1554
1555 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001556 FL( "Received DELBA for TID %d, Reason code %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001557 frmDelBAInd.DelBAParameterSet.tid,
1558 frmDelBAInd.Reason.code );
1559
1560 // Now, validate the DELBA Ind
1561 if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac,
1562 frmDelBAInd.DelBAParameterSet,
1563 pSta ))
1564 return;
1565
1566 //
1567 // Post WDA_DELBA_IND to HAL and delete the
1568 // existing BA session
1569 //
1570 // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16
1571 // is kind of confusing...
1572 //
1573 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1574 pSta,
1575 (tANI_U8) frmDelBAInd.DelBAParameterSet.tid,
1576 (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)?
1577 eBA_INITIATOR: eBA_RECIPIENT,psessionEntry))
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001578 limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001579
1580 return;
1581
1582}
1583
1584static void
1585__limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry)
1586{
1587
1588#if 0
1589 tpSirMacMgmtHdr pHdr;
1590 tDot11fSMPowerSave frmSMPower;
1591 tSirMacHTMIMOPowerSaveState state;
1592 tpDphHashNode pSta;
1593 tANI_U16 aid;
1594 tANI_U32 frameLen, nStatus;
1595 tANI_U8 *pBody;
1596
1597 pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd );
1598 pBody = SIR_MAC_BD_TO_MPDUDATA( pBd );
1599 frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd );
1600
1601 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1602 if( pSta == NULL ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001603 limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001604 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1605 return;
1606 }
1607
1608 /**Unpack the received frame */
1609 nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower);
1610
1611 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001612 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001613 nStatus, frameLen );
1614 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1615 return;
1616 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001617 limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001618 nStatus, frameLen );
1619 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1620 }
1621
1622 limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d"
1623 "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En,
1624 frmSMPower.SMPowerModeSet.Mode);
1625
1626 /** Update in the DPH Table about the Update in the SM Power Save mode*/
1627 if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode)
1628 state = eSIR_HT_MIMO_PS_DYNAMIC;
1629 else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0))
1630 state = eSIR_HT_MIMO_PS_STATIC;
1631 else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0))
1632 state = eSIR_HT_MIMO_PS_NO_LIMIT;
1633 else {
1634 PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));)
1635 return;
1636 }
1637
1638 if (state == pSta->htMIMOPSState) {
1639 PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));)
1640 return;
1641 }
1642
1643 /** Update in the HAL Station Table for the Update of the Protection Mode */
1644 pSta->htMIMOPSState = state;
1645 limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState);
1646
1647#endif
1648
1649}
1650
1651#if defined WLAN_FEATURE_VOWIFI
1652
1653static void
1654__limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1655{
1656 tpSirMacMgmtHdr pHdr;
1657 tDot11fRadioMeasurementRequest frm;
1658 tANI_U32 frameLen, nStatus;
1659 tANI_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 if( psessionEntry == NULL )
1666 {
1667 return;
1668 }
1669
1670 /**Unpack the received frame */
1671 nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm );
1672
1673 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001674 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001675 nStatus, frameLen );
1676 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1677 return;
1678 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001679 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001680 nStatus, frameLen );
1681 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1682 }
1683
1684 // Call rrm function to handle the request.
1685
1686 rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry );
1687}
1688
1689static void
1690__limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1691{
1692 tpSirMacMgmtHdr pHdr;
1693 tDot11fLinkMeasurementRequest frm;
1694 tANI_U32 frameLen, nStatus;
1695 tANI_U8 *pBody;
1696
1697 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1698 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1699 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1700
1701 if( psessionEntry == NULL )
1702 {
1703 return;
1704 }
1705
1706 /**Unpack the received frame */
1707 nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm );
1708
1709 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001710 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001711 nStatus, frameLen );
1712 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1713 return;
1714 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001715 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001716 nStatus, frameLen );
1717 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1718 }
1719
1720 // Call rrm function to handle the request.
1721
1722 rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry );
1723
1724}
1725
1726static void
1727__limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1728{
1729 tpSirMacMgmtHdr pHdr;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001730 tDot11fNeighborReportResponse *pFrm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001731 tANI_U32 frameLen, nStatus;
1732 tANI_U8 *pBody;
1733
1734 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1735 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1736 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1737
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001738 if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1739 (void **)&pFrm, sizeof(tDot11fNeighborReportResponse)))
1740 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001741 limLog(pMac, LOGE, FL("Unable to PAL allocate memory in __limProcessNeighborReport") );
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001742 return;
1743 }
1744
Jeff Johnson295189b2012-06-20 16:38:30 -07001745 if( psessionEntry == NULL )
1746 {
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001747 palFreeMemory(pMac->hHdd, pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001748 return;
1749 }
1750
1751 /**Unpack the received frame */
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001752 nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm );
Jeff Johnson295189b2012-06-20 16:38:30 -07001753
1754 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001755 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001756 nStatus, frameLen );
1757 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001758 palFreeMemory(pMac->hHdd, pFrm);
1759 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001760 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001761 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001762 nStatus, frameLen );
1763 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1764 }
1765
1766 //Call rrm function to handle the request.
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001767 rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry );
1768
1769 palFreeMemory(pMac->hHdd, pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001770}
1771
1772#endif
1773
1774#ifdef WLAN_FEATURE_11W
1775/**
Chet Lanctot186b5732013-03-18 10:26:30 -07001776 * limProcessSAQueryRequestActionFrame
Jeff Johnson295189b2012-06-20 16:38:30 -07001777 *
1778 *FUNCTION:
1779 * This function is called by limProcessActionFrame() upon
1780 * SA query request Action frame reception.
1781 *
1782 *LOGIC:
1783 *
1784 *ASSUMPTIONS:
1785 *
1786 *NOTE:
1787 *
1788 * @param pMac - Pointer to Global MAC structure
Chet Lanctot186b5732013-03-18 10:26:30 -07001789 * @param *pRxPacketInfo - Handle to the Rx packet info
1790 * @param psessionEntry - PE session entry
1791 *
Jeff Johnson295189b2012-06-20 16:38:30 -07001792 * @return None
1793 */
Chet Lanctot186b5732013-03-18 10:26:30 -07001794static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001795{
1796 tpSirMacMgmtHdr pHdr;
1797 tANI_U8 *pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07001798 tANI_U8 transId[2];
Jeff Johnson295189b2012-06-20 16:38:30 -07001799
1800 /* Prima --- Below Macro not available in prima
1801 pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd);
1802 pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */
1803
1804 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1805 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1806
Chet Lanctot186b5732013-03-18 10:26:30 -07001807 /* If this is an unprotected SA Query Request, then ignore it. */
1808 if (pHdr->fc.wep == 0)
1809 return;
1810
Jeff Johnson295189b2012-06-20 16:38:30 -07001811 /*Extract 11w trsansId from SA query request action frame
1812 In SA query response action frame we will send same transId
1813 In SA query request action frame:
1814 Category : 1 byte
1815 Action : 1 byte
Chet Lanctot186b5732013-03-18 10:26:30 -07001816 Transaction ID : 2 bytes */
1817 vos_mem_copy( &transId[0], &pBody[2], 2 );
Jeff Johnson295189b2012-06-20 16:38:30 -07001818
Jeff Johnson295189b2012-06-20 16:38:30 -07001819 //Send 11w SA query response action frame
1820 if (limSendSaQueryResponseFrame(pMac,
1821 transId,
1822 pHdr->sa,psessionEntry) != eSIR_SUCCESS)
1823 {
Chet Lanctot186b5732013-03-18 10:26:30 -07001824 PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001825 return;
1826 }
1827}
1828
Chet Lanctot186b5732013-03-18 10:26:30 -07001829/**
1830 * __limProcessSAQueryResponseActionFrame
1831 *
1832 *FUNCTION:
1833 * This function is called by limProcessActionFrame() upon
1834 * SA query response Action frame reception.
1835 *
1836 *LOGIC:
1837 *
1838 *ASSUMPTIONS:
1839 *
1840 *NOTE:
1841 *
1842 * @param pMac - Pointer to Global MAC structure
1843 * @param *pRxPacketInfo - Handle to the Rx packet info
1844 * @param psessionEntry - PE session entry
1845 * @return None
1846 */
1847static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
1848{
1849 tpSirMacMgmtHdr pHdr;
1850 tANI_U32 frameLen;
1851
1852 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1853 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1854 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
1855 ("SA Query Response received...")) ;
1856 /* Forward to the SME to HDD to wpa_supplicant */
1857 // type is ACTION
1858 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
1859 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
1860 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
1861}
1862
Jeff Johnson295189b2012-06-20 16:38:30 -07001863#endif
1864
1865/**
1866 * limProcessActionFrame
1867 *
1868 *FUNCTION:
1869 * This function is called by limProcessMessageQueue() upon
1870 * Action frame reception.
1871 *
1872 *LOGIC:
1873 *
1874 *ASSUMPTIONS:
1875 *
1876 *NOTE:
1877 *
1878 * @param pMac - Pointer to Global MAC structure
1879 * @param *pRxPacketInfo - A pointer to packet info structure
1880 * @return None
1881 */
1882
1883void
1884limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1885{
1886 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1887 tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07001888#ifdef WLAN_FEATURE_11W
1889 tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1890#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001891
Jeff Johnson295189b2012-06-20 16:38:30 -07001892 switch (pActionHdr->category)
1893 {
1894 case SIR_MAC_ACTION_QOS_MGMT:
Chet Lanctot186b5732013-03-18 10:26:30 -07001895#ifdef WLAN_FEATURE_11W
1896 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
1897 {
1898 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
1899 "since RMF is enabled."), pActionHdr->category);)
1900 break;
1901 }
1902#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001903 if (psessionEntry->limQosEnabled)
1904 {
1905 switch (pActionHdr->actionID)
1906 {
1907 case SIR_MAC_QOS_ADD_TS_REQ:
1908 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1909 break;
1910
1911 case SIR_MAC_QOS_ADD_TS_RSP:
1912 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1913 break;
1914
1915 case SIR_MAC_QOS_DEL_TS_REQ:
1916 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1917 break;
1918
1919 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001920 PELOGE(limLog(pMac, LOGE, FL("Qos action %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001921 break;
1922 }
1923 break ;
1924 }
1925
1926 break;
1927
1928 case SIR_MAC_ACTION_SPECTRUM_MGMT:
Chet Lanctot186b5732013-03-18 10:26:30 -07001929#ifdef WLAN_FEATURE_11W
1930 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
1931 {
1932 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
1933 "since RMF is enabled."), pActionHdr->category);)
1934 break;
1935 }
1936#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001937 switch (pActionHdr->actionID)
1938 {
1939#ifdef ANI_SUPPORT_11H
1940 case SIR_MAC_ACTION_MEASURE_REQUEST_ID:
1941 if(psessionEntry->lim11hEnable)
1942 {
1943 __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo);
1944 }
1945 break;
1946
1947 case SIR_MAC_ACTION_TPC_REQUEST_ID:
1948 if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
1949 (pessionEntry->limSystemRole == eLIM_AP_ROLE))
1950 {
1951 if(psessionEntry->lim11hEnable)
1952 {
1953 __limProcessTpcRequestFrame(pMac, pRxPacketInfo);
1954 }
1955 }
1956 break;
1957
1958#endif
1959 case SIR_MAC_ACTION_CHANNEL_SWITCH_ID:
1960 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
1961 {
1962 __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry);
1963 }
1964 break;
1965 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001966 PELOGE(limLog(pMac, LOGE, FL("Spectrum mgmt action id %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001967 break;
1968 }
1969 break;
1970
1971 case SIR_MAC_ACTION_WME:
1972 if (! psessionEntry->limWmeEnabled)
1973 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001974 limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001975 pActionHdr->actionID);
1976 break;
1977 }
1978 switch(pActionHdr->actionID)
1979 {
1980 case SIR_MAC_QOS_ADD_TS_REQ:
1981 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1982 break;
1983
1984 case SIR_MAC_QOS_ADD_TS_RSP:
1985 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1986 break;
1987
1988 case SIR_MAC_QOS_DEL_TS_REQ:
1989 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1990 break;
1991
1992 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001993 PELOGE(limLog(pMac, LOGE, FL("WME action %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001994 break;
1995 }
1996 break;
1997
1998 case SIR_MAC_ACTION_BLKACK:
1999 // Determine the "type" of BA Action Frame
Chet Lanctot186b5732013-03-18 10:26:30 -07002000#ifdef WLAN_FEATURE_11W
2001 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
2002 {
2003 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2004 "since RMF is enabled."), pActionHdr->category);)
2005 break;
2006 }
2007#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002008 switch(pActionHdr->actionID)
2009 {
2010 case SIR_MAC_BLKACK_ADD_REQ:
2011 __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2012 break;
2013
2014 case SIR_MAC_BLKACK_ADD_RSP:
2015 __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2016 break;
2017
2018 case SIR_MAC_BLKACK_DEL:
2019 __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2020 break;
2021
2022 default:
2023 break;
2024 }
2025
2026 break;
2027 case SIR_MAC_ACTION_HT:
2028 /** Type of HT Action to be performed*/
2029 switch(pActionHdr->actionID) {
2030 case SIR_MAC_SM_POWER_SAVE:
2031 __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2032 break;
2033 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002034 PELOGE(limLog(pMac, LOGE, FL("Action ID %d not handled in HT Action category"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002035 break;
2036 }
2037 break;
2038
2039#if defined WLAN_FEATURE_VOWIFI
2040 case SIR_MAC_ACTION_RRM:
Chet Lanctot186b5732013-03-18 10:26:30 -07002041#ifdef WLAN_FEATURE_11W
2042 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
2043 {
2044 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2045 "since RMF is enabled."), pActionHdr->category);)
2046 break;
2047 }
2048#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002049 if( pMac->rrm.rrmPEContext.rrmEnable )
2050 {
2051 switch(pActionHdr->actionID) {
2052 case SIR_MAC_RRM_RADIO_MEASURE_REQ:
2053 __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2054 break;
2055 case SIR_MAC_RRM_LINK_MEASUREMENT_REQ:
2056 __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2057 break;
2058 case SIR_MAC_RRM_NEIGHBOR_RPT:
2059 __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry );
2060 break;
2061 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002062 PELOGE( limLog( pMac, LOGE, FL("Action ID %d not handled in RRM"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002063 break;
2064
2065 }
2066 }
2067 else
2068 {
2069 // Else we will just ignore the RRM messages.
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002070 PELOGE( limLog( pMac, LOGE, FL("RRM Action frame ignored as RRM is disabled in cfg"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002071 }
2072 break;
2073#endif
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002074#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
2075 case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
2076 {
2077 tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr;
2078 tpSirMacMgmtHdr pHdr;
2079 tANI_U32 frameLen;
2080 tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 };
2081
2082 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2083 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2084
2085 //Check if it is a vendor specific action frame.
2086 if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) &&
2087 (VOS_TRUE == palEqualMemory(pMac->hHdd, psessionEntry->selfMacAddr,
2088 &pHdr->da[0], sizeof(tSirMacAddr))) &&
2089 IS_WES_MODE_ENABLED(pMac) && palEqualMemory( pMac->hHdd, pVendorSpecific->Oui, Oui, 3))
2090 {
2091 PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"),
2092 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);)
2093 /* Forward to the SME to HDD to wpa_supplicant */
2094 // type is ACTION
2095 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2096 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
2097 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
2098 }
2099 else
2100 {
2101 limLog( pMac, LOGE, FL("Dropping the vendor specific action frame because of( "
2102 "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or "
2103 "not received with SelfSta Mac address) system role = %d"),
2104 IS_WES_MODE_ENABLED(pMac),
2105 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1],
2106 pVendorSpecific->Oui[2],
2107 psessionEntry->limSystemRole );
2108 }
2109 }
2110 break;
2111#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002112 case SIR_MAC_ACTION_PUBLIC_USAGE:
2113 switch(pActionHdr->actionID) {
2114 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2115 {
2116 tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr;
2117 tpSirMacMgmtHdr pHdr;
2118 tANI_U32 frameLen;
2119 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2120
2121 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2122 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2123
2124 //Check if it is a P2P public action frame.
2125 if( palEqualMemory( pMac->hHdd, pPubAction->Oui, P2POui, 4 ) )
2126 {
2127 /* Forward to the SME to HDD to wpa_supplicant */
2128 // type is ACTION
2129 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2130 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302131 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002132 }
2133 else
2134 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002135 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002136 pPubAction->Oui[0], pPubAction->Oui[1], pPubAction->Oui[2], pPubAction->Oui[3] );
2137 }
2138 }
2139 break;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002140#ifdef FEATURE_WLAN_TDLS
2141 case SIR_MAC_TDLS_DIS_RSP:
2142 {
2143#ifdef FEATURE_WLAN_TDLS_INTERNAL
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002144 //LIM_LOG_TDLS(printk("Public Action TDLS Discovery RSP ..")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002145 limProcessTdlsPublicActionFrame(pMac, (tANI_U32*)pRxPacketInfo, psessionEntry) ;
2146#else
2147 tpSirMacMgmtHdr pHdr;
2148 tANI_U32 frameLen;
Chilam NG571c65a2013-01-19 12:27:36 +05302149 tANI_S8 rssi;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002150
2151 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2152 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
Chilam NG571c65a2013-01-19 12:27:36 +05302153 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002154 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002155 ("Public Action TDLS Discovery RSP ..")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002156 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2157 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302158 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, rssi);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002159#endif
2160 }
2161 break;
2162#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002163
2164 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002165 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002166 break;
2167 }
2168 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002169
2170#ifdef WLAN_FEATURE_11W
2171 case SIR_MAC_ACTION_SA_QUERY:
2172 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002173 PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);)
2174 switch (pActionHdr->actionID)
2175 {
2176 case SIR_MAC_SA_QUERY_REQ:
2177 /**11w SA query request action frame received**/
2178 /* Respond directly to the incoming request in LIM */
2179 __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2180 break;
2181 case SIR_MAC_SA_QUERY_RSP:
2182 /**11w SA query response action frame received**/
2183 /* Forward to the SME to HDD to wpa_supplicant */
2184 __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2185 break;
2186 default:
2187 break;
2188 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002189 break;
2190 }
2191#endif
Mohit Khanna4a70d262012-09-11 16:30:12 -07002192#ifdef WLAN_FEATURE_11AC
2193 case SIR_MAC_ACTION_VHT:
2194 {
2195 if (psessionEntry->vhtCapability)
2196 {
2197 switch (pActionHdr->actionID)
2198 {
2199 case SIR_MAC_VHT_OPMODE_NOTIFICATION:
2200 __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry);
2201 break;
2202 default:
2203 break;
2204 }
2205 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002206 break;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -07002207 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002208#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002209 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002210 PELOGE(limLog(pMac, LOGE, FL("Action category %d not handled"), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002211 break;
2212 }
2213}
2214
Jeff Johnson295189b2012-06-20 16:38:30 -07002215/**
2216 * limProcessActionFrameNoSession
2217 *
2218 *FUNCTION:
2219 * This function is called by limProcessMessageQueue() upon
2220 * Action frame reception and no session.
2221 * Currently only public action frames can be received from
2222 * a non-associated station.
2223 *
2224 *LOGIC:
2225 *
2226 *ASSUMPTIONS:
2227 *
2228 *NOTE:
2229 *
2230 * @param pMac - Pointer to Global MAC structure
2231 * @param *pBd - A pointer to Buffer descriptor + associated PDUs
2232 * @return None
2233 */
2234
2235void
2236limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd)
2237{
2238 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd);
2239 tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody;
2240
Mohit Khanna23863762012-09-11 17:40:09 -07002241 limLog( pMac, LOG1, "Received a Action frame -- no session");
Jeff Johnson295189b2012-06-20 16:38:30 -07002242
2243 switch ( pActionHdr->category )
2244 {
2245 case SIR_MAC_ACTION_PUBLIC_USAGE:
2246 switch(pActionHdr->actionID) {
2247 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2248 {
2249 tpSirMacMgmtHdr pHdr;
2250 tANI_U32 frameLen;
2251 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2252
2253 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
2254 frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd);
2255
2256 //Check if it is a P2P public action frame.
2257 if( palEqualMemory( pMac->hHdd, pActionHdr->Oui, P2POui, 4 ) )
2258 {
2259 /* Forward to the SME to HDD to wpa_supplicant */
2260 // type is ACTION
2261 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2262 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302263 WDA_GET_RX_CH( pBd ), NULL, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002264 }
2265 else
2266 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002267 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002268 pActionHdr->Oui[0], pActionHdr->Oui[1], pActionHdr->Oui[2], pActionHdr->Oui[3] );
2269 }
2270 }
2271 break;
2272 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002273 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002274 break;
2275 }
2276 break;
2277 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002278 PELOGE(limLog(pMac, LOG1, FL("Unhandled action frame without session -- %x "), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002279 break;
2280
2281 }
2282}