hif_tx.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/hif_tx.h#1
  3. */
  4. /*
  5. ** Log: hif_tx.h
  6. **
  7. ** 03 12 2013 terry.wu
  8. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  9. ** Update Tx utility function for management frame
  10. **
  11. ** 03 04 2013 terry.wu
  12. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  13. ** .
  14. **
  15. ** 01 21 2013 terry.wu
  16. ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
  17. ** Update TX path based on new ucBssIndex modifications.
  18. **
  19. ** 12 27 2012 cp.wu
  20. ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
  21. ** 1. remove unused definitions
  22. ** 2. correct page count and surpress compiler warning
  23. **
  24. ** 09 17 2012 cm.chang
  25. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  26. ** Duplicate source from MT6620 v2.3 driver branch
  27. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  28. *
  29. * 10 07 2010 cp.wu
  30. * [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection
  31. * add firmware download for MT5931.
  32. *
  33. * 07 08 2010 cp.wu
  34. *
  35. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  36. *
  37. * 06 14 2010 cp.wu
  38. * [WPD00003833][MT6620 and MT5931] Driver migration
  39. * fill extra information for revised HIF_TX_HEADER.
  40. *
  41. * 06 10 2010 cp.wu
  42. * [WPD00003833][MT6620 and MT5931] Driver migration
  43. * 1) add flag on MSDU_INFO_T for indicating BIP frame and forceBasicRate
  44. * 2) add packet type for indicating management frames
  45. *
  46. * 06 06 2010 kevin.huang
  47. * [WPD00003832][MT6620 5931] Create driver base
  48. * [MT6620 5931] Create driver base
  49. *
  50. * 03 10 2010 cp.wu
  51. * [WPD00001943]Create WiFi test driver framework on WinXP
  52. * code clean: removing unused variables and structure definitions
  53. *
  54. * 02 09 2010 cp.wu
  55. * [WPD00001943]Create WiFi test driver framework on WinXP
  56. * 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address
  57. * * * 2. follow MSDN defined behavior when associates to another AP
  58. * * * 3. for firmware download, packet size could be up to 2048 bytes
  59. *
  60. * 01 13 2010 tehuang.liu
  61. * [WPD00001943]Create WiFi test driver framework on WinXP
  62. * Enabled the Burst_End Indication mechanism
  63. *
  64. * 01 13 2010 cp.wu
  65. * [WPD00001943]Create WiFi test driver framework on WinXP
  66. * TX: fill ucWlanHeaderLength/ucPktFormtId_Flags according to info provided by prMsduInfo
  67. ** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-12-10 16:43:40 GMT mtk02752
  68. ** code clean
  69. ** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-24 19:55:11 GMT mtk02752
  70. ** adopt HIF_TX_HEADER_T in new data path
  71. ** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-23 17:54:13 GMT mtk02752
  72. ** CMD_HDR_SIZE = (sizeof(WIFI_CMD_T)) to follow up CM's CMD/EVENT documentation
  73. **
  74. ** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-17 22:41:10 GMT mtk01084
  75. ** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-17 17:34:07 GMT mtk02752
  76. ** remove HIF_TX_BUFF_COUNT_TC0 (move to nic_tx.h)
  77. ** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-11-17 12:14:12 GMT mtk02752
  78. ** add initial value for HIF_TX_BUFF_COUNT_TC5
  79. ** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-11-13 13:54:18 GMT mtk01084
  80. ** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-11-04 14:11:14 GMT mtk01084
  81. ** modify SW TX data format
  82. ** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-10-29 19:51:53 GMT mtk01084
  83. ** modify FW/ driver interface
  84. ** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-05-20 12:22:46 GMT mtk01461
  85. ** Add SeqNum field to CMD Header
  86. ** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-17 19:40:52 GMT mtk01461
  87. ** Update the Log Sign
  88. */
  89. #ifndef _HIF_TX_H
  90. #define _HIF_TX_H
  91. /*******************************************************************************
  92. * C O M P I L E R F L A G S
  93. ********************************************************************************
  94. */
  95. /*******************************************************************************
  96. * E X T E R N A L R E F E R E N C E S
  97. ********************************************************************************
  98. */
  99. /*******************************************************************************
  100. * C O N S T A N T S
  101. ********************************************************************************
  102. */
  103. /* Maximum buffer size for individual HIF TCQ Buffer */
  104. #define HIF_TX_BUFF_MAX_SIZE 1552 /* Reserved field was not included */
  105. /* Maximum buffer count for individual HIF TCQ */
  106. #define HIF_TX_BUFF_COUNT_TC0 3
  107. #define HIF_TX_BUFF_COUNT_TC1 3
  108. #define HIF_TX_BUFF_COUNT_TC2 3
  109. #define HIF_TX_BUFF_COUNT_TC3 3
  110. #define HIF_TX_BUFF_COUNT_TC4 2
  111. #define TX_HDR_SIZE sizeof(HIF_TX_HEADER_T)
  112. #define CMD_HDR_SIZE sizeof(WIFI_CMD_T)
  113. #define CMD_PKT_SIZE_FOR_IMAGE 2048 /* !< 2048 Bytes CMD payload buffer */
  114. /*! NIC_HIF_TX_HEADER_T (for short-header format) */
  115. /* DW 0, Byte 0,1 */
  116. #define HIF_TX_HDR_TX_BYTE_COUNT_MASK BITS(0, 15)
  117. /* DW 0, Byte 2 */
  118. #define HIF_TX_HDR_ETHER_TYPE_OFFSET_MASK BITS(0, 6)
  119. #define HIF_TX_HDR_IP_CSUM BIT(7)
  120. /* DW 0, Byte 3 */
  121. #define HIF_TX_HDR_TCP_CSUM BIT(0)
  122. #define HIF_TX_HDR_QUEUE_IDX_MASK BITS(3, 6)
  123. #define HIF_TX_HDR_QUEUE_IDX_OFFSET 3
  124. #define HIF_TX_HDR_PORT_IDX_MASK BIT(7)
  125. #define HIF_TX_HDR_PORT_IDX_OFFSET 7
  126. /*******************************************************************************
  127. * D A T A T Y P E S
  128. ********************************************************************************
  129. */
  130. typedef struct _HIF_HW_TX_HEADER_T {
  131. UINT_16 u2TxByteCount;
  132. UINT_8 ucEtherTypeOffset;
  133. UINT_8 ucCSflags;
  134. UINT_8 aucBuffer[0];
  135. } HIF_HW_TX_HEADER_T, *P_HIF_HW_TX_HEADER_T;
  136. typedef struct _HIF_TX_HEADER_T {
  137. UINT_16 u2TxByteCount_UserPriority;
  138. UINT_8 ucEtherTypeOffset;
  139. UINT_8 ucResource_PktType_CSflags;
  140. UINT_8 ucWlanHeaderLength;
  141. UINT_8 ucPktFormtId_Flags;
  142. UINT_16 u2LLH; /* for BOW */
  143. UINT_16 u2SeqNo; /* for BOW */
  144. UINT_8 ucStaRecIdx;
  145. UINT_8 ucForwardingType_SessionID_Reserved;
  146. UINT_8 ucPacketSeqNo;
  147. UINT_8 ucAck_BIP_BasicRate;
  148. UINT_8 aucReserved[2];
  149. } HIF_TX_HEADER_T, *P_HIF_TX_HEADER_T;
  150. typedef enum _ENUM_HIF_OOB_CTRL_PKT_TYPE_T {
  151. HIF_OOB_CTRL_PKT_TYPE_LOOPBACK = 1,
  152. HIF_OOB_CTRL_PKT_TYP_NUM
  153. } ENUM_HIF_OOB_CTRL_PKT_TYPE_T, *P_ENUM_HIF_OOB_CTRL_PKT_TYPE_T;
  154. /*******************************************************************************
  155. * P U B L I C D A T A
  156. ********************************************************************************
  157. */
  158. /*******************************************************************************
  159. * P R I V A T E D A T A
  160. ********************************************************************************
  161. */
  162. /*******************************************************************************
  163. * M A C R O S
  164. ********************************************************************************
  165. */
  166. #define TFCB_FRAME_PAD_TO_DW(u2Length) ALIGN_4(u2Length)
  167. /*******************************************************************************
  168. * F U N C T I O N D E C L A R A T I O N S
  169. ********************************************************************************
  170. */
  171. /* Kevin: we don't have to call following function to inspect the data structure.
  172. * It will check automatically while at compile time.
  173. */
  174. static __KAL_INLINE__ VOID hif_txDataTypeCheck(VOID);
  175. static __KAL_INLINE__ VOID hif_txDataTypeCheck(VOID)
  176. {
  177. DATA_STRUCT_INSPECTING_ASSERT(sizeof(HIF_TX_HEADER_T) == 16);
  178. }
  179. #endif /*_HIF_TX_H */