ah_desc.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /*
  2. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted (subject to the limitations in the
  7. * disclaimer below) provided that the following conditions are met:
  8. *
  9. * * Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. *
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the
  15. * distribution.
  16. *
  17. * * Neither the name of Qualcomm Atheros nor the names of its
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
  22. * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
  23. * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
  24. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  25. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  27. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  30. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  31. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  32. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  33. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. */
  35. #ifndef _DEV_ATH_DESC_H
  36. #define _DEV_ATH_DESC_H
  37. #include <asf_queue.h>
  38. #include <wlan_cfg.h>
  39. #define HAL_TXSTAT_ALTRATE 0x80
  40. #define ts_rssi ts_rssi_combined
  41. struct ath_tx_status {
  42. a_uint32_t ts_tstamp;
  43. a_uint16_t ts_seqnum;
  44. a_uint8_t ts_status;
  45. a_uint8_t ts_flags;
  46. a_uint8_t ts_rate;
  47. int8_t ts_rssi_combined;
  48. int8_t ts_rssi_ctl0;
  49. int8_t ts_rssi_ctl1;
  50. int8_t ts_rssi_ctl2;
  51. int8_t ts_rssi_ext0;
  52. int8_t ts_rssi_ext1;
  53. int8_t ts_rssi_ext2;
  54. a_uint8_t ts_shortretry;
  55. a_uint8_t ts_longretry;
  56. a_uint8_t ts_virtcol;
  57. a_uint8_t ts_antenna;
  58. a_uint32_t ba_low;
  59. a_uint32_t ba_high;
  60. a_uint32_t evm0;
  61. a_uint32_t evm1;
  62. a_uint32_t evm2;
  63. };
  64. #define HAL_TXERR_XRETRY 0x01
  65. #define HAL_TXERR_FILT 0x02
  66. #define HAL_TXERR_FIFO 0x04
  67. #define HAL_TXERR_XTXOP 0x08
  68. #define HAL_TXERR_TIMER_EXPIRED 0x10
  69. #define HAL_TX_BA 0x01
  70. #define HAL_TX_PWRMGMT 0x02
  71. #define HAL_TX_DESC_CFG_ERR 0x04
  72. #define HAL_TX_DATA_UNDERRUN 0x08
  73. #define HAL_TX_DELIM_UNDERRUN 0x10
  74. #define HAL_TX_SW_FILTERED 0x80
  75. struct ath_rx_status {
  76. a_uint64_t rs_tstamp;
  77. a_uint16_t rs_datalen;
  78. a_uint8_t rs_status;
  79. a_uint8_t rs_phyerr;
  80. int8_t rs_rssi_combined;
  81. int8_t rs_rssi_ctl0;
  82. int8_t rs_rssi_ctl1;
  83. int8_t rs_rssi_ctl2;
  84. int8_t rs_rssi_ext0;
  85. int8_t rs_rssi_ext1;
  86. int8_t rs_rssi_ext2;
  87. a_uint8_t rs_keyix;
  88. a_uint8_t rs_rate;
  89. a_uint8_t rs_antenna;
  90. a_uint8_t rs_more;
  91. a_uint8_t rs_isaggr;
  92. a_uint8_t rs_moreaggr;
  93. a_uint8_t rs_num_delims;
  94. a_uint8_t rs_flags;
  95. a_uint8_t rs_dummy;
  96. a_uint32_t evm0;
  97. a_uint32_t evm1;
  98. a_uint32_t evm2;
  99. };
  100. #define rs_rssi rs_rssi_combined
  101. #define HAL_RXERR_CRC 0x01
  102. #define HAL_RXERR_PHY 0x02
  103. #define HAL_RXERR_FIFO 0x04
  104. #define HAL_RXERR_DECRYPT 0x08
  105. #define HAL_RXERR_MIC 0x10
  106. #define HAL_RX_MORE 0x01
  107. #define HAL_RX_MORE_AGGR 0x02
  108. #define HAL_RX_GI 0x04
  109. #define HAL_RX_2040 0x08
  110. #define HAL_RX_DELIM_CRC_PRE 0x10
  111. #define HAL_RX_DELIM_CRC_POST 0x20
  112. #define HAL_RX_DECRYPT_BUSY 0x40
  113. #define HAL_RXKEYIX_INVALID ((a_uint8_t) -1)
  114. #define HAL_TXKEYIX_INVALID ((a_uint8_t) -1)
  115. /*
  116. * The following definitions are passed directly
  117. * the hardware and managed by the HAL. Drivers
  118. * should not touch those elements marked opaque.
  119. */
  120. #define ATH_GENERIC_DESC \
  121. a_uint32_t ds_link; \
  122. a_uint32_t ds_data; \
  123. a_uint32_t ds_ctl0; \
  124. a_uint32_t ds_ctl1;
  125. struct ath_desc {
  126. ATH_GENERIC_DESC
  127. } adf_os_packed;
  128. struct ath_rx_desc {
  129. ATH_GENERIC_DESC
  130. a_uint32_t ds_hw[9];
  131. adf_nbuf_t ds_nbuf;
  132. adf_os_dma_map_t ds_dmap;
  133. adf_os_dmamap_info_t ds_dmap_info;
  134. adf_os_dma_addr_t ds_daddr;
  135. asf_tailq_entry(ath_rx_desc) ds_list;
  136. } adf_os_packed;
  137. struct ath_tx_desc {
  138. ATH_GENERIC_DESC
  139. a_uint32_t ds_hw[20];
  140. union {
  141. struct ath_tx_status tx;
  142. } ds_us;
  143. } adf_os_packed;
  144. #define ds_txstat ds_us.tx
  145. #define HAL_TXDESC_CLRDMASK 0x0001
  146. #define HAL_TXDESC_NOACK 0x0002
  147. #define HAL_TXDESC_RTSENA 0x0004
  148. #define HAL_TXDESC_CTSENA 0x0008
  149. #define HAL_TXDESC_INTREQ 0x0010
  150. #define HAL_TXDESC_VEOL 0x0020
  151. #define HAL_TXDESC_EXT_ONLY 0x0040
  152. #define HAL_TXDESC_EXT_AND_CTL 0x0080
  153. #define HAL_TXDESC_VMF 0x0100
  154. #define HAL_RXDESC_INTREQ 0x0020
  155. #endif