PageRenderTime 51ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/src/TNETW_Driver/Data_Srv/Tx_HW_Queue/txHwQueueCalc.h

http://github.com/CyanogenMod/cm-kernel
C Header | 126 lines | 59 code | 22 blank | 45 comment | 0 complexity | 47b0373952fcde19c988fc5f8d24cea0 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: txHwQueueCalc.h
  38. *
  39. * PURPOSE: Tx HW blocks and fragmentation threshold calculations module internal definitions.
  40. *
  41. ****************************************************************************/
  42. #ifndef _TX_HW_QUEUE_MEM_CALC_H
  43. #define _TX_HW_QUEUE_MEM_CALC_H
  44. #include "whalParams.h"
  45. #include "TNETW_Driver_types.h"
  46. #include "802_11Defs.h"
  47. #define HW_BLOCK_SIZE 252 /* The net size per HW block (without block header). */
  48. #define RTS_FRAG_DATA_TIME 248
  49. #define MIN_FRAG_THRESH 256
  50. #define FCS_LENGTH 4
  51. #define MAX_MSDU_SECURITY_LENGTH 16 /* RSN + MIC = 8 + 8 = 16 bytes (worst case - AES). */
  52. #define MAX_MPDU_SECURITY_LENGTH 16 /* RSN + MIC = 8 + 8 = 16 bytes (worst case - AES). */
  53. #define DIFF_HEADER_LENGTH_LEGACY_TO_QOS (WLAN_QOS_HDR_LEN - WLAN_HDR_LEN)
  54. #define MAX_MPDU_HEADER_AND_SECURITY (WLAN_QOS_HDR_LEN + MAX_MPDU_SECURITY_LENGTH)
  55. #define OFDM_PLCP_HDR_MICROSECONDS 24
  56. #define SHORT_PREAMBLE_MICROSECONDS 96
  57. #define LONG_PREAMBLE_MICROSECONDS 192
  58. #define B_SIFS_MICROSECONDS 10
  59. #define OFDM_SIGNAL_EXT_MICROSECONDS 6
  60. #define NONOFDM_SHORT_DURATION_MICROSECONDS (B_SIFS_MICROSECONDS + SHORT_PREAMBLE_MICROSECONDS)
  61. #define NONOFDM_LONG_DURATION_MICROSECONDS (B_SIFS_MICROSECONDS + LONG_PREAMBLE_MICROSECONDS)
  62. /* The ACK duration in air (in uSec) per Tx rate,
  63. including MAC header + SIFS, and excluding PLCP header. */
  64. const UINT8 TxMemCalcAckDurationTable[] =
  65. {
  66. 0, /* Auto (not used in this module)*/
  67. B_SIFS_MICROSECONDS + 112, /* 1 Mbps */
  68. B_SIFS_MICROSECONDS + 56, /* 2 Mbps*/
  69. B_SIFS_MICROSECONDS + 20, /* 5.5 Mbps*/
  70. B_SIFS_MICROSECONDS + 10, /* 11 Mbps*/
  71. B_SIFS_MICROSECONDS + 4, /* 22 Mbps*/
  72. B_SIFS_MICROSECONDS + 19, /* 6 Mbps*/
  73. B_SIFS_MICROSECONDS + 12, /* 9 Mbps*/
  74. B_SIFS_MICROSECONDS + 6, /* 18 Mbps*/
  75. B_SIFS_MICROSECONDS + 4, /* 22 Mbps*/
  76. B_SIFS_MICROSECONDS + 4, /* 24 Mbps*/
  77. B_SIFS_MICROSECONDS + 4, /* 36 Mbps*/
  78. B_SIFS_MICROSECONDS + 4, /* 48 Mbps, standard says ack at 36 Mbps*/
  79. B_SIFS_MICROSECONDS + 4 /* 54 Mbps, standard says ack at 36 Mbps*/
  80. };
  81. /* Translate rate code to bit rate in Mbps (5.5M has a factor of 10). */
  82. const UINT8 TxMemCalcRateValueTable[] =
  83. {
  84. 0, /* Auto (not used in this module)*/
  85. 1, /* 1 Mbps */
  86. 2, /* 2 Mbps*/
  87. 55, /* 5.5 Mbp*/
  88. 11, /* 11 Mbps*/
  89. 22, /* 22 Mbps*/
  90. 6, /* 6 Mbps*/
  91. 9, /* 9 Mbps*/
  92. 12, /* 18 Mbps*/
  93. 18, /* 22 Mbps*/
  94. 24, /* 24 Mbps*/
  95. 36, /* 36 Mbps*/
  96. 48, /* 48 Mbps*/
  97. 54 /* 54 Mbps*/
  98. };
  99. /* Module local functions. */
  100. static UINT16 CalcFragThreshold(TxHwQueueObj_t *pTxHwQueue, txCtrlBlkEntry_t *pPktCtrlBlk);
  101. static UINT16 GetTxOpFragThreshold(TxHwQueueObj_t *pTxHwQueue, txCtrlBlkEntry_t *pPktCtrlBlk,
  102. UINT16 txOpLimit, WlanParams_T *pWlanParams);
  103. static rate_e ConvertRateTnetToDriver (UINT16 tnetRate);
  104. #endif /* _TX_HW_QUEUE_MEM_CALC_H */