htc_services.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * Copyright (c) 2012, 2014-2017, 2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-2023 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. #ifndef __HTC_SERVICES_H__
  28. #define __HTC_SERVICES_H__
  29. /* Current service IDs */
  30. typedef enum {
  31. RSVD_SERVICE_GROUP = 0,
  32. WMI_SERVICE_GROUP = 1,
  33. NMI_SERVICE_GROUP = 2,
  34. HTT_SERVICE_GROUP = 3,
  35. CFG_NV_SERVICE_GROUP = 4,
  36. WDI_IPA_SERVICE_GROUP = 5,
  37. PACKET_LOG_SERVICE_GROUP = 6,
  38. LPASS_SERVICE_GROUP = 7,
  39. HTC_TEST_GROUP = 254,
  40. HTC_SERVICE_GROUP_LAST = 255
  41. }HTC_SERVICE_GROUP_IDS;
  42. #define MAKE_SERVICE_ID(group,index) \
  43. (int)(((int)group << 8) | (int)(index))
  44. /* NOTE: service ID of 0x0000 is reserved and should never be used */
  45. #define HTC_CTRL_RSVD_SVC MAKE_SERVICE_ID(RSVD_SERVICE_GROUP,1)
  46. /* WMI_CONTROL_SVC: WMI service for MAC 0 */
  47. #define WMI_CONTROL_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,0)
  48. #define WMI_DATA_BE_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,1)
  49. #define WMI_DATA_BK_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,2)
  50. #define WMI_DATA_VI_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,3)
  51. #define WMI_DATA_VO_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,4)
  52. /* WMI_CONTROL_SVC_WMAC1,2: WMI service for MACs 1 and 2 (where applicable) */
  53. #define WMI_CONTROL_SVC_WMAC1 MAKE_SERVICE_ID(WMI_SERVICE_GROUP,5)
  54. #define WMI_CONTROL_SVC_WMAC2 MAKE_SERVICE_ID(WMI_SERVICE_GROUP,6)
  55. #define WMI_CONTROL_DIAG_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,7)
  56. #define WMI_CONTROL_DBR_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,8)
  57. /* WMI_CONTROL_SVC_WMAC3,4: WMI service for MACs 3 and 4 (where applicable) */
  58. #define WMI_CONTROL_SVC_WMAC3 MAKE_SERVICE_ID(WMI_SERVICE_GROUP,9)
  59. #define WMI_CONTROL_SVC_WMAC4 MAKE_SERVICE_ID(WMI_SERVICE_GROUP,10)
  60. #define WMI_MAX_SERVICES 11
  61. #define NMI_CONTROL_SVC MAKE_SERVICE_ID(NMI_SERVICE_GROUP,0)
  62. #define NMI_DATA_SVC MAKE_SERVICE_ID(NMI_SERVICE_GROUP,1)
  63. /* HTT_DATA_MSG_SVC
  64. * This service is the regular (mandatory) HTT service
  65. * used for transferring data-path messages betwween host and target.
  66. */
  67. #define HTT_DATA_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,0)
  68. /* HTT_DATA2_MSG_SVG
  69. * This is an optional service, used for downloading short tx frames
  70. * over a communication channel parallel to the regular HTT comm channel.
  71. * This can only be used for protocols where frame reordering is permitted (TCP).
  72. * This is helpful for minimizing latency and maximizing efficiency of TCP acks.
  73. * This service is also for sending Rx In-order indication packets over copy engine 9 for
  74. * for dual-band systems with multi-core hosts.
  75. */
  76. #define HTT_DATA2_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,1)
  77. /* This service is only for sending Rx In-order indication packets over copy engine 10
  78. * for dual-band systems with multi-core hosts, in which rx indications from one pdev/MAC
  79. * can be routed to one host processor core in parallel with rx indications from another
  80. * pdev/MAC being routed to another host core over another copy engine, such that these
  81. * rx indications can be processed in parallel.
  82. */
  83. #define HTT_DATA3_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,2)
  84. /* raw stream service (i.e. flash, tcmd, calibration apps) */
  85. #define HTC_RAW_STREAMS_SVC MAKE_SERVICE_ID(HTC_TEST_GROUP,0)
  86. #define CFG_NV_SVC MAKE_SERVICE_ID(CFG_NV_SERVICE_GROUP,0)
  87. #define WDI_IPA_TX_SVC MAKE_SERVICE_ID(WDI_IPA_SERVICE_GROUP,0)
  88. #define PACKET_LOG_SVC MAKE_SERVICE_ID(PACKET_LOG_SERVICE_GROUP,0)
  89. #define LPASS_DATA_MSG_SVC MAKE_SERVICE_ID(LPASS_SERVICE_GROUP,0)
  90. /*
  91. * Directions for interconnect pipe configuration.
  92. * These definitions may be used during configuration and are shared
  93. * between Host and Target.
  94. *
  95. * Pipe Directions are relative to the Host, so PIPEDIR_IN means
  96. * "coming IN over air through Target to Host" as with a WiFi Rx operation.
  97. * Conversely, PIPEDIR_OUT means "going OUT from Host through Target over air"
  98. * as with a WiFi Tx operation. This is somewhat awkward for the "middle-man"
  99. * Target since things that are "PIPEDIR_OUT" are coming IN to the Target
  100. * over the interconnect.
  101. */
  102. typedef A_UINT32 PIPEDIR;
  103. #define PIPEDIR_NONE 0
  104. #define PIPEDIR_IN 1 /* Target-->Host, WiFi Rx direction */
  105. #define PIPEDIR_OUT 2 /* Host->Target, WiFi Tx direction */
  106. #define PIPEDIR_INOUT 3 /* bidirectional, target to target */
  107. #define PIPEDIR_INOUT_T2T PIPEDIR_INOUT
  108. #define PIPEDIR_INOUT_H2H 4 /* bidirectional, host to host */
  109. #define PIPEDIR_MATCH(d1, d2) (((PIPEDIR)(d1) & (PIPEDIR)(d2)) != 0)
  110. #define INVALID_PIPE_NO (-1)
  111. /* Establish a mapping between a service/direction and a pipe. */
  112. struct service_to_pipe {
  113. A_UINT32 service_id;
  114. A_UINT32 pipedir;
  115. A_UINT32 pipenum;
  116. };
  117. #endif /*HTC_SERVICES_H_*/