1 #ifndef _RTL871X_XMIT_H_
2 #define _RTL871X_XMIT_H_
4 #include "osdep_service.h"
6 #include "xmit_osdep.h"
8 #define MAX_XMITBUF_SZ (2048)
9 #define NR_XMITBUFF (4)
10 #define XMITBUF_ALIGN_SZ 512
11 #define TX_GUARD_BAND 5
12 #define MAX_NUMBLKS (1)
14 /* Fixed the Big Endian bug when using the software driver encryption.*/
15 #define WEP_IV(pattrib_iv, txpn, keyidx)\
17 pattrib_iv[0] = txpn._byte_.TSC0;\
18 pattrib_iv[1] = txpn._byte_.TSC1;\
19 pattrib_iv[2] = txpn._byte_.TSC2;\
20 pattrib_iv[3] = ((keyidx & 0x3)<<6);\
21 txpn.val = (txpn.val == 0xffffff) ? 0 : (txpn.val+1);\
24 /* Fixed the Big Endian bug when doing the Tx.
25 * The Linksys WRH54G will check this.*/
26 #define TKIP_IV(pattrib_iv, txpn, keyidx)\
28 pattrib_iv[0] = txpn._byte_.TSC1;\
29 pattrib_iv[1] = (txpn._byte_.TSC1 | 0x20) & 0x7f;\
30 pattrib_iv[2] = txpn._byte_.TSC0;\
31 pattrib_iv[3] = BIT(5) | ((keyidx & 0x3)<<6);\
32 pattrib_iv[4] = txpn._byte_.TSC2;\
33 pattrib_iv[5] = txpn._byte_.TSC3;\
34 pattrib_iv[6] = txpn._byte_.TSC4;\
35 pattrib_iv[7] = txpn._byte_.TSC5;\
36 txpn.val = txpn.val == 0xffffffffffffULL ? 0 : \
40 #define AES_IV(pattrib_iv, txpn, keyidx)\
42 pattrib_iv[0] = txpn._byte_.TSC0;\
43 pattrib_iv[1] = txpn._byte_.TSC1;\
45 pattrib_iv[3] = BIT(5) | ((keyidx & 0x3)<<6);\
46 pattrib_iv[4] = txpn._byte_.TSC2;\
47 pattrib_iv[5] = txpn._byte_.TSC3;\
48 pattrib_iv[6] = txpn._byte_.TSC4;\
49 pattrib_iv[7] = txpn._byte_.TSC5;\
50 txpn.val = txpn.val == 0xffffffffffffULL ? 0 : \
56 struct list_head pending
;
57 struct __queue
*sta_queue
;
58 struct hw_txqueue
*phwtxqueue
;
71 u32 pktlen
; /* the original 802.3 pkt raw_data len
72 * (not include ether_hdr data) */
75 u8 pkt_hdrlen
; /*the original 802.3 pkt header len*/
76 u8 hdrlen
; /*the WLAN Header Len*/
80 u8 vcs_mode
; /*virtual carrier sense method*/
81 u8 pctrl
;/*per packet txdesc control enable*/
85 u8 encrypt
; /* when 0 indicate no encrypt. when non-zero,
86 * indicate the encrypt algorith*/
95 struct sta_info
*psta
;
98 #define WLANHDR_OFFSET 64
99 #define DATA_FRAMETAG 0x01
100 #define L2_FRAMETAG 0x02
101 #define MGNT_FRAMETAG 0x03
102 #define AMSDU_FRAMETAG 0x04
103 #define EII_FRAMETAG 0x05
104 #define IEEE8023_FRAMETAG 0x06
105 #define MP_FRAMETAG 0x07
106 #define TXAGG_FRAMETAG 0x08
109 struct list_head list
;
113 struct urb
*pxmit_urb
[8];
117 struct list_head list
;
118 struct pkt_attrib attrib
;
121 struct _adapter
*padapter
;
123 struct xmit_buf
*pxmitbuf
;
126 struct urb
*pxmit_urb
[8];
132 struct list_head tx_pending
;
133 struct __queue sta_pending
;
137 struct sta_xmit_priv
{
140 sint apsd_setting
; /* When bit mask is on, the associated edca
141 * queue supports APSD.*/
142 struct tx_servq be_q
; /* priority == 0,3 */
143 struct tx_servq bk_q
; /* priority == 1,2*/
144 struct tx_servq vi_q
; /*priority == 4,5*/
145 struct tx_servq vo_q
; /*priority == 6,7*/
146 struct list_head legacy_dz
;
147 struct list_head apsd
;
155 /*volatile*/ sint head
;
156 /*volatile*/ sint tail
;
157 /*volatile*/ sint free_sz
; /*in units of 64 bytes*/
158 /*volatile*/ sint free_cmdsz
;
159 /*volatile*/ sint txsz
[8];
167 struct semaphore xmit_sema
;
168 struct semaphore terminate_xmitthread_sema
;
169 struct __queue be_pending
;
170 struct __queue bk_pending
;
171 struct __queue vi_pending
;
172 struct __queue vo_pending
;
173 struct __queue bm_pending
;
174 struct __queue legacy_dz_queue
;
175 struct __queue apsd_queue
;
176 u8
*pallocated_frame_buf
;
178 uint free_xmitframe_cnt
;
181 struct __queue free_xmit_queue
;
182 struct hw_txqueue be_txqueue
;
183 struct hw_txqueue bk_txqueue
;
184 struct hw_txqueue vi_txqueue
;
185 struct hw_txqueue vo_txqueue
;
186 struct hw_txqueue bmc_txqueue
;
188 struct _adapter
*adapter
;
196 struct hw_xmit
*hwxmits
;
198 struct semaphore tx_retevt
;/*all tx return event;*/
200 struct tasklet_struct xmit_tasklet
;
201 /*per AC pending irp*/
206 struct __queue free_amsdu_xmit_queue
;
207 u8
*pallocated_amsdu_frame_buf
;
208 u8
*pxmit_amsdu_frame_buf
;
209 uint free_amsdu_xmitframe_cnt
;
210 struct __queue free_txagg_xmit_queue
;
211 u8
*pallocated_txagg_frame_buf
;
212 u8
*pxmit_txagg_frame_buf
;
213 uint free_txagg_xmitframe_cnt
;
215 struct __queue free_xmitbuf_queue
;
216 struct __queue pending_xmitbuf_queue
;
217 u8
*pallocated_xmitbuf
;
219 uint free_xmitbuf_cnt
;
222 static inline struct __queue
*get_free_xmit_queue(
223 struct xmit_priv
*pxmitpriv
)
225 return &(pxmitpriv
->free_xmit_queue
);
228 int r8712_free_xmitbuf(struct xmit_priv
*pxmitpriv
,
229 struct xmit_buf
*pxmitbuf
);
230 struct xmit_buf
*r8712_alloc_xmitbuf(struct xmit_priv
*pxmitpriv
);
231 void r8712_update_protection(struct _adapter
*padapter
, u8
*ie
, uint ie_len
);
232 struct xmit_frame
*r8712_alloc_xmitframe(struct xmit_priv
*pxmitpriv
);
233 void r8712_free_xmitframe(struct xmit_priv
*pxmitpriv
,
234 struct xmit_frame
*pxmitframe
);
235 void r8712_free_xmitframe_queue(struct xmit_priv
*pxmitpriv
,
236 struct __queue
*pframequeue
);
237 sint
r8712_xmit_classifier(struct _adapter
*padapter
,
238 struct xmit_frame
*pxmitframe
);
239 sint
r8712_xmitframe_coalesce(struct _adapter
*padapter
, _pkt
*pkt
,
240 struct xmit_frame
*pxmitframe
);
241 sint
_r8712_init_hw_txqueue(struct hw_txqueue
*phw_txqueue
, u8 ac_tag
);
242 void _r8712_init_sta_xmit_priv(struct sta_xmit_priv
*psta_xmitpriv
);
243 sint
r8712_update_attrib(struct _adapter
*padapter
, _pkt
*pkt
,
244 struct pkt_attrib
*pattrib
);
245 int r8712_txframes_sta_ac_pending(struct _adapter
*padapter
,
246 struct pkt_attrib
*pattrib
);
247 sint
_r8712_init_xmit_priv(struct xmit_priv
*pxmitpriv
,
248 struct _adapter
*padapter
);
249 void _free_xmit_priv(struct xmit_priv
*pxmitpriv
);
250 void r8712_free_xmitframe_ex(struct xmit_priv
*pxmitpriv
,
251 struct xmit_frame
*pxmitframe
);
252 int r8712_pre_xmit(struct _adapter
*padapter
, struct xmit_frame
*pxmitframe
);
253 int r8712_xmit_enqueue(struct _adapter
*padapter
,
254 struct xmit_frame
*pxmitframe
);
255 int r8712_xmit_direct(struct _adapter
*padapter
, struct xmit_frame
*pxmitframe
);
256 void r8712_xmit_bh(void *priv
);
258 #include "rtl8712_xmit.h"
260 #endif /*_RTL871X_XMIT_H_*/