blob: 0bf265978eb65d32129a947d59f806648b79451e [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * Airgo Networks, Inc proprietary. All rights reserved.
24 * This file limProcessActionFrame.cc contains the code
25 * for processing Action Frame.
26 * Author: Michael Lui
27 * Date: 05/23/03
28 * History:-
29 * Date Modified by Modification Information
30 * --------------------------------------------------------------------
31 *
32 */
33#include "palTypes.h"
34#include "wniApi.h"
35#include "sirApi.h"
36#include "aniGlobal.h"
37#ifdef FEATURE_WLAN_NON_INTEGRATED_SOC
38#include "halDataStruct.h"
39#endif
40#if (WNI_POLARIS_FW_PRODUCT == AP)
41#include "wniCfgAp.h"
42#else
43#include "wniCfgSta.h"
44#endif
45#include "schApi.h"
46#include "utilsApi.h"
47#include "limTypes.h"
48#include "limUtils.h"
49#include "limAssocUtils.h"
50#include "limSecurityUtils.h"
51#include "limSerDesUtils.h"
52#include "limSendSmeRspMessages.h"
53#include "parserApi.h"
54#include "limAdmitControl.h"
55#include "wmmApsd.h"
56#include "limSendMessages.h"
57#if defined WLAN_FEATURE_VOWIFI
58#include "rrmApi.h"
59#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070060#include "limSessionUtils.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070061
62#if defined FEATURE_WLAN_CCX
63#include "ccxApi.h"
64#endif
65#include "wlan_qct_wda.h"
66
67
68#define BA_DEFAULT_TX_BUFFER_SIZE 64
69
70typedef enum
71{
72 LIM_ADDBA_RSP = 0,
73 LIM_ADDBA_REQ = 1
74}tLimAddBaValidationReqType;
75
76/* Note: The test passes if the STAUT stops sending any frames, and no further
77 frames are transmitted on this channel by the station when the AP has sent
78 the last 6 beacons, with the channel switch information elements as seen
79 with the sniffer.*/
80#define SIR_CHANSW_TX_STOP_MAX_COUNT 6
81/**-----------------------------------------------------------------
82\fn limStopTxAndSwitchChannel
83\brief Stops the transmission if channel switch mode is silent and
84 starts the channel switch timer.
85
86\param pMac
87\return NONE
88-----------------------------------------------------------------*/
89void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId)
90{
91 tANI_U8 isFullPowerRequested = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070092 tpPESession psessionEntry;
93
94 psessionEntry = peFindSessionBySessionId( pMac , sessionId );
95
96 if( NULL == psessionEntry )
97 {
98 limLog(pMac, LOGE, FL("Session %d not active\n "), sessionId);
99 return;
100 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700101
102 PELOG1(limLog(pMac, LOG1, FL("Channel switch Mode == %d\n"),
Jeff Johnsone7245742012-09-05 17:12:55 -0700103 psessionEntry->gLimChannelSwitch.switchMode);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700104
Jeff Johnsone7245742012-09-05 17:12:55 -0700105 if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT ||
106 psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT)
Jeff Johnson295189b2012-06-20 16:38:30 -0700107 {
108 /* Freeze the transmission */
109 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX);
110
111 /*Request for Full power only if the device is in powersave*/
112 if(!limIsSystemInActiveState(pMac))
113 {
114 /* Request Full Power */
115 limSendSmePreChannelSwitchInd(pMac);
116 isFullPowerRequested = 1;
117 }
118 }
119 else
120 {
121 /* Resume the transmission */
122 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX);
123 }
124
Jeff Johnsone7245742012-09-05 17:12:55 -0700125 pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700126 /* change the channel immediatly only if the channel switch count is 0 and the
127 * device is not in powersave
128 * If the device is in powersave channel switch should happen only after the
129 * device comes out of the powersave */
Jeff Johnsone7245742012-09-05 17:12:55 -0700130 if (psessionEntry->gLimChannelSwitch.switchCount == 0)
Jeff Johnson295189b2012-06-20 16:38:30 -0700131 {
132 if(limIsSystemInActiveState(pMac))
133 {
134 limProcessChannelSwitchTimeout(pMac);
135 }
136 else if(!isFullPowerRequested)
137 {
138 /* If the Full power is already not requested
139 * Request Full Power so the channel switch happens
140 * after device comes to full power */
141 limSendSmePreChannelSwitchInd(pMac);
142 }
143 return;
144 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700145 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, NO_SESSION, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700146
Jeff Johnson295189b2012-06-20 16:38:30 -0700147
148 if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS)
149 {
150 limLog(pMac, LOGP, FL("tx_timer_activate failed\n"));
151 }
152 return;
153}
154
155/**------------------------------------------------------------
156\fn limStartChannelSwitch
157\brief Switches the channel if switch count == 0, otherwise
158 starts the timer for channel switch and stops BG scan
159 and heartbeat timer tempororily.
160
161\param pMac
162\param psessionEntry
163\return NONE
164------------------------------------------------------------*/
165tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
166{
167 PELOG1(limLog(pMac, LOG1, FL("Starting the channel switch\n"));)
Jeff Johnsone7245742012-09-05 17:12:55 -0700168
169 /*If channel switch is already running and it is on a different session, just return*/
170 /*This need to be removed for MCC */
171 if( limIsChanSwitchRunning (pMac) &&
172 psessionEntry->gLimSpecMgmt.dot11hChanSwState != eLIM_11H_CHANSW_RUNNING )
173 {
174 limLog(pMac, LOGW, FL("Ignoring channel switch on session %d\n"), psessionEntry->peSessionId);
175 return eSIR_SUCCESS;
176 }
177
Jeff Johnson295189b2012-06-20 16:38:30 -0700178 /* Deactivate and change reconfigure the timeout value */
Jeff Johnsone7245742012-09-05 17:12:55 -0700179 //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER);
180 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
181 {
182 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!\n"));
183 return eSIR_FAILURE;
184 }
185
186 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
187 psessionEntry->gLimChannelSwitch.switchTimeoutValue,
188 0) != TX_SUCCESS)
189 {
190 limLog(pMac, LOGP, FL("tx_timer_change failed \n"));
191 return eSIR_FAILURE;
192 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700193
194 /* Follow the channel switch, forget about the previous quiet. */
195 //If quiet is running, chance is there to resume tx on its timeout.
196 //so stop timer for a safer side.
Jeff Johnsone7245742012-09-05 17:12:55 -0700197 if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN)
Jeff Johnson295189b2012-06-20 16:38:30 -0700198 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700199 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700200 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS)
201 {
202 limLog(pMac, LOGP, FL("tx_timer_deactivate failed\n"));
203 return eSIR_FAILURE;
204 }
205 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700206 else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING)
Jeff Johnson295189b2012-06-20 16:38:30 -0700207 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700208 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700209 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS)
210 {
211 limLog(pMac, LOGP, FL("tx_timer_deactivate failed\n"));
212 return eSIR_FAILURE;
213 }
214 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700215 psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
Jeff Johnson295189b2012-06-20 16:38:30 -0700216
217 /* Prepare for 11h channel switch */
218 limPrepareFor11hChannelSwitch(pMac, psessionEntry);
219
220 /** Dont add any more statements here as we posted finish scan request
221 * to HAL, wait till we get the response
222 */
223 return eSIR_SUCCESS;
224}
225
226
227/**
228 * __limProcessChannelSwitchActionFrame
229 *
230 *FUNCTION:
231 *
232 *LOGIC:
233 *
234 *ASSUMPTIONS:
235 *
236 *NOTE:
237 *
238 * @param pMac - Pointer to Global MAC structure
239 * @param *pRxPacketInfo - A pointer to packet info structure
240 * @return None
241 */
242
243static void
244
245__limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
246{
247
248 tpSirMacMgmtHdr pHdr;
249 tANI_U8 *pBody;
250 tDot11fChannelSwitch *pChannelSwitchFrame;
251 tANI_U16 beaconPeriod;
252 tANI_U32 val;
253 tANI_U32 frameLen;
254 tANI_U32 nStatus;
255 eHalStatus status;
256
257 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
258 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
259 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
260
261 PELOG3(limLog(pMac, LOG3, FL("Received Channel switch action frame\n"));)
262 if (!psessionEntry->lim11hEnable)
263 return;
264
265 status = palAllocateMemory( pMac->hHdd, (void **)&pChannelSwitchFrame, sizeof(*pChannelSwitchFrame));
266 if (eHAL_STATUS_SUCCESS != status)
267 {
268 limLog(pMac, LOGE,
269 FL("palAllocateMemory failed, status = %d \n"), status);
270 return;
271 }
272
273 /* Unpack channel switch frame */
274 nStatus = dot11fUnpackChannelSwitch(pMac, pBody, frameLen, pChannelSwitchFrame);
275
276 if( DOT11F_FAILED( nStatus ))
277 {
278 limLog( pMac, LOGE,
279 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):\n"),
280 nStatus,
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700281 frameLen);
Jeff Johnson295189b2012-06-20 16:38:30 -0700282 palFreeMemory(pMac->hHdd, pChannelSwitchFrame);
283 return;
284 }
285 else if(DOT11F_WARNED( nStatus ))
286 {
287 limLog( pMac, LOGW,
288 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):\n"),
289 nStatus,
290 frameLen);
291 }
292
293 if (palEqualMemory( pMac->hHdd,(tANI_U8 *) &psessionEntry->bssId,
294 (tANI_U8 *) &pHdr->sa,
295 sizeof(tSirMacAddr)))
296 {
297 #if 0
298 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS)
299 {
300 palFreeMemory(pMac->hHdd, pChannelSwitchFrame);
301 limLog(pMac, LOGP, FL("could not retrieve Beacon interval\n"));
302 return;
303 }
304 #endif// TO SUPPORT BT-AMP
305
306 /* copy the beacon interval from psessionEntry*/
307 val = psessionEntry->beaconParams.beaconInterval;
308
309 beaconPeriod = (tANI_U16) val;
310
Jeff Johnsone7245742012-09-05 17:12:55 -0700311 psessionEntry->gLimChannelSwitch.primaryChannel = pChannelSwitchFrame->ChanSwitchAnn.newChannel;
312 psessionEntry->gLimChannelSwitch.switchCount = pChannelSwitchFrame->ChanSwitchAnn.switchCount;
313 psessionEntry->gLimChannelSwitch.switchTimeoutValue = SYS_MS_TO_TICKS(beaconPeriod) *
314 psessionEntry->gLimChannelSwitch.switchCount;
315 psessionEntry->gLimChannelSwitch.switchMode = pChannelSwitchFrame->ChanSwitchAnn.switchMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700316#ifdef WLAN_FEATURE_11AC
317 if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability)
318 {
319 psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth;
320 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0;
321 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq1;
322 }
323#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700324
325 PELOG3(limLog(pMac, LOG3, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks\n"),
Jeff Johnsone7245742012-09-05 17:12:55 -0700326 psessionEntry->gLimChannelSwitch.switchTimeoutValue);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700327
328 /* Only primary channel switch element is present */
Jeff Johnsone7245742012-09-05 17:12:55 -0700329 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
330 psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -0700331
Jeff Johnsone7245742012-09-05 17:12:55 -0700332 if (psessionEntry->htSupportedChannelWidthSet)
Jeff Johnson295189b2012-06-20 16:38:30 -0700333 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700334 if ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
335 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))
Jeff Johnson295189b2012-06-20 16:38:30 -0700336 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700337 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
338 psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700339 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700340#ifdef WLAN_FEATURE_11AC
341 if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present)
342 {
343 if (pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
344 {
345 if (pChannelSwitchFrame->ExtChanSwitchAnn.present && ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
346 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)))
347 {
348 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
349 psessionEntry->gLimChannelSwitch.secondarySubBand = limGet11ACPhyCBState(pMac,
350 psessionEntry->gLimChannelSwitch.primaryChannel,
351 pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset,
352 pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0,
353 psessionEntry);
354 }
355 }
356 }
357#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700358 }
359
360 }
361 else
362 {
363 PELOG1(limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));)
364 }
365
366 if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry))
367 {
368 PELOG1(limLog(pMac, LOG1, FL("Could not start channel switch\n"));)
369 }
370
371 palFreeMemory(pMac->hHdd, pChannelSwitchFrame);
372 return;
373} /*** end limProcessChannelSwitchActionFrame() ***/
374
375
Mohit Khanna4a70d262012-09-11 16:30:12 -0700376#ifdef WLAN_FEATURE_11AC
377static void
378__limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
379{
380
381 tpSirMacMgmtHdr pHdr;
382 tANI_U8 *pBody;
383 tDot11fOperatingMode *pOperatingModeframe;
384 tANI_U32 frameLen;
385 tANI_U32 nStatus;
386 eHalStatus status;
387 tpDphHashNode pSta;
388 tANI_U16 aid;
389 tANI_U8 operMode;
390
391 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
392 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
393 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
394
395 PELOG3(limLog(pMac, LOG3, FL("Received Operating Mode action frame\n"));)
396 status = palAllocateMemory( pMac->hHdd, (void **)&pOperatingModeframe, sizeof(*pOperatingModeframe));
397 if (eHAL_STATUS_SUCCESS != status)
398 {
399 limLog(pMac, LOGE,
400 FL("palAllocateMemory failed, status = %d \n"), status);
401 return;
402 }
403
404 /* Unpack channel switch frame */
405 nStatus = dot11fUnpackOperatingMode(pMac, pBody, frameLen, pOperatingModeframe);
406
407 if( DOT11F_FAILED( nStatus ))
408 {
409 limLog( pMac, LOGE,
410 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):\n"),
411 nStatus,
412 frameLen);
413 palFreeMemory(pMac->hHdd, pOperatingModeframe);
414 return;
415 }
416 else if(DOT11F_WARNED( nStatus ))
417 {
418 limLog( pMac, LOGW,
419 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):\n"),
420 nStatus,
421 frameLen);
422 }
423 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
424
425 operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ;
426 if( operMode != pOperatingModeframe->OperatingMode.chanWidth)
427 {
428 limLog(pMac, LOGE,
429 FL(" recevied Chanwidth %d, staIdx = %d\n"),
430 (pOperatingModeframe->OperatingMode.chanWidth ),
431 pSta->staIndex);
432
433 limLog(pMac, LOGE,
434 FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x\n"),
435 pHdr->sa[0],
436 pHdr->sa[1],
437 pHdr->sa[2],
438 pHdr->sa[3],
439 pHdr->sa[4],
440 pHdr->sa[5]);
441
442 if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ)
443 {
444 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
445 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
446 }
447 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ)
448 {
449 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
450 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
451 }
452 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ)
453 {
454 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
455 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ;
456 }
457 limCheckVHTOpModeChange( pMac, psessionEntry,
458 (pOperatingModeframe->OperatingMode.chanWidth), pSta->staIndex);\
459 }
460 palFreeMemory(pMac->hHdd, pOperatingModeframe);
461 return;
462}
463#endif
464
Jeff Johnson295189b2012-06-20 16:38:30 -0700465static void
466__limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
467{
468#if (WNI_POLARIS_FW_PRODUCT == AP)
469
470 tSirAddtsReqInfo addts;
471 tSirRetStatus retval;
472 tpSirMacMgmtHdr pHdr;
473 tSirMacScheduleIE schedule;
474 tpDphHashNode pSta;
475 tANI_U16 status;
476 tANI_U16 aid;
477 tANI_U32 frameLen;
478 tANI_U8 *pBody;
479 tANI_U8 tspecIdx = 0; //index in the sch tspec table.
480
481 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
482 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
483 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
484
485
486 if ((psessionEntry->limSystemRole != eLIM_AP_ROLE)||(psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
487 {
488 PELOGW(limLog(pMac, LOGW, FL("AddTs request at non-AP: ignoring\n"));)
489 return;
490 }
491
492 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
493 if (pSta == NULL)
494 {
495 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTs\n"));)
496 return;
497 }
498
499 PELOGW(limLog(pMac, LOGW, "AddTs Request from STA %d\n", aid);)
500 retval = sirConvertAddtsReq2Struct(pMac, pBody, frameLen, &addts);
501 if (retval != eSIR_SUCCESS)
502 {
503 PELOGW(limLog(pMac, LOGW, FL("AddTs parsing failed (error %d)\n"), retval);)
504 return;
505 }
506
507 status = eSIR_MAC_SUCCESS_STATUS;
508
509
510 if (addts.wmeTspecPresent)
511 {
512 if ((! psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
513 {
514 PELOGW(limLog(pMac, LOGW, FL("Ignoring addts request: wme not enabled/capable\n"));)
515 status = eSIR_MAC_WME_REFUSED_STATUS;
516 }
517 else
518 {
519 PELOG2(limLog(pMac, LOG2, FL("WME Addts received\n"));)
520 }
521 }
522 else if (addts.wsmTspecPresent)
523 {
524 if ((! psessionEntry->limWsmEnabled) || (! pSta->wsmEnabled))
525 {
526 PELOGW(limLog(pMac, LOGW, FL("Ignoring addts request: wsm not enabled/capable\n"));)
527 status = eSIR_MAC_REQ_DECLINED_STATUS;
528 }
529 else
530 {
531 PELOG2(limLog(pMac, LOG2, FL("WSM Addts received\n"));)
532 }
533 }
534 else if ((! psessionEntry->limQosEnabled) || (! pSta->lleEnabled))
535 {
536 PELOGW(limLog(pMac, LOGW, FL("Ignoring addts request: qos not enabled/capable\n"));)
537 status = eSIR_MAC_REQ_DECLINED_STATUS;
538 }
539 else
540 {
541 PELOG2(limLog(pMac, LOG2, FL("11e QoS Addts received\n"));)
542 }
543
544 // for edca, if no Admit Control, ignore the request
545 if ((status == eSIR_MAC_SUCCESS_STATUS) &&
546 (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA) &&
547 (! psessionEntry->gLimEdcaParamsBC[upToAc(addts.tspec.tsinfo.traffic.userPrio)].aci.acm))
548 {
549 limLog(pMac, LOGW, FL("AddTs with UP %d has no ACM - ignoring request\n"),
550 addts.tspec.tsinfo.traffic.userPrio);
551 status = (addts.wmeTspecPresent) ?
552 eSIR_MAC_WME_REFUSED_STATUS : eSIR_MAC_UNSPEC_FAILURE_STATUS;
553 }
554
555 if (status != eSIR_MAC_SUCCESS_STATUS)
556 {
557 limSendAddtsRspActionFrame(pMac, pHdr->sa, status, &addts, NULL,psessionEntry);
558 return;
559 }
560
561 // try to admit the STA and send the appropriate response
562 retval = limAdmitControlAddTS(pMac, &pSta->staAddr[0], &addts, NULL, pSta->assocId, true, &schedule, &tspecIdx, psessionEntry);
563 if (retval != eSIR_SUCCESS)
564 {
565 PELOGW(limLog(pMac, LOGW, FL("Unable to admit TS\n"));)
566 status = (addts.wmeTspecPresent) ?
567 eSIR_MAC_WME_REFUSED_STATUS : eSIR_MAC_UNSPEC_FAILURE_STATUS;
568 }
569 else if (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA)
570 {
571 if(eSIR_SUCCESS != limSendHalMsgAddTs(pMac, pSta->staIndex, tspecIdx, addts.tspec, psessionEntry->peSessionId))
572 {
573 limLog(pMac, LOGW, FL("AddTs with UP %d failed in limSendHalMsgAddTs - ignoring request\n"),
574 addts.tspec.tsinfo.traffic.userPrio);
575 status = (addts.wmeTspecPresent) ?
576 eSIR_MAC_WME_REFUSED_STATUS : eSIR_MAC_UNSPEC_FAILURE_STATUS;
577
578 limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecIdx);
579 }
580 if (status != eSIR_MAC_SUCCESS_STATUS)
581 {
582 limSendAddtsRspActionFrame(pMac, pHdr->sa, status, &addts, NULL,psessionEntry);
583 return;
584 }
585 }
586#if 0 //only EDCA is supported now.
587 else if (addts.numTclas > 1)
588 {
589 limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported\n"),
590 aid, addts.numTclas);
591 status = (addts.wmeTspecPresent) ?
592 eSIR_MAC_WME_REFUSED_STATUS : eSIR_MAC_UNSPEC_FAILURE_STATUS;
593 }
594 else if (addts.numTclas == 1)
595 {
596 limLog(pMac, LOGW, "AddTs Request from STA %d: tsid %d, UP %d, OK!\n", aid,
597 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
598 status = eSIR_MAC_SUCCESS_STATUS;
599 }
600#endif
601
602 limLog(pMac, LOGW, "AddTs Request from STA %d: Sending AddTs Response with status %d\n",
603 aid, status);
604
605 limSendAddtsRspActionFrame(pMac, pHdr->sa, status, &addts, &schedule,psessionEntry);
606#endif
607}
608
609
610static void
611__limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
612{
613 tSirAddtsRspInfo addts;
614 tSirRetStatus retval;
615 tpSirMacMgmtHdr pHdr;
616 tpDphHashNode pSta;
617 tANI_U16 aid;
618 tANI_U32 frameLen;
619 tANI_U8 *pBody;
620 tpLimTspecInfo tspecInfo;
621 tANI_U8 ac;
622 tpDphHashNode pStaDs = NULL;
623 tANI_U8 rspReqd = 1;
624 tANI_U32 cfgLen;
625 tSirMacAddr peerMacAddr;
626
627
628 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
629 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
630 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
631
632
633 PELOGW(limLog(pMac, LOGW, "Recv AddTs Response\n");)
634 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
635 {
636 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring\n"));)
637 return;
638 }
639
640 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
641 if (pSta == NULL)
642 {
643 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp\n"));)
644 return;
645 }
646
647 retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts);
648 if (retval != eSIR_SUCCESS)
649 {
650 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)\n"), retval);)
651 return;
652 }
653
654 // don't have to check for qos/wme capabilities since we wouldn't have this
655 // flag set otherwise
656 if (! pMac->lim.gLimAddtsSent)
657 {
658 // we never sent an addts request!
659 PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring\n");)
660 return;
661 }
662
663 if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken)
664 {
665 limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring\n",
666 addts.dialogToken, pMac->lim.gLimAddtsReq.req.dialogToken);
667 return;
668 }
669
670 /*
671 * for successful addts reponse, try to add the classifier.
672 * if this fails for any reason, we should send a delts request to the ap
673 * for now, its ok not to send a delts since we are going to add support for
674 * multiple tclas soon and until then we won't send any addts requests with
675 * multiple tclas elements anyway.
676 * In case of addClassifier failure, we just let the addts timer run out
677 */
678 if (((addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
679 (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) &&
680 (addts.status == eSIR_MAC_SUCCESS_STATUS))
681 {
682 // add the classifier - this should always succeed
683 if (addts.numTclas > 1) // currently no support for multiple tclas elements
684 {
685 limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported\n"),
686 aid, addts.numTclas);
687 return;
688 }
689 else if (addts.numTclas == 1)
690 {
691 limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!\n", aid,
692 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
693 }
694 }
695 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d \n",
696 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
697 addts.status);
698
699 // deactivate the response timer
700 limDeactivateAndChangeTimer(pMac, eLIM_ADDTS_RSP_TIMER);
701
702 if (addts.status != eSIR_MAC_SUCCESS_STATUS)
703 {
704 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d \n",
705 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
706 addts.status);
707 limSendSmeAddtsRsp(pMac, true, addts.status, psessionEntry, addts.tspec,
708 psessionEntry->smeSessionId, psessionEntry->transactionId);
709
710 // clear the addts flag
711 pMac->lim.gLimAddtsSent = false;
712
713 return;
714 }
715#ifdef FEATURE_WLAN_CCX
716 if (addts.tsmPresent)
717 {
718 limLog(pMac, LOGW, "TSM IE Present\n");
719 psessionEntry->ccxContext.tsm.tid = addts.tspec.tsinfo.traffic.userPrio;
720 vos_mem_copy(&psessionEntry->ccxContext.tsm.tsmInfo,
721 &addts.tsmIE,sizeof(tSirMacCCXTSMIE));
722 limActivateTSMStatsTimer(pMac, psessionEntry);
723 }
724#endif
725 /* Since AddTS response was successful, check for the PSB flag
726 * and directional flag inside the TS Info field.
727 * An AC is trigger enabled AC if the PSB subfield is set to 1
728 * in the uplink direction.
729 * An AC is delivery enabled AC if the PSB subfield is set to 1
730 * in the downlink direction.
731 * An AC is trigger and delivery enabled AC if the PSB subfield
732 * is set to 1 in the bi-direction field.
733 */
734 if (addts.tspec.tsinfo.traffic.psb == 1)
735 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, SET_UAPSD_MASK);
736 else
737 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, CLEAR_UAPSD_MASK);
738
739
740 /* ADDTS success, so AC is now admitted. We shall now use the default
741 * EDCA parameters as advertised by AP and send the updated EDCA params
742 * to HAL.
743 */
744 ac = upToAc(addts.tspec.tsinfo.traffic.userPrio);
745 if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK)
746 {
747 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
748 }
749 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK)
750 {
751 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
752 }
753 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR)
754 {
755 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
756 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
757 }
758
759 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
760
761 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
762 if (pStaDs != NULL)
763 {
764 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
765 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
766 else
767 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
768 }
769 else
770 limLog(pMac, LOGE, FL("Self entry missing in Hash Table \n"));
771
772
773 sirCopyMacAddr(peerMacAddr,psessionEntry->bssId);
774
775 //if schedule is not present then add TSPEC with svcInterval as 0.
776 if(!addts.schedulePresent)
777 addts.schedule.svcInterval = 0;
778 if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, &addts.tspec, addts.schedule.svcInterval, &tspecInfo))
779 {
780 PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed \n"));)
781 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
782 psessionEntry);
783 pMac->lim.gLimAddtsSent = false;
784 return; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status.
785 }
786 if((addts.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA) ||
787 ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC) &&
788 (psessionEntry->gLimEdcaParams[upToAc(addts.tspec.tsinfo.traffic.userPrio)].aci.acm)))
789 {
790 retval = limSendHalMsgAddTs(pMac, pSta->staIndex, tspecInfo->idx, addts.tspec, psessionEntry->peSessionId);
791 if(eSIR_SUCCESS != retval)
792 {
793 limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecInfo->idx);
794
795 // Send DELTS action frame to AP
796 cfgLen = sizeof(tSirMacAddr);
797 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
798 psessionEntry);
799 limSendSmeAddtsRsp(pMac, true, retval, psessionEntry, addts.tspec,
800 psessionEntry->smeSessionId, psessionEntry->transactionId);
801 pMac->lim.gLimAddtsSent = false;
802 return;
803 }
804 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)\n"),
805 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
806 }
807 else
808 {
809 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)\n"),
810 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
811 PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL \n"));)
812 // Use the smesessionId and smetransactionId from the PE session context
813 limSendSmeAddtsRsp(pMac, true, eSIR_SME_SUCCESS, psessionEntry, addts.tspec,
814 psessionEntry->smeSessionId, psessionEntry->transactionId);
815 }
816
817 // clear the addts flag
818 pMac->lim.gLimAddtsSent = false;
819 return;
820}
821
822
823static void
824__limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
825{
826 tSirRetStatus retval;
827 tSirDeltsReqInfo delts;
828 tpSirMacMgmtHdr pHdr;
829 tpDphHashNode pSta;
830 tANI_U32 frameLen;
831 tANI_U16 aid;
832 tANI_U8 *pBody;
833 tANI_U8 tsStatus;
834 tSirMacTSInfo *tsinfo;
835 tANI_U8 tspecIdx;
836 tANI_U8 ac;
837 tpDphHashNode pStaDs = NULL;
838
839
840 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
841 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
842 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
843
844 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
845 if (pSta == NULL)
846 {
847 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs\n"));)
848 return;
849 }
850
851 // parse the delts request
852 retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts);
853 if (retval != eSIR_SUCCESS)
854 {
855 PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)\n"), retval);)
856 return;
857 }
858
859 if (delts.wmeTspecPresent)
860 {
861 if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
862 {
863 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable\n"));)
864 return;
865 }
866 PELOG2(limLog(pMac, LOG2, FL("WME Delts received\n"));)
867 }
868 else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled)
869 {
870 PELOG2(limLog(pMac, LOG2, FL("11e QoS Delts received\n"));)
871 }
872 else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled)
873 {
874 PELOG2(limLog(pMac, LOG2, FL("WSM Delts received\n"));)
875 }
876 else
877 {
878 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable\n"));)
879 return;
880 }
881
882 tsinfo = delts.wmeTspecPresent ? &delts.tspec.tsinfo : &delts.tsinfo;
883
884 // if no Admit Control, ignore the request
885 if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA))
886 {
887
888#if(defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
889 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE &&
890 (! psessionEntry->gLimEdcaParamsBC[upToAc(tsinfo->traffic.userPrio)].aci.acm)) ||
891 (psessionEntry->limSystemRole != eLIM_AP_ROLE &&
892 (! psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm)))
893#else
894 if ((upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC) || (! psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm))
895#endif
896 {
897 limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request\n"),
898 tsinfo->traffic.userPrio);
899 return;
900 }
901 }
902
903 // try to delete the TS
904 if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx))
905 {
906 PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS\n"));)
907 return;
908 }
909
910 else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
911 (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH))
912 {
913 //Edca only for now.
914 }
915 else
916 {
917 //send message to HAL to delete TS
Jeff Johnsone7245742012-09-05 17:12:55 -0700918 if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac, pSta->staIndex, tspecIdx, delts, psessionEntry->peSessionId))
Jeff Johnson295189b2012-06-20 16:38:30 -0700919 {
920 limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request\n"),
921 tsinfo->traffic.userPrio);
922 return;
923 }
924 }
925
926 /* We successfully deleted the TSPEC. Update the dynamic UAPSD Mask.
927 * The AC for this TSPEC is no longer trigger enabled if this Tspec
928 * was set-up in uplink direction only.
929 * The AC for this TSPEC is no longer delivery enabled if this Tspec
930 * was set-up in downlink direction only.
931 * The AC for this TSPEC is no longer triiger enabled and delivery
932 * enabled if this Tspec was a bidirectional TSPEC.
933 */
934 limSetTspecUapsdMask(pMac, tsinfo, CLEAR_UAPSD_MASK);
935
936
937 /* We're deleting the TSPEC.
938 * The AC for this TSPEC is no longer admitted in uplink/downlink direction
939 * if this TSPEC was set-up in uplink/downlink direction only.
940 * The AC for this TSPEC is no longer admitted in both uplink and downlink
941 * directions if this TSPEC was a bi-directional TSPEC.
942 * If ACM is set for this AC and this AC is admitted only in downlink
943 * direction, PE needs to downgrade the EDCA parameter
944 * (for the AC for which TS is being deleted) to the
945 * next best AC for which ACM is not enabled, and send the
946 * updated values to HAL.
947 */
948 ac = upToAc(tsinfo->traffic.userPrio);
949
950 if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK)
951 {
952 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
953 }
954 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK)
955 {
956 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
957 }
958 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR)
959 {
960 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
961 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
962 }
963
964 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
965
966 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
967 if (pStaDs != NULL)
968 {
969 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
970 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
971 else
972 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
973 }
974 else
975 limLog(pMac, LOGE, FL("Self entry missing in Hash Table \n"));
976
977 PELOG1(limLog(pMac, LOG1, FL("DeleteTS succeeded\n"));)
978 if((psessionEntry->limSystemRole != eLIM_AP_ROLE)&&(psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
979 limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry);
980
981#ifdef FEATURE_WLAN_CCX
982 limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER);
983#endif
984
985}
986
987
988#ifdef ANI_SUPPORT_11H
989/**
990 * limProcessBasicMeasReq
991 *
992 *FUNCTION:
993 * This function is called by limProcessMeasurementRequestFrame()
994 * when it received a Basic measurement Request action frame.
995 * Station/BP receiving this should perform basic measurements
996 * and then send Basic Measurement Report. AP should not perform
997 * any measurements, and send report indicating refusal.
998 *
999 *LOGIC:
1000 *
1001 *ASSUMPTIONS:
1002 *
1003 *NOTE:
1004 *
1005 * @param pMac - Pointer to Global MAC structure
1006 * @param pMeasReqFrame - A pointer to Basic Meas. Req structure
1007 * @return None
1008 */
1009static void
1010__limProcessBasicMeasReq(tpAniSirGlobal pMac,
1011 tpSirMacMeasReqActionFrame pMeasReqFrame,
1012 tSirMacAddr peerMacAddr)
1013{
1014 // TBD - Station shall perform basic measurements
1015
1016 if (limSendMeasReportFrame(pMac,
1017 pMeasReqFrame,
1018 peerMacAddr) != eSIR_SUCCESS)
1019 {
1020 PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report \n"));)
1021 return;
1022 }
1023}
1024
1025
1026/**
1027 * limProcessCcaMeasReq
1028 *
1029 *FUNCTION:
1030 * This function is called by limProcessMeasurementRequestFrame()
1031 * when it received a CCA measurement Request action frame.
1032 * Station/BP receiving this should perform CCA measurements
1033 * and then send CCA Measurement Report. AP should not perform
1034 * any measurements, and send report indicating refusal.
1035 *
1036 *LOGIC:
1037 *
1038 *ASSUMPTIONS:
1039 *
1040 *NOTE:
1041 *
1042 * @param pMac - Pointer to Global MAC structure
1043 * @param pMeasReqFrame - A pointer to CCA Meas. Req structure
1044 * @return None
1045 */
1046static void
1047__limProcessCcaMeasReq(tpAniSirGlobal pMac,
1048 tpSirMacMeasReqActionFrame pMeasReqFrame,
1049 tSirMacAddr peerMacAddr)
1050{
1051 // TBD - Station shall perform cca measurements
1052
1053 if (limSendMeasReportFrame(pMac,
1054 pMeasReqFrame,
1055 peerMacAddr) != eSIR_SUCCESS)
1056 {
1057 PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report \n"));)
1058 return;
1059 }
1060}
1061
1062
1063/**
1064 * __limProcessRpiMeasReq
1065 *
1066 *FUNCTION:
1067 * This function is called by limProcessMeasurementRequestFrame()
1068 * when it received a RPI measurement Request action frame.
1069 * Station/BP/AP receiving this shall not perform any measurements,
1070 * and send report indicating refusal.
1071 *
1072 *LOGIC:
1073 *
1074 *ASSUMPTIONS:
1075 *
1076 *NOTE:
1077 *
1078 * @param pMac - Pointer to Global MAC structure
1079 * @param pMeasReqFrame - A pointer to RPI Meas. Req structure
1080 * @return None
1081 */
1082static void
1083__limProcessRpiMeasReq(tpAniSirGlobal pMac,
1084 tpSirMacMeasReqActionFrame pMeasReqFrame,
1085 tSirMacAddr peerMacAddr)
1086{
1087 if (limSendMeasReportFrame(pMac,
1088 pMeasReqFrame,
1089 peerMacAddr) != eSIR_SUCCESS)
1090 {
1091 PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report \n"));)
1092 return;
1093 }
1094}
1095
1096
1097/**
1098 * __limProcessMeasurementRequestFrame
1099 *
1100 *FUNCTION:
1101 *
1102 *LOGIC:
1103 *
1104 *ASSUMPTIONS:
1105 *
1106 *NOTE:
1107 *
1108 * @param pMac - Pointer to Global MAC structure
1109 * @param *pRxPacketInfo - A pointer to packet info structure
1110 * @return None
1111 */
1112
1113static void
1114__limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1115{
1116 tpSirMacMgmtHdr pHdr;
1117 tANI_U8 *pBody;
1118 tpSirMacMeasReqActionFrame pMeasReqFrame;
1119 tANI_U32 frameLen;
1120
1121 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1122 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1123 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1124
1125 if ( eHAL_STATUS_SUCCESS !=
1126 palAllocateMemory( pMac->hHdd, (void **)&pMeasReqFrame, sizeof( tSirMacMeasReqActionFrame ) ) )
1127 {
1128 limLog(pMac, LOGE,
1129 FL("limProcessMeasurementRequestFrame: palAllocateMemory failed \n"));
1130 return;
1131 }
1132
1133 if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) !=
1134 eSIR_SUCCESS)
1135 {
1136 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame \n"));)
1137 return;
1138 }
1139
1140
1141 switch(pMeasReqFrame->measReqIE.measType)
1142 {
1143 case SIR_MAC_BASIC_MEASUREMENT_TYPE:
1144 __limProcessBasicMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1145 break;
1146
1147 case SIR_MAC_CCA_MEASUREMENT_TYPE:
1148 __limProcessCcaMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1149 break;
1150
1151 case SIR_MAC_RPI_MEASUREMENT_TYPE:
1152 __limProcessRpiMeasReq(pMac, pMeasReqFrame, pHdr->sa);
1153 break;
1154
1155 default:
1156 PELOG1(limLog(pMac, LOG1, FL("Unknown Measurement Type %d \n"),
1157 pMeasReqFrame->measReqIE.measType);)
1158 break;
1159 }
1160
1161} /*** end limProcessMeasurementRequestFrame ***/
1162
1163
1164/**
1165 * limProcessTpcRequestFrame
1166 *
1167 *FUNCTION:
1168 * This function is called upon receiving Tpc Request frame.
1169 *
1170 *NOTE:
1171 *
1172 * @param pMac - Pointer to Global MAC structure
1173 * @param *pRxPacketInfo - A pointer to packet info structure
1174 * @return None
1175 */
1176
1177static void
1178__limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1179{
1180 tpSirMacMgmtHdr pHdr;
1181 tANI_U8 *pBody;
1182 tpSirMacTpcReqActionFrame pTpcReqFrame;
1183 tANI_U32 frameLen;
1184
1185 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1186 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1187 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1188
1189 PELOG1(limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));)
1190
1191 if ( eHAL_STATUS_SUCCESS !=
1192 palAllocateMemory( pMac->hHdd, (void **)&pTpcReqFrame, sizeof( tSirMacTpcReqActionFrame ) ) )
1193 {
1194 PELOGE(limLog(pMac, LOGE, FL("palAllocateMemory failed \n"));)
1195 return;
1196 }
1197
1198 if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) !=
1199 eSIR_SUCCESS)
1200 {
1201 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame \n"));)
1202 return;
1203 }
1204
1205 if (limSendTpcReportFrame(pMac,
1206 pTpcReqFrame,
1207 pHdr->sa) != eSIR_SUCCESS)
1208 {
1209 PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. \n"));)
1210 return;
1211 }
1212}
1213#endif
1214
1215
1216/**
1217 * \brief Validate an ADDBA Req from peer with respect
1218 * to our own BA configuration
1219 *
1220 * \sa __limValidateAddBAParameterSet
1221 *
1222 * \param pMac The global tpAniSirGlobal object
1223 *
1224 * \param baParameterSet The ADDBA Parameter Set.
1225 *
1226 * \param pDelBAFlag this parameter is NULL except for call from processAddBAReq
1227 * delBAFlag is set when entry already exists.
1228 *
1229 * \param reqType ADDBA Req v/s ADDBA Rsp
1230 * 1 - ADDBA Req
1231 * 0 - ADDBA Rsp
1232 *
1233 * \return eSIR_SUCCESS if setup completes successfully
1234 * eSIR_FAILURE is some problem is encountered
1235 */
1236
1237static tSirMacStatusCodes
1238__limValidateAddBAParameterSet( tpAniSirGlobal pMac,
1239 tpDphHashNode pSta,
1240 tDot11fFfAddBAParameterSet baParameterSet,
1241 tANI_U8 dialogueToken,
1242 tLimAddBaValidationReqType reqType ,
1243 tANI_U8* pDelBAFlag /*this parameter is NULL except for call from processAddBAReq*/)
1244{
1245 if(baParameterSet.tid >= STACFG_MAX_TC)
1246 {
1247 return eSIR_MAC_WME_INVALID_PARAMS_STATUS;
1248 }
1249
1250 //check if there is already a BA session setup with this STA/TID while processing AddBaReq
1251 if((true == pSta->tcCfg[baParameterSet.tid].fUseBARx) &&
1252 (LIM_ADDBA_REQ == reqType))
1253 {
1254 //There is already BA session setup for STA/TID.
1255 limLog( pMac, LOGW,
1256 FL( "AddBAReq rcvd when there is already a session for this StaId = %d, tid = %d\n " ),
1257 pSta->staIndex, baParameterSet.tid);
1258 limPrintMacAddr( pMac, pSta->staAddr, LOGW );
1259
1260 if(pDelBAFlag)
1261 *pDelBAFlag = true;
1262 }
1263 return eSIR_MAC_SUCCESS_STATUS;
1264}
1265
1266/**
1267 * \brief Validate a DELBA Ind from peer with respect
1268 * to our own BA configuration
1269 *
1270 * \sa __limValidateDelBAParameterSet
1271 *
1272 * \param pMac The global tpAniSirGlobal object
1273 *
1274 * \param baParameterSet The DELBA Parameter Set.
1275 *
1276 * \param pSta Runtime, STA-related configuration cached
1277 * in the HashNode object
1278 *
1279 * \return eSIR_SUCCESS if setup completes successfully
1280 * eSIR_FAILURE is some problem is encountered
1281 */
1282static tSirMacStatusCodes
1283__limValidateDelBAParameterSet( tpAniSirGlobal pMac,
1284 tDot11fFfDelBAParameterSet baParameterSet,
1285 tpDphHashNode pSta )
1286{
1287tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS;
1288
1289 // Validate if a BA is active for the requested TID
1290 if( pSta->tcCfg[baParameterSet.tid].fUseBATx ||
1291 pSta->tcCfg[baParameterSet.tid].fUseBARx )
1292 {
1293 statusCode = eSIR_MAC_SUCCESS_STATUS;
1294
1295 limLog( pMac, LOGW,
1296 FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL...\n"));
1297 }
1298 else
1299 limLog( pMac, LOGW,
1300 FL("Received an INVALID DELBA Ind for TID %d...\n"),
1301 baParameterSet.tid );
1302
1303 return statusCode;
1304}
1305
1306/**
1307 * \brief Process an ADDBA REQ
1308 *
1309 * \sa limProcessAddBAReq
1310 *
1311 * \param pMac The global tpAniSirGlobal object
1312 *
1313 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1314 *
1315 * \return none
1316 *
1317 */
1318static void
1319__limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1320{
1321 tDot11fAddBAReq frmAddBAReq;
1322 tpSirMacMgmtHdr pHdr;
1323 tpDphHashNode pSta;
1324 tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS;
1325 tANI_U16 aid;
1326 tANI_U32 frameLen, nStatus;
1327 tANI_U8 *pBody;
1328 tANI_U8 delBAFlag =0;
1329
1330 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1331 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1332 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1333
1334 // Unpack the received frame
1335 nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq );
1336 if( DOT11F_FAILED( nStatus ))
1337 {
1338 limLog( pMac, LOGE,
1339 FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):\n"),
1340 nStatus,
1341 frameLen );
1342
1343 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1344
1345 // Without an unpacked request we cannot respond, so silently ignore the request
1346 return;
1347 }
1348 else if ( DOT11F_WARNED( nStatus ) )
1349 {
1350 limLog( pMac, LOGW,
1351 FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):\n"),
1352 nStatus,
1353 frameLen );
1354
1355 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1356 }
1357
1358 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1359 if( pSta == NULL )
1360 {
1361 limLog( pMac, LOGE,
1362 FL( "STA context not found - ignoring ADDBA from \n" ));
1363 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1364
1365 // FIXME - Should we do this?
1366 status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS;
1367 goto returnAfterError;
1368 }
1369
1370 limLog( pMac, LOGW,
1371 FL( "ADDBA Req from STA with AID %d, tid = %d\n" ),
1372 aid, frmAddBAReq.AddBAParameterSet.tid);
1373
1374#ifdef WLAN_SOFTAP_VSTA_FEATURE
1375 // we can only do BA on "hard" STAs
1376 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1377 {
1378 status = eSIR_MAC_REQ_DECLINED_STATUS;
1379 goto returnAfterError;
1380 }
1381#endif //WLAN_SOFTAP_VSTA_FEATURE
1382
1383
1384 // Now, validate the ADDBA Req
1385 if( eSIR_MAC_SUCCESS_STATUS !=
1386 (status = __limValidateAddBAParameterSet( pMac, pSta,
1387 frmAddBAReq.AddBAParameterSet,
1388 0, //dialogue token is don't care in request validation.
1389 LIM_ADDBA_REQ, &delBAFlag)))
1390 goto returnAfterError;
1391
1392 //BA already set, so we need to delete it before adding new one.
1393 if(delBAFlag)
1394 {
1395 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1396 pSta,
1397 (tANI_U8)frmAddBAReq.AddBAParameterSet.tid,
1398 eBA_RECIPIENT,psessionEntry))
1399 {
1400 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1401 goto returnAfterError;
1402 }
1403 }
1404
1405 // Check if the ADD BA Declined configuration is Disabled
1406 if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) {
1407 limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d \n" ),
1408 frmAddBAReq.AddBAParameterSet.tid);
1409 status = eSIR_MAC_REQ_DECLINED_STATUS;
1410 goto returnAfterError;
1411 }
1412
1413 //
1414 // Post WDA_ADDBA_REQ to HAL.
1415 // If HAL/HDD decide to allow this ADDBA Req session,
1416 // then this BA session is termed active
1417 //
1418
1419 // Change the Block Ack state of this STA to wait for
1420 // ADDBA Rsp from HAL
1421 LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
1422
1423 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1424 pSta,
1425 (tANI_U8) frmAddBAReq.DialogToken.token,
1426 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1427 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1428 frmAddBAReq.AddBAParameterSet.bufferSize,
1429 frmAddBAReq.BATimeout.timeout,
1430 (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn,
1431 eBA_RECIPIENT,psessionEntry))
1432 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1433 else
1434 return;
1435
1436returnAfterError:
1437
1438 //
1439 // Package LIM_MLM_ADDBA_RSP to MLME, with proper
1440 // status code. MLME will then send an ADDBA RSP
1441 // over the air to the peer MAC entity
1442 //
1443 if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac,
1444 pHdr->sa,
1445 status,
1446 frmAddBAReq.DialogToken.token,
1447 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1448 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1449 frmAddBAReq.AddBAParameterSet.bufferSize,
1450 frmAddBAReq.BATimeout.timeout,psessionEntry))
1451 {
1452 limLog( pMac, LOGW,
1453 FL( "Failed to post LIM_MLM_ADDBA_RSP to " ));
1454 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1455 }
1456
1457}
1458
1459/**
1460 * \brief Process an ADDBA RSP
1461 *
1462 * \sa limProcessAddBARsp
1463 *
1464 * \param pMac The global tpAniSirGlobal object
1465 *
1466 * \param pRxPacketInfo Handle to the packet info structure from HDD
1467 *
1468 * \return none
1469 *
1470 */
1471static void
1472__limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1473{
1474tDot11fAddBARsp frmAddBARsp;
1475tpSirMacMgmtHdr pHdr;
1476tpDphHashNode pSta;
1477tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1478tANI_U16 aid;
1479tANI_U32 frameLen, nStatus;
1480tANI_U8 *pBody;
1481
1482 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1483 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1484 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1485
1486 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1487 if( pSta == NULL )
1488 {
1489 limLog( pMac, LOGE,
1490 FL( "STA context not found - ignoring ADDBA from \n" ));
1491 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1492 return;
1493 }
1494
1495#ifdef WLAN_SOFTAP_VSTA_FEATURE
1496 // We can only do BA on "hard" STAs. We should not have issued an ADDBA
1497 // Request, so we should never be processing a ADDBA Response
1498 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1499 {
1500 return;
1501 }
1502#endif //WLAN_SOFTAP_VSTA_FEATURE
1503
1504 // Unpack the received frame
1505 nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp );
1506 if( DOT11F_FAILED( nStatus ))
1507 {
1508 limLog( pMac, LOGE,
1509 FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):\n"),
1510 nStatus,
1511 frameLen );
1512
1513 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1514 goto returnAfterError;
1515 }
1516 else if ( DOT11F_WARNED( nStatus ) )
1517 {
1518 limLog( pMac, LOGW,
1519 FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):\n"),
1520 nStatus,
1521 frameLen );
1522
1523 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1524 }
1525
1526 limLog( pMac, LOGW,
1527 FL( "ADDBA Rsp from STA with AID %d, tid = %d, status = %d\n" ),
1528 aid, frmAddBARsp.AddBAParameterSet.tid, frmAddBARsp.Status.status);
1529
1530 //if there is no matchin dialougue token then ignore the response.
1531
1532 if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token,
1533 pSta->assocId, frmAddBARsp.AddBAParameterSet.tid))
1534 {
1535 PELOGW(limLog(pMac, LOGW, FL("dialogueToken in received addBARsp did not match with outstanding requests\n"));)
1536 return;
1537 }
1538
1539 // Check first if the peer accepted the ADDBA Req
1540 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1541 {
1542 //if peer responded with buffer size 0 then we should pick the default.
1543 if(0 == frmAddBARsp.AddBAParameterSet.bufferSize)
1544 frmAddBARsp.AddBAParameterSet.bufferSize = BA_DEFAULT_TX_BUFFER_SIZE;
1545
1546 // Now, validate the ADDBA Rsp
1547 if( eSIR_MAC_SUCCESS_STATUS !=
1548 __limValidateAddBAParameterSet( pMac, pSta,
1549 frmAddBARsp.AddBAParameterSet,
1550 (tANI_U8)frmAddBARsp.DialogToken.token,
1551 LIM_ADDBA_RSP, NULL))
1552 goto returnAfterError;
1553 }
1554 else
1555 goto returnAfterError;
1556
1557 // Change STA state to wait for ADDBA Rsp from HAL
1558 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
1559
1560 //
1561 // Post WDA_ADDBA_REQ to HAL.
1562 // If HAL/HDD decide to allow this ADDBA Rsp session,
1563 // then this BA session is termed active
1564 //
1565
1566 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1567 pSta,
1568 (tANI_U8) frmAddBARsp.DialogToken.token,
1569 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1570 (tANI_U8) frmAddBARsp.AddBAParameterSet.policy,
1571 frmAddBARsp.AddBAParameterSet.bufferSize,
1572 frmAddBARsp.BATimeout.timeout,
1573 0,
1574 eBA_INITIATOR,psessionEntry))
1575 reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1576 else
1577 return;
1578
1579returnAfterError:
1580
1581 // TODO: Do we need to signal an error status to SME,
1582 // if status != eSIR_MAC_SUCCESS_STATUS
1583
1584 // Restore STA "BA" State
1585 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE);
1586 //
1587 // Need to send a DELBA IND to peer, who
1588 // would have setup a BA session with this STA
1589 //
1590 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1591 {
1592 //
1593 // Package LIM_MLM_DELBA_REQ to MLME, with proper
1594 // status code. MLME will then send a DELBA IND
1595 // over the air to the peer MAC entity
1596 //
1597 if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac,
1598 pSta,
1599 eBA_INITIATOR,
1600 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1601 reasonCode, psessionEntry))
1602 {
1603 limLog( pMac, LOGW,
1604 FL( "Failed to post LIM_MLM_DELBA_REQ to " ));
1605 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1606 }
1607 }
1608}
1609
1610/**
1611 * \brief Process a DELBA Indication
1612 *
1613 * \sa limProcessDelBAInd
1614 *
1615 * \param pMac The global tpAniSirGlobal object
1616 *
1617 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1618 *
1619 * \return none
1620 *
1621 */
1622static void
1623__limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1624{
1625tDot11fDelBAInd frmDelBAInd;
1626tpSirMacMgmtHdr pHdr;
1627tpDphHashNode pSta;
1628tANI_U16 aid;
1629tANI_U32 frameLen, nStatus;
1630tANI_U8 *pBody;
1631
1632 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1633 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1634 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1635
1636 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1637 if( pSta == NULL )
1638 {
1639 limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from \n"));
1640 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1641 return;
1642 }
1643
1644 limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d\n" ), aid );
1645
1646 // Unpack the received frame
1647 nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd );
1648 if( DOT11F_FAILED( nStatus ))
1649 {
1650 limLog( pMac, LOGE,
1651 FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):\n"),
1652 nStatus,
1653 frameLen );
1654
1655 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1656 return;
1657 }
1658 else if ( DOT11F_WARNED( nStatus ) )
1659 {
1660 limLog( pMac, LOGW,
1661 FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):\n"),
1662 nStatus,
1663 frameLen );
1664
1665 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1666 }
1667
1668 limLog( pMac, LOGW,
1669 FL( "Received DELBA for TID %d, Reason code %d\n" ),
1670 frmDelBAInd.DelBAParameterSet.tid,
1671 frmDelBAInd.Reason.code );
1672
1673 // Now, validate the DELBA Ind
1674 if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac,
1675 frmDelBAInd.DelBAParameterSet,
1676 pSta ))
1677 return;
1678
1679 //
1680 // Post WDA_DELBA_IND to HAL and delete the
1681 // existing BA session
1682 //
1683 // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16
1684 // is kind of confusing...
1685 //
1686 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1687 pSta,
1688 (tANI_U8) frmDelBAInd.DelBAParameterSet.tid,
1689 (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)?
1690 eBA_INITIATOR: eBA_RECIPIENT,psessionEntry))
1691 limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed \n"));
1692
1693 return;
1694
1695}
1696
1697static void
1698__limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry)
1699{
1700
1701#if 0
1702 tpSirMacMgmtHdr pHdr;
1703 tDot11fSMPowerSave frmSMPower;
1704 tSirMacHTMIMOPowerSaveState state;
1705 tpDphHashNode pSta;
1706 tANI_U16 aid;
1707 tANI_U32 frameLen, nStatus;
1708 tANI_U8 *pBody;
1709
1710 pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd );
1711 pBody = SIR_MAC_BD_TO_MPDUDATA( pBd );
1712 frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd );
1713
1714 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1715 if( pSta == NULL ) {
1716 limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from \n" ));
1717 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1718 return;
1719 }
1720
1721 /**Unpack the received frame */
1722 nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower);
1723
1724 if( DOT11F_FAILED( nStatus )) {
1725 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):\n"),
1726 nStatus, frameLen );
1727 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1728 return;
1729 }else if ( DOT11F_WARNED( nStatus ) ) {
1730 limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):\n"),
1731 nStatus, frameLen );
1732 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1733 }
1734
1735 limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d"
1736 "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En,
1737 frmSMPower.SMPowerModeSet.Mode);
1738
1739 /** Update in the DPH Table about the Update in the SM Power Save mode*/
1740 if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode)
1741 state = eSIR_HT_MIMO_PS_DYNAMIC;
1742 else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0))
1743 state = eSIR_HT_MIMO_PS_STATIC;
1744 else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0))
1745 state = eSIR_HT_MIMO_PS_NO_LIMIT;
1746 else {
1747 PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));)
1748 return;
1749 }
1750
1751 if (state == pSta->htMIMOPSState) {
1752 PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));)
1753 return;
1754 }
1755
1756 /** Update in the HAL Station Table for the Update of the Protection Mode */
1757 pSta->htMIMOPSState = state;
1758 limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState);
1759
1760#endif
1761
1762}
1763
1764#if defined WLAN_FEATURE_VOWIFI
1765
1766static void
1767__limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1768{
1769 tpSirMacMgmtHdr pHdr;
1770 tDot11fRadioMeasurementRequest frm;
1771 tANI_U32 frameLen, nStatus;
1772 tANI_U8 *pBody;
1773
1774 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1775 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1776 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1777
1778 if( psessionEntry == NULL )
1779 {
1780 return;
1781 }
1782
1783 /**Unpack the received frame */
1784 nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm );
1785
1786 if( DOT11F_FAILED( nStatus )) {
1787 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):\n"),
1788 nStatus, frameLen );
1789 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1790 return;
1791 }else if ( DOT11F_WARNED( nStatus ) ) {
1792 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):\n"),
1793 nStatus, frameLen );
1794 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1795 }
1796
1797 // Call rrm function to handle the request.
1798
1799 rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry );
1800}
1801
1802static void
1803__limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1804{
1805 tpSirMacMgmtHdr pHdr;
1806 tDot11fLinkMeasurementRequest frm;
1807 tANI_U32 frameLen, nStatus;
1808 tANI_U8 *pBody;
1809
1810 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1811 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1812 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1813
1814 if( psessionEntry == NULL )
1815 {
1816 return;
1817 }
1818
1819 /**Unpack the received frame */
1820 nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm );
1821
1822 if( DOT11F_FAILED( nStatus )) {
1823 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):\n"),
1824 nStatus, frameLen );
1825 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1826 return;
1827 }else if ( DOT11F_WARNED( nStatus ) ) {
1828 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):\n"),
1829 nStatus, frameLen );
1830 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1831 }
1832
1833 // Call rrm function to handle the request.
1834
1835 rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry );
1836
1837}
1838
1839static void
1840__limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1841{
1842 tpSirMacMgmtHdr pHdr;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001843 tDot11fNeighborReportResponse *pFrm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001844 tANI_U32 frameLen, nStatus;
1845 tANI_U8 *pBody;
1846
1847 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1848 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1849 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1850
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001851 if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
1852 (void **)&pFrm, sizeof(tDot11fNeighborReportResponse)))
1853 {
1854 limLog(pMac, LOGE, FL("Unable to PAL allocate memory in __limProcessNeighborReport\n") );
1855 return;
1856 }
1857
Jeff Johnson295189b2012-06-20 16:38:30 -07001858 if( psessionEntry == NULL )
1859 {
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001860 palFreeMemory(pMac->hHdd, pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001861 return;
1862 }
1863
1864 /**Unpack the received frame */
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001865 nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm );
Jeff Johnson295189b2012-06-20 16:38:30 -07001866
1867 if( DOT11F_FAILED( nStatus )) {
1868 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):\n"),
1869 nStatus, frameLen );
1870 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001871 palFreeMemory(pMac->hHdd, pFrm);
1872 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001873 }else if ( DOT11F_WARNED( nStatus ) ) {
1874 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):\n"),
1875 nStatus, frameLen );
1876 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1877 }
1878
1879 //Call rrm function to handle the request.
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001880 rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry );
1881
1882 palFreeMemory(pMac->hHdd, pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001883}
1884
1885#endif
1886
1887#ifdef WLAN_FEATURE_11W
1888/**
1889 * limProcessActionFrame
1890 *
1891 *FUNCTION:
1892 * This function is called by limProcessActionFrame() upon
1893 * SA query request Action frame reception.
1894 *
1895 *LOGIC:
1896 *
1897 *ASSUMPTIONS:
1898 *
1899 *NOTE:
1900 *
1901 * @param pMac - Pointer to Global MAC structure
1902 * @param *pBd - A pointer to Buffer descriptor + associated PDUs
1903 * @return None
1904 */
1905static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1906{
1907 tpSirMacMgmtHdr pHdr;
1908 tANI_U8 *pBody;
1909 tANI_U16 transId = 0;
1910
1911 /* Prima --- Below Macro not available in prima
1912 pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd);
1913 pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */
1914
1915 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1916 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1917
1918 /*Extract 11w trsansId from SA query request action frame
1919 In SA query response action frame we will send same transId
1920 In SA query request action frame:
1921 Category : 1 byte
1922 Action : 1 byte
1923 Transaction ID : 2 bbytes */
1924
1925 transId = pBody[2];
1926 transId = transId << 8;
1927 transId |= pBody[3];
1928
1929 //Send 11w SA query response action frame
1930 if (limSendSaQueryResponseFrame(pMac,
1931 transId,
1932 pHdr->sa,psessionEntry) != eSIR_SUCCESS)
1933 {
1934 PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame. \n"));)
1935 return;
1936 }
1937}
1938
1939#endif
1940
1941/**
1942 * limProcessActionFrame
1943 *
1944 *FUNCTION:
1945 * This function is called by limProcessMessageQueue() upon
1946 * Action frame reception.
1947 *
1948 *LOGIC:
1949 *
1950 *ASSUMPTIONS:
1951 *
1952 *NOTE:
1953 *
1954 * @param pMac - Pointer to Global MAC structure
1955 * @param *pRxPacketInfo - A pointer to packet info structure
1956 * @return None
1957 */
1958
1959void
1960limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1961{
1962 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1963 tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody;
1964
1965
1966 switch (pActionHdr->category)
1967 {
1968 case SIR_MAC_ACTION_QOS_MGMT:
1969 if (psessionEntry->limQosEnabled)
1970 {
1971 switch (pActionHdr->actionID)
1972 {
1973 case SIR_MAC_QOS_ADD_TS_REQ:
1974 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1975 break;
1976
1977 case SIR_MAC_QOS_ADD_TS_RSP:
1978 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1979 break;
1980
1981 case SIR_MAC_QOS_DEL_TS_REQ:
1982 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1983 break;
1984
1985 default:
1986 PELOGE(limLog(pMac, LOGE, FL("Qos action %d not handled\n"), pActionHdr->actionID);)
1987 break;
1988 }
1989 break ;
1990 }
1991
1992 break;
1993
1994 case SIR_MAC_ACTION_SPECTRUM_MGMT:
1995 switch (pActionHdr->actionID)
1996 {
1997#ifdef ANI_SUPPORT_11H
1998 case SIR_MAC_ACTION_MEASURE_REQUEST_ID:
1999 if(psessionEntry->lim11hEnable)
2000 {
2001 __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo);
2002 }
2003 break;
2004
2005 case SIR_MAC_ACTION_TPC_REQUEST_ID:
2006 if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
2007 (pessionEntry->limSystemRole == eLIM_AP_ROLE))
2008 {
2009 if(psessionEntry->lim11hEnable)
2010 {
2011 __limProcessTpcRequestFrame(pMac, pRxPacketInfo);
2012 }
2013 }
2014 break;
2015
2016#endif
2017 case SIR_MAC_ACTION_CHANNEL_SWITCH_ID:
2018 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
2019 {
2020 __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry);
2021 }
2022 break;
2023 default:
2024 PELOGE(limLog(pMac, LOGE, FL("Spectrum mgmt action id %d not handled\n"), pActionHdr->actionID);)
2025 break;
2026 }
2027 break;
2028
2029 case SIR_MAC_ACTION_WME:
2030 if (! psessionEntry->limWmeEnabled)
2031 {
2032 limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d\n"),
2033 pActionHdr->actionID);
2034 break;
2035 }
2036 switch(pActionHdr->actionID)
2037 {
2038 case SIR_MAC_QOS_ADD_TS_REQ:
2039 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2040 break;
2041
2042 case SIR_MAC_QOS_ADD_TS_RSP:
2043 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2044 break;
2045
2046 case SIR_MAC_QOS_DEL_TS_REQ:
2047 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2048 break;
2049
2050 default:
2051 PELOGE(limLog(pMac, LOGE, FL("WME action %d not handled\n"), pActionHdr->actionID);)
2052 break;
2053 }
2054 break;
2055
2056 case SIR_MAC_ACTION_BLKACK:
2057 // Determine the "type" of BA Action Frame
2058 switch(pActionHdr->actionID)
2059 {
2060 case SIR_MAC_BLKACK_ADD_REQ:
2061 __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2062 break;
2063
2064 case SIR_MAC_BLKACK_ADD_RSP:
2065 __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2066 break;
2067
2068 case SIR_MAC_BLKACK_DEL:
2069 __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2070 break;
2071
2072 default:
2073 break;
2074 }
2075
2076 break;
2077 case SIR_MAC_ACTION_HT:
2078 /** Type of HT Action to be performed*/
2079 switch(pActionHdr->actionID) {
2080 case SIR_MAC_SM_POWER_SAVE:
2081 __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2082 break;
2083 default:
2084 PELOGE(limLog(pMac, LOGE, FL("Action ID %d not handled in HT Action category\n"), pActionHdr->actionID);)
2085 break;
2086 }
2087 break;
2088
2089#if defined WLAN_FEATURE_VOWIFI
2090 case SIR_MAC_ACTION_RRM:
2091 if( pMac->rrm.rrmPEContext.rrmEnable )
2092 {
2093 switch(pActionHdr->actionID) {
2094 case SIR_MAC_RRM_RADIO_MEASURE_REQ:
2095 __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2096 break;
2097 case SIR_MAC_RRM_LINK_MEASUREMENT_REQ:
2098 __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2099 break;
2100 case SIR_MAC_RRM_NEIGHBOR_RPT:
2101 __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry );
2102 break;
2103 default:
2104 PELOGE( limLog( pMac, LOGE, FL("Action ID %d not handled in RRM\n"), pActionHdr->actionID);)
2105 break;
2106
2107 }
2108 }
2109 else
2110 {
2111 // Else we will just ignore the RRM messages.
2112 PELOGE( limLog( pMac, LOGE, FL("RRM Action frame ignored as RRM is disabled in cfg\n"));)
2113 }
2114 break;
2115#endif
2116#if defined WLAN_FEATURE_P2P
2117 case SIR_MAC_ACTION_PUBLIC_USAGE:
2118 switch(pActionHdr->actionID) {
2119 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2120 {
2121 tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr;
2122 tpSirMacMgmtHdr pHdr;
2123 tANI_U32 frameLen;
2124 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2125
2126 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2127 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2128
2129 //Check if it is a P2P public action frame.
2130 if( palEqualMemory( pMac->hHdd, pPubAction->Oui, P2POui, 4 ) )
2131 {
2132 /* Forward to the SME to HDD to wpa_supplicant */
2133 // type is ACTION
2134 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2135 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Jeff Johnsone7245742012-09-05 17:12:55 -07002136 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -07002137 }
2138 else
2139 {
2140 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x\n"),
2141 pPubAction->Oui[0], pPubAction->Oui[1], pPubAction->Oui[2], pPubAction->Oui[3] );
2142 }
2143 }
2144 break;
2145
2146 default:
2147 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x \n"), pActionHdr->actionID);)
2148 break;
2149 }
2150 break;
2151#endif
2152
2153#ifdef WLAN_FEATURE_11W
2154 case SIR_MAC_ACTION_SA_QUERY:
2155 {
2156 /**11w SA query request action frame received**/
2157 __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2158 break;
2159 }
2160#endif
Mohit Khanna4a70d262012-09-11 16:30:12 -07002161#ifdef WLAN_FEATURE_11AC
2162 case SIR_MAC_ACTION_VHT:
2163 {
2164 if (psessionEntry->vhtCapability)
2165 {
2166 switch (pActionHdr->actionID)
2167 {
2168 case SIR_MAC_VHT_OPMODE_NOTIFICATION:
2169 __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry);
2170 break;
2171 default:
2172 break;
2173 }
2174 }
2175 }
2176#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002177 default:
2178 PELOGE(limLog(pMac, LOGE, FL("Action category %d not handled\n"), pActionHdr->category);)
2179 break;
2180 }
2181}
2182
2183#if defined WLAN_FEATURE_P2P
2184/**
2185 * limProcessActionFrameNoSession
2186 *
2187 *FUNCTION:
2188 * This function is called by limProcessMessageQueue() upon
2189 * Action frame reception and no session.
2190 * Currently only public action frames can be received from
2191 * a non-associated station.
2192 *
2193 *LOGIC:
2194 *
2195 *ASSUMPTIONS:
2196 *
2197 *NOTE:
2198 *
2199 * @param pMac - Pointer to Global MAC structure
2200 * @param *pBd - A pointer to Buffer descriptor + associated PDUs
2201 * @return None
2202 */
2203
2204void
2205limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd)
2206{
2207 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd);
2208 tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody;
2209
Mohit Khanna23863762012-09-11 17:40:09 -07002210 limLog( pMac, LOG1, "Received a Action frame -- no session");
Jeff Johnson295189b2012-06-20 16:38:30 -07002211
2212 switch ( pActionHdr->category )
2213 {
2214 case SIR_MAC_ACTION_PUBLIC_USAGE:
2215 switch(pActionHdr->actionID) {
2216 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2217 {
2218 tpSirMacMgmtHdr pHdr;
2219 tANI_U32 frameLen;
2220 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2221
2222 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
2223 frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd);
2224
2225 //Check if it is a P2P public action frame.
2226 if( palEqualMemory( pMac->hHdd, pActionHdr->Oui, P2POui, 4 ) )
2227 {
2228 /* Forward to the SME to HDD to wpa_supplicant */
2229 // type is ACTION
2230 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2231 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Jeff Johnsone7245742012-09-05 17:12:55 -07002232 WDA_GET_RX_CH( pBd ), NULL);
Jeff Johnson295189b2012-06-20 16:38:30 -07002233 }
2234 else
2235 {
2236 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x\n"),
2237 pActionHdr->Oui[0], pActionHdr->Oui[1], pActionHdr->Oui[2], pActionHdr->Oui[3] );
2238 }
2239 }
2240 break;
2241 default:
2242 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x \n"), pActionHdr->actionID);)
2243 break;
2244 }
2245 break;
2246 default:
Mohit Khanna23863762012-09-11 17:40:09 -07002247 PELOGE(limLog(pMac, LOG1, FL("Unhandled action frame without session -- %x \n"), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002248 break;
2249
2250 }
2251}
2252#endif