htc_services.h 5.2 KB

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