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 * 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
19 ******************************************************************************/
20 #ifndef _RTL8192D_XMIT_H_
21 #define _RTL8192D_XMIT_H_
24 //defined for TX DESC Operation
39 #define PKT_OFFSET_SZ 0
42 #define Rate_ID_SHT 16
43 #define NAVUSEHDR BIT(20)
44 #define PKT_OFFSET_SHT 26
48 #define AGG_EN BIT(29)
55 #define HW_SEQ_EN BIT(7)
56 #define USERATE BIT(8)
57 #define DISDATAFB BIT(10)
58 #define DATA_SHORT BIT(24)
59 #define DATA_BW BIT(25)
65 // Queue Select Value in TxDesc
67 #define QSLT_BK 0x2//0x01
69 #define QSLT_VI 0x5//0x4
70 #define QSLT_VO 0x7//0x6
71 #define QSLT_BEACON 0x10
72 #define QSLT_HIGH 0x11
73 #define QSLT_MGNT 0x12
76 //Because we open EM for normal case, we just always insert 2*8 bytes.by wl
77 #ifdef USB_PACKET_OFFSET_SZ
78 #define USB_92D_DUMMY_OFFSET (PACKET_OFFSET_SZ/8)
80 #define USB_92D_DUMMY_OFFSET 2
82 #define USB_92D_DUMMY_LENGTH (USB_92D_DUMMY_OFFSET * PACKET_OFFSET_SZ)
83 #define USB_HWDESC_HEADER_LEN (TXDESC_SIZE + USB_92D_DUMMY_LENGTH)
86 #define SET_EARLYMODE_PKTNUM(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 0, 3, __Value)
87 #define SET_EARLYMODE_LEN0(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 4, 12, __Value)
88 #define SET_EARLYMODE_LEN1(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 16, 12, __Value)
89 #define SET_EARLYMODE_LEN2_1(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr, 28, 4, __Value)
90 #define SET_EARLYMODE_LEN2_2(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 0, 8, __Value)
91 #define SET_EARLYMODE_LEN3(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 8, 12, __Value)
92 #define SET_EARLYMODE_LEN4(__pAddr, __Value) SET_BITS_TO_LE_4BYTE(__pAddr+4, 20, 12, __Value)
94 /* Copy from rtl8192c */
95 struct txrpt_ccx_8192d {
130 #define txrpt_ccx_qtime_8192d(txrpt_ccx) ((txrpt_ccx)->ccx_qtime0+((txrpt_ccx)->ccx_qtime1<<8))
132 #ifdef CONFIG_XMIT_ACK
133 void dump_txrpt_ccx_8192d(void *buf);
134 void handle_txrpt_ccx_8192d(_adapter *adapter, void *buf);
136 #define dump_txrpt_ccx_8192d(buf) do {} while(0)
137 #define handle_txrpt_ccx_8192d(adapter, buf) do {} while(0)
140 #ifdef CONFIG_USB_HCI
142 s32 rtl8192du_init_xmit_priv(_adapter * padapter);
144 void rtl8192du_free_xmit_priv(_adapter * padapter);
146 void rtl8192du_cal_txdesc_chksum(struct tx_desc *ptxdesc);
148 s32 rtl8192du_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);
150 s32 rtl8192du_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe);
152 s32 rtl8192du_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe);
154 s32 rtl8192du_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
156 #ifdef CONFIG_HOSTAPD_MLME
157 s32 rtl8192du_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt);
162 #ifdef CONFIG_PCI_HCI
163 s32 rtl8192de_init_xmit_priv(_adapter * padapter);
164 void rtl8192de_free_xmit_priv(_adapter * padapter);
166 s32 rtl8192de_enqueue_xmitbuf(struct rtw_tx_ring *ring, struct xmit_buf *pxmitbuf);
167 struct xmit_buf *rtl8192de_dequeue_xmitbuf(struct rtw_tx_ring *ring);
169 void rtl8192de_xmitframe_resume(_adapter *padapter);
171 s32 rtl8192de_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe);
173 s32 rtl8192de_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe);
175 s32 rtl8192de_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe);
177 #ifdef CONFIG_HOSTAPD_MLME
178 s32 rtl8192de_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt);
181 #endif//end if CONFIG_PCI_HCI