rtl8723a_xmit.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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 __RTL8723A_XMIT_H__
  21. #define __RTL8723A_XMIT_H__
  22. #include <rtl8192c_xmit.h>
  23. //
  24. //defined for TX DESC Operation
  25. //
  26. #define MAX_TID (15)
  27. //OFFSET 0
  28. #define OFFSET_SZ 0
  29. #define OFFSET_SHT 16
  30. #define BMC BIT(24)
  31. #define LSG BIT(26)
  32. #define FSG BIT(27)
  33. #define OWN BIT(31)
  34. //OFFSET 4
  35. #define PKT_OFFSET_SZ 0
  36. #define BK BIT(6)
  37. #define QSEL_SHT 8
  38. #define Rate_ID_SHT 16
  39. #define NAVUSEHDR BIT(20)
  40. #define PKT_OFFSET_SHT 26
  41. #define HWPC BIT(31)
  42. //OFFSET 8
  43. #define AGG_EN BIT(29)
  44. //OFFSET 12
  45. #define SEQ_SHT 16
  46. //OFFSET 16
  47. #define QoS BIT(6)
  48. #define HW_SEQ_EN BIT(7)
  49. #define USERATE BIT(8)
  50. #define DISDATAFB BIT(10)
  51. #define DATA_SHORT BIT(24)
  52. #define DATA_BW BIT(25)
  53. //OFFSET 20
  54. #define SGI BIT(6)
  55. typedef struct txdesc_8723a
  56. {
  57. u32 pktlen:16;
  58. u32 offset:8;
  59. u32 bmc:1;
  60. u32 htc:1;
  61. u32 ls:1;
  62. u32 fs:1;
  63. u32 linip:1;
  64. u32 noacm:1;
  65. u32 gf:1;
  66. u32 own:1;
  67. u32 macid:5;
  68. u32 agg_en:1;
  69. u32 bk:1;
  70. u32 rd_en:1;
  71. u32 qsel:5;
  72. u32 rd_nav_ext:1;
  73. u32 lsig_txop_en:1;
  74. u32 pifs:1;
  75. u32 rate_id:4;
  76. u32 navusehdr:1;
  77. u32 en_desc_id:1;
  78. u32 sectype:2;
  79. u32 rsvd0424:2;
  80. u32 pkt_offset:5; // unit: 8 bytes
  81. u32 rsvd0431:1;
  82. u32 rts_rc:6;
  83. u32 data_rc:6;
  84. u32 rsvd0812:2;
  85. u32 bar_rty_th:2;
  86. u32 rsvd0816:1;
  87. u32 morefrag:1;
  88. u32 raw:1;
  89. u32 ccx:1;
  90. u32 ampdu_density:3;
  91. u32 bt_null:1;
  92. u32 ant_sel_a:1;
  93. u32 ant_sel_b:1;
  94. u32 tx_ant_cck:2;
  95. u32 tx_antl:2;
  96. u32 tx_ant_ht:2;
  97. u32 nextheadpage:8;
  98. u32 tailpage:8;
  99. u32 seq:12;
  100. u32 cpu_handle:1;
  101. u32 tag1:1;
  102. u32 trigger_int:1;
  103. u32 hwseq_en:1;
  104. u32 rtsrate:5;
  105. u32 ap_dcfe:1;
  106. u32 hwseq_sel:2;
  107. u32 userate:1;
  108. u32 disrtsfb:1;
  109. u32 disdatafb:1;
  110. u32 cts2self:1;
  111. u32 rtsen:1;
  112. u32 hw_rts_en:1;
  113. u32 port_id:1;
  114. u32 rsvd1615:3;
  115. u32 wait_dcts:1;
  116. u32 cts2ap_en:1;
  117. u32 data_sc:2;
  118. u32 data_stbc:2;
  119. u32 data_short:1;
  120. u32 data_bw:1;
  121. u32 rts_short:1;
  122. u32 rts_bw:1;
  123. u32 rts_sc:2;
  124. u32 vcs_stbc:2;
  125. u32 datarate:6;
  126. u32 sgi:1;
  127. u32 try_rate:1;
  128. u32 data_ratefb_lmt:5;
  129. u32 rts_ratefb_lmt:4;
  130. u32 rty_lmt_en:1;
  131. u32 data_rt_lmt:6;
  132. u32 usb_txagg_num:8;
  133. u32 txagg_a:5;
  134. u32 txagg_b:5;
  135. u32 use_max_len:1;
  136. u32 max_agg_num:5;
  137. u32 mcsg1_max_len:4;
  138. u32 mcsg2_max_len:4;
  139. u32 mcsg3_max_len:4;
  140. u32 mcs7_sgi_max_len:4;
  141. u32 checksum:16; // TxBuffSize(PCIe)/CheckSum(USB)
  142. u32 mcsg4_max_len:4;
  143. u32 mcsg5_max_len:4;
  144. u32 mcsg6_max_len:4;
  145. u32 mcs15_sgi_max_len:4;
  146. }TXDESC_8723A, *PTXDESC_8723A;
  147. #define txdesc_set_ccx_sw_8723a(txdesc, value) \
  148. do { \
  149. ((struct txdesc_8723a *)(txdesc))->mcsg4_max_len = (((value)>>8) & 0x0f); \
  150. ((struct txdesc_8723a *)(txdesc))->mcs15_sgi_max_len= (((value)>>4) & 0x0f); \
  151. ((struct txdesc_8723a *)(txdesc))->mcsg6_max_len = ((value) & 0x0f); \
  152. } while (0)
  153. struct txrpt_ccx_8723a {
  154. /* offset 0 */
  155. u8 tag1:1;
  156. u8 rsvd:4;
  157. u8 int_bt:1;
  158. u8 int_tri:1;
  159. u8 int_ccx:1;
  160. /* offset 1 */
  161. u8 mac_id:5;
  162. u8 pkt_drop:1;
  163. u8 pkt_ok:1;
  164. u8 bmc:1;
  165. /* offset 2 */
  166. u8 retry_cnt:6;
  167. u8 lifetime_over:1;
  168. u8 retry_over:1;
  169. /* offset 3 */
  170. u8 ccx_qtime0;
  171. u8 ccx_qtime1;
  172. /* offset 5 */
  173. u8 final_data_rate;
  174. /* offset 6 */
  175. u8 sw1:4;
  176. u8 qsel:4;
  177. /* offset 7 */
  178. u8 sw0;
  179. };
  180. #define txrpt_ccx_sw_8723a(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8))
  181. #define txrpt_ccx_qtime_8723a(txrpt_ccx) ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8))
  182. #ifdef CONFIG_XMIT_ACK
  183. void dump_txrpt_ccx_8723a(void *buf);
  184. void handle_txrpt_ccx_8723a(_adapter *adapter, void *buf);
  185. #else
  186. #define dump_txrpt_ccx_8723a(buf) do {} while(0)
  187. #define handle_txrpt_ccx_8723a(adapter, buf) do {} while(0)
  188. #endif //CONFIG_XMIT_ACK
  189. void rtl8723a_update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem);
  190. void rtl8723a_fill_fake_txdesc(PADAPTER padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull);
  191. #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
  192. s32 rtl8723as_init_xmit_priv(PADAPTER padapter);
  193. void rtl8723as_free_xmit_priv(PADAPTER padapter);
  194. s32 rtl8723as_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe);
  195. s32 rtl8723as_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe);
  196. s32 rtl8723as_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
  197. s32 rtl8723as_xmit_buf_handler(PADAPTER padapter);
  198. thread_return rtl8723as_xmit_thread(thread_context context);
  199. #endif
  200. #ifdef CONFIG_USB_HCI
  201. s32 rtl8723au_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
  202. s32 rtl8723au_xmit_buf_handler(PADAPTER padapter);
  203. #endif
  204. #endif