Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     Copyright (C) 2009 Ivo van Doorn <IvDoorn@gmail.com>
0004     Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de>
0005     Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
0006     Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com>
0007     Copyright (C) 2009 Axel Kollhofer <rain_maker@root-forum.org>
0008     <http://rt2x00.serialmonkey.com>
0009 
0010  */
0011 
0012 /*
0013     Module: rt2800usb
0014     Abstract: Data structures and registers for the rt2800usb module.
0015     Supported chipsets: RT2800U.
0016  */
0017 
0018 #ifndef RT2800USB_H
0019 #define RT2800USB_H
0020 
0021 /*
0022  * 8051 firmware image.
0023  */
0024 #define FIRMWARE_RT2870         "rt2870.bin"
0025 #define FIRMWARE_IMAGE_BASE     0x3000
0026 
0027 /*
0028  * DMA descriptor defines.
0029  */
0030 #define TXINFO_DESC_SIZE        (1 * sizeof(__le32))
0031 #define RXINFO_DESC_SIZE        (1 * sizeof(__le32))
0032 
0033 /*
0034  * TX Info structure
0035  */
0036 
0037 /*
0038  * Word0
0039  * WIV: Wireless Info Valid. 1: Driver filled WI,  0: DMA needs to copy WI
0040  * QSEL: Select on-chip FIFO ID for 2nd-stage output scheduler.
0041  *       0:MGMT, 1:HCCA 2:EDCA
0042  * USB_DMA_NEXT_VALID: Used ONLY in USB bulk Aggregation, NextValid
0043  * DMA_TX_BURST: used ONLY in USB bulk Aggregation.
0044  *               Force USB DMA transmit frame from current selected endpoint
0045  */
0046 #define TXINFO_W0_USB_DMA_TX_PKT_LEN    FIELD32(0x0000ffff)
0047 #define TXINFO_W0_WIV           FIELD32(0x01000000)
0048 #define TXINFO_W0_QSEL          FIELD32(0x06000000)
0049 #define TXINFO_W0_SW_USE_LAST_ROUND FIELD32(0x08000000)
0050 #define TXINFO_W0_USB_DMA_NEXT_VALID    FIELD32(0x40000000)
0051 #define TXINFO_W0_USB_DMA_TX_BURST  FIELD32(0x80000000)
0052 
0053 /*
0054  * RX Info structure
0055  */
0056 
0057 /*
0058  * Word 0
0059  */
0060 
0061 #define RXINFO_W0_USB_DMA_RX_PKT_LEN    FIELD32(0x0000ffff)
0062 
0063 /*
0064  * RX descriptor format for RX Ring.
0065  */
0066 
0067 /*
0068  * Word0
0069  * UNICAST_TO_ME: This RX frame is unicast to me.
0070  * MULTICAST: This is a multicast frame.
0071  * BROADCAST: This is a broadcast frame.
0072  * MY_BSS: this frame belongs to the same BSSID.
0073  * CRC_ERROR: CRC error.
0074  * CIPHER_ERROR: 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid.
0075  * AMSDU: rx with 802.3 header, not 802.11 header.
0076  */
0077 
0078 #define RXD_W0_BA           FIELD32(0x00000001)
0079 #define RXD_W0_DATA         FIELD32(0x00000002)
0080 #define RXD_W0_NULLDATA         FIELD32(0x00000004)
0081 #define RXD_W0_FRAG         FIELD32(0x00000008)
0082 #define RXD_W0_UNICAST_TO_ME        FIELD32(0x00000010)
0083 #define RXD_W0_MULTICAST        FIELD32(0x00000020)
0084 #define RXD_W0_BROADCAST        FIELD32(0x00000040)
0085 #define RXD_W0_MY_BSS           FIELD32(0x00000080)
0086 #define RXD_W0_CRC_ERROR        FIELD32(0x00000100)
0087 #define RXD_W0_CIPHER_ERROR     FIELD32(0x00000600)
0088 #define RXD_W0_AMSDU            FIELD32(0x00000800)
0089 #define RXD_W0_HTC          FIELD32(0x00001000)
0090 #define RXD_W0_RSSI         FIELD32(0x00002000)
0091 #define RXD_W0_L2PAD            FIELD32(0x00004000)
0092 #define RXD_W0_AMPDU            FIELD32(0x00008000)
0093 #define RXD_W0_DECRYPTED        FIELD32(0x00010000)
0094 #define RXD_W0_PLCP_RSSI        FIELD32(0x00020000)
0095 #define RXD_W0_CIPHER_ALG       FIELD32(0x00040000)
0096 #define RXD_W0_LAST_AMSDU       FIELD32(0x00080000)
0097 #define RXD_W0_PLCP_SIGNAL      FIELD32(0xfff00000)
0098 
0099 #endif /* RT2800USB_H */