blob: e0f2c53d85fd30a1d1f45233f582e5cd96233fe0 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Sravan Kumar Kairamd9e8cbb2017-01-17 12:17:28 +05302 * Copyright (c) 2012-2013, 2017 The Linux Foundation. All rights reserved.
Kiet Lam1ed83fc2014-02-19 01:15:45 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam1ed83fc2014-02-19 01:15:45 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Jeff Johnson295189b2012-06-20 16:38:30 -070028/**=========================================================================
29 *
30 * \file wlan_qct_wdi_ds.c
31 *
32 * \brief define Dataservice API
33 *
34 * WLAN Device Abstraction layer External API for Dataservice
35 * DESCRIPTION
36 * This file contains the external API implemntation exposed by the
37 * wlan device abstarction layer module.
38 *
Jeff Johnson295189b2012-06-20 16:38:30 -070039 */
40
41
42#include "wlan_qct_wdi.h"
43#include "wlan_qct_wdi_i.h"
44#include "wlan_qct_wdi_ds.h"
45#include "wlan_qct_wdi_ds_i.h"
46#include "wlan_qct_wdi_dts.h"
47#include "wlan_qct_wdi_dp.h"
48#include "wlan_qct_wdi_sta.h"
49
50
51
52
53/* DAL registration function.
54 * Parameters:
55 * pContext:Cookie that should be passed back to the caller along
56 * with the callback.
57 * pfnTxCompleteCallback:Callback function that is to be invoked to return
58 * packets which have been transmitted.
59 * pfnRxPacketCallback:Callback function that is to be invoked to deliver
60 * packets which have been received
61 * pfnTxFlowControlCallback:Callback function that is to be invoked to
62 * indicate/clear congestion.
63 *
64 * Return Value: SUCCESS Completed successfully.
65 * FAILURE_XXX Request was rejected due XXX Reason.
66 *
67 */
68WDI_Status WDI_DS_Register( void *pContext,
69 WDI_DS_TxCompleteCallback pfnTxCompleteCallback,
70 WDI_DS_RxPacketCallback pfnRxPacketCallback,
71 WDI_DS_TxFlowControlCallback pfnTxFlowControlCallback,
Mihir Shete5affadc2015-05-29 20:54:57 +053072 WDI_DS_RxLogCallback pfnRxLogCallback,
Jeff Johnson295189b2012-06-20 16:38:30 -070073 void *pCallbackContext)
74{
75 WDI_DS_ClientDataType *pClientData;
76 wpt_uint8 bssLoop;
77
78 // Do Sanity checks
79 if (NULL == pContext ||
80 NULL == pCallbackContext ||
81 NULL == pfnTxCompleteCallback ||
82 NULL == pfnRxPacketCallback ||
83 NULL == pfnTxFlowControlCallback) {
84 return WDI_STATUS_E_FAILURE;
85 }
86
87 pClientData = (WDI_DS_ClientDataType *)WDI_DS_GetDatapathContext(pContext);
88 if (NULL == pClientData)
89 {
90 return WDI_STATUS_MEM_FAILURE;
91 }
92
93 // Store callbacks in client structure
94 pClientData->pcontext = pContext;
95 pClientData->receiveFrameCB = pfnRxPacketCallback;
96 pClientData->txCompleteCB = pfnTxCompleteCallback;
97 pClientData->txResourceCB = pfnTxFlowControlCallback;
Mihir Shete5affadc2015-05-29 20:54:57 +053098 pClientData->rxLogCB = pfnRxLogCallback;
Jeff Johnson295189b2012-06-20 16:38:30 -070099 pClientData->pCallbackContext = pCallbackContext;
100
101 for(bssLoop = 0; bssLoop < WDI_DS_MAX_SUPPORTED_BSS; bssLoop++)
102 {
103 pClientData->staIdxPerBssIdxTable[bssLoop].isUsed = 0;
104 pClientData->staIdxPerBssIdxTable[bssLoop].bssIdx = WDI_DS_INDEX_INVALID;
105 pClientData->staIdxPerBssIdxTable[bssLoop].staIdx = WDI_DS_INDEX_INVALID;
106 }
107 return WDI_STATUS_SUCCESS;
108}
109
110
111
112/* DAL Transmit function.
113 * Parameters:
114 * pContext:Cookie that should be passed back to the caller along with the callback.
115 * pFrame:Refernce to PAL frame.
116 * more: Does the invokee have more than one packet pending?
117 * Return Value: SUCCESS Completed successfully.
118 * FAILURE_XXX Request was rejected due XXX Reason.
119 *
120 */
121
122
123WDI_Status WDI_DS_TxPacket(void *pContext,
124 wpt_packet *pFrame,
125 wpt_boolean more)
126{
127 WDI_DS_ClientDataType *pClientData;
128 wpt_uint8 ucSwFrameTXXlation;
129 wpt_uint8 ucUP;
130 wpt_uint8 ucTypeSubtype;
Kiet Lam9b11b012013-10-24 11:43:30 +0530131 wpt_uint8 isEapol;
Sravan Kumar Kairamd9e8cbb2017-01-17 12:17:28 +0530132 wpt_uint8 isArp;
Jeff Johnson295189b2012-06-20 16:38:30 -0700133 wpt_uint8 alignment;
Chandrasekaran Manishekar7218fa22014-06-26 10:34:25 +0530134 wpt_uint32 ucTxFlag;
Chet Lanctot4b088622013-05-22 16:09:22 -0700135 wpt_uint8 ucProtMgmtFrame;
Jeff Johnson295189b2012-06-20 16:38:30 -0700136 wpt_uint8* pSTAMACAddress;
137 wpt_uint8* pAddr2MACAddress;
138 WDI_DS_TxMetaInfoType *pTxMetadata;
139 void *physBDHeader, *pvBDHeader;
140 wpt_uint8 ucType;
141 WDI_DS_BdMemPoolType *pMemPool;
142 wpt_uint8 ucBdPoolType;
143 wpt_uint8 staId;
Yue Maf74c9862013-03-21 16:36:15 -0700144 WDI_Status wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -0700145
146 // Do Sanity checks
147 if (NULL == pContext)
148 {
149 return WDI_STATUS_E_FAILURE;
150 }
151
152 pClientData = (WDI_DS_ClientDataType *) WDI_DS_GetDatapathContext(pContext);
153 if (NULL == pClientData || pClientData->suspend)
154 {
155 return WDI_STATUS_E_FAILURE;
156 }
157
158 // extract metadata from PAL packet
159 pTxMetadata = WDI_DS_ExtractTxMetaData(pFrame);
160 ucSwFrameTXXlation = pTxMetadata->fdisableFrmXlt;
161 ucTypeSubtype = pTxMetadata->typeSubtype;
162 ucUP = pTxMetadata->fUP;
Kiet Lam9b11b012013-10-24 11:43:30 +0530163 isEapol = pTxMetadata->isEapol;
Sravan Kumar Kairamd9e8cbb2017-01-17 12:17:28 +0530164 isArp = pTxMetadata->isArp;
Jeff Johnson295189b2012-06-20 16:38:30 -0700165 ucTxFlag = pTxMetadata->txFlags;
Chet Lanctot4b088622013-05-22 16:09:22 -0700166 ucProtMgmtFrame = pTxMetadata->fProtMgmtFrame;
Jeff Johnson295189b2012-06-20 16:38:30 -0700167 pSTAMACAddress = &(pTxMetadata->fSTAMACAddress[0]);
168 pAddr2MACAddress = &(pTxMetadata->addr2MACAddress[0]);
169
170 /*------------------------------------------------------------------------
171 Get type and subtype of the frame first
172 ------------------------------------------------------------------------*/
173 ucType = (ucTypeSubtype & WDI_FRAME_TYPE_MASK) >> WDI_FRAME_TYPE_OFFSET;
174 switch(ucType)
175 {
176 case WDI_MAC_DATA_FRAME:
Hoonki Leee10ce392013-02-26 11:47:00 -0800177#ifdef FEATURE_WLAN_TDLS
178 /* I utilizes TDLS mgmt frame always sent at BD_RATE2. (See limProcessTdls.c)
179 Assumption here is data frame sent by WDA_TxPacket() <- HalTxFrame/HalTxFrameWithComplete()
180 should take managment path. As of today, only TDLS feature has special data frame
181 which needs to be treated as mgmt.
182 */
183 if((!pTxMetadata->isEapol) &&
184 ((pTxMetadata->txFlags & WDI_USE_BD_RATE2_FOR_MANAGEMENT_FRAME) != WDI_USE_BD_RATE2_FOR_MANAGEMENT_FRAME))
185#else
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700186 if(!pTxMetadata->isEapol)
Hoonki Leee10ce392013-02-26 11:47:00 -0800187#endif
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700188 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700189 pMemPool = &(pClientData->dataMemPool);
190 ucBdPoolType = WDI_DATA_POOL_ID;
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700191 break;
192 }
193 // intentional fall-through to handle eapol packet as mgmt
Jeff Johnson295189b2012-06-20 16:38:30 -0700194 case WDI_MAC_MGMT_FRAME:
195 pMemPool = &(pClientData->mgmtMemPool);
196 ucBdPoolType = WDI_MGMT_POOL_ID;
197 break;
198 default:
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700199 return WDI_STATUS_E_FAILURE;
Jeff Johnson295189b2012-06-20 16:38:30 -0700200 }
201
202 // Allocate BD header from pool
203 pvBDHeader = WDI_DS_MemPoolAlloc(pMemPool, &physBDHeader, ucBdPoolType);
204 if(NULL == pvBDHeader)
205 return WDI_STATUS_E_FAILURE;
206
207 WDI_SetBDPointers(pFrame, pvBDHeader, physBDHeader);
208
209 alignment = 0;
210 WDI_DS_PrepareBDHeader(pFrame, ucSwFrameTXXlation, alignment);
Agarwal Ashisha8e81f52014-04-02 01:59:52 +0530211 if (pTxMetadata->isEapol)
212 {
213 WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
214 "Packet Length is %d\n", pTxMetadata->fPktlen);
215 }
Yue Maf74c9862013-03-21 16:36:15 -0700216 wdiStatus = WDI_FillTxBd(pContext, ucTypeSubtype, pSTAMACAddress, pAddr2MACAddress,
Sravan Kumar Kairamd9e8cbb2017-01-17 12:17:28 +0530217 &ucUP, 1, pvBDHeader, ucTxFlag /* No ACK */, ucProtMgmtFrame, 0, isEapol, isArp,
218 &staId, pTxMetadata->txBdToken);
Yue Maf74c9862013-03-21 16:36:15 -0700219
220 if(WDI_STATUS_SUCCESS != wdiStatus)
221 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700222 WDI_DS_MemPoolFree(pMemPool, pvBDHeader, physBDHeader);
Yue Maf74c9862013-03-21 16:36:15 -0700223 return wdiStatus;
Jeff Johnson295189b2012-06-20 16:38:30 -0700224 }
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800225
226 pTxMetadata->staIdx = staId;
227
Jeff Johnson295189b2012-06-20 16:38:30 -0700228 // Send packet to transport layer.
229 if(eWLAN_PAL_STATUS_SUCCESS !=WDTS_TxPacket(pContext, pFrame)){
230 WDI_DS_MemPoolFree(pMemPool, pvBDHeader, physBDHeader);
231 return WDI_STATUS_E_FAILURE;
232 }
233
234 /* resource count only for data packet */
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700235 // EAPOL packet doesn't use data mem pool if being treated as higher priority
Hoonki Leee10ce392013-02-26 11:47:00 -0800236#ifdef FEATURE_WLAN_TDLS
237 /* I utilizes TDLS mgmt frame always sent at BD_RATE2. (See limProcessTdls.c)
238 Assumption here is data frame sent by WDA_TxPacket() <- HalTxFrame/HalTxFrameWithComplete()
239 should take managment path. As of today, only TDLS feature has special data frame
240 which needs to be treated as mgmt.
241 */
242 if((WDI_MAC_DATA_FRAME == ucType) && (!pTxMetadata->isEapol) && ((pTxMetadata->txFlags & WDI_USE_BD_RATE2_FOR_MANAGEMENT_FRAME) != WDI_USE_BD_RATE2_FOR_MANAGEMENT_FRAME))
243#else
Madan Mohan Koyyalamudi1541a5b2012-10-29 16:18:21 -0700244 if(WDI_MAC_DATA_FRAME == ucType && (!pTxMetadata->isEapol))
Hoonki Leee10ce392013-02-26 11:47:00 -0800245#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700246 {
247 WDI_DS_MemPoolIncreaseReserveCount(pMemPool, staId);
248 }
249 return WDI_STATUS_SUCCESS;
250}
251
252
253/* DAL Transmit Complete function.
254 * Parameters:
255 * pContext:Cookie that should be passed back to the caller along with the callback.
256 * ucTxResReq:TX resource number required by TL
257 * Return Value: SUCCESS Completed successfully.
258 * FAILURE_XXX Request was rejected due XXX Reason.
259 *
260 */
261
262
263WDI_Status WDI_DS_TxComplete(void *pContext, wpt_uint32 ucTxResReq)
264{
265 // Do Sanity checks
266 if(NULL == pContext)
267 return WDI_STATUS_E_FAILURE;
268
269 // Send notification to transport layer.
270 if(eWLAN_PAL_STATUS_SUCCESS !=WDTS_CompleteTx(pContext, ucTxResReq))
271 {
272 return WDI_STATUS_E_FAILURE;
273 }
274
275 return WDI_STATUS_SUCCESS;
276}
277
278/* DAL Suspend Transmit function.
279 * Parameters:
280 * pContext:Cookie that should be passed back to the caller along with the callback.
281 * Return Value: SUCCESS Completed successfully.
282 * FAILURE_XXX Request was rejected due XXX Reason.
283 *
284 */
285
286
287WDI_Status WDI_DS_TxSuspend(void *pContext)
288{
289 WDI_DS_ClientDataType *pClientData =
290 (WDI_DS_ClientDataType *) WDI_DS_GetDatapathContext(pContext);
291 pClientData->suspend = 1;
292
293 return WDI_STATUS_SUCCESS;
294
295}
296
297
298/* DAL Resume Transmit function.
299 * Parameters:
300 * pContext:Cookie that should be passed back to the caller along with the callback.
301 * Return Value: SUCCESS Completed successfully.
302 * FAILURE_XXX Request was rejected due XXX Reason.
303 *
304 */
305
306
307WDI_Status WDI_DS_TxResume(void *pContext)
308{
309 WDI_DS_ClientDataType *pClientData =
310 (WDI_DS_ClientDataType *) WDI_DS_GetDatapathContext(pContext);
311
312 pClientData->suspend = 0;
313
314 return WDI_STATUS_SUCCESS;
315}
316
317/* DAL Get Available Resource Count.
318 * This is the number of free descririptor in DXE
319 * Parameters:
320 * pContext:Cookie that should be passed back to the caller along with the callback.
321 * wdiResPool: - identifier of resource pool
322 * Return Value: number of resources available
323 * This is the number of free descririptor in DXE
324 *
325 */
326
327wpt_uint32 WDI_GetAvailableResCount(void *pContext,WDI_ResPoolType wdiResPool)
328{
329 WDI_DS_ClientDataType *pClientData =
330 (WDI_DS_ClientDataType *) WDI_DS_GetDatapathContext(pContext);
331
332 switch(wdiResPool)
333 {
334 case WDI_MGMT_POOL_ID:
335 return (WDI_DS_HI_PRI_RES_NUM - 2*WDI_DS_GetAvailableResCount(&pClientData->mgmtMemPool));
336 case WDI_DATA_POOL_ID:
337 return WDTS_GetFreeTxDataResNumber(pContext);
338 default:
339 return 0;
340 }
341}
342
343/* DAL Get resrved Resource Count per STA.
344 * Parameters:
345 * pContext:Cookie that should be passed back to the caller along with the callback.
346 * wdiResPool: - identifier of resource pool
347 * staId: STA ID
348 * Return Value: number of resources reserved per STA
349 *
350 */
351wpt_uint32 WDI_DS_GetReservedResCountPerSTA(void *pContext,WDI_ResPoolType wdiResPool, wpt_uint8 staId)
352{
353 WDI_DS_ClientDataType *pClientData =
354 (WDI_DS_ClientDataType *) WDI_DS_GetDatapathContext(pContext);
355 switch(wdiResPool)
356 {
357 case WDI_MGMT_POOL_ID:
358 return WDI_DS_MemPoolGetRsvdResCountPerSTA(&pClientData->mgmtMemPool, staId);
359 case WDI_DATA_POOL_ID:
360 return WDI_DS_MemPoolGetRsvdResCountPerSTA(&pClientData->dataMemPool, staId);
361 default:
362 return 0;
363 }
364}
365
366/* DAL STA info add into memPool.
367 * Parameters:
368 * pContext:Cookie that should be passed back to the caller along with the callback.
369 * staId: STA ID
370 * Return Value: number of resources reserved per STA
371 *
372 */
373WDI_Status WDI_DS_AddSTAMemPool(void *pContext, wpt_uint8 staIndex)
374{
375 WDI_Status status = WDI_STATUS_SUCCESS;
376 WDI_DS_ClientDataType *pClientData =
377 (WDI_DS_ClientDataType *) WDI_DS_GetDatapathContext(pContext);
378
379 status = WDI_DS_MemPoolAddSTA(&pClientData->mgmtMemPool, staIndex);
380 if(WDI_STATUS_SUCCESS != status)
381 {
382 /* Add STA into MGMT memPool Fail */
383 return status;
384 }
385
386 status = WDI_DS_MemPoolAddSTA(&pClientData->dataMemPool, staIndex);
387 if(WDI_STATUS_SUCCESS != status)
388 {
389 /* Add STA into DATA memPool Fail */
390 return status;
391 }
392
393 return WDI_STATUS_SUCCESS;
394}
395
396/* DAL STA info del from memPool.
397 * Parameters:
398 * pContext:Cookie that should be passed back to the caller along with the callback.
399 * staId: STA ID
400 * Return Value: number of resources reserved per STA
401 *
402 */
403WDI_Status WDI_DS_DelSTAMemPool(void *pContext, wpt_uint8 staIndex)
404{
405 WDI_Status status = WDI_STATUS_SUCCESS;
406 WDI_DS_ClientDataType *pClientData =
407 (WDI_DS_ClientDataType *) WDI_DS_GetDatapathContext(pContext);
408
409 status = WDI_DS_MemPoolDelSTA(&pClientData->mgmtMemPool, staIndex);
410 if(WDI_STATUS_SUCCESS != status)
411 {
412 /* Del STA from MGMT memPool Fail */
413 return status;
414 }
415 status = WDI_DS_MemPoolDelSTA(&pClientData->dataMemPool, staIndex);
416 if(WDI_STATUS_SUCCESS != status)
417 {
418 /* Del STA from DATA memPool Fail */
419 return status;
420 }
421 return WDI_STATUS_SUCCESS;
422}
423
424/* DAL Set STA index associated with BSS index.
425 * Parameters:
426 * pContext:Cookie that should be passed back to the caller along with the callback.
427 * bssIdx: BSS index
428 * staId: STA index associated with BSS index
429 * Return Status: Found empty slot
430 *
431 */
432WDI_Status WDI_DS_SetStaIdxPerBssIdx(void *pContext, wpt_uint8 bssIdx, wpt_uint8 staIdx)
433{
434 WDI_DS_ClientDataType *pClientData;
435 wpt_uint8 bssLoop;
436
437 pClientData = (WDI_DS_ClientDataType *)WDI_DS_GetDatapathContext(pContext);
438 for (bssLoop = 0; bssLoop < WDI_DS_MAX_SUPPORTED_BSS; bssLoop++)
439 {
440 if ((pClientData->staIdxPerBssIdxTable[bssLoop].isUsed) &&
441 (bssIdx == pClientData->staIdxPerBssIdxTable[bssLoop].bssIdx) &&
442 (staIdx == pClientData->staIdxPerBssIdxTable[bssLoop].staIdx))
443 {
444 return WDI_STATUS_SUCCESS;
445 }
446
447 if (0 == pClientData->staIdxPerBssIdxTable[bssLoop].isUsed)
448 {
449 pClientData->staIdxPerBssIdxTable[bssLoop].bssIdx = bssIdx;
450 pClientData->staIdxPerBssIdxTable[bssLoop].staIdx = staIdx;
451 pClientData->staIdxPerBssIdxTable[bssLoop].isUsed = 1;
452 return WDI_STATUS_SUCCESS;
453 }
454 }
455
456 /* Could not find empty slot */
457 return WDI_STATUS_E_FAILURE;
458}
459
460/* DAL Get STA index associated with BSS index.
461 * Parameters:
462 * pContext:Cookie that should be passed back to the caller along with the callback.
463 * bssIdx: BSS index
464 * staId: STA index associated with BSS index
465 * Return Status: Found empty slot
466 *
467 */
468WDI_Status WDI_DS_GetStaIdxFromBssIdx(void *pContext, wpt_uint8 bssIdx, wpt_uint8 *staIdx)
469{
470 WDI_DS_ClientDataType *pClientData;
471 wpt_uint8 bssLoop;
472
473 pClientData = (WDI_DS_ClientDataType *)WDI_DS_GetDatapathContext(pContext);
474 for(bssLoop = 0; bssLoop < WDI_DS_MAX_SUPPORTED_BSS; bssLoop++)
475 {
476 if(bssIdx == pClientData->staIdxPerBssIdxTable[bssLoop].bssIdx)
477 {
478 /* Found BSS index from slot */
479 *staIdx = pClientData->staIdxPerBssIdxTable[bssLoop].staIdx;
480 return WDI_STATUS_SUCCESS;
481 }
482 }
483
484 /* Could not find associated STA index with BSS index */
485 return WDI_STATUS_E_FAILURE;
486}
487
488/* DAL Clear STA index associated with BSS index.
489 * Parameters:
490 * pContext:Cookie that should be passed back to the caller along with the callback.
491 * bssIdx: BSS index
492 * staId: STA index associated with BSS index
493 * Return Status: Found empty slot
494 *
495 */
496WDI_Status WDI_DS_ClearStaIdxPerBssIdx(void *pContext, wpt_uint8 bssIdx, wpt_uint8 staIdx)
497{
498 WDI_DS_ClientDataType *pClientData;
499 wpt_uint8 bssLoop;
500
501 pClientData = (WDI_DS_ClientDataType *)WDI_DS_GetDatapathContext(pContext);
502 for(bssLoop = 0; bssLoop < WDI_DS_MAX_SUPPORTED_BSS; bssLoop++)
503 {
504 if((bssIdx == pClientData->staIdxPerBssIdxTable[bssLoop].bssIdx) &&
505 (staIdx == pClientData->staIdxPerBssIdxTable[bssLoop].staIdx))
506 {
507 pClientData->staIdxPerBssIdxTable[bssLoop].bssIdx = WDI_DS_INDEX_INVALID;
508 pClientData->staIdxPerBssIdxTable[bssLoop].staIdx = WDI_DS_INDEX_INVALID;
509 pClientData->staIdxPerBssIdxTable[bssLoop].isUsed = 0;
510 return WDI_STATUS_SUCCESS;
511 }
512 }
513
514 /* Could not find associated STA index with BSS index */
515 return WDI_STATUS_E_FAILURE;
516}
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800517
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800518/* @brief: WDI_DS_GetTrafficStats
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800519 * This function should be invoked to fetch the current stats
520 * Parameters:
521 * pStats:Pointer to the collected stats
522 * len: length of buffer pointed to by pStats
523 * Return Status: None
524 */
525void WDI_DS_GetTrafficStats(WDI_TrafficStatsType** pStats, wpt_uint32 *len)
526{
527 return WDTS_GetTrafficStats(pStats, len);
528}
529
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800530/* @brief: WDI_DS_DeactivateTrafficStats
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800531 * This function should be invoked to deactivate traffic stats collection
532 * Parameters: None
533 * Return Status: None
534 */
535void WDI_DS_DeactivateTrafficStats(void)
536{
537 return WDTS_DeactivateTrafficStats();
538}
539
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800540/* @brief: WDI_DS_ActivateTrafficStats
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800541 * This function should be invoked to activate traffic stats collection
542 * Parameters: None
543 * Return Status: None
544 */
545void WDI_DS_ActivateTrafficStats(void)
546{
547 return WDTS_ActivateTrafficStats();
548}
549
Kumar Anand90ca3dd2013-01-18 15:24:47 -0800550/* @brief: WDI_DS_ClearTrafficStats
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -0800551 * This function should be invoked to clear all past stats
552 * Parameters: None
553 * Return Status: None
554 */
555void WDI_DS_ClearTrafficStats(void)
556{
557 return WDTS_ClearTrafficStats();
558}
559