1a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/*
2a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * txCtrlParams.c
3a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *
43bb9a92880f8cda8c242707ad02077f13b009632Dmitry Shmidt * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.
5a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * All rights reserved.
6a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *
7a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * Redistribution and use in source and binary forms, with or without
8a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * modification, are permitted provided that the following conditions
9a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * are met:
10a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *
11a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *  * Redistributions of source code must retain the above copyright
12a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *    notice, this list of conditions and the following disclaimer.
13a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *  * Redistributions in binary form must reproduce the above copyright
14a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *    notice, this list of conditions and the following disclaimer in
15a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *    the documentation and/or other materials provided with the
16a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *    distribution.
17a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *  * Neither the name Texas Instruments nor the names of its
18a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *    contributors may be used to endorse or promote products derived
19a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *    from this software without specific prior written permission.
20a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *
21a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt */
33a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
34a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/*******************************************************************************/
35a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/*                                                                             */
36a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/*      MODULE: txCtrlParams.c                                                 */
37a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/*    PURPOSE:  The txCtrl module parameters handling.                         */
38a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/*              This is a part of the txCtrl module (using the same object).   */
39a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/*                                                                             */
40a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/*******************************************************************************/
41a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
42a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#define __FILE_ID__  FILE_ID_57
43a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#include "tidef.h"
44a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#include "report.h"
45a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#include "paramOut.h"
46a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#include "osApi.h"
47a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#include "timer.h"
48a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#include "EvHandler.h"
49a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#include "txCtrl.h"
50a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
51a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
52a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
53a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
54a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
55a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
56a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        calcCreditFromTimer
57a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
58a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    This function is called when credit calculation timer
59a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				is expired. it calculate the credit for the admission ctrl
60a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				credit algorithm
61a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
62a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
63a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtINPUT:	    hTxCtrl         - handle to the ts data object
64a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt            bTwdInitOccured - Indicates if TWDriver recovery occured since timer started
65a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
66a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtOUTPUT:     None
67a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
68a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtRETURN:     void
69a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
70a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtstatic void calcCreditFromTimer(TI_HANDLE hTxCtrl, TI_BOOL bTwdInitOccured)
71a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
72a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	OS_802_11_THRESHOLD_CROSS_INDICATION_PARAMS	mediumTimeCross;
73a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t	*pTxCtrl = (txCtrl_t *)hTxCtrl;
74a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_UINT32		ac;
75a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_INT32		prevCredit;
76a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_INT32		highCreditThreshold;
77a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_INT32		lowCreditThreshold;
78a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_INT32		usageRatio;
79a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_INT32		currUsage;
80a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_INT32		prevUsage;
81a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_UINT32		currentTimeStamp = os_timeStampMs(pTxCtrl->hOs);  /* get current time stamp */
82a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
83a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	/*
84a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	 *  For each AC under admission control calculate the new usage and credit time,
85a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	 *     and send events if a threshold is crossed.
86a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	 */
87a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	for(ac = 0 ; ac < MAX_NUM_OF_AC ; ac++)
88a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	{
89a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* check if this queue is under admission ctrl operation */
90a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		if(pTxCtrl->mediumTime[ac] == 0)
91a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		{
92a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTRACE1(pTxCtrl->hReport, REPORT_SEVERITY_INFORMATION, ": ac = %d mediumTime = 0 \n", ac);
93a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
94a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			continue;
95a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		}
96a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
97a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* in case of wraparound */
98a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		if(currentTimeStamp < pTxCtrl->lastCreditCalcTimeStamp[ac])
99a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			pTxCtrl->lastCreditCalcTimeStamp[ac] = 0;
100a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
101a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* store prev credit */
102a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		prevCredit = pTxCtrl->credit[ac];
103a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
104a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* Calculate the medium usage ratio:    totalUsedTime / mediumTime * 1000
105a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		   Note that since the totalUsedTime is in usec and not msec we don't multiply by 1000.	 */
106a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		usageRatio = pTxCtrl->totalUsedTime[ac] / pTxCtrl->mediumTime[ac];
107a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
108a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* calculate credit */
109a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->credit[ac] += (currentTimeStamp - pTxCtrl->lastCreditCalcTimeStamp[ac]) - usageRatio;
110a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
111a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* update last time stamp */
112a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->lastCreditCalcTimeStamp[ac] = currentTimeStamp;
113a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
114a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* in case credit is bigger than mediumTime -> set credit to medium time */
115a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		if (pTxCtrl->credit[ac] > (TI_INT32)(pTxCtrl->mediumTime[ac]) )
116a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			pTxCtrl->credit[ac] = pTxCtrl->mediumTime[ac];
117a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
118a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt       TRACE2(pTxCtrl->hReport, REPORT_SEVERITY_INFORMATION, "credit = %d  | TotalUsedTime = %d\n", pTxCtrl->credit[ac], pTxCtrl->totalUsedTime[ac]/1000);
119a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
120a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* Check medium-usage threshold cross events */
121a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/*********************************************/
122a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/*
123a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 * The medium-usage events are defined as follows:
124a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 * The high threshold triggers event only when crossed upward (traffic increased above threshold).
125a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 * The low threshold triggers event only when crossed downward (traffic decreased below threshold).
126a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 * Thus, the two thresholds provide hysteresis and prevent multiple triggering.
127a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 * The high threshold should be greater than the low threshold.
128a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 *
129a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 *   Note:	The driver doesn't delay traffic even if violating the usage limit!
130a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 *			It only indicates the user application about the thresholds crossing.
131a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		 */
132a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
133a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		highCreditThreshold = (TI_INT32)((pTxCtrl->mediumTime[ac])*(pTxCtrl->highMediumUsageThreshold[ac])/100);
134a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		lowCreditThreshold  = (TI_INT32)((pTxCtrl->mediumTime[ac])*(pTxCtrl->lowMediumUsageThreshold[ac])/100);
135a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
136a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* The credit is getting more negative as we get closer to the medium usage limit, so we invert
137a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		     it before comparing to the thresholds (lower credit means higher usage). */
138a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		currUsage = -pTxCtrl->credit[ac];
139a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		prevUsage = -prevCredit;
140a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
141a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* crossing below the low threshold */
142a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		if ( (currUsage < lowCreditThreshold) && (prevUsage >= lowCreditThreshold) )
143a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		{
144a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			/* send event */
145a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			mediumTimeCross.uAC = ac;
146a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			mediumTimeCross.uHighOrLowThresholdFlag = (TI_UINT32)LOW_THRESHOLD_CROSS;
147a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			mediumTimeCross.uAboveOrBelowFlag = (TI_UINT32)CROSS_BELOW;
148a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
149a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			EvHandlerSendEvent(pTxCtrl->hEvHandler, IPC_EVENT_MEDIUM_TIME_CROSS,
150a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				(TI_UINT8 *)&mediumTimeCross, sizeof(OS_802_11_THRESHOLD_CROSS_INDICATION_PARAMS));
151a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
152a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt            TRACE3(pTxCtrl->hReport, REPORT_SEVERITY_INFORMATION, "crossed below low threshold !!! prevUsage = %d, currUsage = %d, lowCreditThreshold = %d\n",				prevUsage, currUsage, lowCreditThreshold);
153a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		}
154a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
155a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* crossing above the high threshold */
156a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		else if ( (currUsage > highCreditThreshold) && (prevUsage <= highCreditThreshold) )
157a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		{
158a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			/* send event */
159a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			mediumTimeCross.uAC = ac;
160a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			mediumTimeCross.uHighOrLowThresholdFlag = (TI_UINT32)HIGH_THRESHOLD_CROSS;
161a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			mediumTimeCross.uAboveOrBelowFlag = (TI_UINT32)CROSS_ABOVE;
162a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
163a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			EvHandlerSendEvent(pTxCtrl->hEvHandler, IPC_EVENT_MEDIUM_TIME_CROSS,
164a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				(TI_UINT8 *)&mediumTimeCross, sizeof(OS_802_11_THRESHOLD_CROSS_INDICATION_PARAMS));
165a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
166a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt            TRACE3(pTxCtrl->hReport, REPORT_SEVERITY_INFORMATION, "crossed above high threshold !!! prevUsage = %d, currUsage = %d, highCreditThreshold = %d\n",				prevUsage, currUsage, highCreditThreshold);
167a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		}
168a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
169a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* reset totalUsedTime */
170a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->totalUsedTime[ac] = 0;
171a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	}
172a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
173a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
174a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
175a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/****************************************************************************
176a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                      updateDataPktPrototype()
177a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ****************************************************************************
178a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * DESCRIPTION:	Updates the data packet prototype values according to
179a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				changed parameters (e.g. rate policy change).
180a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ****************************************************************************/
181a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtstatic void updateDataPktPrototype(txCtrl_t *pTxCtrl)
182a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
183a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->dataPktDescAttrib = pTxCtrl->txSessionCount << TX_ATTR_OFST_SESSION_COUNTER;
184a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
185a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
186a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
187a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***************************************************************************
188a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*                       txCtrlParams_resetCounters
189a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt****************************************************************************
190a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* DESCRIPTION:  Reset the tx data module counters
191a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*
192a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* INPUTS:       hTxCtrl - the object
193a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*
194a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* OUTPUT:
195a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*
196a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* RETURNS:
197a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt***************************************************************************/
198a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_resetCounters(TI_HANDLE hTxCtrl)
199a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
200a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
201a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
202a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    os_memoryZero(pTxCtrl->hOs, &pTxCtrl->txDataCounters, sizeof(TTxDataCounters) * MAX_NUM_OF_AC);
203a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    os_memoryZero(pTxCtrl->hOs, &pTxCtrl->SumTotalDelayUs, sizeof(pTxCtrl->SumTotalDelayUs));
204a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->currentConsecutiveRetryFail = 0;
205a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
206a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
207a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
208a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***************************************************************************
209a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*                       txCtrlParams_RegNotif                                    *
210a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt****************************************************************************/
211a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTI_HANDLE txCtrlParams_RegNotif(TI_HANDLE hTxCtrl, TI_UINT16 EventMask, GeneralEventCall_t CallBack,
212a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt						  TI_HANDLE context, TI_UINT32 Cookie)
213a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
214a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
215a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    if (!hTxCtrl)
216a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        return NULL;
217a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    return DistributorMgr_Reg(pTxCtrl->TxEventDistributor,EventMask,(TI_HANDLE)CallBack,context,Cookie);
218a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
219a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
220a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
221a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***************************************************************************
222a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*                       txCtrlParams_AddToNotifMask                              *
223a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt****************************************************************************/
224a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTI_STATUS txCtrlParams_AddToNotifMask(TI_HANDLE hTxCtrl, TI_HANDLE Notifh, TI_UINT16 EventMask)
225a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
226a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
227a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    if (!hTxCtrl)
228a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        return TI_NOK;
229a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    return DistributorMgr_AddToMask(pTxCtrl->TxEventDistributor, Notifh, EventMask);
230a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
231a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
232a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
233a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***************************************************************************
234a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*                       txCtrlParams_UnRegNotif                                  *
235a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt****************************************************************************/
236a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTI_STATUS txCtrlParams_UnRegNotif(TI_HANDLE hTxCtrl, TI_HANDLE RegEventHandle)
237a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
238a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
239a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
240a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    if (!hTxCtrl)
241a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        return TI_NOK;
242a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
2433bb9a92880f8cda8c242707ad02077f13b009632Dmitry Shmidt    return (DistributorMgr_UnReg(pTxCtrl->TxEventDistributor,RegEventHandle));
244a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
245a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
246a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
247a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
248a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setAdmissionCtrlParams
249a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
250a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    This function is called for add/delete a tspec in order
251a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				to update parameters.
252a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
253a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtINPUT:			hTxCtrl - handale to the ts data object
254a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				acId - the AC of the tspec
255a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				mediumTime	- tha alocated medium time for this UP
256a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				minimumPHYRate - the min phy rate to send a packet of this UP
257a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				admFlag - indicate if the its addition or deletion of tspec
258a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
259a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtOUTPUT:     None
260a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
261a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtRETURN:     void
262a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
263a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTI_STATUS txCtrlParams_setAdmissionCtrlParams(TI_HANDLE hTxCtrl, TI_UINT8 acId, TI_UINT16 mediumTime,
264a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt											  TI_UINT32 minimumPHYRate, TI_BOOL admFlag)
265a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
266a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
267a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_UINT32	i;
268a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
269a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	if(admFlag == TI_TRUE)
270a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	{
271a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* tspec added */
272a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->mediumTime[acId] = mediumTime;
273a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        pTxCtrl->admissionState[acId] = AC_ADMITTED;
274a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->useAdmissionAlgo[acId] = TI_TRUE;
275a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->lastCreditCalcTimeStamp[acId] = os_timeStampMs(pTxCtrl->hOs);
276a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->credit[acId] = mediumTime;
277a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	}
278a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	else
279a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	{
280a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* tspaec deleted */
281a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->mediumTime[acId] = 0;
282a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        pTxCtrl->admissionState[acId] = AC_NOT_ADMITTED;
283a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->useAdmissionAlgo[acId] = TI_FALSE;
284a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->lastCreditCalcTimeStamp[acId] = 0;
285a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->credit[acId] = 0;
286a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	}
287a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
288a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	/* Update the Tx queues mapping after admission change. */
289a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_UpdateQueuesMapping (hTxCtrl);
290a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
291a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	/* If the timer was not enabled in registry than we will never set it */
292a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	if (pTxCtrl->bCreditCalcTimerEnabled)
293a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	{
294a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    	/* enable disable credit calculation timer */
295a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    	for (i = 0; i < MAX_NUM_OF_AC; i++)
296a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    	{
297a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    		if (pTxCtrl->useAdmissionAlgo[i])
298a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    		{
299a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    			if (!pTxCtrl->bCreditCalcTimerRunning)
300a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    			{
301a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    				pTxCtrl->bCreditCalcTimerRunning = TI_TRUE;
302a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                    tmr_StartTimer (pTxCtrl->hCreditTimer,
303a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                                    calcCreditFromTimer,
304a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                                    (TI_HANDLE)pTxCtrl,
305a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                                    pTxCtrl->creditCalculationTimeout,
306a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                                    TI_TRUE);
307a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    			}
308a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
309a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    			return TI_OK;
310a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    		}
311a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    	}
312a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
313a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    	/* in all queues useAdmissionAlgo is not TRUE, so stop timer if running */
314a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        if (pTxCtrl->bCreditCalcTimerRunning)
315a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        {
316a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt            tmr_StopTimer (pTxCtrl->hCreditTimer);
317a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt            pTxCtrl->bCreditCalcTimerRunning = TI_FALSE;
318a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        }
319a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    }
320a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
321a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	return TI_OK;
322a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
323a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
324a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
325a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***************************************************************************
326a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*                           txCtrlParams_getParam
327a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt****************************************************************************
328a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* DESCRIPTION:  Get a specific parameter by an external user application.
329a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*
330a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* OUTPUT:       pParamInfo - structure which include the value of
331a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*               the requested parameter
332a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt***************************************************************************/
333a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTI_STATUS txCtrlParams_getParam(TI_HANDLE hTxCtrl, paramInfo_t *pParamInfo)
334a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
335a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
336a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_UINT32 ac;
337a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
338a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    if(pTxCtrl == NULL)  /* check handle validity */
339a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    {
340a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        return TI_NOK;
341a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    }
342a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
343a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    switch (pParamInfo->paramType)
344a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    {
345a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    case TX_CTRL_COUNTERS_PARAM:
346a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* Convert total-delays units from usec to mSec. */
347a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		for(ac = 0 ; ac < MAX_NUM_OF_AC ; ac++)
348a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		{
349a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			pTxCtrl->txDataCounters[ac].SumTotalDelayMs = pTxCtrl->SumTotalDelayUs[ac] / 1000;
350a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		}
351a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        os_memoryCopy( pTxCtrl->hOs, pParamInfo->content.pTxDataCounters, &(pTxCtrl->txDataCounters[0]),
352a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                       sizeof(TTxDataCounters) * MAX_NUM_OF_AC);
353a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pParamInfo->paramLength = sizeof(TTxDataCounters) * MAX_NUM_OF_AC;
354a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        break;
355a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
356a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	case TX_CTRL_GET_DATA_FRAME_COUNTER:
357a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pParamInfo->content.txPacketsCount = 0;
358a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		for (ac = 0; ac < MAX_NUM_OF_AC; ac++)
359a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        	pParamInfo->content.txPacketsCount += pTxCtrl->txDataCounters[ac].XmitOk;
360a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        break;
361a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
362a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	case TX_CTRL_REPORT_TS_STATISTICS:
363a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		ac = pParamInfo->content.tsMetricsCounters.acID;
364a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		os_memoryCopy(pTxCtrl->hOs,
365a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt					  pParamInfo->content.tsMetricsCounters.pTxDataCounters,
366a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt					  &(pTxCtrl->txDataCounters[ac]),
367a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt					  sizeof(TTxDataCounters));
368a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		os_memoryZero(pTxCtrl->hOs, &(pTxCtrl->txDataCounters[ac]), sizeof(TTxDataCounters));
369a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		break;
370a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
371a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	case TX_CTRL_GENERIC_ETHERTYPE:
372a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pParamInfo->content.txGenericEthertype = pTxCtrl->genericEthertype;
373a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		break;
374a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
375a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
376a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    default:
377a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        TRACE0(pTxCtrl->hReport, REPORT_SEVERITY_ERROR, ": PARAMETER NOT SUPPORTED\n");
378a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        return PARAM_NOT_SUPPORTED;
379a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    }
380a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
381a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    return TI_OK;
382a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
383a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
384a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
385a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***************************************************************************
386a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*                           txCtrlParams_setParam
387a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt****************************************************************************
388a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* DESCRIPTION:  Set a specific parameter by an external user application.
389a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*
390a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* INPUTS:       hTxCtrl - the object
391a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*               pParamInfo - structure which include the value to set for
392a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*               the requested parameter
393a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt***************************************************************************/
394a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTI_STATUS txCtrlParams_setParam(TI_HANDLE hTxCtrl, paramInfo_t *pParamInfo)
395a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
396a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
397a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	TI_UINT8 acID;
398a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
399a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    if(pTxCtrl == NULL)  /* check handle validity */
400a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    {
401a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        return TI_NOK;
402a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    }
403a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
404a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    switch (pParamInfo->paramType)
405a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    {
406a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    case TX_CTRL_SET_MEDIUM_USAGE_THRESHOLD:
407a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		acID = (TI_UINT8)pParamInfo->content.txDataMediumUsageThreshold.uAC;
408a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		if(acID < MAX_NUM_OF_AC)
409a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		{
410a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			pTxCtrl->highMediumUsageThreshold[acID] =
411a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				pParamInfo->content.txDataMediumUsageThreshold.uHighThreshold;
412a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt			pTxCtrl->lowMediumUsageThreshold[acID] =
413a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				pParamInfo->content.txDataMediumUsageThreshold.uLowThreshold;
414a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		}
415a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		else
416a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTRACE1(pTxCtrl->hReport, REPORT_SEVERITY_ERROR, ": Wrong AC (AC=%d > 3)\n", acID);
417a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		break;
418a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
419a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    case TX_CTRL_GET_MEDIUM_USAGE_THRESHOLD:
420a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		/* Note: SET operation is used for GET, because AC parameter should be supplied from Utility-
421a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	         Adapter to driver (copy of user supplied block of data is only performed in SetParam calls). */
422a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		acID = (TI_UINT8)pParamInfo->content.txDataMediumUsageThreshold.uAC;
423a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pParamInfo->content.txDataMediumUsageThreshold.uHighThreshold = pTxCtrl->highMediumUsageThreshold[acID];
424a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pParamInfo->content.txDataMediumUsageThreshold.uLowThreshold  = pTxCtrl->lowMediumUsageThreshold[acID];
425a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		break;
426a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
427a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    case TX_CTRL_POLL_AP_PACKETS_FROM_AC:
428a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt       TRACE0(pTxCtrl->hReport, REPORT_SEVERITY_ERROR, ": Poll-AP is not supported in this version!!\n");
429a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt       return PARAM_NOT_SUPPORTED;
430a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
431a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	case TX_CTRL_RESET_COUNTERS_PARAM:
432a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		txCtrlParams_resetCounters(hTxCtrl);
433a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		break;
434a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
435a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	case TX_CTRL_GENERIC_ETHERTYPE:
436a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        pTxCtrl->genericEthertype = pParamInfo->content.txGenericEthertype;
437a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		{
438a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				paramInfo_t param;
439a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				param.paramType = RX_DATA_GENERIC_ETHERTYPE_PARAM;
440a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				param.content.rxGenericEthertype = pTxCtrl->genericEthertype;
441a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				rxData_setParam(pTxCtrl->hRxData, &param);
442a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		}
443a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		break;
444a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
445a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
446a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    default:
447a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        TRACE0(pTxCtrl->hReport, REPORT_SEVERITY_ERROR, ": PARAMETER NOT SUPPORTED\n");
448a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        return PARAM_NOT_SUPPORTED;
449a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    }
450a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
451a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    return TI_OK;
452a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
453a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
454a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
455a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
456a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setBssId
457a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
458a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the BSS-ID.
459a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
460a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setBssId (TI_HANDLE hTxCtrl, TMacAddr *pCurrBssId)
461a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
462a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
463a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
464a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	MAC_COPY (pTxCtrl->currBssId, *pCurrBssId);
465a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
466a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
467a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
468a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
469a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setBssType
470a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
471a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the BSS type.
472a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
473a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setBssType (TI_HANDLE hTxCtrl, ScanBssType_e currBssType)
474a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
475a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
476a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
477a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->currBssType = currBssType;
478a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
479a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
480a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
481a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
482a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setQosHeaderConverMode
483a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
484a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the BSS type.
485a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
486a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setQosHeaderConverMode (TI_HANDLE hTxCtrl, EHeaderConvertMode  headerConverMode)
487a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
488a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
489a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
490a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->headerConverMode = headerConverMode;
491a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
492a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	updateDataPktPrototype(pTxCtrl);  /* Needed due to QoS mode change. */
493a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
494a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
495a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/**
496a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * \fn     txCtrlParams_SetHtControl()
497a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * \brief  Update The HT Control Field on txCtrl module.
498a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *
499a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * \note
500a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * \param  hTxCtrl - the hTxCtrl handle.
501a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * \param  pHtCapabilitiesIe - input structure.
502a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * \return TI_OK on success or TI_NOK on failure
503a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt * \sa
504a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt */
505a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtTI_STATUS txCtrlParams_SetHtControl (TI_HANDLE hTxCtrl, TtxCtrlHtControl *pHtControl)
506a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
507a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
508a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
509a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    pTxCtrl->tTxCtrlHtControl.bHtEnable = pHtControl->bHtEnable;
510a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
511a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    return TI_OK;
512a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
513a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
514a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
515a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setCurrentPrivacyInvokedMode
516a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
517a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the current privacy invoked mode.
518a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
519a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setCurrentPrivacyInvokedMode (TI_HANDLE hTxCtrl, TI_BOOL currentPrivacyInvokedMode)
520a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
521a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
522a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
523a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->currentPrivacyInvokedMode = currentPrivacyInvokedMode;
524a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
525a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
526a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
527a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
528a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setEapolEncryptionStatus
529a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
530a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the Eapol Encryption Status.
531a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
532a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setEapolEncryptionStatus (TI_HANDLE hTxCtrl, TI_BOOL eapolEncryptionStatus)
533a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
534a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
535a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
536a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->eapolEncryptionStatus = eapolEncryptionStatus;
537a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
538a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
539a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
540a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
541a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setEncryptionFieldSizes
542a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
543a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the encryption field size for the header padding.
544a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
545a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setEncryptionFieldSizes (TI_HANDLE hTxCtrl, TI_UINT8 encryptionFieldSize)
546a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
547a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
548a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
549a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->encryptionFieldSize = encryptionFieldSize;
550a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
551a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
552a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
553a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
554a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_getCurrentEncryptionInfo
555a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
556a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Provide the current encryption mode and padding size.
557a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
558a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_getCurrentEncryptionInfo (TI_HANDLE hTxCtrl,
559a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                                            TI_BOOL    *pCurrentPrivacyInvokedMode,
560a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                                            TI_UINT8   *pEncryptionFieldSize)
561a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
562a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
563a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
564a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    *pCurrentPrivacyInvokedMode = pTxCtrl->currentPrivacyInvokedMode;
565a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    *pEncryptionFieldSize = pTxCtrl->encryptionFieldSize;
566a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
567a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
568a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
569a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
570a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_GetTxRate
571a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
572a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Provide the last successfull data packet Tx rate.
573a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
574a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtERate txCtrlParams_GetTxRate (TI_HANDLE hTxCtrl)
575a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
576a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
577a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
578a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    return pTxCtrl->eCurrentTxRate;
579a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
580a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
581a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
582a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
583a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setAcAdmissionStatus
584a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
585a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the AC admission status - required or not and admitted or not.
586a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt				Update also the queues mapping in case it should change.
587a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
588a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setAcAdmissionStatus (TI_HANDLE hTxCtrl,
589a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                                        TI_UINT8 ac,
590a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt                                        EAdmissionState admissionRequired,
591a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt										ETrafficAdmState admissionState)
592a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
593a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
594a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
595a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->admissionRequired[ac] = admissionRequired;
596a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->admissionState[ac]    = admissionState;
597a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
598a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	/* Update the Tx queues mapping after admission change. */
599a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_UpdateQueuesMapping (hTxCtrl);
600a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
601a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
602a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
603a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
604a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setAcMsduLifeTime
605a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
606a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the AC MSDU lifetime. The units are TUs (1024 usec).
607a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
608a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setAcMsduLifeTime (TI_HANDLE hTxCtrl, TI_UINT8 ac, TI_UINT32 uMsduLifeTimeTu)
609a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
610a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
611a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
612a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->aMsduLifeTimeTu[ac] = (TI_UINT16)uMsduLifeTimeTu;
613a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
614a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
615a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
616a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
617a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                        txCtrlParams_setAcAckPolicy
618a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
619a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the AC Ack policy.
620a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
621a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_setAcAckPolicy (TI_HANDLE hTxCtrl, TI_UINT8 ac, AckPolicy_e ackPolicy)
622a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
623a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
624a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
625a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->ackPolicy[ac] = ackPolicy;
626a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
627a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
628a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
629a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
630a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                     txCtrlParams_updateMgmtRateAttributes
631a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
632a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update per AC the rate policy for Mgmnt packets or IBSS BCAST packets.
633a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
634a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_updateMgmtRateAttributes(TI_HANDLE hTxCtrl, TI_UINT8 ratePolicyId, TI_UINT8 ac)
635a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
636a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
637a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
638a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->mgmtRatePolicy[ac] = ratePolicyId;
639a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
640a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
641a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
642a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
643a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                     txCtrlParams_updateDataRateAttributes
644a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
645a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update per AC the rate policy for regular data packets (excluding IBSS BCAST packets).
646a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
647a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_updateDataRateAttributes(TI_HANDLE hTxCtrl, TI_UINT8 ratePolicyId, TI_UINT8 ac)
648a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
649a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
650a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
651a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->dataRatePolicy[ac] = ratePolicyId;
652a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
653a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
654a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
655a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
656a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                     txCtrlParams_updateTxSessionCount
657a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
658a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Update the current Tx-session index configured to FW.
659a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
660a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_updateTxSessionCount(TI_HANDLE hTxCtrl, TI_UINT16 txSessionCount)
661a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
662a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
663a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
664a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	pTxCtrl->txSessionCount = txSessionCount;
665a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
666a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt	updateDataPktPrototype(pTxCtrl);
667a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
668a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
669a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
670a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
671a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
672a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/********************************************************************************
673a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*																				*
674a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*                       DEBUG  FUNCTIONS  IMPLEMENTATION						*
675a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*																				*
676a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*********************************************************************************/
677a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
678a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#ifdef TI_DBG
679a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
680a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
681a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                     txCtrlParams_printInfo
682a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
683a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Print module internal information.
684a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
685a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_printInfo(TI_HANDLE hTxCtrl)
686a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
687ddac9c138c5b4b16b99fb8bc5f0f10418efa1029Dmitry Shmidt#ifdef REPORT_LOG
688ddac9c138c5b4b16b99fb8bc5f0f10418efa1029Dmitry Shmidt    txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
689a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
690a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("-------------- Tx-Ctrl Module Information --------------\n"));
691a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("========================================================\n"));
692a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
693a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("ACs Mapping:\n"));
694a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("------------\n"));
695a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("admissionRequired[3,2,1,0]   =  %d,   %d,   %d,   %d\n",
696a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->admissionRequired[3], pTxCtrl->admissionRequired[2],
697a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->admissionRequired[1], pTxCtrl->admissionRequired[0]));
698a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("admissionState[3,2,1,0]      =  %d,   %d,   %d,   %d\n",
699a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->admissionState[3], pTxCtrl->admissionState[2],
700a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->admissionState[1], pTxCtrl->admissionState[0]));
701a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("highestAdmittedAc[3,2,1,0]   =  %d,   %d,   %d,   %d\n",
702a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->highestAdmittedAc[3], pTxCtrl->highestAdmittedAc[2],
703a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->highestAdmittedAc[1], pTxCtrl->highestAdmittedAc[0]));
704a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("admittedAcToTidMap[3,2,1,0]  =  0x%x, 0x%x, 0x%x, 0x%x\n",
705a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->admittedAcToTidMap[3], pTxCtrl->admittedAcToTidMap[2],
706a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->admittedAcToTidMap[1], pTxCtrl->admittedAcToTidMap[0]));
707a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("busyAcBitmap                 = 0x%x\n", pTxCtrl->busyAcBitmap));
708a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("busyTidBitmap                = 0x%x\n", pTxCtrl->busyTidBitmap));
709a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("--------------------------------------------------------\n"));
710a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
711a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("Tx Attributes:\n"));
712a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("--------------\n"));
713a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("mgmtRatePolicy[3,2,1,0]      =  %d,   %d,   %d,   %d\n",
714a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->mgmtRatePolicy[3], pTxCtrl->mgmtRatePolicy[2],
715a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->mgmtRatePolicy[1], pTxCtrl->mgmtRatePolicy[0]));
716a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("dataRatePolicy[3,2,1,0]      =  %d,   %d,   %d,   %d\n",
717a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->dataRatePolicy[3], pTxCtrl->dataRatePolicy[2],
718a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->dataRatePolicy[1], pTxCtrl->dataRatePolicy[0]));
719a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("dataPktDescAttrib            = 0x%x\n", pTxCtrl->dataPktDescAttrib));
720a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("--------------------------------------------------------\n"));
721a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
722a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("Parameters:\n"));
723a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("----------\n"));
724a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("headerConverMode             = %d\n", pTxCtrl->headerConverMode));
725a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("currentPrivacyInvokedMode    = %d\n", pTxCtrl->currentPrivacyInvokedMode));
726a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("eapolEncryptionStatus        = %d\n", pTxCtrl->eapolEncryptionStatus));
727a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("encryptionFieldSize          = %d\n", pTxCtrl->encryptionFieldSize));
728a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("currBssType                  = %d\n", pTxCtrl->currBssType));
729a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("========================================================\n\n"));
730ddac9c138c5b4b16b99fb8bc5f0f10418efa1029Dmitry Shmidt#endif
731a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
732a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
733a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
734a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***********************************************************************
735a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt *                     txCtrlParams_printDebugCounters
736a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt ***********************************************************************
737a615fb1650af6e111053506f1b764b28a5b4631dDmitry ShmidtDESCRIPTION:    Print Tx statistics debug counters.
738a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt************************************************************************/
739a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_printDebugCounters(TI_HANDLE hTxCtrl)
740a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
741ddac9c138c5b4b16b99fb8bc5f0f10418efa1029Dmitry Shmidt#ifdef REPORT_LOG
742ddac9c138c5b4b16b99fb8bc5f0f10418efa1029Dmitry Shmidt    txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
743a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    TI_UINT32 ac;
744a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
745a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("-------------- Tx-Ctrl Statistics Per AC ---------------\n"));
746a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("========================================================\n"));
747a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
748a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("---------- Packets Sent To Tx-Ctrl ---------------------\n"));
749a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
750a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumPktsSent[ac]));
751a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
752a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("---------- Number of Queue-Stop (BP) -------------------\n"));
753a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
754a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumPktsBackpressure[ac]));
755a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
756a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("---------- Number of AC Busy (Requeue pkt) -------------\n"));
757a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
758a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumPktsBusy[ac]));
759a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
760a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("---------- Packets Sent to Xfer ------------------------\n"));
761a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
762a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumPktsXfered[ac]));
763a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
764a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("----------- Xfer rc = Success --------------------------\n"));
765a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
766a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumPktsSuccess[ac]));
767a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
768a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("----------- Xfer rc = Pending --------------------------\n"));
769a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
770a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumPktsPending[ac]));
771a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
772a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("----------- Xfer rc = Error ----------------------------\n"));
773a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
774a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumPktsError[ac]));
775a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
776a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("----------- Number of Tx-Complete Packets --------------\n"));
777a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
778a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumTxCmplt[ac]));
779a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
780a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("----------- Number of Tx-Complete Packets TI_OK -----------\n"));
781a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
782a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumTxCmpltOk[ac]));
783a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
784a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("----------- Number of Tx-Complete Packets Fails --------\n"));
785a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
786a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumTxCmpltError[ac]));
787a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
788a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("----------- Number of Tx-Complete Bytes TI_OK -------------\n"));
789a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    for(ac = 0; ac < MAX_NUM_OF_AC; ac++)
790a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt        WLAN_OS_REPORT(("AC %d = %d\n", ac, pTxCtrl->dbgCounters.dbgNumTxCmpltOkBytes[ac]));
791a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("--------------------------------------------------------\n"));
792a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
793a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("Total Number of Xfer-Complete Events = %d\n", pTxCtrl->dbgCounters.dbgNumXferCmplt));
794a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("Total Number of Xfer-Pending  Events = %d\n",
795a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->dbgCounters.dbgNumPktsPending[0] +	pTxCtrl->dbgCounters.dbgNumPktsPending[1] +
796a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt		pTxCtrl->dbgCounters.dbgNumPktsPending[2] +	pTxCtrl->dbgCounters.dbgNumPktsPending[3]));
797a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    WLAN_OS_REPORT(("========================================================\n\n"));
798ddac9c138c5b4b16b99fb8bc5f0f10418efa1029Dmitry Shmidt#endif
799a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
800a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
801a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
802a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt/***************************************************************************
803a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt*                       txCtrlParams_resetDbgCounters
804a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt****************************************************************************
805a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt* DESCRIPTION:  Reset the tx data module debug counters
806a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt***************************************************************************/
807a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidtvoid txCtrlParams_resetDbgCounters(TI_HANDLE hTxCtrl)
808a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt{
809a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
810a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
811a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt    os_memoryZero(pTxCtrl->hOs, &pTxCtrl->dbgCounters, sizeof(txDataDbgCounters_t));
812a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt}
813a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
814a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
815a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt
816a615fb1650af6e111053506f1b764b28a5b4631dDmitry Shmidt#endif   /* TI_DBG */
817