• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2 **+-----------------------------------------------------------------------+**
3 **|                                                                       |**
4 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
5 **| All rights reserved.                                                  |**
6 **|                                                                       |**
7 **| Redistribution and use in source and binary forms, with or without    |**
8 **| modification, are permitted provided that the following conditions    |**
9 **| are met:                                                              |**
10 **|                                                                       |**
11 **|  * Redistributions of source code must retain the above copyright     |**
12 **|    notice, this list of conditions and the following disclaimer.      |**
13 **|  * Redistributions in binary form must reproduce the above copyright  |**
14 **|    notice, this list of conditions and the following disclaimer in    |**
15 **|    the documentation and/or other materials provided with the         |**
16 **|    distribution.                                                      |**
17 **|  * Neither the name Texas Instruments nor the names of its            |**
18 **|    contributors may be used to endorse or promote products derived    |**
19 **|    from this software without specific prior written permission.      |**
20 **|                                                                       |**
21 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
22 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
23 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
24 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
25 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
26 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
27 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
28 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
29 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
30 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
31 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
32 **|                                                                       |**
33 **+-----------------------------------------------------------------------+**
34 ****************************************************************************/
35 
36 /***************************************************************************/
37 /*															           	   */
38 /*		MODULE:	MsduList.c									           	   */
39 /*    PURPOSE:	MSDU list implementation        				       	   */
40 /*															               */
41 /***************************************************************************/
42 
43 #ifndef _MSDU_LIST_H_
44 #define _MSDU_LIST_H_
45 
46 #include "memMngrEx.h"
47 #include "report.h"
48 
49 
50 /************************************************************************/
51 /* MSDU link list definition.											*/
52 /************************************************************************/
53 typedef struct
54 {
55 	TI_HANDLE	hMemMgr;		/* handle to memory manger */
56 	TI_HANDLE	hReport;		/* handle to Report object */
57 	TI_HANDLE	hOs;			/* handle to Os Abstraction object */
58 
59 	TI_HANDLE	hCriticalSectionProtect;
60 
61 	mem_MSDU_T *first;			/* Points to the first Msdu's in the list. */
62 	mem_MSDU_T *last;			/* Points to the last Msdu's is the list. */
63 	UINT16   maxNumOfMsdu;		/* The maximum number of Msdu's allowed to be in the queue. */
64 	UINT16   CurrNumOfMsdu;		/* The current number of Msdu's.         */
65 	qOvFlowPolicy_e  ovFlowPolicy; /* tx over flow policy */
66 
67 	UINT16	numOfOverFlow ;
68 	UINT16	maxCurrOfMsdu ;
69 
70 	/* admission ctrl params */
71 	UINT8	acId;	/* the AC used for this Tx queue. */
72 	BOOL	useAdmissionAlgo;
73 	INT32 	credit;
74 	UINT32	enableTransmissionTime ;
75 	UINT32	lastTimeStamp;
76 	UINT32	mediumTime;
77 
78 	UINT32 totalUsedTime;
79 
80 	trafficAdmState_e  admissionState;
81 	admissionState_e   admissionRequired;
82 
83 
84 	INT32 highMediumUsageThreshold;
85 	INT32 lowMediumUsageThreshold;
86 	UINT8 selectionHistoryCounter; /* When selected by Tx scheduler this counter is preset, and is decremented
87 									  every scheduler activation, so we have some indication on selections history. */
88 
89 }MsduList_t;
90 
91 
92 MsduList_t* msduList_CreateNewMsduList(TI_HANDLE hOs );
93 
94 TI_STATUS	msduList_ConfigMsduList( MsduList_t* this,	TI_HANDLE hMemMgr,
95 							 TI_HANDLE hReport, TI_HANDLE hOs,INT16 maxNumOfElements );
96 
97 TI_STATUS	msduList_SetMsduListNumOfElements( MsduList_t* this, UINT16 maxNumOfElements);
98 
99 TI_STATUS	msduList_SetMsduListOverFlowPolicy( MsduList_t* this, qOvFlowPolicy_e  QueueOvFlowPolicy);
100 
101 TI_STATUS msduList_FreeMsduList( MsduList_t* this);
102 
103 TI_STATUS msduList_EmptyMsduList( MsduList_t* this );
104 
105 TI_STATUS msduList_Insert( MsduList_t* this , mem_MSDU_T  **pMsdu );
106 
107 TI_STATUS msduList_WatchFirst( MsduList_t *this, mem_MSDU_T  **pMsdu );
108 
109 TI_STATUS msduList_GetFirst( MsduList_t *this, mem_MSDU_T  **pMsdu );
110 
111 UINT32 msduList_getCurrNumOfMsdu(MsduList_t *this);
112 
113 
114 /* Test Functions */
115 /*----------------*/
116 void printFullMsduList(MsduList_t *this);
117 void printMsduList(MsduList_t *this);
118 
119 
120 #endif /* _MSDU_LIST_H_ */
121