rt2800usb.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. Copyright (C) 2004 - 2009 rt2x00 SourceForge Project
  3. <http://rt2x00.serialmonkey.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the
  14. Free Software Foundation, Inc.,
  15. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  16. */
  17. /*
  18. Module: rt2800usb
  19. Abstract: Data structures and registers for the rt2800usb module.
  20. Supported chipsets: RT2800U.
  21. */
  22. #ifndef RT2800USB_H
  23. #define RT2800USB_H
  24. /*
  25. * USB registers.
  26. */
  27. /*
  28. * USB_DMA_CFG
  29. * RX_BULK_AGG_TIMEOUT: Rx Bulk Aggregation TimeOut in unit of 33ns.
  30. * RX_BULK_AGG_LIMIT: Rx Bulk Aggregation Limit in unit of 256 bytes.
  31. * PHY_CLEAR: phy watch dog enable.
  32. * TX_CLEAR: Clear USB DMA TX path.
  33. * TXOP_HALT: Halt TXOP count down when TX buffer is full.
  34. * RX_BULK_AGG_EN: Enable Rx Bulk Aggregation.
  35. * RX_BULK_EN: Enable USB DMA Rx.
  36. * TX_BULK_EN: Enable USB DMA Tx.
  37. * EP_OUT_VALID: OUT endpoint data valid.
  38. * RX_BUSY: USB DMA RX FSM busy.
  39. * TX_BUSY: USB DMA TX FSM busy.
  40. */
  41. #define USB_DMA_CFG 0x02a0
  42. #define USB_DMA_CFG_RX_BULK_AGG_TIMEOUT FIELD32(0x000000ff)
  43. #define USB_DMA_CFG_RX_BULK_AGG_LIMIT FIELD32(0x0000ff00)
  44. #define USB_DMA_CFG_PHY_CLEAR FIELD32(0x00010000)
  45. #define USB_DMA_CFG_TX_CLEAR FIELD32(0x00080000)
  46. #define USB_DMA_CFG_TXOP_HALT FIELD32(0x00100000)
  47. #define USB_DMA_CFG_RX_BULK_AGG_EN FIELD32(0x00200000)
  48. #define USB_DMA_CFG_RX_BULK_EN FIELD32(0x00400000)
  49. #define USB_DMA_CFG_TX_BULK_EN FIELD32(0x00800000)
  50. #define USB_DMA_CFG_EP_OUT_VALID FIELD32(0x3f000000)
  51. #define USB_DMA_CFG_RX_BUSY FIELD32(0x40000000)
  52. #define USB_DMA_CFG_TX_BUSY FIELD32(0x80000000)
  53. /*
  54. * USB_CYC_CFG
  55. */
  56. #define USB_CYC_CFG 0x02a4
  57. #define USB_CYC_CFG_CLOCK_CYCLE FIELD32(0x000000ff)
  58. /*
  59. * 8051 firmware image.
  60. */
  61. #define FIRMWARE_RT2870 "rt2870.bin"
  62. #define FIRMWARE_IMAGE_BASE 0x3000
  63. /*
  64. * DMA descriptor defines.
  65. */
  66. #define TXINFO_DESC_SIZE ( 1 * sizeof(__le32) )
  67. #define RXINFO_DESC_SIZE ( 1 * sizeof(__le32) )
  68. /*
  69. * TX Info structure
  70. */
  71. /*
  72. * Word0
  73. * WIV: Wireless Info Valid. 1: Driver filled WI, 0: DMA needs to copy WI
  74. * QSEL: Select on-chip FIFO ID for 2nd-stage output scheduler.
  75. * 0:MGMT, 1:HCCA 2:EDCA
  76. * USB_DMA_NEXT_VALID: Used ONLY in USB bulk Aggregation, NextValid
  77. * DMA_TX_BURST: used ONLY in USB bulk Aggregation.
  78. * Force USB DMA transmit frame from current selected endpoint
  79. */
  80. #define TXINFO_W0_USB_DMA_TX_PKT_LEN FIELD32(0x0000ffff)
  81. #define TXINFO_W0_WIV FIELD32(0x01000000)
  82. #define TXINFO_W0_QSEL FIELD32(0x06000000)
  83. #define TXINFO_W0_SW_USE_LAST_ROUND FIELD32(0x08000000)
  84. #define TXINFO_W0_USB_DMA_NEXT_VALID FIELD32(0x40000000)
  85. #define TXINFO_W0_USB_DMA_TX_BURST FIELD32(0x80000000)
  86. /*
  87. * RX descriptor format for RX Ring.
  88. */
  89. /*
  90. * Word0
  91. * UNICAST_TO_ME: This RX frame is unicast to me.
  92. * MULTICAST: This is a multicast frame.
  93. * BROADCAST: This is a broadcast frame.
  94. * MY_BSS: this frame belongs to the same BSSID.
  95. * CRC_ERROR: CRC error.
  96. * CIPHER_ERROR: 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid.
  97. * AMSDU: rx with 802.3 header, not 802.11 header.
  98. */
  99. #define RXD_W0_BA FIELD32(0x00000001)
  100. #define RXD_W0_DATA FIELD32(0x00000002)
  101. #define RXD_W0_NULLDATA FIELD32(0x00000004)
  102. #define RXD_W0_FRAG FIELD32(0x00000008)
  103. #define RXD_W0_UNICAST_TO_ME FIELD32(0x00000010)
  104. #define RXD_W0_MULTICAST FIELD32(0x00000020)
  105. #define RXD_W0_BROADCAST FIELD32(0x00000040)
  106. #define RXD_W0_MY_BSS FIELD32(0x00000080)
  107. #define RXD_W0_CRC_ERROR FIELD32(0x00000100)
  108. #define RXD_W0_CIPHER_ERROR FIELD32(0x00000600)
  109. #define RXD_W0_AMSDU FIELD32(0x00000800)
  110. #define RXD_W0_HTC FIELD32(0x00001000)
  111. #define RXD_W0_RSSI FIELD32(0x00002000)
  112. #define RXD_W0_L2PAD FIELD32(0x00004000)
  113. #define RXD_W0_AMPDU FIELD32(0x00008000)
  114. #define RXD_W0_DECRYPTED FIELD32(0x00010000)
  115. #define RXD_W0_PLCP_RSSI FIELD32(0x00020000)
  116. #define RXD_W0_CIPHER_ALG FIELD32(0x00040000)
  117. #define RXD_W0_LAST_AMSDU FIELD32(0x00080000)
  118. #define RXD_W0_PLCP_SIGNAL FIELD32(0xfff00000)
  119. #endif /* RT2800USB_H */