PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/src/core/data_ctrl/Tx/MsduList.h

http://github.com/CyanogenMod/cm-kernel
C Header | 120 lines | 44 code | 29 blank | 47 comment | 0 complexity | 12add13d3d5303fe97b1c47a7a733634 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
  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. /* MODULE: MsduList.c */
  38. /* PURPOSE: MSDU list implementation */
  39. /* */
  40. /***************************************************************************/
  41. #ifndef _MSDU_LIST_H_
  42. #define _MSDU_LIST_H_
  43. #include "memMngrEx.h"
  44. #include "report.h"
  45. /************************************************************************/
  46. /* MSDU link list definition. */
  47. /************************************************************************/
  48. typedef struct
  49. {
  50. TI_HANDLE hMemMgr; /* handle to memory manger */
  51. TI_HANDLE hReport; /* handle to Report object */
  52. TI_HANDLE hOs; /* handle to Os Abstraction object */
  53. TI_HANDLE hCriticalSectionProtect;
  54. mem_MSDU_T *first; /* Points to the first Msdu's in the list. */
  55. mem_MSDU_T *last; /* Points to the last Msdu's is the list. */
  56. UINT16 maxNumOfMsdu; /* The maximum number of Msdu's allowed to be in the queue. */
  57. UINT16 CurrNumOfMsdu; /* The current number of Msdu's. */
  58. qOvFlowPolicy_e ovFlowPolicy; /* tx over flow policy */
  59. UINT16 numOfOverFlow ;
  60. UINT16 maxCurrOfMsdu ;
  61. /* admission ctrl params */
  62. UINT8 acId; /* the AC used for this Tx queue. */
  63. BOOL useAdmissionAlgo;
  64. INT32 credit;
  65. UINT32 enableTransmissionTime ;
  66. UINT32 lastTimeStamp;
  67. UINT32 mediumTime;
  68. UINT32 totalUsedTime;
  69. trafficAdmState_e admissionState;
  70. admissionState_e admissionRequired;
  71. INT32 highMediumUsageThreshold;
  72. INT32 lowMediumUsageThreshold;
  73. UINT8 selectionHistoryCounter; /* When selected by Tx scheduler this counter is preset, and is decremented
  74. every scheduler activation, so we have some indication on selections history. */
  75. }MsduList_t;
  76. MsduList_t* msduList_CreateNewMsduList(TI_HANDLE hOs );
  77. TI_STATUS msduList_ConfigMsduList( MsduList_t* this, TI_HANDLE hMemMgr,
  78. TI_HANDLE hReport, TI_HANDLE hOs,INT16 maxNumOfElements );
  79. TI_STATUS msduList_SetMsduListNumOfElements( MsduList_t* this, UINT16 maxNumOfElements);
  80. TI_STATUS msduList_SetMsduListOverFlowPolicy( MsduList_t* this, qOvFlowPolicy_e QueueOvFlowPolicy);
  81. TI_STATUS msduList_FreeMsduList( MsduList_t* this);
  82. TI_STATUS msduList_EmptyMsduList( MsduList_t* this );
  83. TI_STATUS msduList_Insert( MsduList_t* this , mem_MSDU_T **pMsdu );
  84. TI_STATUS msduList_WatchFirst( MsduList_t *this, mem_MSDU_T **pMsdu );
  85. TI_STATUS msduList_GetFirst( MsduList_t *this, mem_MSDU_T **pMsdu );
  86. UINT32 msduList_getCurrNumOfMsdu(MsduList_t *this);
  87. /* Test Functions */
  88. /*----------------*/
  89. void printFullMsduList(MsduList_t *this);
  90. void printMsduList(MsduList_t *this);
  91. #endif /* _MSDU_LIST_H_ */