rt2800pci.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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: rt2800pci
  19. Abstract: Data structures and registers for the rt2800pci module.
  20. Supported chipsets: RT2800E & RT2800ED.
  21. */
  22. #ifndef RT2800PCI_H
  23. #define RT2800PCI_H
  24. /*
  25. * PCI registers.
  26. */
  27. /*
  28. * E2PROM_CSR: EEPROM control register.
  29. * RELOAD: Write 1 to reload eeprom content.
  30. * TYPE: 0: 93c46, 1:93c66.
  31. * LOAD_STATUS: 1:loading, 0:done.
  32. */
  33. #define E2PROM_CSR 0x0004
  34. #define E2PROM_CSR_DATA_CLOCK FIELD32(0x00000001)
  35. #define E2PROM_CSR_CHIP_SELECT FIELD32(0x00000002)
  36. #define E2PROM_CSR_DATA_IN FIELD32(0x00000004)
  37. #define E2PROM_CSR_DATA_OUT FIELD32(0x00000008)
  38. #define E2PROM_CSR_TYPE FIELD32(0x00000030)
  39. #define E2PROM_CSR_LOAD_STATUS FIELD32(0x00000040)
  40. #define E2PROM_CSR_RELOAD FIELD32(0x00000080)
  41. /*
  42. * Queue register offset macros
  43. */
  44. #define TX_QUEUE_REG_OFFSET 0x10
  45. #define TX_BASE_PTR(__x) TX_BASE_PTR0 + ((__x) * TX_QUEUE_REG_OFFSET)
  46. #define TX_MAX_CNT(__x) TX_MAX_CNT0 + ((__x) * TX_QUEUE_REG_OFFSET)
  47. #define TX_CTX_IDX(__x) TX_CTX_IDX0 + ((__x) * TX_QUEUE_REG_OFFSET)
  48. #define TX_DTX_IDX(__x) TX_DTX_IDX0 + ((__x) * TX_QUEUE_REG_OFFSET)
  49. /*
  50. * 8051 firmware image.
  51. */
  52. #define FIRMWARE_RT2860 "rt2860.bin"
  53. #define FIRMWARE_IMAGE_BASE 0x2000
  54. /*
  55. * DMA descriptor defines.
  56. */
  57. #define TXD_DESC_SIZE ( 4 * sizeof(__le32) )
  58. #define RXD_DESC_SIZE ( 4 * sizeof(__le32) )
  59. /*
  60. * TX descriptor format for TX, PRIO and Beacon Ring.
  61. */
  62. /*
  63. * Word0
  64. */
  65. #define TXD_W0_SD_PTR0 FIELD32(0xffffffff)
  66. /*
  67. * Word1
  68. */
  69. #define TXD_W1_SD_LEN1 FIELD32(0x00003fff)
  70. #define TXD_W1_LAST_SEC1 FIELD32(0x00004000)
  71. #define TXD_W1_BURST FIELD32(0x00008000)
  72. #define TXD_W1_SD_LEN0 FIELD32(0x3fff0000)
  73. #define TXD_W1_LAST_SEC0 FIELD32(0x40000000)
  74. #define TXD_W1_DMA_DONE FIELD32(0x80000000)
  75. /*
  76. * Word2
  77. */
  78. #define TXD_W2_SD_PTR1 FIELD32(0xffffffff)
  79. /*
  80. * Word3
  81. * WIV: Wireless Info Valid. 1: Driver filled WI, 0: DMA needs to copy WI
  82. * QSEL: Select on-chip FIFO ID for 2nd-stage output scheduler.
  83. * 0:MGMT, 1:HCCA 2:EDCA
  84. */
  85. #define TXD_W3_WIV FIELD32(0x01000000)
  86. #define TXD_W3_QSEL FIELD32(0x06000000)
  87. #define TXD_W3_TCO FIELD32(0x20000000)
  88. #define TXD_W3_UCO FIELD32(0x40000000)
  89. #define TXD_W3_ICO FIELD32(0x80000000)
  90. /*
  91. * RX descriptor format for RX Ring.
  92. */
  93. /*
  94. * Word0
  95. */
  96. #define RXD_W0_SDP0 FIELD32(0xffffffff)
  97. /*
  98. * Word1
  99. */
  100. #define RXD_W1_SDL1 FIELD32(0x00003fff)
  101. #define RXD_W1_SDL0 FIELD32(0x3fff0000)
  102. #define RXD_W1_LS0 FIELD32(0x40000000)
  103. #define RXD_W1_DMA_DONE FIELD32(0x80000000)
  104. /*
  105. * Word2
  106. */
  107. #define RXD_W2_SDP1 FIELD32(0xffffffff)
  108. /*
  109. * Word3
  110. * AMSDU: RX with 802.3 header, not 802.11 header.
  111. * DECRYPTED: This frame is being decrypted.
  112. */
  113. #define RXD_W3_BA FIELD32(0x00000001)
  114. #define RXD_W3_DATA FIELD32(0x00000002)
  115. #define RXD_W3_NULLDATA FIELD32(0x00000004)
  116. #define RXD_W3_FRAG FIELD32(0x00000008)
  117. #define RXD_W3_UNICAST_TO_ME FIELD32(0x00000010)
  118. #define RXD_W3_MULTICAST FIELD32(0x00000020)
  119. #define RXD_W3_BROADCAST FIELD32(0x00000040)
  120. #define RXD_W3_MY_BSS FIELD32(0x00000080)
  121. #define RXD_W3_CRC_ERROR FIELD32(0x00000100)
  122. #define RXD_W3_CIPHER_ERROR FIELD32(0x00000600)
  123. #define RXD_W3_AMSDU FIELD32(0x00000800)
  124. #define RXD_W3_HTC FIELD32(0x00001000)
  125. #define RXD_W3_RSSI FIELD32(0x00002000)
  126. #define RXD_W3_L2PAD FIELD32(0x00004000)
  127. #define RXD_W3_AMPDU FIELD32(0x00008000)
  128. #define RXD_W3_DECRYPTED FIELD32(0x00010000)
  129. #define RXD_W3_PLCP_SIGNAL FIELD32(0x00020000)
  130. #define RXD_W3_PLCP_RSSI FIELD32(0x00040000)
  131. #endif /* RT2800PCI_H */