1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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.
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
14 ******************************************************************************/
15 #ifndef __RTL8188E_XMIT_H__
16 #define __RTL8188E_XMIT_H__
18 #define MAX_TX_AGG_PACKET_NUMBER 0xFF
20 /* Queue Select Value in TxDesc */
22 #define QSLT_BK 0x2/* 0x01 */
24 #define QSLT_VI 0x5/* 0x4 */
25 #define QSLT_VO 0x7/* 0x6 */
26 #define QSLT_BEACON 0x10
27 #define QSLT_HIGH 0x11
28 #define QSLT_MGNT 0x12
31 /* For 88e early mode */
32 #define SET_EARLYMODE_PKTNUM(__pAddr, __Value) \
33 SET_BITS_TO_LE_4BYTE(__pAddr, 0, 3, __Value)
34 #define SET_EARLYMODE_LEN0(__pAddr, __Value) \
35 SET_BITS_TO_LE_4BYTE(__pAddr, 4, 12, __Value)
36 #define SET_EARLYMODE_LEN1(__pAddr, __Value) \
37 SET_BITS_TO_LE_4BYTE(__pAddr, 16, 12, __Value)
38 #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) \
39 SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value)
40 #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) \
41 SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value)
42 #define SET_EARLYMODE_LEN3(__pAddr, __Value) \
43 SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value)
44 #define SET_EARLYMODE_LEN4(__pAddr, __Value) \
45 SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value)
48 /* defined for TX DESC Operation */
63 #define PKT_OFFSET_SZ 0
65 #define RATE_ID_SHT 16
66 #define NAVUSEHDR BIT(20)
67 #define SEC_TYPE_SHT 22
68 #define PKT_OFFSET_SHT 26
71 #define AGG_EN BIT(12)
72 #define AGG_BK BIT(16)
73 #define AMPDU_DENSITY_SHT 20
74 #define ANTSEL_A BIT(24)
75 #define ANTSEL_B BIT(25)
76 #define TX_ANT_CCK_SHT 26
77 #define TX_ANTL_SHT 28
78 #define TX_ANT_HT_SHT 30
82 #define EN_HWSEQ BIT(31)
87 #define USERATE BIT(8)
88 #define DISDATAFB BIT(10)
89 #define CTS_2_SELF BIT(11)
90 #define RTS_EN BIT(12)
91 #define HW_RTS_EN BIT(13)
92 #define DATA_SHORT BIT(24)
93 #define PWR_STATUS_SHT 15
94 #define DATA_SC_SHT 20
95 #define DATA_BW BIT(25)
98 #define RTY_LMT_EN BIT(17)
108 #define USB_TXAGG_NUM_SHT 24
110 #define txdesc_set_ccx_sw_88e(txdesc, value) \
112 ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \
113 ((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \
116 struct txrpt_ccx_88e {
120 u8 txdma_underflow:1;
150 #define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8))
151 #define txrpt_ccx_qtime_88e(txrpt_ccx) \
152 ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8))
154 void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc,
155 u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull);
156 s32 rtl8188eu_init_xmit_priv(struct adapter *padapter);
157 s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter);
158 #define hal_xmit_handler rtl8188eu_xmit_buf_handler
159 void rtl8188eu_xmit_tasklet(void *priv);
160 s32 rtl8188eu_xmitframe_complete(struct adapter *padapter,
161 struct xmit_priv *pxmitpriv);
163 void dump_txrpt_ccx_88e(void *buf);
164 void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf);
166 void _dbg_dump_tx_info(struct adapter *padapter, int frame_tag,
167 struct tx_desc *ptxdesc);
169 #endif /* __RTL8188E_XMIT_H__ */