xref: /linux/drivers/net/wireless/ralink/rt2x00/rt2800usb.h (revision 58e16d792a6a8c6b750f637a4649967fcac853dc)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 	Copyright (C) 2009 Ivo van Doorn <IvDoorn@gmail.com>
4 	Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de>
5 	Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
6 	Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com>
7 	Copyright (C) 2009 Axel Kollhofer <rain_maker@root-forum.org>
8 	<http://rt2x00.serialmonkey.com>
9 
10  */
11 
12 /*
13 	Module: rt2800usb
14 	Abstract: Data structures and registers for the rt2800usb module.
15 	Supported chipsets: RT2800U.
16  */
17 
18 #ifndef RT2800USB_H
19 #define RT2800USB_H
20 
21 /*
22  * 8051 firmware image.
23  */
24 #define FIRMWARE_RT2870			"rt2870.bin"
25 #define FIRMWARE_IMAGE_BASE		0x3000
26 
27 /*
28  * DMA descriptor defines.
29  */
30 #define TXINFO_DESC_SIZE		(1 * sizeof(__le32))
31 #define RXINFO_DESC_SIZE		(1 * sizeof(__le32))
32 
33 /*
34  * TX Info structure
35  */
36 
37 /*
38  * Word0
39  * WIV: Wireless Info Valid. 1: Driver filled WI,  0: DMA needs to copy WI
40  * QSEL: Select on-chip FIFO ID for 2nd-stage output scheduler.
41  *       0:MGMT, 1:HCCA 2:EDCA
42  * USB_DMA_NEXT_VALID: Used ONLY in USB bulk Aggregation, NextValid
43  * DMA_TX_BURST: used ONLY in USB bulk Aggregation.
44  *               Force USB DMA transmit frame from current selected endpoint
45  */
46 #define TXINFO_W0_USB_DMA_TX_PKT_LEN	FIELD32(0x0000ffff)
47 #define TXINFO_W0_WIV			FIELD32(0x01000000)
48 #define TXINFO_W0_QSEL			FIELD32(0x06000000)
49 #define TXINFO_W0_SW_USE_LAST_ROUND	FIELD32(0x08000000)
50 #define TXINFO_W0_USB_DMA_NEXT_VALID	FIELD32(0x40000000)
51 #define TXINFO_W0_USB_DMA_TX_BURST	FIELD32(0x80000000)
52 
53 /*
54  * RX Info structure
55  */
56 
57 /*
58  * Word 0
59  */
60 
61 #define RXINFO_W0_USB_DMA_RX_PKT_LEN	FIELD32(0x0000ffff)
62 
63 /*
64  * RX descriptor format for RX Ring.
65  */
66 
67 /*
68  * Word0
69  * UNICAST_TO_ME: This RX frame is unicast to me.
70  * MULTICAST: This is a multicast frame.
71  * BROADCAST: This is a broadcast frame.
72  * MY_BSS: this frame belongs to the same BSSID.
73  * CRC_ERROR: CRC error.
74  * CIPHER_ERROR: 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid.
75  * AMSDU: rx with 802.3 header, not 802.11 header.
76  */
77 
78 #define RXD_W0_BA			FIELD32(0x00000001)
79 #define RXD_W0_DATA			FIELD32(0x00000002)
80 #define RXD_W0_NULLDATA			FIELD32(0x00000004)
81 #define RXD_W0_FRAG			FIELD32(0x00000008)
82 #define RXD_W0_UNICAST_TO_ME		FIELD32(0x00000010)
83 #define RXD_W0_MULTICAST		FIELD32(0x00000020)
84 #define RXD_W0_BROADCAST		FIELD32(0x00000040)
85 #define RXD_W0_MY_BSS			FIELD32(0x00000080)
86 #define RXD_W0_CRC_ERROR		FIELD32(0x00000100)
87 #define RXD_W0_CIPHER_ERROR		FIELD32(0x00000600)
88 #define RXD_W0_AMSDU			FIELD32(0x00000800)
89 #define RXD_W0_HTC			FIELD32(0x00001000)
90 #define RXD_W0_RSSI			FIELD32(0x00002000)
91 #define RXD_W0_L2PAD			FIELD32(0x00004000)
92 #define RXD_W0_AMPDU			FIELD32(0x00008000)
93 #define RXD_W0_DECRYPTED		FIELD32(0x00010000)
94 #define RXD_W0_PLCP_RSSI		FIELD32(0x00020000)
95 #define RXD_W0_CIPHER_ALG		FIELD32(0x00040000)
96 #define RXD_W0_LAST_AMSDU		FIELD32(0x00080000)
97 #define RXD_W0_PLCP_SIGNAL		FIELD32(0xfff00000)
98 
99 #endif /* RT2800USB_H */
100