rt2800usb.h 2.9 KB

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