htt_common.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * Copyright (c) 2012-2016, 2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt_common.h
  29. *
  30. * @details the public header file of HTT layer shared between host and firmware
  31. */
  32. #ifndef _HTT_COMMON_H_
  33. #define _HTT_COMMON_H_
  34. #include <htt_deps.h> /* A_UINT32 */
  35. enum htt_sec_type {
  36. htt_sec_type_none,
  37. htt_sec_type_wep128,
  38. htt_sec_type_wep104,
  39. htt_sec_type_wep40,
  40. htt_sec_type_tkip,
  41. htt_sec_type_tkip_nomic,
  42. htt_sec_type_aes_ccmp,
  43. htt_sec_type_wapi,
  44. htt_sec_type_aes_ccmp_256,
  45. htt_sec_type_aes_gcmp,
  46. htt_sec_type_aes_gcmp_256,
  47. /* keep this last! */
  48. htt_num_sec_types
  49. };
  50. enum htt_rx_ind_mpdu_status {
  51. HTT_RX_IND_MPDU_STATUS_UNKNOWN = 0x0,
  52. HTT_RX_IND_MPDU_STATUS_OK,
  53. HTT_RX_IND_MPDU_STATUS_ERR_FCS,
  54. HTT_RX_IND_MPDU_STATUS_ERR_DUP,
  55. HTT_RX_IND_MPDU_STATUS_ERR_REPLAY,
  56. HTT_RX_IND_MPDU_STATUS_ERR_INV_PEER,
  57. HTT_RX_IND_MPDU_STATUS_UNAUTH_PEER, /* only accept EAPOL frames */
  58. HTT_RX_IND_MPDU_STATUS_OUT_OF_SYNC,
  59. HTT_RX_IND_MPDU_STATUS_MGMT_CTRL, /* Non-data in promiscuous mode */
  60. HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR,
  61. HTT_RX_IND_MPDU_STATUS_DECRYPT_ERR,
  62. HTT_RX_IND_MPDU_STATUS_MPDU_LENGTH_ERR,
  63. HTT_RX_IND_MPDU_STATUS_ENCRYPT_REQUIRED_ERR,
  64. HTT_RX_IND_MPDU_STATUS_PRIVACY_ERR,
  65. /*
  66. * MISC: discard for unspecified reasons.
  67. * Leave this enum value last.
  68. */
  69. HTT_RX_IND_MPDU_STATUS_ERR_MISC = 0xFF
  70. };
  71. #define HTT_INVALID_PEER 0xffff
  72. #define HTT_INVALID_VDEV 0xff
  73. #define HTT_NON_QOS_TID 16
  74. #define HTT_INVALID_TID 31
  75. #define HTT_TX_EXT_TID_DEFAULT 0
  76. #define HTT_TX_EXT_TID_NON_QOS_MCAST_BCAST HTT_NON_QOS_TID
  77. #define HTT_TX_EXT_TID_MGMT 17
  78. #define HTT_TX_EXT_TID_INVALID HTT_INVALID_TID
  79. #define HTT_TX_EXT_TID_NONPAUSE 19
  80. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  81. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  82. /**
  83. * @brief General specification of the tx frame contents
  84. *
  85. * @details
  86. * For efficiency, the HTT packet type values correspond
  87. * to the bit positions of the WAL packet type values, so the
  88. * translation is a simple shift operation.
  89. * The exception is the "mgmt" type, which specifies frame payload
  90. * type rather than L2 header type.
  91. */
  92. enum htt_pkt_type {
  93. htt_pkt_type_raw = 0,
  94. htt_pkt_type_native_wifi = 1,
  95. htt_pkt_type_ethernet = 2,
  96. htt_pkt_type_mgmt = 3,
  97. htt_pkt_type_eth2 = 4,
  98. /* keep this last */
  99. htt_pkt_num_types
  100. };
  101. /*
  102. * TX MSDU ID partition -
  103. * FW supports bigger MSDU ID partition which is defined as
  104. * HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN
  105. * When both host and FW support new partition, FW uses
  106. * HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN
  107. * If host doesn't support, FW falls back to HTT_TX_IPA_MSDU_ID_SPACE_BEGIN
  108. * Handshaking is done through WMI_READY and WMI_INIT
  109. */
  110. #define HTT_TX_HOST_MSDU_ID_SPACE_BEGIN 0
  111. #define HTT_TX_IPA_MSDU_ID_SPACE_BEGIN 3000
  112. #define TGT_RX2TX_MSDU_ID_SPACE_BEGIN 6000
  113. #define HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN 8192 /* = 0x2000 = b10,0000,0000,0000 */
  114. #define TGT_RX2TX_NEW_MSDU_ID_SPACE_BEGIN 12288 /* = 0x3000 = b11,0000,0000,0000 */
  115. /* HTT Access Category values */
  116. enum HTT_AC_WMM {
  117. /* WMM Access Categories */
  118. HTT_AC_WMM_BE = 0x0,
  119. HTT_AC_WMM_BK = 0x1,
  120. HTT_AC_WMM_VI = 0x2,
  121. HTT_AC_WMM_VO = 0x3,
  122. HTT_NUM_AC_WMM = 0x4,
  123. /* extension Access Categories */
  124. HTT_AC_EXT_NON_QOS = 0x4,
  125. HTT_AC_EXT_UCAST_MGMT = 0x5,
  126. HTT_AC_EXT_MCAST_DATA = 0x6,
  127. HTT_AC_EXT_MCAST_MGMT = 0x7,
  128. };
  129. enum HTT_AC_WMM_MASK {
  130. /* WMM Access Categories */
  131. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  132. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  133. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  134. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  135. /* extension Access Categories */
  136. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  137. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  138. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  139. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  140. };
  141. #define HTT_AC_MASK_WMM \
  142. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  143. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  144. #define HTT_AC_MASK_EXT \
  145. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  146. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  147. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  148. /** 2 word representation of MAC addr */
  149. typedef struct {
  150. /** upper 4 bytes of MAC address */
  151. A_UINT32 mac_addr31to0;
  152. /** lower 2 bytes of MAC address */
  153. A_UINT32 mac_addr47to32;
  154. } htt_mac_addr;
  155. #define HTT_STATS_MAX_CHAINS 8
  156. #endif /* _HTT_COMMON_H_ */