1 /******************************************************************************
3 * Copyright(c) 2009-2010 Realtek Corporation.
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 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
22 * Larry Finger <Larry.Finger@lwfinger.net>
24 *****************************************************************************/
26 #ifndef __RTL8821AE_TRX_H__
27 #define __RTL8821AE_TRX_H__
29 #define TX_DESC_SIZE 40
30 #define TX_DESC_AGGR_SUBFRAME_SIZE 32
32 #define RX_DESC_SIZE 32
33 #define RX_DRV_INFO_SIZE_UNIT 8
35 #define TX_DESC_NEXT_DESC_OFFSET 40
36 #define USB_HWDESC_HEADER_LEN 40
39 #define SET_TX_DESC_PKT_SIZE(__pdesc, __val) \
40 SET_BITS_TO_LE_4BYTE(__pdesc, 0, 16, __val)
41 #define SET_TX_DESC_OFFSET(__pdesc, __val) \
42 SET_BITS_TO_LE_4BYTE(__pdesc, 16, 8, __val)
43 #define SET_TX_DESC_BMC(__pdesc, __val) \
44 SET_BITS_TO_LE_4BYTE(__pdesc, 24, 1, __val)
45 #define SET_TX_DESC_HTC(__pdesc, __val) \
46 SET_BITS_TO_LE_4BYTE(__pdesc, 25, 1, __val)
47 #define SET_TX_DESC_LAST_SEG(__pdesc, __val) \
48 SET_BITS_TO_LE_4BYTE(__pdesc, 26, 1, __val)
49 #define SET_TX_DESC_FIRST_SEG(__pdesc, __val) \
50 SET_BITS_TO_LE_4BYTE(__pdesc, 27, 1, __val)
51 #define SET_TX_DESC_LINIP(__pdesc, __val) \
52 SET_BITS_TO_LE_4BYTE(__pdesc, 28, 1, __val)
53 #define SET_TX_DESC_NO_ACM(__pdesc, __val) \
54 SET_BITS_TO_LE_4BYTE(__pdesc, 29, 1, __val)
55 #define SET_TX_DESC_GF(__pdesc, __val) \
56 SET_BITS_TO_LE_4BYTE(__pdesc, 30, 1, __val)
57 #define SET_TX_DESC_OWN(__pdesc, __val) \
58 SET_BITS_TO_LE_4BYTE(__pdesc, 31, 1, __val)
60 #define GET_TX_DESC_PKT_SIZE(__pdesc) \
61 LE_BITS_TO_4BYTE(__pdesc, 0, 16)
62 #define GET_TX_DESC_OFFSET(__pdesc) \
63 LE_BITS_TO_4BYTE(__pdesc, 16, 8)
64 #define GET_TX_DESC_BMC(__pdesc) \
65 LE_BITS_TO_4BYTE(__pdesc, 24, 1)
66 #define GET_TX_DESC_HTC(__pdesc) \
67 LE_BITS_TO_4BYTE(__pdesc, 25, 1)
68 #define GET_TX_DESC_LAST_SEG(__pdesc) \
69 LE_BITS_TO_4BYTE(__pdesc, 26, 1)
70 #define GET_TX_DESC_FIRST_SEG(__pdesc) \
71 LE_BITS_TO_4BYTE(__pdesc, 27, 1)
72 #define GET_TX_DESC_LINIP(__pdesc) \
73 LE_BITS_TO_4BYTE(__pdesc, 28, 1)
74 #define GET_TX_DESC_NO_ACM(__pdesc) \
75 LE_BITS_TO_4BYTE(__pdesc, 29, 1)
76 #define GET_TX_DESC_GF(__pdesc) \
77 LE_BITS_TO_4BYTE(__pdesc, 30, 1)
78 #define GET_TX_DESC_OWN(__pdesc) \
79 LE_BITS_TO_4BYTE(__pdesc, 31, 1)
81 #define SET_TX_DESC_MACID(__pdesc, __val) \
82 SET_BITS_TO_LE_4BYTE(__pdesc+4, 0, 7, __val)
83 #define SET_TX_DESC_QUEUE_SEL(__pdesc, __val) \
84 SET_BITS_TO_LE_4BYTE(__pdesc+4, 8, 5, __val)
85 #define SET_TX_DESC_RDG_NAV_EXT(__pdesc, __val) \
86 SET_BITS_TO_LE_4BYTE(__pdesc+4, 13, 1, __val)
87 #define SET_TX_DESC_LSIG_TXOP_EN(__pdesc, __val) \
88 SET_BITS_TO_LE_4BYTE(__pdesc+4, 14, 1, __val)
89 #define SET_TX_DESC_PIFS(__pdesc, __val) \
90 SET_BITS_TO_LE_4BYTE(__pdesc+4, 15, 1, __val)
91 #define SET_TX_DESC_RATE_ID(__pdesc, __val) \
92 SET_BITS_TO_LE_4BYTE(__pdesc+4, 16, 5, __val)
93 #define SET_TX_DESC_EN_DESC_ID(__pdesc, __val) \
94 SET_BITS_TO_LE_4BYTE(__pdesc+4, 21, 1, __val)
95 #define SET_TX_DESC_SEC_TYPE(__pdesc, __val) \
96 SET_BITS_TO_LE_4BYTE(__pdesc+4, 22, 2, __val)
97 #define SET_TX_DESC_PKT_OFFSET(__pdesc, __val) \
98 SET_BITS_TO_LE_4BYTE(__pdesc+4, 24, 5, __val)
100 #define SET_TX_DESC_PAID(__pdesc, __val) \
101 SET_BITS_TO_LE_4BYTE(__pdesc+8, 0, 9, __val)
102 #define SET_TX_DESC_CCA_RTS(__pdesc, __val) \
103 SET_BITS_TO_LE_4BYTE(__pdesc+8, 10, 2, __val)
104 #define SET_TX_DESC_AGG_ENABLE(__pdesc, __val) \
105 SET_BITS_TO_LE_4BYTE(__pdesc+8, 12, 1, __val)
106 #define SET_TX_DESC_RDG_ENABLE(__pdesc, __val) \
107 SET_BITS_TO_LE_4BYTE(__pdesc+8, 13, 1, __val)
108 #define SET_TX_DESC_BAR_RTY_TH(__pdesc, __val) \
109 SET_BITS_TO_LE_4BYTE(__pdesc+8, 14, 2, __val)
110 #define SET_TX_DESC_AGG_BREAK(__pdesc, __val) \
111 SET_BITS_TO_LE_4BYTE(__pdesc+8, 16, 1, __val)
112 #define SET_TX_DESC_MORE_FRAG(__pdesc, __val) \
113 SET_BITS_TO_LE_4BYTE(__pdesc+8, 17, 1, __val)
114 #define SET_TX_DESC_RAW(__pdesc, __val) \
115 SET_BITS_TO_LE_4BYTE(__pdesc+8, 18, 1, __val)
116 #define SET_TX_DESC_SPE_RPT(__pdesc, __val) \
117 SET_BITS_TO_LE_4BYTE(__pdesc+8, 19, 1, __val)
118 #define SET_TX_DESC_AMPDU_DENSITY(__pdesc, __val) \
119 SET_BITS_TO_LE_4BYTE(__pdesc+8, 20, 3, __val)
120 #define SET_TX_DESC_BT_INT(__pdesc, __val) \
121 SET_BITS_TO_LE_4BYTE(__pdesc+8, 23, 1, __val)
122 #define SET_TX_DESC_GID(__pdesc, __val) \
123 SET_BITS_TO_LE_4BYTE(__pdesc+8, 24, 6, __val)
125 #define SET_TX_DESC_WHEADER_LEN(__pdesc, __val) \
126 SET_BITS_TO_LE_4BYTE(__pdesc+12, 0, 4, __val)
127 #define SET_TX_DESC_CHK_EN(__pdesc, __val) \
128 SET_BITS_TO_LE_4BYTE(__pdesc+12, 4, 1, __val)
129 #define SET_TX_DESC_EARLY_MODE(__pdesc, __val) \
130 SET_BITS_TO_LE_4BYTE(__pdesc+12, 5, 1, __val)
131 #define SET_TX_DESC_HWSEQ_SEL(__pdesc, __val) \
132 SET_BITS_TO_LE_4BYTE(__pdesc+12, 6, 2, __val)
133 #define SET_TX_DESC_USE_RATE(__pdesc, __val) \
134 SET_BITS_TO_LE_4BYTE(__pdesc+12, 8, 1, __val)
135 #define SET_TX_DESC_DISABLE_RTS_FB(__pdesc, __val) \
136 SET_BITS_TO_LE_4BYTE(__pdesc+12, 9, 1, __val)
137 #define SET_TX_DESC_DISABLE_FB(__pdesc, __val) \
138 SET_BITS_TO_LE_4BYTE(__pdesc+12, 10, 1, __val)
139 #define SET_TX_DESC_CTS2SELF(__pdesc, __val) \
140 SET_BITS_TO_LE_4BYTE(__pdesc+12, 11, 1, __val)
141 #define SET_TX_DESC_RTS_ENABLE(__pdesc, __val) \
142 SET_BITS_TO_LE_4BYTE(__pdesc+12, 12, 1, __val)
143 #define SET_TX_DESC_HW_RTS_ENABLE(__pdesc, __val) \
144 SET_BITS_TO_LE_4BYTE(__pdesc+12, 13, 1, __val)
145 #define SET_TX_DESC_NAV_USE_HDR(__pdesc, __val) \
146 SET_BITS_TO_LE_4BYTE(__pdesc+12, 15, 1, __val)
147 #define SET_TX_DESC_USE_MAX_LEN(__pdesc, __val) \
148 SET_BITS_TO_LE_4BYTE(__pdesc+12, 16, 1, __val)
149 #define SET_TX_DESC_MAX_AGG_NUM(__pdesc, __val) \
150 SET_BITS_TO_LE_4BYTE(__pdesc+12, 17, 5, __val)
151 #define SET_TX_DESC_NDPA(__pdesc, __val) \
152 SET_BITS_TO_LE_4BYTE(__pdesc+12, 22, 2, __val)
153 #define SET_TX_DESC_AMPDU_MAX_TIME(__pdesc, __val) \
154 SET_BITS_TO_LE_4BYTE(__pdesc+12, 24, 8, __val)
155 #define SET_TX_DESC_TX_ANT(__pdesc, __val) \
156 SET_BITS_TO_LE_4BYTE(__pdesc+20, 24, 4, __val)
158 #define SET_TX_DESC_TX_RATE(__pdesc, __val) \
159 SET_BITS_TO_LE_4BYTE(__pdesc+16, 0, 7, __val)
160 #define SET_TX_DESC_DATA_RATE_FB_LIMIT(__pdesc, __val) \
161 SET_BITS_TO_LE_4BYTE(__pdesc+16, 8, 5, __val)
162 #define SET_TX_DESC_RTS_RATE_FB_LIMIT(__pdesc, __val) \
163 SET_BITS_TO_LE_4BYTE(__pdesc+16, 13, 4, __val)
164 #define SET_TX_DESC_RETRY_LIMIT_ENABLE(__pdesc, __val) \
165 SET_BITS_TO_LE_4BYTE(__pdesc+16, 17, 1, __val)
166 #define SET_TX_DESC_DATA_RETRY_LIMIT(__pdesc, __val) \
167 SET_BITS_TO_LE_4BYTE(__pdesc+16, 18, 6, __val)
168 #define SET_TX_DESC_RTS_RATE(__pdesc, __val) \
169 SET_BITS_TO_LE_4BYTE(__pdesc+16, 24, 5, __val)
171 #define SET_TX_DESC_TX_SUB_CARRIER(__pdesc, __val) \
172 SET_BITS_TO_LE_4BYTE(__pdesc+20, 0, 4, __val)
173 #define SET_TX_DESC_DATA_SHORTGI(__pdesc, __val) \
174 SET_BITS_TO_LE_1BYTE(__pdesc+20, 4, 1, __val)
175 #define SET_TX_DESC_DATA_BW(__pdesc, __val) \
176 SET_BITS_TO_LE_4BYTE(__pdesc+20, 5, 2, __val)
177 #define SET_TX_DESC_DATA_LDPC(__pdesc, __val) \
178 SET_BITS_TO_LE_4BYTE(__pdesc+20, 7, 1, __val)
179 #define SET_TX_DESC_DATA_STBC(__pdesc, __val) \
180 SET_BITS_TO_LE_4BYTE(__pdesc+20, 8, 2, __val)
181 #define SET_TX_DESC_CTROL_STBC(__pdesc, __val) \
182 SET_BITS_TO_LE_4BYTE(__pdesc+20, 10, 2, __val)
183 #define SET_TX_DESC_RTS_SHORT(__pdesc, __val) \
184 SET_BITS_TO_LE_4BYTE(__pdesc+20, 12, 1, __val)
185 #define SET_TX_DESC_RTS_SC(__pdesc, __val) \
186 SET_BITS_TO_LE_4BYTE(__pdesc+20, 13, 4, __val)
188 #define SET_TX_DESC_TX_BUFFER_SIZE(__pdesc, __val) \
189 SET_BITS_TO_LE_4BYTE(__pdesc+28, 0, 16, __val)
191 #define GET_TX_DESC_TX_BUFFER_SIZE(__pdesc) \
192 LE_BITS_TO_4BYTE(__pdesc+28, 0, 16)
194 #define SET_TX_DESC_HWSEQ_EN(__pdesc, __val) \
195 SET_BITS_TO_LE_4BYTE(__pdesc+32, 15, 1, __val)
197 #define SET_TX_DESC_SEQ(__pdesc, __val) \
198 SET_BITS_TO_LE_4BYTE(__pdesc+36, 12, 12, __val)
200 #define SET_TX_DESC_TX_BUFFER_ADDRESS(__pdesc, __val) \
201 SET_BITS_TO_LE_4BYTE(__pdesc+40, 0, 32, __val)
203 #define GET_TX_DESC_TX_BUFFER_ADDRESS(__pdesc) \
204 LE_BITS_TO_4BYTE(__pdesc+40, 0, 32)
206 #define SET_TX_DESC_NEXT_DESC_ADDRESS(__pdesc, __val) \
207 SET_BITS_TO_LE_4BYTE(__pdesc+48, 0, 32, __val)
209 #define GET_TX_DESC_NEXT_DESC_ADDRESS(__pdesc) \
210 LE_BITS_TO_4BYTE(__pdesc+48, 0, 32)
212 #define GET_RX_DESC_PKT_LEN(__pdesc) \
213 LE_BITS_TO_4BYTE(__pdesc, 0, 14)
214 #define GET_RX_DESC_CRC32(__pdesc) \
215 LE_BITS_TO_4BYTE(__pdesc, 14, 1)
216 #define GET_RX_DESC_ICV(__pdesc) \
217 LE_BITS_TO_4BYTE(__pdesc, 15, 1)
218 #define GET_RX_DESC_DRV_INFO_SIZE(__pdesc) \
219 LE_BITS_TO_4BYTE(__pdesc, 16, 4)
220 #define GET_RX_DESC_SECURITY(__pdesc) \
221 LE_BITS_TO_4BYTE(__pdesc, 20, 3)
222 #define GET_RX_DESC_QOS(__pdesc) \
223 LE_BITS_TO_4BYTE(__pdesc, 23, 1)
224 #define GET_RX_DESC_SHIFT(__pdesc) \
225 LE_BITS_TO_4BYTE(__pdesc, 24, 2)
226 #define GET_RX_DESC_PHYST(__pdesc) \
227 LE_BITS_TO_4BYTE(__pdesc, 26, 1)
228 #define GET_RX_DESC_SWDEC(__pdesc) \
229 LE_BITS_TO_4BYTE(__pdesc, 27, 1)
230 #define GET_RX_DESC_LS(__pdesc) \
231 LE_BITS_TO_4BYTE(__pdesc, 28, 1)
232 #define GET_RX_DESC_FS(__pdesc) \
233 LE_BITS_TO_4BYTE(__pdesc, 29, 1)
234 #define GET_RX_DESC_EOR(__pdesc) \
235 LE_BITS_TO_4BYTE(__pdesc, 30, 1)
236 #define GET_RX_DESC_OWN(__pdesc) \
237 LE_BITS_TO_4BYTE(__pdesc, 31, 1)
239 #define SET_RX_DESC_PKT_LEN(__pdesc, __val) \
240 SET_BITS_TO_LE_4BYTE(__pdesc, 0, 14, __val)
241 #define SET_RX_DESC_EOR(__pdesc, __val) \
242 SET_BITS_TO_LE_4BYTE(__pdesc, 30, 1, __val)
243 #define SET_RX_DESC_OWN(__pdesc, __val) \
244 SET_BITS_TO_LE_4BYTE(__pdesc, 31, 1, __val)
246 #define GET_RX_DESC_MACID(__pdesc) \
247 LE_BITS_TO_4BYTE(__pdesc+4, 0, 7)
248 #define GET_RX_DESC_TID(__pdesc) \
249 LE_BITS_TO_4BYTE(__pdesc+4, 8, 4)
250 #define GET_RX_DESC_AMSDU(__pdesc) \
251 LE_BITS_TO_4BYTE(__pdesc+4, 13, 1)
252 #define GET_RX_STATUS_DESC_RXID_MATCH(__pdesc) \
253 LE_BITS_TO_4BYTE(__pdesc+4, 14, 1)
254 #define GET_RX_DESC_PAGGR(__pdesc) \
255 LE_BITS_TO_4BYTE(__pdesc+4, 15, 1)
256 #define GET_RX_DESC_A1_FIT(__pdesc) \
257 LE_BITS_TO_4BYTE(__pdesc+4, 16, 4)
258 #define GET_RX_DESC_CHKERR(__pdesc) \
259 LE_BITS_TO_4BYTE(__pdesc+4, 20, 1)
260 #define GET_RX_DESC_IPVER(__pdesc) \
261 LE_BITS_TO_4BYTE(__pdesc+4, 21, 1)
262 #define GET_RX_STATUS_DESC_IS_TCPUDP(__pdesc) \
263 LE_BITS_TO_4BYTE(__pdesc+4, 22, 1)
264 #define GET_RX_STATUS_DESC_CHK_VLD(__pdesc) \
265 LE_BITS_TO_4BYTE(__pdesc+4, 23, 1)
266 #define GET_RX_DESC_PAM(__pdesc) \
267 LE_BITS_TO_4BYTE(__pdesc+4, 24, 1)
268 #define GET_RX_DESC_PWR(__pdesc) \
269 LE_BITS_TO_4BYTE(__pdesc+4, 25, 1)
270 #define GET_RX_DESC_MD(__pdesc) \
271 LE_BITS_TO_4BYTE(__pdesc+4, 26, 1)
272 #define GET_RX_DESC_MF(__pdesc) \
273 LE_BITS_TO_4BYTE(__pdesc+4, 27, 1)
274 #define GET_RX_DESC_TYPE(__pdesc) \
275 LE_BITS_TO_4BYTE(__pdesc+4, 28, 2)
276 #define GET_RX_DESC_MC(__pdesc) \
277 LE_BITS_TO_4BYTE(__pdesc+4, 30, 1)
278 #define GET_RX_DESC_BC(__pdesc) \
279 LE_BITS_TO_4BYTE(__pdesc+4, 31, 1)
281 #define GET_RX_DESC_SEQ(__pdesc) \
282 LE_BITS_TO_4BYTE(__pdesc+8, 0, 12)
283 #define GET_RX_DESC_FRAG(__pdesc) \
284 LE_BITS_TO_4BYTE(__pdesc+8, 12, 4)
285 #define GET_RX_STATUS_DESC_RX_IS_QOS(__pdesc) \
286 LE_BITS_TO_4BYTE(__pdesc+8, 16, 1)
287 #define GET_RX_STATUS_DESC_WLANHD_IV_LEN(__pdesc) \
288 LE_BITS_TO_4BYTE(__pdesc+8, 18, 6)
289 #define GET_RX_STATUS_DESC_RPT_SEL(__pdesc) \
290 LE_BITS_TO_4BYTE(__pdesc+8, 28, 1)
292 #define GET_RX_DESC_RXMCS(__pdesc) \
293 LE_BITS_TO_4BYTE(__pdesc+12, 0, 7)
294 #define GET_RX_DESC_HTC(__pdesc) \
295 LE_BITS_TO_4BYTE(__pdesc+12, 10, 1)
296 #define GET_RX_STATUS_DESC_EOSP(__pdesc) \
297 LE_BITS_TO_4BYTE(__pdesc+12, 11, 1)
298 #define GET_RX_STATUS_DESC_BSSID_FIT(__pdesc) \
299 LE_BITS_TO_4BYTE(__pdesc+12, 12, 2)
301 #define GET_RX_STATUS_DESC_PATTERN_MATCH(__pdesc) \
302 LE_BITS_TO_4BYTE(__pdesc+12, 29, 1)
303 #define GET_RX_STATUS_DESC_UNICAST_MATCH(__pdesc) \
304 LE_BITS_TO_4BYTE(__pdesc+12, 30, 1)
305 #define GET_RX_STATUS_DESC_MAGIC_MATCH(__pdesc) \
306 LE_BITS_TO_4BYTE(__pdesc+12, 31, 1)
308 #define GET_RX_DESC_SPLCP(__pdesc) \
309 LE_BITS_TO_4BYTE(__pdesc+16, 0, 1)
310 #define GET_RX_STATUS_DESC_LDPC(__pdesc) \
311 LE_BITS_TO_4BYTE(__pdesc+16, 1, 1)
312 #define GET_RX_STATUS_DESC_STBC(__pdesc) \
313 LE_BITS_TO_4BYTE(__pdesc+16, 2, 1)
314 #define GET_RX_DESC_BW(__pdesc) \
315 LE_BITS_TO_4BYTE(__pdesc+16, 4, 2)
317 #define GET_RX_DESC_TSFL(__pdesc) \
318 LE_BITS_TO_4BYTE(__pdesc+20, 0, 32)
320 #define GET_RX_DESC_BUFF_ADDR(__pdesc) \
321 LE_BITS_TO_4BYTE(__pdesc+24, 0, 32)
322 #define GET_RX_DESC_BUFF_ADDR64(__pdesc) \
323 LE_BITS_TO_4BYTE(__pdesc+28, 0, 32)
325 #define SET_RX_DESC_BUFF_ADDR(__pdesc, __val) \
326 SET_BITS_TO_LE_4BYTE(__pdesc+24, 0, 32, __val)
327 #define SET_RX_DESC_BUFF_ADDR64(__pdesc, __val) \
328 SET_BITS_TO_LE_4BYTE(__pdesc+28, 0, 32, __val)
330 /* TX report 2 format in Rx desc*/
332 #define GET_RX_RPT2_DESC_PKT_LEN(__status) \
333 LE_BITS_TO_4BYTE(__status, 0, 9)
334 #define GET_RX_RPT2_DESC_MACID_VALID_1(__status) \
335 LE_BITS_TO_4BYTE(__status+16, 0, 32)
336 #define GET_RX_RPT2_DESC_MACID_VALID_2(__status) \
337 LE_BITS_TO_4BYTE(__status+20, 0, 32)
339 #define SET_EARLYMODE_PKTNUM(__paddr, __value) \
340 SET_BITS_TO_LE_4BYTE(__paddr, 0, 4, __value)
341 #define SET_EARLYMODE_LEN0(__paddr, __value) \
342 SET_BITS_TO_LE_4BYTE(__paddr, 4, 12, __value)
343 #define SET_EARLYMODE_LEN1(__paddr, __value) \
344 SET_BITS_TO_LE_4BYTE(__paddr, 16, 12, __value)
345 #define SET_EARLYMODE_LEN2_1(__paddr, __value) \
346 SET_BITS_TO_LE_4BYTE(__paddr, 28, 4, __value)
347 #define SET_EARLYMODE_LEN2_2(__paddr, __value) \
348 SET_BITS_TO_LE_4BYTE(__paddr+4, 0, 8, __value)
349 #define SET_EARLYMODE_LEN3(__paddr, __value) \
350 SET_BITS_TO_LE_4BYTE(__paddr+4, 8, 12, __value)
351 #define SET_EARLYMODE_LEN4(__paddr, __value) \
352 SET_BITS_TO_LE_4BYTE(__paddr+4, 20, 12, __value)
354 #define CLEAR_PCI_TX_DESC_CONTENT(__pdesc, _size) \
356 if (_size > TX_DESC_NEXT_DESC_OFFSET) \
357 memset(__pdesc, 0, TX_DESC_NEXT_DESC_OFFSET); \
359 memset(__pdesc, 0, _size); \
362 #define RTL8821AE_RX_HAL_IS_CCK_RATE(rxmcs)\
363 (rxmcs == DESC_RATE1M ||\
364 rxmcs == DESC_RATE2M ||\
365 rxmcs == DESC_RATE5_5M ||\
366 rxmcs == DESC_RATE11M)
368 struct phy_rx_agc_info_t
{
369 #ifdef __LITTLE_ENDIAN
376 struct phy_status_rpt
{
379 #ifdef __LITTLE_ENDIAN
383 #else /* _BIG_ENDIAN_ */
390 u8 cfosho
[4]; /* DW 1 byte 1 DW 2 byte 0 */
393 char cfotail
[4]; /* DW 2 byte 1 DW 3 byte 0 */
396 char rxevm
[2]; /* DW 3 byte 1 DW 3 byte 2 */
397 char rxsnr
[2]; /* DW 3 byte 3 DW 4 byte 0 */
401 u8 pdsnr
[2]; /* DW 4 byte 3 DW 5 Byte 0 */
416 struct rx_fwinfo_8821ae
{
434 struct tx_desc_8821ae
{
510 u32 rtsrate_fb_lmt
:4;
535 u32 nextdescaddress64
;
537 u32 reserve_pass_pcie_mm_limit
[4];
540 struct rx_desc_8821ae
{
598 void rtl8821ae_tx_fill_desc(struct ieee80211_hw
*hw
,
599 struct ieee80211_hdr
*hdr
, u8
*pdesc_tx
, u8
*txbd
,
600 struct ieee80211_tx_info
*info
,
601 struct ieee80211_sta
*sta
,
603 u8 hw_queue
, struct rtl_tcb_desc
*ptcb_desc
);
604 bool rtl8821ae_rx_query_desc(struct ieee80211_hw
*hw
,
605 struct rtl_stats
*status
,
606 struct ieee80211_rx_status
*rx_status
,
607 u8
*pdesc
, struct sk_buff
*skb
);
608 void rtl8821ae_set_desc(struct ieee80211_hw
*hw
, u8
*pdesc
,
609 bool istx
, u8 desc_name
, u8
*val
);
610 u32
rtl8821ae_get_desc(u8
*pdesc
, bool istx
, u8 desc_name
);
611 bool rtl8821ae_is_tx_desc_closed(struct ieee80211_hw
*hw
,
612 u8 hw_queue
, u16 index
);
613 void rtl8821ae_tx_polling(struct ieee80211_hw
*hw
, u8 hw_queue
);
614 void rtl8821ae_tx_fill_cmddesc(struct ieee80211_hw
*hw
, u8
*pdesc
,
615 bool firstseg
, bool lastseg
,
616 struct sk_buff
*skb
);
617 u32
rtl8821ae_rx_command_packet(struct ieee80211_hw
*hw
,
618 const struct rtl_stats
*status
,
619 struct sk_buff
*skb
);