htc_services.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (c) 2012, 2014 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. HTC_TEST_GROUP = 254,
  37. HTC_SERVICE_GROUP_LAST = 255
  38. } HTC_SERVICE_GROUP_IDS;
  39. #define MAKE_SERVICE_ID(group,index) \
  40. (int)(((int)group << 8) | (int)(index))
  41. /* NOTE: service ID of 0x0000 is reserved and should never be used */
  42. #define HTC_CTRL_RSVD_SVC MAKE_SERVICE_ID(RSVD_SERVICE_GROUP,1)
  43. #define WMI_CONTROL_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,0)
  44. #define WMI_DATA_BE_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,1)
  45. #define WMI_DATA_BK_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,2)
  46. #define WMI_DATA_VI_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,3)
  47. #define WMI_DATA_VO_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,4)
  48. #define WMI_MAX_SERVICES 5
  49. #define NMI_CONTROL_SVC MAKE_SERVICE_ID(NMI_SERVICE_GROUP,0)
  50. #define NMI_DATA_SVC MAKE_SERVICE_ID(NMI_SERVICE_GROUP,1)
  51. #define HTT_DATA_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,0)
  52. #define HTT_DATA2_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,1)
  53. #define HTT_DATA3_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP, 2)
  54. /* raw stream service (i.e. flash, tcmd, calibration apps) */
  55. #define HTC_RAW_STREAMS_SVC MAKE_SERVICE_ID(HTC_TEST_GROUP,0)
  56. #define CFG_NV_SVC MAKE_SERVICE_ID(CFG_NV_SERVICE_GROUP,0)
  57. #define WDI_IPA_TX_SVC MAKE_SERVICE_ID(WDI_IPA_SERVICE_GROUP,0)
  58. /*
  59. * Directions for interconnect pipe configuration.
  60. * These definitions may be used during configuration and are shared
  61. * between Host and Target.
  62. *
  63. * Pipe Directions are relative to the Host, so PIPEDIR_IN means
  64. * "coming IN over air through Target to Host" as with a WiFi Rx operation.
  65. * Conversely, PIPEDIR_OUT means "going OUT from Host through Target over air"
  66. * as with a WiFi Tx operation. This is somewhat awkward for the "middle-man"
  67. * Target since things that are "PIPEDIR_OUT" are coming IN to the Target
  68. * over the interconnect.
  69. */
  70. typedef A_UINT32 PIPEDIR;
  71. #define PIPEDIR_NONE 0
  72. #define PIPEDIR_IN 1 /* Target-->Host, WiFi Rx direction */
  73. #define PIPEDIR_OUT 2 /* Host->Target, WiFi Tx direction */
  74. #define PIPEDIR_INOUT 3 /* bidirectional - target to target */
  75. #define PIPEDIR_INOUT_H2H 4 /* bidirectional - host to host */
  76. #define PIPEDIR_MATCH(d1, d2) (((PIPEDIR)(d1) & (PIPEDIR)(d2)) != 0)
  77. /* Establish a mapping between a service/direction and a pipe. */
  78. struct service_to_pipe {
  79. A_UINT32 service_id;
  80. A_UINT32 pipedir;
  81. A_UINT32 pipenum;
  82. };
  83. #endif /*HTC_SERVICES_H_ */