rtl8192d_xmit.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef _RTL8192D_XMIT_H_
  21. #define _RTL8192D_XMIT_H_
  22. //
  23. //defined for TX DESC Operation
  24. //
  25. #define MAX_TID (15)
  26. //OFFSET 0
  27. #define OFFSET_SZ 0
  28. #define OFFSET_SHT 16
  29. #define BMC BIT(24)
  30. #define LSG BIT(26)
  31. #define FSG BIT(27)
  32. #define OWN BIT(31)
  33. //OFFSET 4
  34. #define PKT_OFFSET_SZ 0
  35. #define BK BIT(6)
  36. #define QSEL_SHT 8
  37. #define Rate_ID_SHT 16
  38. #define NAVUSEHDR BIT(20)
  39. #define PKT_OFFSET_SHT 26
  40. #define HWPC BIT(31)
  41. //OFFSET 8
  42. #define AGG_EN BIT(29)
  43. //OFFSET 12
  44. #define SEQ_SHT 16
  45. //OFFSET 16
  46. #define QoS BIT(6)
  47. #define HW_SEQ_EN BIT(7)
  48. #define USERATE BIT(8)
  49. #define DISDATAFB BIT(10)
  50. #define DATA_SHORT BIT(24)
  51. #define DATA_BW BIT(25)
  52. //OFFSET 20
  53. #define SGI BIT(6)
  54. //
  55. // Queue Select Value in TxDesc
  56. //
  57. #define QSLT_BK 0x2//0x01
  58. #define QSLT_BE 0x0
  59. #define QSLT_VI 0x5//0x4
  60. #define QSLT_VO 0x7//0x6
  61. #define QSLT_BEACON 0x10
  62. #define QSLT_HIGH 0x11
  63. #define QSLT_MGNT 0x12
  64. #define QSLT_CMD 0x13
  65. //Because we open EM for normal case, we just always insert 2*8 bytes.by wl
  66. #define USB_92D_DUMMY_OFFSET 2
  67. #define USB_92D_DUMMY_LENGTH (USB_92D_DUMMY_OFFSET * PACKET_OFFSET_SZ)
  68. #define USB_HWDESC_HEADER_LEN (TXDESC_SIZE + USB_92D_DUMMY_LENGTH)
  69. //For 92D early mode
  70. #define SET_EARLYMODE_PKTNUM(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 0, 3, __Value)
  71. #define SET_EARLYMODE_LEN0(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 4, 12, __Value)
  72. #define SET_EARLYMODE_LEN1(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 16, 12, __Value)
  73. #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value)
  74. #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value)
  75. #define SET_EARLYMODE_LEN3(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value)
  76. #define SET_EARLYMODE_LEN4(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value)
  77. /* Copy from rtl8192c */
  78. struct txrpt_ccx_8192d {
  79. /* offset 0 */
  80. u8 retry_cnt:6;
  81. u8 rsvd_0:2;
  82. /* offset 1 */
  83. u8 rts_retry_cnt:6;
  84. u8 rsvd_1:2;
  85. /* offset 2 */
  86. u8 ccx_qtime0;
  87. u8 ccx_qtime1;
  88. /* offset 4 */
  89. u8 missed_pkt_num:5;
  90. u8 rsvd_4:3;
  91. /* offset 5 */
  92. u8 mac_id:5;
  93. u8 des1_fragssn:3;
  94. /* offset 6 */
  95. u8 rpt_pkt_num:5;
  96. u8 pkt_drop:1;
  97. u8 lifetime_over:1;
  98. u8 retry_over:1;
  99. /* offset 7*/
  100. u8 edca_tx_queue:4;
  101. u8 rsvd_7:1;
  102. u8 bmc:1;
  103. u8 pkt_ok:1;
  104. u8 int_ccx:1;
  105. };
  106. #define txrpt_ccx_qtime_8192d(txrpt_ccx) ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8))
  107. #ifdef CONFIG_XMIT_ACK
  108. void dump_txrpt_ccx_8192d(void *buf);
  109. void handle_txrpt_ccx_8192d(_adapter *adapter, void *buf);
  110. #else
  111. #define dump_txrpt_ccx_8192d(buf) do {} while(0)
  112. #define handle_txrpt_ccx_8192d(adapter, buf) do {} while(0)
  113. #endif
  114. #ifdef CONFIG_USB_HCI
  115. s32 rtl8192du_init_xmit_priv(_adapter * padapter);
  116. void rtl8192du_free_xmit_priv(_adapter * padapter);
  117. void rtl8192du_cal_txdesc_chksum(struct tx_desc *ptxdesc);
  118. s32 rtl8192du_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);
  119. s32 rtl8192du_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe);
  120. s32 rtl8192du_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe);
  121. s32 rtl8192du_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
  122. #ifdef CONFIG_HOSTAPD_MLME
  123. s32 rtl8192du_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt);
  124. #endif
  125. #endif
  126. #ifdef CONFIG_PCI_HCI
  127. s32 rtl8192de_init_xmit_priv(_adapter * padapter);
  128. void rtl8192de_free_xmit_priv(_adapter * padapter);
  129. s32 rtl8192de_enqueue_xmitbuf(struct rtw_tx_ring *ring, struct xmit_buf *pxmitbuf);
  130. struct xmit_buf *rtl8192de_dequeue_xmitbuf(struct rtw_tx_ring *ring);
  131. void rtl8192de_xmitframe_resume(_adapter *padapter);
  132. s32 rtl8192de_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe);
  133. s32 rtl8192de_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe);
  134. s32 rtl8192de_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
  135. #ifdef CONFIG_HOSTAPD_MLME
  136. s32 rtl8192de_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt);
  137. #endif
  138. #endif//end if CONFIG_PCI_HCI
  139. #endif