htt_common.h 5.5 KB

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