rt2800usb.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. Copyright (C) 2009 Ivo van Doorn <IvDoorn@gmail.com>
  3. Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de>
  4. Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
  5. Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com>
  6. Copyright (C) 2009 Axel Kollhofer <rain_maker@root-forum.org>
  7. <http://rt2x00.serialmonkey.com>
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, see <http://www.gnu.org/licenses/>.
  18. */
  19. /*
  20. Module: rt2800usb
  21. Abstract: Data structures and registers for the rt2800usb module.
  22. Supported chipsets: RT2800U.
  23. */
  24. #ifndef RT2800USB_H
  25. #define RT2800USB_H
  26. /*
  27. * 8051 firmware image.
  28. */
  29. #define FIRMWARE_RT2870 "rt2870.bin"
  30. #define FIRMWARE_IMAGE_BASE 0x3000
  31. /*
  32. * DMA descriptor defines.
  33. */
  34. #define TXINFO_DESC_SIZE (1 * sizeof(__le32))
  35. #define RXINFO_DESC_SIZE (1 * sizeof(__le32))
  36. /*
  37. * TX Info structure
  38. */
  39. /*
  40. * Word0
  41. * WIV: Wireless Info Valid. 1: Driver filled WI, 0: DMA needs to copy WI
  42. * QSEL: Select on-chip FIFO ID for 2nd-stage output scheduler.
  43. * 0:MGMT, 1:HCCA 2:EDCA
  44. * USB_DMA_NEXT_VALID: Used ONLY in USB bulk Aggregation, NextValid
  45. * DMA_TX_BURST: used ONLY in USB bulk Aggregation.
  46. * Force USB DMA transmit frame from current selected endpoint
  47. */
  48. #define TXINFO_W0_USB_DMA_TX_PKT_LEN FIELD32(0x0000ffff)
  49. #define TXINFO_W0_WIV FIELD32(0x01000000)
  50. #define TXINFO_W0_QSEL FIELD32(0x06000000)
  51. #define TXINFO_W0_SW_USE_LAST_ROUND FIELD32(0x08000000)
  52. #define TXINFO_W0_USB_DMA_NEXT_VALID FIELD32(0x40000000)
  53. #define TXINFO_W0_USB_DMA_TX_BURST FIELD32(0x80000000)
  54. /*
  55. * RX Info structure
  56. */
  57. /*
  58. * Word 0
  59. */
  60. #define RXINFO_W0_USB_DMA_RX_PKT_LEN FIELD32(0x0000ffff)
  61. /*
  62. * RX descriptor format for RX Ring.
  63. */
  64. /*
  65. * Word0
  66. * UNICAST_TO_ME: This RX frame is unicast to me.
  67. * MULTICAST: This is a multicast frame.
  68. * BROADCAST: This is a broadcast frame.
  69. * MY_BSS: this frame belongs to the same BSSID.
  70. * CRC_ERROR: CRC error.
  71. * CIPHER_ERROR: 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid.
  72. * AMSDU: rx with 802.3 header, not 802.11 header.
  73. */
  74. #define RXD_W0_BA FIELD32(0x00000001)
  75. #define RXD_W0_DATA FIELD32(0x00000002)
  76. #define RXD_W0_NULLDATA FIELD32(0x00000004)
  77. #define RXD_W0_FRAG FIELD32(0x00000008)
  78. #define RXD_W0_UNICAST_TO_ME FIELD32(0x00000010)
  79. #define RXD_W0_MULTICAST FIELD32(0x00000020)
  80. #define RXD_W0_BROADCAST FIELD32(0x00000040)
  81. #define RXD_W0_MY_BSS FIELD32(0x00000080)
  82. #define RXD_W0_CRC_ERROR FIELD32(0x00000100)
  83. #define RXD_W0_CIPHER_ERROR FIELD32(0x00000600)
  84. #define RXD_W0_AMSDU FIELD32(0x00000800)
  85. #define RXD_W0_HTC FIELD32(0x00001000)
  86. #define RXD_W0_RSSI FIELD32(0x00002000)
  87. #define RXD_W0_L2PAD FIELD32(0x00004000)
  88. #define RXD_W0_AMPDU FIELD32(0x00008000)
  89. #define RXD_W0_DECRYPTED FIELD32(0x00010000)
  90. #define RXD_W0_PLCP_RSSI FIELD32(0x00020000)
  91. #define RXD_W0_CIPHER_ALG FIELD32(0x00040000)
  92. #define RXD_W0_LAST_AMSDU FIELD32(0x00080000)
  93. #define RXD_W0_PLCP_SIGNAL FIELD32(0xfff00000)
  94. #endif /* RT2800USB_H */