1 /******************************************************************************
\r
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
\r
5 * This program is free software; you can redistribute it and/or modify it
\r
6 * under the terms of version 2 of the GNU General Public License as
\r
7 * published by the Free Software Foundation.
\r
9 * This program is distributed in the hope that it will be useful, but WITHOUT
\r
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
14 * You should have received a copy of the GNU General Public License along with
\r
15 * this program; if not, write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
\r
19 ******************************************************************************/
\r
20 #ifndef __RTL8188E_XMIT_H__
\r
21 #define __RTL8188E_XMIT_H__
\r
26 //For 88e early mode
\r
27 #define SET_EARLYMODE_PKTNUM(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 0, 3, __Value)
\r
28 #define SET_EARLYMODE_LEN0(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 4, 12, __Value)
\r
29 #define SET_EARLYMODE_LEN1(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 16, 12, __Value)
\r
30 #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value)
\r
31 #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value)
\r
32 #define SET_EARLYMODE_LEN3(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value)
\r
33 #define SET_EARLYMODE_LEN4(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value)
\r
36 //defined for TX DESC Operation
\r
39 #define MAX_TID (15)
\r
43 #define OFFSET_SHT 16
\r
51 #define PKT_OFFSET_SZ 0
\r
53 #define RATE_ID_SHT 16
\r
54 #define NAVUSEHDR BIT(20)
\r
55 #define SEC_TYPE_SHT 22
\r
56 #define PKT_OFFSET_SHT 26
\r
59 #define AGG_EN BIT(12)
\r
60 #define AGG_BK BIT(16)
\r
61 #define AMPDU_DENSITY_SHT 20
\r
62 #define ANTSEL_A BIT(24)
\r
63 #define ANTSEL_B BIT(25)
\r
64 #define TX_ANT_CCK_SHT 26
\r
65 #define TX_ANTL_SHT 28
\r
66 #define TX_ANT_HT_SHT 30
\r
70 #define EN_HWSEQ BIT(31)
\r
74 #define HW_SSN BIT(7)
\r
75 #define USERATE BIT(8)
\r
76 #define DISDATAFB BIT(10)
\r
77 #define CTS_2_SELF BIT(11)
\r
78 #define RTS_EN BIT(12)
\r
79 #define HW_RTS_EN BIT(13)
\r
80 #define DATA_SHORT BIT(24)
\r
81 #define PWR_STATUS_SHT 15
\r
82 #define DATA_SC_SHT 20
\r
83 #define DATA_BW BIT(25)
\r
86 #define RTY_LMT_EN BIT(17)
\r
91 #define USB_TXAGG_NUM_SHT 24
\r
93 typedef struct txdesc_88e
\r
112 u32 lsig_txop_en:1;
\r
119 u32 pkt_offset:5; // unit: 8 bytes
\r
132 u32 ampdu_density:3;
\r
141 u32 nextheadpage:8;
\r
176 u32 data_ratefb_lmt:5;
\r
177 u32 rts_ratefb_lmt:4;
\r
180 u32 usb_txagg_num:8;
\r
187 u32 mcsg1_max_len:4;
\r
188 u32 mcsg2_max_len:4;
\r
189 u32 mcsg3_max_len:4;
\r
190 u32 mcs7_sgi_max_len:4;
\r
193 u32 checksum:16; // TxBuffSize(PCIe)/CheckSum(USB)
\r
194 u32 sw0:8; /* offset 30 */
\r
196 u32 mcs15_sgi_max_len:4;
\r
197 }TXDESC_8188E, *PTXDESC_8188E;
\r
199 #define txdesc_set_ccx_sw_88e(txdesc, value) \
\r
201 ((struct txdesc_88e *)(txdesc))->sw1 = (((value)>>8) & 0x0f); \
\r
202 ((struct txdesc_88e *)(txdesc))->sw0 = ((value) & 0xff); \
\r
205 struct txrpt_ccx_88e {
\r
209 u8 txdma_underflow:1;
\r
221 u8 lifetime_over:1;
\r
229 u8 final_data_rate;
\r
239 #define txrpt_ccx_sw_88e(txrpt_ccx) ((txrpt_ccx)->sw0 + ((txrpt_ccx)->sw1<<8))
\r
240 #define txrpt_ccx_qtime_88e(txrpt_ccx) ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8))
\r
242 #define SET_TX_DESC_SEC_TYPE_8188E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+4, 22, 2, __Value)
\r
244 void rtl8188e_fill_fake_txdesc(PADAPTER padapter,u8*pDesc,u32 BufferLen,
\r
245 u8 IsPsPoll,u8 IsBTQosNull, u8 bDataFrame);
\r
246 void rtl8188e_cal_txdesc_chksum(struct tx_desc *ptxdesc);
\r
248 #if defined(CONFIG_SDIO_HCI)||defined (CONFIG_GSPI_HCI)
\r
249 s32 rtl8188es_init_xmit_priv(PADAPTER padapter);
\r
250 void rtl8188es_free_xmit_priv(PADAPTER padapter);
\r
251 s32 rtl8188es_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe);
\r
252 s32 rtl8188es_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe);
\r
253 s32 rtl8188es_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
\r
254 thread_return rtl8188es_xmit_thread(thread_context context);
\r
255 s32 rtl8188es_xmit_buf_handler(PADAPTER padapter);
\r
257 #ifdef CONFIG_SDIO_TX_TASKLET
\r
258 void rtl8188es_xmit_tasklet(void *priv);
\r
262 #ifdef CONFIG_USB_HCI
\r
263 s32 rtl8188eu_init_xmit_priv(PADAPTER padapter);
\r
264 void rtl8188eu_free_xmit_priv(PADAPTER padapter);
\r
265 s32 rtl8188eu_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe);
\r
266 s32 rtl8188eu_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe);
\r
267 s32 rtl8188eu_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
\r
268 s32 rtl8188eu_xmit_buf_handler(PADAPTER padapter);
\r
269 void rtl8188eu_xmit_tasklet(void *priv);
\r
270 s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);
\r
273 #ifdef CONFIG_PCI_HCI
\r
274 s32 rtl8188ee_init_xmit_priv(PADAPTER padapter);
\r
275 void rtl8188ee_free_xmit_priv(PADAPTER padapter);
\r
276 void rtl8188ee_xmitframe_resume(_adapter *padapter);
\r
277 s32 rtl8188ee_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe);
\r
278 s32 rtl8188ee_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe);
\r
279 s32 rtl8188ee_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
\r
280 void rtl8188ee_xmit_tasklet(void *priv);
\r
285 #ifdef CONFIG_TX_EARLY_MODE
\r
286 void UpdateEarlyModeInfo8188E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf );
\r
289 #ifdef CONFIG_XMIT_ACK
\r
290 void dump_txrpt_ccx_88e(void *buf);
\r
291 void handle_txrpt_ccx_88e(_adapter *adapter, u8 *buf);
\r
293 #define dump_txrpt_ccx_88e(buf) do {} while(0)
\r
294 #define handle_txrpt_ccx_88e(adapter, buf) do {} while(0)
\r
295 #endif //CONFIG_XMIT_ACK
\r
297 void _dbg_dump_tx_info(_adapter *padapter,int frame_tag,struct tx_desc *ptxdesc);
\r
298 #endif //__RTL8188E_XMIT_H__
\r