PageRenderTime 42ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://github.com/CyanogenMod/cm-kernel
C Header | 257 lines | 148 code | 45 blank | 64 comment | 0 complexity | 94b9ee0337ea9dff4fa5aa18089ede35 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: tx.h */
  38. /* PURPOSE: Tx module Header file */
  39. /* */
  40. /***************************************************************************/
  41. #ifndef _TX_DATA_H_
  42. #define _TX_DATA_H_
  43. #include "MsduList.h"
  44. #include "paramOut.h"
  45. #include "DataCtrl_Api.h"
  46. #define DEF_TX_PORT_STATUS CLOSE
  47. #define DEF_CURRENT_PRIVACY_INVOKED_MODE FALSE
  48. #define DEF_EAPOL_ENCRYPTION_STATUS FALSE
  49. #define DEF_SCHEDULER_THRESHOLD 32
  50. #define DEF_IS_SCHEDULER_IN_WORK FALSE
  51. #define SCHEDULER_TIMER 1000
  52. #define THROUGHPUT_TIMER 1000
  53. #define DEF_HAL_INTERFACE_STATUS TX_DATA_OPEN
  54. /*Ronnie: add GWSI IF status and the following defines*/
  55. #define DEF_GWSI_INTERFACE_STATUS GWSI_OPEN
  56. #define MAX_NUMBER_OF_PRIORITIES 1
  57. typedef struct
  58. {
  59. UINT32 dbgDropedPacketsCounter; /* Pkts that failed to be inserted into Q */
  60. UINT32 dbgInsertToMsduListBytes[MAX_NUM_OF_TX_QUEUES]; /* Bytes inserted into Q */
  61. UINT32 dbgInsertToMsduListPackets[MAX_NUM_OF_TX_QUEUES]; /* Pkts that inserted into Q */
  62. UINT32 dbgDropedFromMsduListPackets[MAX_NUM_OF_TX_QUEUES]; /* Pkts that failed to be inserted into Q */
  63. UINT32 dbgScheduledOutPackets[MAX_NUM_OF_TX_QUEUES]; /* Pkts scheduled for transmission per Q */
  64. UINT32 dbgSendToGwsiQosPackets[MAX_NUM_OF_TX_QUEUES]; /* Pkts sent to GWSI layer */
  65. UINT32 dbgDroppedDueExpiryTimePackets[MAX_NUM_OF_TX_QUEUES]; /* Pkts dropped due to expiry time */
  66. UINT32 dbgNumOfMsduFreeInTxTransfer[MAX_NUM_OF_TX_QUEUES]; /* Pkts freed on XFER */
  67. UINT32 dbgNumOfMsduTxTransferCB[MAX_NUM_OF_TX_QUEUES]; /* num of XFER done CB calls */
  68. UINT32 dbgNumOfMsduXferDoneInShceduler[MAX_NUM_OF_TX_QUEUES]; /* Pkts for which XFER done was received in scheduler */
  69. UINT32 dbgNumOfMsduSuccessInScheduler[MAX_NUM_OF_TX_QUEUES]; /* Pkts fof which success was received in scheduler */
  70. UINT32 dbgNumOfMsduPendingInScheduler[MAX_NUM_OF_TX_QUEUES]; /* Pkts for which pending was received in scheduler */
  71. UINT32 dbgNumOfMsduBusyInScheduler[MAX_NUM_OF_TX_QUEUES]; /* Pkts for which busy was received in scheduler */
  72. UINT32 dbgNumOfMsduErrorInScheduler[MAX_NUM_OF_TX_QUEUES]; /* Pkts for which error was received in scheduler */
  73. UINT32 dbgNumOfsendPacketComplete[MAX_NUM_OF_TX_QUEUES]; /* Pkts that reached complete CB */
  74. UINT32 dbgTxCmpltOk[MAX_NUM_OF_TX_QUEUES]; /* Pkts that reached complete CB with status OK */
  75. UINT32 dbgTxCmpltError[MAX_NUM_OF_TX_QUEUES]; /* Pkts that reached complete CB with status NOK */
  76. UINT32 dbgTxCmpltOkBytes[MAX_NUM_OF_TX_QUEUES]; /* Acknowledged bytes (complete status OK) */
  77. UINT32 dbgNumOfNullMsdu; /* number of NULL MSDUs altogether */
  78. } txDataDbgCounters_t;
  79. typedef struct
  80. {
  81. struct
  82. {
  83. UINT32 core; /* Cumulative core jitter */
  84. UINT32 xfer; /* Cumulative XFER jitter */
  85. UINT32 fw; /* Cumulative firmware jitter */
  86. UINT32 air; /* Cumulative air jitter */
  87. } jitter;
  88. struct
  89. {
  90. UINT32 core; /* Cumulative core delay */
  91. UINT32 xfer; /* Cumulative XFER delay */
  92. UINT32 wait; /* Cumulative XFER wait for firmware to wake-up */
  93. UINT32 fw; /* Cumulative firmware delay */
  94. UINT32 air; /* Cumulative air delay */
  95. } delay;
  96. struct
  97. {
  98. UINT32 core; /* Last core delay */
  99. UINT32 xfer; /* Last xfer delay */
  100. UINT32 fw; /* Last firmware duration */
  101. UINT32 air; /* Last TX air duration */
  102. } last_delay;
  103. struct
  104. {
  105. UINT32 core; /* Maximum core delay */
  106. UINT32 xfer; /* Maximum xfer delay */
  107. UINT32 fw; /* Maximum firmware duration */
  108. UINT32 air; /* Maximum TX air duration */
  109. } max_delay;
  110. struct
  111. {
  112. UINT32 core; /* Number of packets passed through core */
  113. UINT32 xfer; /* Number of packets transferred via XFER during last second */
  114. UINT32 wait; /* Number of times XFER waited for firmware to wake-up */
  115. UINT32 fw; /* Packets that reached complete CB with status OK */
  116. UINT32 fw_err; /* Packets that reached complete CB with status NOK */
  117. } count;
  118. } txDataJitter_t;
  119. typedef struct
  120. {
  121. headerConvetMode_e headerConverMode; /* header converting mode */
  122. acTrfcType_e tag_ToAcClsfrTable[MAX_NUM_OF_802_1d_TAGS]; /* tag to AC classification */
  123. } txQosParams_t;
  124. typedef struct
  125. {
  126. /* Handles */
  127. TI_HANDLE hCtrlData;
  128. TI_HANDLE hTnetwDrv;
  129. TI_HANDLE hWhalCtrl;
  130. TI_HANDLE hOs;
  131. TI_HANDLE hReport;
  132. TI_HANDLE hMemMngr;
  133. TI_HANDLE pSchedulerTimer;
  134. TI_HANDLE pCreditTimer;
  135. TI_HANDLE hSiteMgr;
  136. TI_HANDLE hEvHandler;
  137. TI_HANDLE hQosMngr;
  138. TI_HANDLE hPowerMgr;
  139. TI_HANDLE pThroughputTimer;
  140. TI_HANDLE pAirThroughputTimer;
  141. TI_HANDLE pJitterTimer;
  142. TI_HANDLE TxEventDistributor;
  143. TI_HANDLE hBufferPool; /* Packet ID buffer pool */
  144. TI_HANDLE pVadTimer; /* VAD timer handle */
  145. /* critical section protect */
  146. void* hCriticalSectionProtect;
  147. BOOL bSchedulerTimerRunning;
  148. /* Tx flow parameters */
  149. portStatus_e txDataPortStatus;
  150. portStatus_e savePortStatus; /* save value for recovery */
  151. BOOL txDataCurrentPrivacyInvokedMode;
  152. BOOL saveTxDataCurrentPrivacyInvokedMode;/* save value for recovery */
  153. BOOL txDataEapolEncryptionStatus;
  154. BOOL saveTxDataEapolEncryptionStatus; /* save value for recovery */
  155. BOOL txDataIsSchedulerInWork;
  156. /* Tx queues */
  157. UINT8 txDataNumOfQueues;
  158. MsduList_t* mngMsduList;
  159. MsduList_t* dataMsduListArr[MAX_NUM_OF_TX_QUEUES];
  160. int txDataNumOfMsdusToTransmit;
  161. UINT8 QidToAcTable[MAX_NUM_OF_TX_QUEUES];
  162. UINT32 creditCalculationTimeout;
  163. /* indicate the percentage of the MSDU lifetime under which the driver *
  164. * will send it to the Fw, */
  165. UINT8 uFracOfLifeTimeToDrop;
  166. /* GWSI state */
  167. txDataGwsiInterfaceStatus_e txDataGwsiInterfaceStatus;
  168. txDataHalInterfaceStatus_t txDataHalInterfaceStatus;
  169. /* Counters */
  170. txDataCounters_t txDataCounters[MAX_NUM_OF_TX_QUEUES]; /* Save Tx statistics per Tx-queue. */
  171. txDataCounters_t txDataReportedCounters[MAX_NUM_OF_TX_QUEUES]; /* Tx statistics per Tx-queue, cleared on read */
  172. txDataCounters_t tempTxDataCounters[MAX_NUM_OF_TX_QUEUES]; /* temporary storage for IOCTL retrieval. */
  173. UINT32 currentConsecutiveRetryFail; /* current consecutive number of tx failures due to max retry */
  174. /* debug counters */
  175. txDataDbgCounters_t txDataDbgCounters;
  176. /* Jitter debug info */
  177. #if defined(TI_DBG)
  178. txDataJitter_t txJitter [MAX_NUM_OF_TX_QUEUES];
  179. #endif
  180. /* Tx Disabling flag */
  181. txDisableReason_e txDisable;
  182. /* QOS parameters */
  183. acTrfcCtrl_t txDataAcTrfcCtrl[MAX_NUM_OF_AC];
  184. txQosParams_t txDataQosParams;
  185. /* timer throughput per tx queue */
  186. BOOL txThroughputTimerEnable;
  187. /* timer air throughput per tx queue */
  188. BOOL txAirThroughputTimerEnable;
  189. /* jitter periodic timer flag */
  190. BOOL txJitterTimerEnable;
  191. /* credit calculation timer is enabled from registry */
  192. BOOL bCreditCalcTimerEnabled;
  193. /* credit calculation timer is running */
  194. BOOL bCreditCalcTimerRunning;
  195. /* enable to delay MSDU because of medium usage exeeded */
  196. BOOL admCtrlDelayDueToMediumTimeOverUsage;
  197. /* enable/disable adm down grade */
  198. BOOL admissionDownGradeEnable;
  199. /* power control params and flag */
  200. BOOL hwRequest; /* HW request flag */
  201. UINT32 powerCtrlId; /* txDta Id for power control */
  202. BOOL txDataAvailableQueue[MAX_NUM_OF_TX_QUEUES];
  203. /* encryption params */
  204. UINT8 encryptionFieldSize; /* size to reserve in WLAN header fpr encryption */
  205. UINT8 saveEncryptionFieldSize;/* save value for recovery */
  206. BOOL bVadTimerEnabled;
  207. UINT16 vadTimerDuration; /* in milliseconds */
  208. } txData_t;
  209. /* test functions */
  210. /*----------------*/
  211. void Test_HeaderConvertion(TI_HANDLE hTxData, mem_MSDU_T *pMsdu);
  212. #endif