PageRenderTime 47ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/src/core/data_ctrl/Ctrl/4X/fourX.h

http://github.com/CyanogenMod/cm-kernel
C Header | 218 lines | 128 code | 41 blank | 49 comment | 0 complexity | 9c23d4744f74c6f1d80d8a9befdcf0c9 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: */
  38. /* PURPOSE: */
  39. /* */
  40. /***************************************************************************/
  41. #ifndef _FOUR_X_H
  42. #define _FOUR_X_H
  43. #include "osTIType.h"
  44. #include "paramIn.h"
  45. #include "paramOut.h"
  46. #include "Concatenator.h"
  47. #include "DeConcatenator.h"
  48. #include "ackEmulUtil.h"
  49. #include "memMngrEx.h"
  50. #include "802_11Defs.h"
  51. #include "MsduList.h"
  52. #include "DataCtrl_Api.h"
  53. #define FOUR_X_MODULE_LOG CTRL_DATA_MODULE_LOG
  54. #define DEF_CW_MAX 1023
  55. #define DEF_CW_MIN 15
  56. #define DEF_CW_COMBO_CW_MIN 3
  57. #define DEF_CW_COMBO_DIFS 64
  58. #define DEF_CW_COMBO_SLOT 15
  59. #define CONCATENATION_CAPABILITY_ID 0x0001
  60. #define CONTENTION_WINDOW_CAPABILITY_ID 0x0002
  61. #define CW_COMB_CAPABILITY_ID 0x0003
  62. #define ACK ELIMINATION_CAPABILITY_ID 0x0004
  63. #define ERP_PROTECTION_CAPABILITY_ID 0x0005
  64. #define FOUR_X_PROTOCOL_VERSION_0 0x00
  65. #define FOUR_X_INFO_ELEMENT_VERSION_0_LEN 4
  66. #define FOUR_X_PROTOCOL_VERSION_1 0x01
  67. #define FOUR_X_CONCAT_CAP_ID 0x0001
  68. #define FOUR_X_CONCAT_CAP_LEN 0x0002
  69. typedef struct
  70. {
  71. BOOL enableDisable;
  72. UINT16 concatenationSize;
  73. } concatenationParams_t;
  74. typedef struct
  75. {
  76. UINT32 count1;
  77. UINT32 count2;
  78. UINT32 count3;
  79. UINT32 count4;
  80. UINT32 count5;
  81. UINT32 count6;
  82. UINT32 count7;
  83. } concatenationDecisionCounter_t;
  84. typedef struct
  85. {
  86. BOOL enableDisable;
  87. UINT16 CWMin;
  88. UINT16 CWMax;
  89. }contentionWindowParams_t;
  90. typedef struct
  91. {
  92. BOOL enableDisable;
  93. UINT16 DIFS;
  94. UINT16 SLOT;
  95. UINT16 CWMin;
  96. }CWCombParams_t;
  97. typedef struct
  98. {
  99. BOOL enableDisable;
  100. }ackEmulationParams_t;
  101. typedef struct
  102. {
  103. BOOL enableDisable;
  104. }ERP_ProtectionParams_t;
  105. typedef struct
  106. {
  107. UINT8 fourXProtocolVersion;
  108. concatenationParams_t concatenationParams;
  109. contentionWindowParams_t contentionWindowParams;
  110. CWCombParams_t CWCombParams;
  111. ackEmulationParams_t ackEmulationParams;
  112. ERP_ProtectionParams_t ERP_ProtectionParams;
  113. } fourX_Capabilities_t;
  114. typedef struct
  115. {
  116. TI_HANDLE hOs;
  117. TI_HANDLE hReport;
  118. TI_HANDLE hMemMngr;
  119. TI_HANDLE hWhalCtrl;
  120. TI_HANDLE hTxData;
  121. /* current enable/disable status */
  122. BOOL concatenationEnable;
  123. BOOL CWMinEnable;
  124. BOOL CWComboEnable;
  125. BOOL ackEmulationEnable;
  126. BOOL ERP_ProtectionEnable;
  127. /* desired enable/disable features */
  128. BOOL desiredConcatenationEnable;
  129. BOOL desiredCWMinEnable;
  130. BOOL desiredCWComboEnable;
  131. BOOL desiredAckEmulationEnable;
  132. BOOL desiredERP_ProtectionEnable;
  133. /* desired parameters */
  134. UINT32 desiredMaxConcatSize;
  135. UINT16 desiredCWMin;
  136. UINT16 desiredCWMax;
  137. /* AP supported features */
  138. fourX_Capabilities_t ApFourX_Capabilities;
  139. /* 4x parameters */
  140. UINT32 currentMaxConcatSize;
  141. UINT16 currentCWMin;
  142. UINT16 currentCWMax;
  143. /* 4x sub modules */
  144. deConcatenator_t* pDeConcatenator;
  145. concatenator_t* pConcatenator;
  146. ackEmul_t* pAckEmul;
  147. /* for debug */
  148. concatenationDecisionCounter_t counters;
  149. } fourX_t;
  150. fourX_t* fourX_create(TI_HANDLE hOs);
  151. TI_STATUS fourX_config(fourX_t* pFourX,
  152. TI_HANDLE hOs,
  153. TI_HANDLE hReport,
  154. TI_HANDLE hMemMngr,
  155. TI_HANDLE hWhalCtrl,
  156. TI_HANDLE hTxData,
  157. fourXInitParams_t* fourXInitParams);
  158. TI_STATUS fourX_destroy(fourX_t* pFourX);
  159. TI_STATUS fourX_rxMsdu(fourX_t* pFourX,
  160. mem_MSDU_T** rxMsduPtr);
  161. TI_STATUS fourX_txMsduBeforInsertToQueue(fourX_t* pFourX,
  162. mem_MSDU_T** msduPtr);
  163. TI_STATUS fourX_txMsduDeQueue(fourX_t* pFourX,
  164. mem_MSDU_T** returnMsduPtr,
  165. MsduList_t* pMsduList,
  166. hwTxInformation_t* pHwTxInformation);
  167. /* 4X manager */
  168. TI_STATUS fourXManager_evalSite(fourX_t* pFourX,
  169. dot11_4X_t* site4xParams,
  170. UINT32 *matchingLevel);
  171. TI_STATUS fourXManager_setSite(fourX_t* pFourX,
  172. dot11_4X_t* site4xParams);
  173. TI_STATUS fourXManager_get4xInfoElemnt(fourX_t* pFourX,
  174. dot11_4X_t* fourXInfoElemnt);
  175. /* debug functions */
  176. void fourX_printParams(fourX_t* pFourX);
  177. #endif