blob: eade47f81e80f330b57330a5de464106480674a8 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Jeff Johnson295189b2012-06-20 16:38:30 -07005 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006/*
7 * Airgo Networks, Inc proprietary. All rights reserved.
8 * This file limProcessActionFrame.cc contains the code
9 * for processing Action Frame.
10 * Author: Michael Lui
11 * Date: 05/23/03
12 * History:-
13 * Date Modified by Modification Information
14 * --------------------------------------------------------------------
15 *
16 */
17#include "palTypes.h"
18#include "wniApi.h"
19#include "sirApi.h"
20#include "aniGlobal.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070021#include "wniCfgSta.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070022#include "schApi.h"
23#include "utilsApi.h"
24#include "limTypes.h"
25#include "limUtils.h"
26#include "limAssocUtils.h"
27#include "limSecurityUtils.h"
28#include "limSerDesUtils.h"
29#include "limSendSmeRspMessages.h"
30#include "parserApi.h"
31#include "limAdmitControl.h"
32#include "wmmApsd.h"
33#include "limSendMessages.h"
34#if defined WLAN_FEATURE_VOWIFI
35#include "rrmApi.h"
36#endif
Jeff Johnsone7245742012-09-05 17:12:55 -070037#include "limSessionUtils.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070038
Srinivas Girigowda5cecb202013-10-08 09:13:25 -070039#if defined(FEATURE_WLAN_CCX) && !defined(FEATURE_WLAN_CCX_UPLOAD)
Jeff Johnson295189b2012-06-20 16:38:30 -070040#include "ccxApi.h"
41#endif
42#include "wlan_qct_wda.h"
43
44
45#define BA_DEFAULT_TX_BUFFER_SIZE 64
46
47typedef enum
48{
49 LIM_ADDBA_RSP = 0,
50 LIM_ADDBA_REQ = 1
51}tLimAddBaValidationReqType;
52
53/* Note: The test passes if the STAUT stops sending any frames, and no further
54 frames are transmitted on this channel by the station when the AP has sent
55 the last 6 beacons, with the channel switch information elements as seen
56 with the sniffer.*/
57#define SIR_CHANSW_TX_STOP_MAX_COUNT 6
58/**-----------------------------------------------------------------
59\fn limStopTxAndSwitchChannel
60\brief Stops the transmission if channel switch mode is silent and
61 starts the channel switch timer.
62
63\param pMac
64\return NONE
65-----------------------------------------------------------------*/
66void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId)
67{
68 tANI_U8 isFullPowerRequested = 0;
Jeff Johnsone7245742012-09-05 17:12:55 -070069 tpPESession psessionEntry;
70
71 psessionEntry = peFindSessionBySessionId( pMac , sessionId );
72
73 if( NULL == psessionEntry )
74 {
75 limLog(pMac, LOGE, FL("Session %d not active\n "), sessionId);
76 return;
77 }
Jeff Johnson295189b2012-06-20 16:38:30 -070078
Kiran Kumar Lokere80007262013-03-18 19:45:50 -070079 PELOG1(limLog(pMac, LOG1, FL("Channel switch Mode == %d"),
Jeff Johnsone7245742012-09-05 17:12:55 -070080 psessionEntry->gLimChannelSwitch.switchMode);)
Jeff Johnson295189b2012-06-20 16:38:30 -070081
Jeff Johnsone7245742012-09-05 17:12:55 -070082 if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT ||
83 psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT)
Jeff Johnson295189b2012-06-20 16:38:30 -070084 {
85 /* Freeze the transmission */
86 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX);
87
88 /*Request for Full power only if the device is in powersave*/
89 if(!limIsSystemInActiveState(pMac))
90 {
91 /* Request Full Power */
92 limSendSmePreChannelSwitchInd(pMac);
93 isFullPowerRequested = 1;
94 }
95 }
96 else
97 {
98 /* Resume the transmission */
99 limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX);
100 }
101
Jeff Johnsone7245742012-09-05 17:12:55 -0700102 pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700103 /* change the channel immediatly only if the channel switch count is 0 and the
104 * device is not in powersave
105 * If the device is in powersave channel switch should happen only after the
106 * device comes out of the powersave */
Jeff Johnsone7245742012-09-05 17:12:55 -0700107 if (psessionEntry->gLimChannelSwitch.switchCount == 0)
Jeff Johnson295189b2012-06-20 16:38:30 -0700108 {
109 if(limIsSystemInActiveState(pMac))
110 {
111 limProcessChannelSwitchTimeout(pMac);
112 }
113 else if(!isFullPowerRequested)
114 {
115 /* If the Full power is already not requested
116 * Request Full Power so the channel switch happens
117 * after device comes to full power */
118 limSendSmePreChannelSwitchInd(pMac);
119 }
120 return;
121 }
Leela V Kiran Kumar Reddy Chiralac3b9d382013-01-31 20:49:53 -0800122 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700123
Jeff Johnson295189b2012-06-20 16:38:30 -0700124
125 if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS)
126 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700127 limLog(pMac, LOGP, FL("tx_timer_activate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 }
129 return;
130}
131
132/**------------------------------------------------------------
133\fn limStartChannelSwitch
134\brief Switches the channel if switch count == 0, otherwise
135 starts the timer for channel switch and stops BG scan
136 and heartbeat timer tempororily.
137
138\param pMac
139\param psessionEntry
140\return NONE
141------------------------------------------------------------*/
142tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry)
143{
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700144 PELOG1(limLog(pMac, LOG1, FL("Starting the channel switch"));)
Jeff Johnsone7245742012-09-05 17:12:55 -0700145
146 /*If channel switch is already running and it is on a different session, just return*/
147 /*This need to be removed for MCC */
148 if( limIsChanSwitchRunning (pMac) &&
149 psessionEntry->gLimSpecMgmt.dot11hChanSwState != eLIM_11H_CHANSW_RUNNING )
150 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700151 limLog(pMac, LOGW, FL("Ignoring channel switch on session %d"), psessionEntry->peSessionId);
Jeff Johnsone7245742012-09-05 17:12:55 -0700152 return eSIR_SUCCESS;
153 }
154
Jeff Johnson295189b2012-06-20 16:38:30 -0700155 /* Deactivate and change reconfigure the timeout value */
Jeff Johnsone7245742012-09-05 17:12:55 -0700156 //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER);
Varun Reddy Yeturue3bbf6e2013-02-08 18:50:55 -0800157 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER));
Jeff Johnsone7245742012-09-05 17:12:55 -0700158 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS)
159 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700160 limLog(pMac, LOGP, FL("tx_timer_deactivate failed!"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700161 return eSIR_FAILURE;
162 }
163
164 if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer,
165 psessionEntry->gLimChannelSwitch.switchTimeoutValue,
166 0) != TX_SUCCESS)
167 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700168 limLog(pMac, LOGP, FL("tx_timer_change failed "));
Jeff Johnsone7245742012-09-05 17:12:55 -0700169 return eSIR_FAILURE;
170 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700171
172 /* Follow the channel switch, forget about the previous quiet. */
173 //If quiet is running, chance is there to resume tx on its timeout.
174 //so stop timer for a safer side.
Jeff Johnsone7245742012-09-05 17:12:55 -0700175 if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN)
Jeff Johnson295189b2012-06-20 16:38:30 -0700176 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700177 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700178 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS)
179 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700180 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700181 return eSIR_FAILURE;
182 }
183 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700184 else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING)
Jeff Johnson295189b2012-06-20 16:38:30 -0700185 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700186 MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER));
Jeff Johnson295189b2012-06-20 16:38:30 -0700187 if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS)
188 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700189 limLog(pMac, LOGP, FL("tx_timer_deactivate failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700190 return eSIR_FAILURE;
191 }
192 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700193 psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT;
Jeff Johnson295189b2012-06-20 16:38:30 -0700194
195 /* Prepare for 11h channel switch */
196 limPrepareFor11hChannelSwitch(pMac, psessionEntry);
197
198 /** Dont add any more statements here as we posted finish scan request
199 * to HAL, wait till we get the response
200 */
201 return eSIR_SUCCESS;
202}
203
204
205/**
206 * __limProcessChannelSwitchActionFrame
207 *
208 *FUNCTION:
209 *
210 *LOGIC:
211 *
212 *ASSUMPTIONS:
213 *
214 *NOTE:
215 *
216 * @param pMac - Pointer to Global MAC structure
217 * @param *pRxPacketInfo - A pointer to packet info structure
218 * @return None
219 */
220
221static void
222
223__limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
224{
225
226 tpSirMacMgmtHdr pHdr;
227 tANI_U8 *pBody;
228 tDot11fChannelSwitch *pChannelSwitchFrame;
229 tANI_U16 beaconPeriod;
230 tANI_U32 val;
231 tANI_U32 frameLen;
232 tANI_U32 nStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -0700233
234 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
235 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
236 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
237
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700238 PELOG3(limLog(pMac, LOG3, FL("Received Channel switch action frame"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700239 if (!psessionEntry->lim11hEnable)
240 return;
241
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530242 pChannelSwitchFrame = vos_mem_malloc(sizeof(*pChannelSwitchFrame));
243 if (NULL == pChannelSwitchFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -0700244 {
245 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530246 FL("AllocateMemory failed"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700247 return;
248 }
249
250 /* Unpack channel switch frame */
251 nStatus = dot11fUnpackChannelSwitch(pMac, pBody, frameLen, pChannelSwitchFrame);
252
253 if( DOT11F_FAILED( nStatus ))
254 {
255 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700256 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700257 nStatus,
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700258 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530259 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700260 return;
261 }
262 else if(DOT11F_WARNED( nStatus ))
263 {
264 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700265 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700266 nStatus,
267 frameLen);
268 }
269
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530270 if (vos_mem_compare((tANI_U8 *) &psessionEntry->bssId,
271 (tANI_U8 *) &pHdr->sa,
272 sizeof(tSirMacAddr)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700273 {
274 #if 0
275 if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS)
276 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530277 vos_mem_free(pChannelSwitchFrame);
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700278 limLog(pMac, LOGP, FL("could not retrieve Beacon interval"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700279 return;
280 }
281 #endif// TO SUPPORT BT-AMP
282
283 /* copy the beacon interval from psessionEntry*/
284 val = psessionEntry->beaconParams.beaconInterval;
285
286 beaconPeriod = (tANI_U16) val;
287
Jeff Johnsone7245742012-09-05 17:12:55 -0700288 psessionEntry->gLimChannelSwitch.primaryChannel = pChannelSwitchFrame->ChanSwitchAnn.newChannel;
289 psessionEntry->gLimChannelSwitch.switchCount = pChannelSwitchFrame->ChanSwitchAnn.switchCount;
290 psessionEntry->gLimChannelSwitch.switchTimeoutValue = SYS_MS_TO_TICKS(beaconPeriod) *
291 psessionEntry->gLimChannelSwitch.switchCount;
292 psessionEntry->gLimChannelSwitch.switchMode = pChannelSwitchFrame->ChanSwitchAnn.switchMode;
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700293#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700294 if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability)
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700295 {
296 psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth;
297 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0;
298 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq1;
299 }
300#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700301
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700302 PELOG3(limLog(pMac, LOG3, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"),
Jeff Johnsone7245742012-09-05 17:12:55 -0700303 psessionEntry->gLimChannelSwitch.switchTimeoutValue);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700304
305 /* Only primary channel switch element is present */
Jeff Johnsone7245742012-09-05 17:12:55 -0700306 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
307 psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED;
Jeff Johnson295189b2012-06-20 16:38:30 -0700308
Jeff Johnsone7245742012-09-05 17:12:55 -0700309 if (psessionEntry->htSupportedChannelWidthSet)
Jeff Johnson295189b2012-06-20 16:38:30 -0700310 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700311 if ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
312 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))
Jeff Johnson295189b2012-06-20 16:38:30 -0700313 {
Jeff Johnsone7245742012-09-05 17:12:55 -0700314 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
315 psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset;
Jeff Johnson295189b2012-06-20 16:38:30 -0700316 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700317#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700318 if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present)
319 {
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700320 if (pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
321 {
322 if (pChannelSwitchFrame->ExtChanSwitchAnn.present && ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) ||
323 (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)))
324 {
325 psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700326 psessionEntry->gLimChannelSwitch.secondarySubBand =
327 limGet11ACPhyCBState(pMac,
328 psessionEntry->gLimChannelSwitch.primaryChannel,
329 pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset,
330 pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0,
331 psessionEntry);
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700332 }
333 }
334 }
335#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700336 }
337
338 }
339 else
340 {
341 PELOG1(limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));)
342 }
343
344 if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry))
345 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700346 PELOG1(limLog(pMac, LOG1, FL("Could not start channel switch"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700347 }
348
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530349 vos_mem_free(pChannelSwitchFrame);
Jeff Johnson295189b2012-06-20 16:38:30 -0700350 return;
351} /*** end limProcessChannelSwitchActionFrame() ***/
352
353
Mohit Khanna4a70d262012-09-11 16:30:12 -0700354#ifdef WLAN_FEATURE_11AC
355static void
356__limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
357{
358
359 tpSirMacMgmtHdr pHdr;
360 tANI_U8 *pBody;
361 tDot11fOperatingMode *pOperatingModeframe;
362 tANI_U32 frameLen;
363 tANI_U32 nStatus;
Mohit Khanna4a70d262012-09-11 16:30:12 -0700364 tpDphHashNode pSta;
365 tANI_U16 aid;
366 tANI_U8 operMode;
367
368 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
369 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
370 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
371
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700372 PELOG3(limLog(pMac, LOG3, FL("Received Operating Mode action frame"));)
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530373 pOperatingModeframe = vos_mem_malloc(sizeof(*pOperatingModeframe));
374 if (NULL == pOperatingModeframe)
Mohit Khanna4a70d262012-09-11 16:30:12 -0700375 {
376 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530377 FL("AllocateMemory failed"));
Mohit Khanna4a70d262012-09-11 16:30:12 -0700378 return;
379 }
380
381 /* Unpack channel switch frame */
382 nStatus = dot11fUnpackOperatingMode(pMac, pBody, frameLen, pOperatingModeframe);
383
384 if( DOT11F_FAILED( nStatus ))
385 {
386 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700387 FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700388 nStatus,
389 frameLen);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530390 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700391 return;
392 }
393 else if(DOT11F_WARNED( nStatus ))
394 {
395 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700396 FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700397 nStatus,
398 frameLen);
399 }
400 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
401
402 operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ;
403 if( operMode != pOperatingModeframe->OperatingMode.chanWidth)
404 {
405 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700406 FL(" received Chanwidth %d, staIdx = %d"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700407 (pOperatingModeframe->OperatingMode.chanWidth ),
408 pSta->staIndex);
409
410 limLog(pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700411 FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"),
Mohit Khanna4a70d262012-09-11 16:30:12 -0700412 pHdr->sa[0],
413 pHdr->sa[1],
414 pHdr->sa[2],
415 pHdr->sa[3],
416 pHdr->sa[4],
417 pHdr->sa[5]);
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700418
Mohit Khanna4a70d262012-09-11 16:30:12 -0700419 if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ)
420 {
421 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
422 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
423 }
424 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ)
425 {
426 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
427 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ;
428 }
429 else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ)
430 {
431 pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
432 pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ;
433 }
434 limCheckVHTOpModeChange( pMac, psessionEntry,
435 (pOperatingModeframe->OperatingMode.chanWidth), pSta->staIndex);\
436 }
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530437 vos_mem_free(pOperatingModeframe);
Mohit Khanna4a70d262012-09-11 16:30:12 -0700438 return;
439}
440#endif
441
Jeff Johnson295189b2012-06-20 16:38:30 -0700442static void
443__limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
444{
Jeff Johnson295189b2012-06-20 16:38:30 -0700445}
446
447
448static void
449__limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
450{
451 tSirAddtsRspInfo addts;
452 tSirRetStatus retval;
453 tpSirMacMgmtHdr pHdr;
454 tpDphHashNode pSta;
455 tANI_U16 aid;
456 tANI_U32 frameLen;
457 tANI_U8 *pBody;
458 tpLimTspecInfo tspecInfo;
459 tANI_U8 ac;
460 tpDphHashNode pStaDs = NULL;
461 tANI_U8 rspReqd = 1;
462 tANI_U32 cfgLen;
463 tSirMacAddr peerMacAddr;
464
465
466 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
467 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
468 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
469
470
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700471 PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700472 if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))
473 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700474 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700475 return;
476 }
477
478 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
479 if (pSta == NULL)
480 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700481 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700482 return;
483 }
484
485 retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts);
486 if (retval != eSIR_SUCCESS)
487 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700488 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700489 return;
490 }
491
492 // don't have to check for qos/wme capabilities since we wouldn't have this
493 // flag set otherwise
494 if (! pMac->lim.gLimAddtsSent)
495 {
496 // we never sent an addts request!
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700497 PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring");)
Jeff Johnson295189b2012-06-20 16:38:30 -0700498 return;
499 }
500
501 if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken)
502 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700503 limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring",
Jeff Johnson295189b2012-06-20 16:38:30 -0700504 addts.dialogToken, pMac->lim.gLimAddtsReq.req.dialogToken);
505 return;
506 }
507
508 /*
509 * for successful addts reponse, try to add the classifier.
510 * if this fails for any reason, we should send a delts request to the ap
511 * for now, its ok not to send a delts since we are going to add support for
512 * multiple tclas soon and until then we won't send any addts requests with
513 * multiple tclas elements anyway.
514 * In case of addClassifier failure, we just let the addts timer run out
515 */
516 if (((addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
517 (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) &&
518 (addts.status == eSIR_MAC_SUCCESS_STATUS))
519 {
520 // add the classifier - this should always succeed
521 if (addts.numTclas > 1) // currently no support for multiple tclas elements
522 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700523 limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700524 aid, addts.numTclas);
525 return;
526 }
527 else if (addts.numTclas == 1)
528 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700529 limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!", aid,
Jeff Johnson295189b2012-06-20 16:38:30 -0700530 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio);
531 }
532 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700533 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700534 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
535 addts.status);
536
537 // deactivate the response timer
538 limDeactivateAndChangeTimer(pMac, eLIM_ADDTS_RSP_TIMER);
539
540 if (addts.status != eSIR_MAC_SUCCESS_STATUS)
541 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700542 limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ",
Jeff Johnson295189b2012-06-20 16:38:30 -0700543 addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio,
544 addts.status);
545 limSendSmeAddtsRsp(pMac, true, addts.status, psessionEntry, addts.tspec,
546 psessionEntry->smeSessionId, psessionEntry->transactionId);
547
548 // clear the addts flag
549 pMac->lim.gLimAddtsSent = false;
550
551 return;
552 }
553#ifdef FEATURE_WLAN_CCX
554 if (addts.tsmPresent)
555 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700556 limLog(pMac, LOGW, "TSM IE Present");
Jeff Johnson295189b2012-06-20 16:38:30 -0700557 psessionEntry->ccxContext.tsm.tid = addts.tspec.tsinfo.traffic.userPrio;
558 vos_mem_copy(&psessionEntry->ccxContext.tsm.tsmInfo,
559 &addts.tsmIE,sizeof(tSirMacCCXTSMIE));
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700560#ifdef FEATURE_WLAN_CCX_UPLOAD
561 limSendSmeTsmIEInd(pMac, psessionEntry, addts.tsmIE.tsid,
562 addts.tsmIE.state, addts.tsmIE.msmt_interval);
563#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700564 limActivateTSMStatsTimer(pMac, psessionEntry);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700565#endif /* FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700566 }
567#endif
568 /* Since AddTS response was successful, check for the PSB flag
569 * and directional flag inside the TS Info field.
570 * An AC is trigger enabled AC if the PSB subfield is set to 1
571 * in the uplink direction.
572 * An AC is delivery enabled AC if the PSB subfield is set to 1
573 * in the downlink direction.
574 * An AC is trigger and delivery enabled AC if the PSB subfield
575 * is set to 1 in the bi-direction field.
576 */
577 if (addts.tspec.tsinfo.traffic.psb == 1)
578 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, SET_UAPSD_MASK);
579 else
580 limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, CLEAR_UAPSD_MASK);
581
582
583 /* ADDTS success, so AC is now admitted. We shall now use the default
584 * EDCA parameters as advertised by AP and send the updated EDCA params
585 * to HAL.
586 */
587 ac = upToAc(addts.tspec.tsinfo.traffic.userPrio);
588 if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK)
589 {
590 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
591 }
592 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK)
593 {
594 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
595 }
596 else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR)
597 {
598 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac);
599 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac);
600 }
601
602 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
603
604 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
605 if (pStaDs != NULL)
606 {
607 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
608 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
609 else
610 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
611 }
612 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700613 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700614
615
616 sirCopyMacAddr(peerMacAddr,psessionEntry->bssId);
617
618 //if schedule is not present then add TSPEC with svcInterval as 0.
619 if(!addts.schedulePresent)
620 addts.schedule.svcInterval = 0;
621 if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, &addts.tspec, addts.schedule.svcInterval, &tspecInfo))
622 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700623 PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700624 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
625 psessionEntry);
626 pMac->lim.gLimAddtsSent = false;
627 return; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status.
628 }
629 if((addts.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA) ||
Madan Mohan Koyyalamudi198ade32013-09-29 03:52:25 +0530630 ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC)))
Jeff Johnson295189b2012-06-20 16:38:30 -0700631 {
632 retval = limSendHalMsgAddTs(pMac, pSta->staIndex, tspecInfo->idx, addts.tspec, psessionEntry->peSessionId);
633 if(eSIR_SUCCESS != retval)
634 {
635 limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecInfo->idx);
636
637 // Send DELTS action frame to AP
638 cfgLen = sizeof(tSirMacAddr);
639 limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec,
640 psessionEntry);
641 limSendSmeAddtsRsp(pMac, true, retval, psessionEntry, addts.tspec,
642 psessionEntry->smeSessionId, psessionEntry->transactionId);
643 pMac->lim.gLimAddtsSent = false;
644 return;
645 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700646 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700647 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
648 }
649 else
650 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700651 PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700652 addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);)
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700653 PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700654 // Use the smesessionId and smetransactionId from the PE session context
655 limSendSmeAddtsRsp(pMac, true, eSIR_SME_SUCCESS, psessionEntry, addts.tspec,
656 psessionEntry->smeSessionId, psessionEntry->transactionId);
657 }
658
659 // clear the addts flag
660 pMac->lim.gLimAddtsSent = false;
661 return;
662}
663
664
665static void
666__limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
667{
668 tSirRetStatus retval;
669 tSirDeltsReqInfo delts;
670 tpSirMacMgmtHdr pHdr;
671 tpDphHashNode pSta;
672 tANI_U32 frameLen;
673 tANI_U16 aid;
674 tANI_U8 *pBody;
675 tANI_U8 tsStatus;
676 tSirMacTSInfo *tsinfo;
677 tANI_U8 tspecIdx;
678 tANI_U8 ac;
679 tpDphHashNode pStaDs = NULL;
680
681
682 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
683 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
684 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
685
686 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable);
687 if (pSta == NULL)
688 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700689 PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700690 return;
691 }
692
693 // parse the delts request
694 retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts);
695 if (retval != eSIR_SUCCESS)
696 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700697 PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)"), retval);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700698 return;
699 }
700
701 if (delts.wmeTspecPresent)
702 {
703 if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled))
704 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700705 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700706 return;
707 }
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700708 PELOG2(limLog(pMac, LOG2, FL("WME Delts received"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700709 }
710 else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled)
711 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700712 PELOG2(limLog(pMac, LOG2, FL("11e QoS Delts received"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700713 }
714 else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled)
715 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700716 PELOG2(limLog(pMac, LOG2, FL("WSM Delts received"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700717 }
718 else
719 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700720 PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700721 return;
722 }
723
724 tsinfo = delts.wmeTspecPresent ? &delts.tspec.tsinfo : &delts.tsinfo;
725
726 // if no Admit Control, ignore the request
727 if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA))
728 {
729
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530730 if (upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC)
Jeff Johnson295189b2012-06-20 16:38:30 -0700731 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700732 limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700733 tsinfo->traffic.userPrio);
734 return;
735 }
736 }
737
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530738 if ((psessionEntry->limSystemRole != eLIM_AP_ROLE) &&
739 (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE))
740 limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry);
741
Jeff Johnson295189b2012-06-20 16:38:30 -0700742 // try to delete the TS
743 if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx))
744 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700745 PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700746 return;
747 }
748
749 else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) ||
750 (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH))
751 {
752 //Edca only for now.
753 }
754 else
755 {
756 //send message to HAL to delete TS
Madan Mohan Koyyalamudic0a75a42013-10-07 04:20:49 +0530757 if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac,
758 pSta->staIndex,
759 tspecIdx,
760 delts,
761 psessionEntry->peSessionId,
762 psessionEntry->bssId))
Jeff Johnson295189b2012-06-20 16:38:30 -0700763 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700764 limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700765 tsinfo->traffic.userPrio);
766 return;
767 }
768 }
769
770 /* We successfully deleted the TSPEC. Update the dynamic UAPSD Mask.
771 * The AC for this TSPEC is no longer trigger enabled if this Tspec
772 * was set-up in uplink direction only.
773 * The AC for this TSPEC is no longer delivery enabled if this Tspec
774 * was set-up in downlink direction only.
775 * The AC for this TSPEC is no longer triiger enabled and delivery
776 * enabled if this Tspec was a bidirectional TSPEC.
777 */
778 limSetTspecUapsdMask(pMac, tsinfo, CLEAR_UAPSD_MASK);
779
780
781 /* We're deleting the TSPEC.
782 * The AC for this TSPEC is no longer admitted in uplink/downlink direction
783 * if this TSPEC was set-up in uplink/downlink direction only.
784 * The AC for this TSPEC is no longer admitted in both uplink and downlink
785 * directions if this TSPEC was a bi-directional TSPEC.
786 * If ACM is set for this AC and this AC is admitted only in downlink
787 * direction, PE needs to downgrade the EDCA parameter
788 * (for the AC for which TS is being deleted) to the
789 * next best AC for which ACM is not enabled, and send the
790 * updated values to HAL.
791 */
792 ac = upToAc(tsinfo->traffic.userPrio);
793
794 if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK)
795 {
796 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
797 }
798 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK)
799 {
800 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
801 }
802 else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR)
803 {
804 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac);
805 pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac);
806 }
807
808 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
809
810 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
811 if (pStaDs != NULL)
812 {
813 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
814 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
815 else
816 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
817 }
818 else
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700819 limLog(pMac, LOGE, FL("Self entry missing in Hash Table "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700820
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700821 PELOG1(limLog(pMac, LOG1, FL("DeleteTS succeeded"));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700822
823#ifdef FEATURE_WLAN_CCX
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700824#ifdef FEATURE_WLAN_CCX_UPLOAD
825 limSendSmeTsmIEInd(pMac, psessionEntry, 0, 0, 0);
826#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700827 limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER);
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700828#endif /* FEATURE_WLAN_CCX_UPLOAD */
Jeff Johnson295189b2012-06-20 16:38:30 -0700829#endif
830
831}
832
833
834#ifdef ANI_SUPPORT_11H
835/**
836 * limProcessBasicMeasReq
837 *
838 *FUNCTION:
839 * This function is called by limProcessMeasurementRequestFrame()
840 * when it received a Basic measurement Request action frame.
841 * Station/BP receiving this should perform basic measurements
842 * and then send Basic Measurement Report. AP should not perform
843 * any measurements, and send report indicating refusal.
844 *
845 *LOGIC:
846 *
847 *ASSUMPTIONS:
848 *
849 *NOTE:
850 *
851 * @param pMac - Pointer to Global MAC structure
852 * @param pMeasReqFrame - A pointer to Basic Meas. Req structure
853 * @return None
854 */
855static void
856__limProcessBasicMeasReq(tpAniSirGlobal pMac,
857 tpSirMacMeasReqActionFrame pMeasReqFrame,
858 tSirMacAddr peerMacAddr)
859{
860 // TBD - Station shall perform basic measurements
861
862 if (limSendMeasReportFrame(pMac,
863 pMeasReqFrame,
864 peerMacAddr) != eSIR_SUCCESS)
865 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700866 PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700867 return;
868 }
869}
870
871
872/**
873 * limProcessCcaMeasReq
874 *
875 *FUNCTION:
876 * This function is called by limProcessMeasurementRequestFrame()
877 * when it received a CCA measurement Request action frame.
878 * Station/BP receiving this should perform CCA measurements
879 * and then send CCA Measurement Report. AP should not perform
880 * any measurements, and send report indicating refusal.
881 *
882 *LOGIC:
883 *
884 *ASSUMPTIONS:
885 *
886 *NOTE:
887 *
888 * @param pMac - Pointer to Global MAC structure
889 * @param pMeasReqFrame - A pointer to CCA Meas. Req structure
890 * @return None
891 */
892static void
893__limProcessCcaMeasReq(tpAniSirGlobal pMac,
894 tpSirMacMeasReqActionFrame pMeasReqFrame,
895 tSirMacAddr peerMacAddr)
896{
897 // TBD - Station shall perform cca measurements
898
899 if (limSendMeasReportFrame(pMac,
900 pMeasReqFrame,
901 peerMacAddr) != eSIR_SUCCESS)
902 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700903 PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700904 return;
905 }
906}
907
908
909/**
910 * __limProcessRpiMeasReq
911 *
912 *FUNCTION:
913 * This function is called by limProcessMeasurementRequestFrame()
914 * when it received a RPI measurement Request action frame.
915 * Station/BP/AP receiving this shall not perform any measurements,
916 * and send report indicating refusal.
917 *
918 *LOGIC:
919 *
920 *ASSUMPTIONS:
921 *
922 *NOTE:
923 *
924 * @param pMac - Pointer to Global MAC structure
925 * @param pMeasReqFrame - A pointer to RPI Meas. Req structure
926 * @return None
927 */
928static void
929__limProcessRpiMeasReq(tpAniSirGlobal pMac,
930 tpSirMacMeasReqActionFrame pMeasReqFrame,
931 tSirMacAddr peerMacAddr)
932{
933 if (limSendMeasReportFrame(pMac,
934 pMeasReqFrame,
935 peerMacAddr) != eSIR_SUCCESS)
936 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700937 PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700938 return;
939 }
940}
941
942
943/**
944 * __limProcessMeasurementRequestFrame
945 *
946 *FUNCTION:
947 *
948 *LOGIC:
949 *
950 *ASSUMPTIONS:
951 *
952 *NOTE:
953 *
954 * @param pMac - Pointer to Global MAC structure
955 * @param *pRxPacketInfo - A pointer to packet info structure
956 * @return None
957 */
958
959static void
960__limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
961{
962 tpSirMacMgmtHdr pHdr;
963 tANI_U8 *pBody;
964 tpSirMacMeasReqActionFrame pMeasReqFrame;
965 tANI_U32 frameLen;
966
967 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
968 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
969 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
970
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530971 pMeasReqFrame = vos_mem_malloc(sizeof( tSirMacMeasReqActionFrame ));
972 if (NULL == pMeasReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -0700973 {
974 limLog(pMac, LOGE,
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530975 FL("limProcessMeasurementRequestFrame: AllocateMemory failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -0700976 return;
977 }
978
979 if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) !=
980 eSIR_SUCCESS)
981 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -0700982 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -0700983 return;
984 }
985
986
987 switch(pMeasReqFrame->measReqIE.measType)
988 {
989 case SIR_MAC_BASIC_MEASUREMENT_TYPE:
990 __limProcessBasicMeasReq(pMac, pMeasReqFrame, pHdr->sa);
991 break;
992
993 case SIR_MAC_CCA_MEASUREMENT_TYPE:
994 __limProcessCcaMeasReq(pMac, pMeasReqFrame, pHdr->sa);
995 break;
996
997 case SIR_MAC_RPI_MEASUREMENT_TYPE:
998 __limProcessRpiMeasReq(pMac, pMeasReqFrame, pHdr->sa);
999 break;
1000
1001 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001002 PELOG1(limLog(pMac, LOG1, FL("Unknown Measurement Type %d "),
Jeff Johnson295189b2012-06-20 16:38:30 -07001003 pMeasReqFrame->measReqIE.measType);)
1004 break;
1005 }
1006
1007} /*** end limProcessMeasurementRequestFrame ***/
1008
1009
1010/**
1011 * limProcessTpcRequestFrame
1012 *
1013 *FUNCTION:
1014 * This function is called upon receiving Tpc Request frame.
1015 *
1016 *NOTE:
1017 *
1018 * @param pMac - Pointer to Global MAC structure
1019 * @param *pRxPacketInfo - A pointer to packet info structure
1020 * @return None
1021 */
1022
1023static void
1024__limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
1025{
1026 tpSirMacMgmtHdr pHdr;
1027 tANI_U8 *pBody;
1028 tpSirMacTpcReqActionFrame pTpcReqFrame;
1029 tANI_U32 frameLen;
1030
1031 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1032 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1033 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1034
1035 PELOG1(limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));)
1036
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301037 pTpcReqFrame = vos_mem_malloc(sizeof( tSirMacTpcReqActionFrame ));
1038 if (NULL == pTpcReqFrame)
Jeff Johnson295189b2012-06-20 16:38:30 -07001039 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301040 PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001041 return;
1042 }
1043
1044 if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) !=
1045 eSIR_SUCCESS)
1046 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001047 PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001048 return;
1049 }
1050
1051 if (limSendTpcReportFrame(pMac,
1052 pTpcReqFrame,
1053 pHdr->sa) != eSIR_SUCCESS)
1054 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001055 PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. "));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001056 return;
1057 }
1058}
1059#endif
1060
1061
1062/**
1063 * \brief Validate an ADDBA Req from peer with respect
1064 * to our own BA configuration
1065 *
1066 * \sa __limValidateAddBAParameterSet
1067 *
1068 * \param pMac The global tpAniSirGlobal object
1069 *
1070 * \param baParameterSet The ADDBA Parameter Set.
1071 *
1072 * \param pDelBAFlag this parameter is NULL except for call from processAddBAReq
1073 * delBAFlag is set when entry already exists.
1074 *
1075 * \param reqType ADDBA Req v/s ADDBA Rsp
1076 * 1 - ADDBA Req
1077 * 0 - ADDBA Rsp
1078 *
1079 * \return eSIR_SUCCESS if setup completes successfully
1080 * eSIR_FAILURE is some problem is encountered
1081 */
1082
1083static tSirMacStatusCodes
1084__limValidateAddBAParameterSet( tpAniSirGlobal pMac,
1085 tpDphHashNode pSta,
1086 tDot11fFfAddBAParameterSet baParameterSet,
1087 tANI_U8 dialogueToken,
1088 tLimAddBaValidationReqType reqType ,
1089 tANI_U8* pDelBAFlag /*this parameter is NULL except for call from processAddBAReq*/)
1090{
1091 if(baParameterSet.tid >= STACFG_MAX_TC)
1092 {
1093 return eSIR_MAC_WME_INVALID_PARAMS_STATUS;
1094 }
1095
1096 //check if there is already a BA session setup with this STA/TID while processing AddBaReq
1097 if((true == pSta->tcCfg[baParameterSet.tid].fUseBARx) &&
1098 (LIM_ADDBA_REQ == reqType))
1099 {
1100 //There is already BA session setup for STA/TID.
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001101 limLog( pMac, LOGE,
Jeff Johnson295189b2012-06-20 16:38:30 -07001102 FL( "AddBAReq rcvd when there is already a session for this StaId = %d, tid = %d\n " ),
1103 pSta->staIndex, baParameterSet.tid);
1104 limPrintMacAddr( pMac, pSta->staAddr, LOGW );
1105
1106 if(pDelBAFlag)
1107 *pDelBAFlag = true;
1108 }
1109 return eSIR_MAC_SUCCESS_STATUS;
1110}
1111
1112/**
1113 * \brief Validate a DELBA Ind from peer with respect
1114 * to our own BA configuration
1115 *
1116 * \sa __limValidateDelBAParameterSet
1117 *
1118 * \param pMac The global tpAniSirGlobal object
1119 *
1120 * \param baParameterSet The DELBA Parameter Set.
1121 *
1122 * \param pSta Runtime, STA-related configuration cached
1123 * in the HashNode object
1124 *
1125 * \return eSIR_SUCCESS if setup completes successfully
1126 * eSIR_FAILURE is some problem is encountered
1127 */
1128static tSirMacStatusCodes
1129__limValidateDelBAParameterSet( tpAniSirGlobal pMac,
1130 tDot11fFfDelBAParameterSet baParameterSet,
1131 tpDphHashNode pSta )
1132{
1133tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS;
1134
1135 // Validate if a BA is active for the requested TID
1136 if( pSta->tcCfg[baParameterSet.tid].fUseBATx ||
1137 pSta->tcCfg[baParameterSet.tid].fUseBARx )
1138 {
1139 statusCode = eSIR_MAC_SUCCESS_STATUS;
1140
1141 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001142 FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL..."));
Jeff Johnson295189b2012-06-20 16:38:30 -07001143 }
1144 else
1145 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001146 FL("Received an INVALID DELBA Ind for TID %d..."),
Jeff Johnson295189b2012-06-20 16:38:30 -07001147 baParameterSet.tid );
1148
1149 return statusCode;
1150}
1151
1152/**
1153 * \brief Process an ADDBA REQ
1154 *
1155 * \sa limProcessAddBAReq
1156 *
1157 * \param pMac The global tpAniSirGlobal object
1158 *
1159 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1160 *
1161 * \return none
1162 *
1163 */
1164static void
1165__limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1166{
1167 tDot11fAddBAReq frmAddBAReq;
1168 tpSirMacMgmtHdr pHdr;
1169 tpDphHashNode pSta;
1170 tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS;
1171 tANI_U16 aid;
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001172 tANI_U32 frameLen, nStatus,val;
Jeff Johnson295189b2012-06-20 16:38:30 -07001173 tANI_U8 *pBody;
1174 tANI_U8 delBAFlag =0;
1175
1176 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1177 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1178 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001179 val = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -07001180
1181 // Unpack the received frame
1182 nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq );
1183 if( DOT11F_FAILED( nStatus ))
1184 {
1185 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001186 FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001187 nStatus,
1188 frameLen );
1189
1190 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1191
1192 // Without an unpacked request we cannot respond, so silently ignore the request
1193 return;
1194 }
1195 else if ( DOT11F_WARNED( nStatus ) )
1196 {
1197 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001198 FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001199 nStatus,
1200 frameLen );
1201
1202 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1203 }
1204
Kiran Kumar Lokere2ac471f2013-05-30 16:08:48 -07001205 psessionEntry->amsduSupportedInBA = frmAddBAReq.AddBAParameterSet.amsduSupported;
1206
Jeff Johnson295189b2012-06-20 16:38:30 -07001207 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1208 if( pSta == NULL )
1209 {
1210 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001211 FL( "STA context not found - ignoring ADDBA from " ));
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001212 limPrintMacAddr( pMac, pHdr->sa, LOGE );
Jeff Johnson295189b2012-06-20 16:38:30 -07001213
1214 // FIXME - Should we do this?
1215 status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS;
1216 goto returnAfterError;
1217 }
1218
1219 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001220 FL( "ADDBA Req from STA with AID %d, tid = %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001221 aid, frmAddBAReq.AddBAParameterSet.tid);
1222
1223#ifdef WLAN_SOFTAP_VSTA_FEATURE
1224 // we can only do BA on "hard" STAs
1225 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1226 {
1227 status = eSIR_MAC_REQ_DECLINED_STATUS;
1228 goto returnAfterError;
1229 }
1230#endif //WLAN_SOFTAP_VSTA_FEATURE
1231
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001232 if (wlan_cfgGetInt(pMac, WNI_CFG_DEL_ALL_RX_BA_SESSIONS_2_4_G_BTC, &val) !=
1233 eSIR_SUCCESS)
1234 {
1235 limLog(pMac, LOGE,
1236 FL("Unable to get WNI_CFG_DEL_ALL_RX_BA_SESSIONS_2_4_G_BTC"));
1237 val = 0;
1238 }
1239 if ((SIR_BAND_2_4_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) &&
1240 val)
1241 {
1242 limLog( pMac, LOGW,
1243 FL( "BTC disabled aggregation - ignoring ADDBA from " ));
1244 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1245
1246 status = eSIR_MAC_REQ_DECLINED_STATUS;
1247 goto returnAfterError;
1248 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001249
1250 // Now, validate the ADDBA Req
1251 if( eSIR_MAC_SUCCESS_STATUS !=
1252 (status = __limValidateAddBAParameterSet( pMac, pSta,
1253 frmAddBAReq.AddBAParameterSet,
1254 0, //dialogue token is don't care in request validation.
1255 LIM_ADDBA_REQ, &delBAFlag)))
1256 goto returnAfterError;
1257
1258 //BA already set, so we need to delete it before adding new one.
1259 if(delBAFlag)
1260 {
1261 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1262 pSta,
1263 (tANI_U8)frmAddBAReq.AddBAParameterSet.tid,
1264 eBA_RECIPIENT,psessionEntry))
1265 {
1266 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1267 goto returnAfterError;
1268 }
1269 }
1270
1271 // Check if the ADD BA Declined configuration is Disabled
1272 if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001273 limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001274 frmAddBAReq.AddBAParameterSet.tid);
1275 status = eSIR_MAC_REQ_DECLINED_STATUS;
1276 goto returnAfterError;
1277 }
1278
1279 //
1280 // Post WDA_ADDBA_REQ to HAL.
1281 // If HAL/HDD decide to allow this ADDBA Req session,
1282 // then this BA session is termed active
1283 //
1284
1285 // Change the Block Ack state of this STA to wait for
1286 // ADDBA Rsp from HAL
1287 LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001288
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001289 if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS)
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001290 {
1291 limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT"));
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001292 return ;
Kiran Kumar Lokere495c6142013-04-01 20:52:41 -07001293 }
1294
1295
1296 if (frmAddBAReq.AddBAParameterSet.bufferSize)
1297 {
1298 frmAddBAReq.AddBAParameterSet.bufferSize =
1299 VOS_MIN(val, frmAddBAReq.AddBAParameterSet.bufferSize);
1300 }
1301 else
1302 {
1303 frmAddBAReq.AddBAParameterSet.bufferSize = val;
1304 }
Kiran Kumar Lokere458d7322013-05-29 14:29:43 -07001305 limLog( pMac, LOG1, FL( "ADDBAREQ NUMBUFF %d" ),
Madan Mohan Koyyalamudidd11eaf2012-11-02 16:04:21 -07001306 frmAddBAReq.AddBAParameterSet.bufferSize);
Jeff Johnson295189b2012-06-20 16:38:30 -07001307
1308 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1309 pSta,
1310 (tANI_U8) frmAddBAReq.DialogToken.token,
1311 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1312 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1313 frmAddBAReq.AddBAParameterSet.bufferSize,
1314 frmAddBAReq.BATimeout.timeout,
1315 (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn,
1316 eBA_RECIPIENT,psessionEntry))
1317 status = eSIR_MAC_UNSPEC_FAILURE_STATUS;
1318 else
1319 return;
1320
1321returnAfterError:
1322
1323 //
1324 // Package LIM_MLM_ADDBA_RSP to MLME, with proper
1325 // status code. MLME will then send an ADDBA RSP
1326 // over the air to the peer MAC entity
1327 //
1328 if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac,
1329 pHdr->sa,
1330 status,
1331 frmAddBAReq.DialogToken.token,
1332 (tANI_U8) frmAddBAReq.AddBAParameterSet.tid,
1333 (tANI_U8) frmAddBAReq.AddBAParameterSet.policy,
1334 frmAddBAReq.AddBAParameterSet.bufferSize,
1335 frmAddBAReq.BATimeout.timeout,psessionEntry))
1336 {
1337 limLog( pMac, LOGW,
1338 FL( "Failed to post LIM_MLM_ADDBA_RSP to " ));
1339 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1340 }
1341
1342}
1343
1344/**
1345 * \brief Process an ADDBA RSP
1346 *
1347 * \sa limProcessAddBARsp
1348 *
1349 * \param pMac The global tpAniSirGlobal object
1350 *
1351 * \param pRxPacketInfo Handle to the packet info structure from HDD
1352 *
1353 * \return none
1354 *
1355 */
1356static void
1357__limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1358{
1359tDot11fAddBARsp frmAddBARsp;
1360tpSirMacMgmtHdr pHdr;
1361tpDphHashNode pSta;
1362tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1363tANI_U16 aid;
1364tANI_U32 frameLen, nStatus;
1365tANI_U8 *pBody;
1366
1367 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1368 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1369 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1370
1371 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1372 if( pSta == NULL )
1373 {
1374 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001375 FL( "STA context not found - ignoring ADDBA from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001376 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1377 return;
1378 }
1379
1380#ifdef WLAN_SOFTAP_VSTA_FEATURE
1381 // We can only do BA on "hard" STAs. We should not have issued an ADDBA
1382 // Request, so we should never be processing a ADDBA Response
1383 if (!(IS_HWSTA_IDX(pSta->staIndex)))
1384 {
1385 return;
1386 }
1387#endif //WLAN_SOFTAP_VSTA_FEATURE
1388
1389 // Unpack the received frame
1390 nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp );
1391 if( DOT11F_FAILED( nStatus ))
1392 {
1393 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001394 FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001395 nStatus,
1396 frameLen );
1397
1398 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1399 goto returnAfterError;
1400 }
1401 else if ( DOT11F_WARNED( nStatus ) )
1402 {
1403 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001404 FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001405 nStatus,
1406 frameLen );
1407
1408 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1409 }
1410
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001411 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001412 FL( "ADDBA Rsp from STA with AID %d, tid = %d, status = %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001413 aid, frmAddBARsp.AddBAParameterSet.tid, frmAddBARsp.Status.status);
1414
1415 //if there is no matchin dialougue token then ignore the response.
1416
1417 if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token,
1418 pSta->assocId, frmAddBARsp.AddBAParameterSet.tid))
1419 {
Hoonki Lee9af07cf2013-04-24 01:21:58 -07001420 PELOGW(limLog(pMac, LOGE, FL("dialogueToken in received addBARsp did not match with outstanding requests"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001421 return;
1422 }
1423
1424 // Check first if the peer accepted the ADDBA Req
1425 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1426 {
1427 //if peer responded with buffer size 0 then we should pick the default.
1428 if(0 == frmAddBARsp.AddBAParameterSet.bufferSize)
1429 frmAddBARsp.AddBAParameterSet.bufferSize = BA_DEFAULT_TX_BUFFER_SIZE;
1430
1431 // Now, validate the ADDBA Rsp
1432 if( eSIR_MAC_SUCCESS_STATUS !=
1433 __limValidateAddBAParameterSet( pMac, pSta,
1434 frmAddBARsp.AddBAParameterSet,
1435 (tANI_U8)frmAddBARsp.DialogToken.token,
1436 LIM_ADDBA_RSP, NULL))
1437 goto returnAfterError;
1438 }
1439 else
1440 goto returnAfterError;
1441
1442 // Change STA state to wait for ADDBA Rsp from HAL
1443 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP);
1444
1445 //
1446 // Post WDA_ADDBA_REQ to HAL.
1447 // If HAL/HDD decide to allow this ADDBA Rsp session,
1448 // then this BA session is termed active
1449 //
1450
1451 if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac,
1452 pSta,
1453 (tANI_U8) frmAddBARsp.DialogToken.token,
1454 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1455 (tANI_U8) frmAddBARsp.AddBAParameterSet.policy,
1456 frmAddBARsp.AddBAParameterSet.bufferSize,
1457 frmAddBARsp.BATimeout.timeout,
1458 0,
1459 eBA_INITIATOR,psessionEntry))
1460 reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
1461 else
1462 return;
1463
1464returnAfterError:
1465
1466 // TODO: Do we need to signal an error status to SME,
1467 // if status != eSIR_MAC_SUCCESS_STATUS
1468
1469 // Restore STA "BA" State
1470 LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE);
1471 //
1472 // Need to send a DELBA IND to peer, who
1473 // would have setup a BA session with this STA
1474 //
1475 if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status )
1476 {
1477 //
1478 // Package LIM_MLM_DELBA_REQ to MLME, with proper
1479 // status code. MLME will then send a DELBA IND
1480 // over the air to the peer MAC entity
1481 //
1482 if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac,
1483 pSta,
1484 eBA_INITIATOR,
1485 (tANI_U8) frmAddBARsp.AddBAParameterSet.tid,
1486 reasonCode, psessionEntry))
1487 {
1488 limLog( pMac, LOGW,
1489 FL( "Failed to post LIM_MLM_DELBA_REQ to " ));
1490 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1491 }
1492 }
1493}
1494
1495/**
1496 * \brief Process a DELBA Indication
1497 *
1498 * \sa limProcessDelBAInd
1499 *
1500 * \param pMac The global tpAniSirGlobal object
1501 *
1502 * \param pRxPacketInfo Handle to the Rx packet info from HDD
1503 *
1504 * \return none
1505 *
1506 */
1507static void
1508__limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1509{
1510tDot11fDelBAInd frmDelBAInd;
1511tpSirMacMgmtHdr pHdr;
1512tpDphHashNode pSta;
1513tANI_U16 aid;
1514tANI_U32 frameLen, nStatus;
1515tANI_U8 *pBody;
1516
1517 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1518 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1519 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1520
1521 pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1522 if( pSta == NULL )
1523 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001524 limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001525 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1526 return;
1527 }
1528
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001529 limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid );
Jeff Johnson295189b2012-06-20 16:38:30 -07001530
1531 // Unpack the received frame
1532 nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd );
1533 if( DOT11F_FAILED( nStatus ))
1534 {
1535 limLog( pMac, LOGE,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001536 FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001537 nStatus,
1538 frameLen );
1539
1540 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1541 return;
1542 }
1543 else if ( DOT11F_WARNED( nStatus ) )
1544 {
1545 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001546 FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001547 nStatus,
1548 frameLen );
1549
1550 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1551 }
1552
1553 limLog( pMac, LOGW,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001554 FL( "Received DELBA for TID %d, Reason code %d" ),
Jeff Johnson295189b2012-06-20 16:38:30 -07001555 frmDelBAInd.DelBAParameterSet.tid,
1556 frmDelBAInd.Reason.code );
1557
1558 // Now, validate the DELBA Ind
1559 if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac,
1560 frmDelBAInd.DelBAParameterSet,
1561 pSta ))
1562 return;
1563
1564 //
1565 // Post WDA_DELBA_IND to HAL and delete the
1566 // existing BA session
1567 //
1568 // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16
1569 // is kind of confusing...
1570 //
1571 if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac,
1572 pSta,
1573 (tANI_U8) frmDelBAInd.DelBAParameterSet.tid,
1574 (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)?
1575 eBA_INITIATOR: eBA_RECIPIENT,psessionEntry))
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001576 limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed "));
Jeff Johnson295189b2012-06-20 16:38:30 -07001577
1578 return;
1579
1580}
1581
1582static void
1583__limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry)
1584{
1585
1586#if 0
1587 tpSirMacMgmtHdr pHdr;
1588 tDot11fSMPowerSave frmSMPower;
1589 tSirMacHTMIMOPowerSaveState state;
1590 tpDphHashNode pSta;
1591 tANI_U16 aid;
1592 tANI_U32 frameLen, nStatus;
1593 tANI_U8 *pBody;
1594
1595 pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd );
1596 pBody = SIR_MAC_BD_TO_MPDUDATA( pBd );
1597 frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd );
1598
1599 pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable );
1600 if( pSta == NULL ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001601 limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " ));
Jeff Johnson295189b2012-06-20 16:38:30 -07001602 limPrintMacAddr( pMac, pHdr->sa, LOGW );
1603 return;
1604 }
1605
1606 /**Unpack the received frame */
1607 nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower);
1608
1609 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001610 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001611 nStatus, frameLen );
1612 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1613 return;
1614 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001615 limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001616 nStatus, frameLen );
1617 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1618 }
1619
1620 limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d"
1621 "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En,
1622 frmSMPower.SMPowerModeSet.Mode);
1623
1624 /** Update in the DPH Table about the Update in the SM Power Save mode*/
1625 if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode)
1626 state = eSIR_HT_MIMO_PS_DYNAMIC;
1627 else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0))
1628 state = eSIR_HT_MIMO_PS_STATIC;
1629 else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0))
1630 state = eSIR_HT_MIMO_PS_NO_LIMIT;
1631 else {
1632 PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));)
1633 return;
1634 }
1635
1636 if (state == pSta->htMIMOPSState) {
1637 PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));)
1638 return;
1639 }
1640
1641 /** Update in the HAL Station Table for the Update of the Protection Mode */
1642 pSta->htMIMOPSState = state;
1643 limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState);
1644
1645#endif
1646
1647}
1648
1649#if defined WLAN_FEATURE_VOWIFI
1650
1651static void
1652__limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1653{
1654 tpSirMacMgmtHdr pHdr;
1655 tDot11fRadioMeasurementRequest frm;
1656 tANI_U32 frameLen, nStatus;
1657 tANI_U8 *pBody;
1658
1659 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1660 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1661 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1662
1663 if( psessionEntry == NULL )
1664 {
1665 return;
1666 }
1667
1668 /**Unpack the received frame */
1669 nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm );
1670
1671 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001672 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001673 nStatus, frameLen );
1674 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1675 return;
1676 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001677 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001678 nStatus, frameLen );
1679 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1680 }
1681
1682 // Call rrm function to handle the request.
1683
1684 rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry );
1685}
1686
1687static void
1688__limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1689{
1690 tpSirMacMgmtHdr pHdr;
1691 tDot11fLinkMeasurementRequest frm;
1692 tANI_U32 frameLen, nStatus;
1693 tANI_U8 *pBody;
1694
1695 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1696 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1697 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1698
1699 if( psessionEntry == NULL )
1700 {
1701 return;
1702 }
1703
1704 /**Unpack the received frame */
1705 nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm );
1706
1707 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001708 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001709 nStatus, frameLen );
1710 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1711 return;
1712 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001713 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001714 nStatus, frameLen );
1715 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1716 }
1717
1718 // Call rrm function to handle the request.
1719
1720 rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry );
1721
1722}
1723
1724static void
1725__limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry )
1726{
1727 tpSirMacMgmtHdr pHdr;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001728 tDot11fNeighborReportResponse *pFrm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001729 tANI_U32 frameLen, nStatus;
1730 tANI_U8 *pBody;
1731
1732 pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo );
1733 pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo );
1734 frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo );
1735
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301736 pFrm = vos_mem_malloc(sizeof(tDot11fNeighborReportResponse));
1737 if (NULL == pFrm)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001738 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301739 limLog(pMac, LOGE, FL("Unable to allocate memory in __limProcessNeighborReport") );
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001740 return;
1741 }
1742
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301743 if(psessionEntry == NULL)
Jeff Johnson295189b2012-06-20 16:38:30 -07001744 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301745 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001746 return;
1747 }
1748
1749 /**Unpack the received frame */
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001750 nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm );
Jeff Johnson295189b2012-06-20 16:38:30 -07001751
1752 if( DOT11F_FAILED( nStatus )) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001753 limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001754 nStatus, frameLen );
1755 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301756 vos_mem_free(pFrm);
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001757 return;
Jeff Johnson295189b2012-06-20 16:38:30 -07001758 }else if ( DOT11F_WARNED( nStatus ) ) {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001759 limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001760 nStatus, frameLen );
1761 PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );)
1762 }
1763
1764 //Call rrm function to handle the request.
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07001765 rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry );
1766
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301767 vos_mem_free(pFrm);
Jeff Johnson295189b2012-06-20 16:38:30 -07001768}
1769
1770#endif
1771
1772#ifdef WLAN_FEATURE_11W
1773/**
Chet Lanctot186b5732013-03-18 10:26:30 -07001774 * limProcessSAQueryRequestActionFrame
Jeff Johnson295189b2012-06-20 16:38:30 -07001775 *
1776 *FUNCTION:
1777 * This function is called by limProcessActionFrame() upon
1778 * SA query request Action frame reception.
1779 *
1780 *LOGIC:
1781 *
1782 *ASSUMPTIONS:
1783 *
1784 *NOTE:
1785 *
1786 * @param pMac - Pointer to Global MAC structure
Chet Lanctot186b5732013-03-18 10:26:30 -07001787 * @param *pRxPacketInfo - Handle to the Rx packet info
1788 * @param psessionEntry - PE session entry
1789 *
Jeff Johnson295189b2012-06-20 16:38:30 -07001790 * @return None
1791 */
Chet Lanctot186b5732013-03-18 10:26:30 -07001792static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -07001793{
1794 tpSirMacMgmtHdr pHdr;
1795 tANI_U8 *pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07001796 tANI_U8 transId[2];
Jeff Johnson295189b2012-06-20 16:38:30 -07001797
1798 /* Prima --- Below Macro not available in prima
1799 pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd);
1800 pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */
1801
1802 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1803 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1804
Chet Lanctot186b5732013-03-18 10:26:30 -07001805 /* If this is an unprotected SA Query Request, then ignore it. */
1806 if (pHdr->fc.wep == 0)
1807 return;
1808
Jeff Johnson295189b2012-06-20 16:38:30 -07001809 /*Extract 11w trsansId from SA query request action frame
1810 In SA query response action frame we will send same transId
1811 In SA query request action frame:
1812 Category : 1 byte
1813 Action : 1 byte
Chet Lanctot186b5732013-03-18 10:26:30 -07001814 Transaction ID : 2 bytes */
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301815 vos_mem_copy(&transId[0], &pBody[2], 2);
Jeff Johnson295189b2012-06-20 16:38:30 -07001816
Jeff Johnson295189b2012-06-20 16:38:30 -07001817 //Send 11w SA query response action frame
1818 if (limSendSaQueryResponseFrame(pMac,
1819 transId,
1820 pHdr->sa,psessionEntry) != eSIR_SUCCESS)
1821 {
Chet Lanctot186b5732013-03-18 10:26:30 -07001822 PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));)
Jeff Johnson295189b2012-06-20 16:38:30 -07001823 return;
1824 }
1825}
1826
Chet Lanctot186b5732013-03-18 10:26:30 -07001827/**
1828 * __limProcessSAQueryResponseActionFrame
1829 *
1830 *FUNCTION:
1831 * This function is called by limProcessActionFrame() upon
1832 * SA query response Action frame reception.
1833 *
1834 *LOGIC:
1835 *
1836 *ASSUMPTIONS:
1837 *
1838 *NOTE:
1839 *
1840 * @param pMac - Pointer to Global MAC structure
1841 * @param *pRxPacketInfo - Handle to the Rx packet info
1842 * @param psessionEntry - PE session entry
1843 * @return None
1844 */
1845static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry)
1846{
1847 tpSirMacMgmtHdr pHdr;
1848 tANI_U32 frameLen;
1849
1850 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1851 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
1852 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
1853 ("SA Query Response received...")) ;
1854 /* Forward to the SME to HDD to wpa_supplicant */
1855 // type is ACTION
1856 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
1857 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
1858 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
1859}
1860
Jeff Johnson295189b2012-06-20 16:38:30 -07001861#endif
1862
1863/**
1864 * limProcessActionFrame
1865 *
1866 *FUNCTION:
1867 * This function is called by limProcessMessageQueue() upon
1868 * Action frame reception.
1869 *
1870 *LOGIC:
1871 *
1872 *ASSUMPTIONS:
1873 *
1874 *NOTE:
1875 *
1876 * @param pMac - Pointer to Global MAC structure
1877 * @param *pRxPacketInfo - A pointer to packet info structure
1878 * @return None
1879 */
1880
1881void
1882limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
1883{
1884 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
1885 tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody;
Chet Lanctot186b5732013-03-18 10:26:30 -07001886#ifdef WLAN_FEATURE_11W
1887 tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
1888#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001889
Jeff Johnson295189b2012-06-20 16:38:30 -07001890 switch (pActionHdr->category)
1891 {
1892 case SIR_MAC_ACTION_QOS_MGMT:
Chet Lanctot186b5732013-03-18 10:26:30 -07001893#ifdef WLAN_FEATURE_11W
1894 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
1895 {
1896 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
1897 "since RMF is enabled."), pActionHdr->category);)
1898 break;
1899 }
1900#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001901 if (psessionEntry->limQosEnabled)
1902 {
1903 switch (pActionHdr->actionID)
1904 {
1905 case SIR_MAC_QOS_ADD_TS_REQ:
1906 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1907 break;
1908
1909 case SIR_MAC_QOS_ADD_TS_RSP:
1910 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1911 break;
1912
1913 case SIR_MAC_QOS_DEL_TS_REQ:
1914 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1915 break;
1916
1917 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001918 PELOGE(limLog(pMac, LOGE, FL("Qos action %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001919 break;
1920 }
1921 break ;
1922 }
1923
1924 break;
1925
1926 case SIR_MAC_ACTION_SPECTRUM_MGMT:
Chet Lanctot186b5732013-03-18 10:26:30 -07001927#ifdef WLAN_FEATURE_11W
1928 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
1929 {
1930 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
1931 "since RMF is enabled."), pActionHdr->category);)
1932 break;
1933 }
1934#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001935 switch (pActionHdr->actionID)
1936 {
1937#ifdef ANI_SUPPORT_11H
1938 case SIR_MAC_ACTION_MEASURE_REQUEST_ID:
1939 if(psessionEntry->lim11hEnable)
1940 {
1941 __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo);
1942 }
1943 break;
1944
1945 case SIR_MAC_ACTION_TPC_REQUEST_ID:
1946 if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
1947 (pessionEntry->limSystemRole == eLIM_AP_ROLE))
1948 {
1949 if(psessionEntry->lim11hEnable)
1950 {
1951 __limProcessTpcRequestFrame(pMac, pRxPacketInfo);
1952 }
1953 }
1954 break;
1955
1956#endif
1957 case SIR_MAC_ACTION_CHANNEL_SWITCH_ID:
1958 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
1959 {
1960 __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry);
1961 }
1962 break;
1963 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001964 PELOGE(limLog(pMac, LOGE, FL("Spectrum mgmt action id %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001965 break;
1966 }
1967 break;
1968
1969 case SIR_MAC_ACTION_WME:
1970 if (! psessionEntry->limWmeEnabled)
1971 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001972 limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001973 pActionHdr->actionID);
1974 break;
1975 }
1976 switch(pActionHdr->actionID)
1977 {
1978 case SIR_MAC_QOS_ADD_TS_REQ:
1979 __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1980 break;
1981
1982 case SIR_MAC_QOS_ADD_TS_RSP:
1983 __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1984 break;
1985
1986 case SIR_MAC_QOS_DEL_TS_REQ:
1987 __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
1988 break;
1989
1990 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07001991 PELOGE(limLog(pMac, LOGE, FL("WME action %d not handled"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07001992 break;
1993 }
1994 break;
1995
1996 case SIR_MAC_ACTION_BLKACK:
1997 // Determine the "type" of BA Action Frame
Chet Lanctot186b5732013-03-18 10:26:30 -07001998#ifdef WLAN_FEATURE_11W
1999 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
2000 {
2001 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2002 "since RMF is enabled."), pActionHdr->category);)
2003 break;
2004 }
2005#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002006 switch(pActionHdr->actionID)
2007 {
2008 case SIR_MAC_BLKACK_ADD_REQ:
2009 __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2010 break;
2011
2012 case SIR_MAC_BLKACK_ADD_RSP:
2013 __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2014 break;
2015
2016 case SIR_MAC_BLKACK_DEL:
2017 __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2018 break;
2019
2020 default:
2021 break;
2022 }
2023
2024 break;
2025 case SIR_MAC_ACTION_HT:
2026 /** Type of HT Action to be performed*/
2027 switch(pActionHdr->actionID) {
2028 case SIR_MAC_SM_POWER_SAVE:
2029 __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry);
2030 break;
2031 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002032 PELOGE(limLog(pMac, LOGE, FL("Action ID %d not handled in HT Action category"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002033 break;
2034 }
2035 break;
2036
2037#if defined WLAN_FEATURE_VOWIFI
2038 case SIR_MAC_ACTION_RRM:
Chet Lanctot186b5732013-03-18 10:26:30 -07002039#ifdef WLAN_FEATURE_11W
2040 if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0))
2041 {
2042 PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame "
2043 "since RMF is enabled."), pActionHdr->category);)
2044 break;
2045 }
2046#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002047 if( pMac->rrm.rrmPEContext.rrmEnable )
2048 {
2049 switch(pActionHdr->actionID) {
2050 case SIR_MAC_RRM_RADIO_MEASURE_REQ:
2051 __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2052 break;
2053 case SIR_MAC_RRM_LINK_MEASUREMENT_REQ:
2054 __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry );
2055 break;
2056 case SIR_MAC_RRM_NEIGHBOR_RPT:
2057 __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry );
2058 break;
2059 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002060 PELOGE( limLog( pMac, LOGE, FL("Action ID %d not handled in RRM"), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002061 break;
2062
2063 }
2064 }
2065 else
2066 {
2067 // Else we will just ignore the RRM messages.
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002068 PELOGE( limLog( pMac, LOGE, FL("RRM Action frame ignored as RRM is disabled in cfg"));)
Jeff Johnson295189b2012-06-20 16:38:30 -07002069 }
2070 break;
2071#endif
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002072#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
2073 case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY:
2074 {
2075 tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr;
2076 tpSirMacMgmtHdr pHdr;
2077 tANI_U32 frameLen;
2078 tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 };
2079
2080 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2081 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2082
2083 //Check if it is a vendor specific action frame.
2084 if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) &&
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302085 (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr,
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002086 &pHdr->da[0], sizeof(tSirMacAddr))) &&
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002087 IS_WES_MODE_ENABLED(pMac) &&
2088 vos_mem_compare(pVendorSpecific->Oui, Oui, 3))
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002089 {
2090 PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"),
2091 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);)
2092 /* Forward to the SME to HDD to wpa_supplicant */
2093 // type is ACTION
2094 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2095 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
2096 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
2097 }
2098 else
2099 {
2100 limLog( pMac, LOGE, FL("Dropping the vendor specific action frame because of( "
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002101 "WES Mode not enabled (WESMODE = %d) or OUI mismatch (%02x %02x %02x) or "
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002102 "not received with SelfSta Mac address) system role = %d"),
Srinivas Girigowdaad34ca92013-10-22 10:54:29 -07002103 IS_WES_MODE_ENABLED(pMac),
Srinivas Girigowda100eb322013-03-15 16:48:20 -07002104 pVendorSpecific->Oui[0], pVendorSpecific->Oui[1],
2105 pVendorSpecific->Oui[2],
2106 psessionEntry->limSystemRole );
2107 }
2108 }
2109 break;
2110#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002111 case SIR_MAC_ACTION_PUBLIC_USAGE:
2112 switch(pActionHdr->actionID) {
2113 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2114 {
2115 tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr;
2116 tpSirMacMgmtHdr pHdr;
2117 tANI_U32 frameLen;
2118 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2119
2120 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2121 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
2122
2123 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302124 if (vos_mem_compare(pPubAction->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002125 {
2126 /* Forward to the SME to HDD to wpa_supplicant */
2127 // type is ACTION
2128 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2129 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302130 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002131 }
2132 else
2133 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002134 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002135 pPubAction->Oui[0], pPubAction->Oui[1], pPubAction->Oui[2], pPubAction->Oui[3] );
2136 }
2137 }
2138 break;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002139#ifdef FEATURE_WLAN_TDLS
2140 case SIR_MAC_TDLS_DIS_RSP:
2141 {
2142#ifdef FEATURE_WLAN_TDLS_INTERNAL
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002143 //LIM_LOG_TDLS(printk("Public Action TDLS Discovery RSP ..")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002144 limProcessTdlsPublicActionFrame(pMac, (tANI_U32*)pRxPacketInfo, psessionEntry) ;
2145#else
2146 tpSirMacMgmtHdr pHdr;
2147 tANI_U32 frameLen;
Chilam NG571c65a2013-01-19 12:27:36 +05302148 tANI_S8 rssi;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002149
2150 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
2151 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
Chilam NG571c65a2013-01-19 12:27:36 +05302152 rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002153 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO,
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002154 ("Public Action TDLS Discovery RSP ..")) ;
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002155 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2156 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302157 WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, rssi);
Mohit Khanna698ba2a2012-12-04 15:08:18 -08002158#endif
2159 }
2160 break;
2161#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002162
2163 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002164 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002165 break;
2166 }
2167 break;
Jeff Johnson295189b2012-06-20 16:38:30 -07002168
2169#ifdef WLAN_FEATURE_11W
2170 case SIR_MAC_ACTION_SA_QUERY:
2171 {
Chet Lanctot186b5732013-03-18 10:26:30 -07002172 PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);)
2173 switch (pActionHdr->actionID)
2174 {
2175 case SIR_MAC_SA_QUERY_REQ:
2176 /**11w SA query request action frame received**/
2177 /* Respond directly to the incoming request in LIM */
2178 __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2179 break;
2180 case SIR_MAC_SA_QUERY_RSP:
2181 /**11w SA query response action frame received**/
2182 /* Forward to the SME to HDD to wpa_supplicant */
2183 __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry );
2184 break;
2185 default:
2186 break;
2187 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002188 break;
2189 }
2190#endif
Mohit Khanna4a70d262012-09-11 16:30:12 -07002191#ifdef WLAN_FEATURE_11AC
2192 case SIR_MAC_ACTION_VHT:
2193 {
2194 if (psessionEntry->vhtCapability)
2195 {
2196 switch (pActionHdr->actionID)
2197 {
2198 case SIR_MAC_VHT_OPMODE_NOTIFICATION:
2199 __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry);
2200 break;
2201 default:
2202 break;
2203 }
2204 }
Chet Lanctot186b5732013-03-18 10:26:30 -07002205 break;
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -07002206 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002207#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002208 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002209 PELOGE(limLog(pMac, LOGE, FL("Action category %d not handled"), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002210 break;
2211 }
2212}
2213
Jeff Johnson295189b2012-06-20 16:38:30 -07002214/**
2215 * limProcessActionFrameNoSession
2216 *
2217 *FUNCTION:
2218 * This function is called by limProcessMessageQueue() upon
2219 * Action frame reception and no session.
2220 * Currently only public action frames can be received from
2221 * a non-associated station.
2222 *
2223 *LOGIC:
2224 *
2225 *ASSUMPTIONS:
2226 *
2227 *NOTE:
2228 *
2229 * @param pMac - Pointer to Global MAC structure
2230 * @param *pBd - A pointer to Buffer descriptor + associated PDUs
2231 * @return None
2232 */
2233
2234void
2235limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd)
2236{
2237 tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd);
2238 tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody;
2239
Mohit Khanna23863762012-09-11 17:40:09 -07002240 limLog( pMac, LOG1, "Received a Action frame -- no session");
Jeff Johnson295189b2012-06-20 16:38:30 -07002241
2242 switch ( pActionHdr->category )
2243 {
2244 case SIR_MAC_ACTION_PUBLIC_USAGE:
2245 switch(pActionHdr->actionID) {
2246 case SIR_MAC_ACTION_VENDOR_SPECIFIC:
2247 {
2248 tpSirMacMgmtHdr pHdr;
2249 tANI_U32 frameLen;
2250 tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 };
2251
2252 pHdr = WDA_GET_RX_MAC_HEADER(pBd);
2253 frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd);
2254
2255 //Check if it is a P2P public action frame.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302256 if (vos_mem_compare(pActionHdr->Oui, P2POui, 4))
Jeff Johnson295189b2012-06-20 16:38:30 -07002257 {
2258 /* Forward to the SME to HDD to wpa_supplicant */
2259 // type is ACTION
2260 limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType,
2261 (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0,
Chilam NG571c65a2013-01-19 12:27:36 +05302262 WDA_GET_RX_CH( pBd ), NULL, 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07002263 }
2264 else
2265 {
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002266 limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"),
Jeff Johnson295189b2012-06-20 16:38:30 -07002267 pActionHdr->Oui[0], pActionHdr->Oui[1], pActionHdr->Oui[2], pActionHdr->Oui[3] );
2268 }
2269 }
2270 break;
2271 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002272 PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002273 break;
2274 }
2275 break;
2276 default:
Kiran Kumar Lokere80007262013-03-18 19:45:50 -07002277 PELOGE(limLog(pMac, LOG1, FL("Unhandled action frame without session -- %x "), pActionHdr->category);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002278 break;
2279
2280 }
2281}