txmon_tlvs.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef _TXMON_TLVS_H_
  19. #define _TXMON_TLVS_H_
  20. #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_M 0x0000ffff
  21. #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_S 0
  22. #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_M 0xffff0000
  23. #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_S 16
  24. #define TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_M 0x000000ff
  25. #define TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_S 0
  26. #define TXMON_FW2SW_MON_FES_SETUP_MHZ_M 0x00ffff00
  27. #define TXMON_FW2SW_MON_FES_SETUP_MHZ_S 8
  28. #define TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_M 0xffffffff
  29. #define TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_S 0
  30. #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_GET(_var) \
  31. (((_var) & TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_M) >> \
  32. TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_S)
  33. #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_SET(_var, _val) \
  34. do { \
  35. HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1, _val); \
  36. ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ1_S)); \
  37. } while (0)
  38. #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_GET(_var) \
  39. (((_var) & TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_M) >> \
  40. TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_S)
  41. #define TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_SET(_var, _val) \
  42. do { \
  43. HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2, _val); \
  44. ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_BAND_CENTER_FREQ2_S)); \
  45. } while (0)
  46. #define TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_GET(_var) \
  47. (((_var) & TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_M) >> \
  48. TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_S)
  49. #define TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_SET(_var, _val) \
  50. do { \
  51. HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_PHY_MODE, _val); \
  52. ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_PHY_MODE_S)); \
  53. } while (0)
  54. #define TXMON_FW2SW_MON_FES_SETUP_MHZ_GET(_var) \
  55. (((_var) & TXMON_FW2SW_MON_FES_SETUP_MHZ_M) >> \
  56. TXMON_FW2SW_MON_FES_SETUP_MHZ_S)
  57. #define TXMON_FW2SW_MON_FES_SETUP_MHZ_SET(_var, _val) \
  58. do { \
  59. HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_MHZ, _val); \
  60. ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_MHZ_S)); \
  61. } while (0)
  62. #define TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_GET(_var) \
  63. (((_var) & TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_M) >> \
  64. TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_S)
  65. #define TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_SET(_var, _val) \
  66. do { \
  67. HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID, _val); \
  68. ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_SCHEDULE_ID_S)); \
  69. } while (0)
  70. enum txmon_fw2sw_user_id {
  71. TXMON_FW2SW_TYPE_FES_SETUP = 0, /* Placed after FES_SETUP */
  72. TXMON_FW2SW_TYPE_FES_SETUP_USER = 1, /* Placed before FES_SETUP_COMPLETE */
  73. TXMON_FW2SW_TYPE_FES_SETUP_EXT = 2, /* Placed after FES_SETUP_COMPLETE */
  74. TXMON_FW2SW_TYPE_MAX = 4
  75. };
  76. typedef struct txmon_fw2sw_fes_setup {
  77. A_UINT32 band_center_freq1 : 16,
  78. band_center_freq2 : 16;
  79. A_UINT32 phy_mode : 8, /* this field is filled with WLAN_PHY_MODE enum value */
  80. mhz : 16,
  81. reserved : 8;
  82. A_UINT32 schedule_id;
  83. } txmon_fw2sw_fes_setup_t;
  84. typedef struct txmon_fw2sw_fes_setup_ext {
  85. A_UINT32 reserved;
  86. } txmon_fw2sw_fes_setup_ext_t;
  87. #define TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_M 0x0000003f
  88. #define TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_S 0
  89. #define TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_GET(_var) \
  90. (((_var) & TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_M) >> \
  91. TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_S)
  92. #define TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_SET(_var, _val) \
  93. do { \
  94. HTT_CHECK_SET_VAL(TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID, _val); \
  95. ((_var) |= ((_val) << TXMON_FW2SW_MON_FES_SETUP_USER_USER_ID_S)); \
  96. } while (0)
  97. typedef struct txmon_fw2sw_fes_setup_user {
  98. A_UINT32 user_id : 6,
  99. reserved : 24;
  100. } txmon_fw2sw_fes_setup_user_t;
  101. struct txmon_fw2sw_mon_fes_setup_tlv {
  102. struct tlv_usr_32_hdr tag; /* tlv_usrid => TXMON_FW2SW_TYPE_FES_SETUP */
  103. struct txmon_fw2sw_fes_setup setup;
  104. };
  105. struct txmon_fw2sw_mon_fes_setup_ext_tlv {
  106. struct tlv_usr_32_hdr tag; /* tlv_usrid => TXMON_FW2SW_TYPE_FES_SETUP_EXT*/
  107. struct txmon_fw2sw_fes_setup_ext setup_ext;
  108. };
  109. struct txmon_fw2sw_mon_fes_setup_user_tlv {
  110. struct tlv_usr_32_hdr tag; /* tlv_usrid => TXMON_FW2SW_TYPE_FES_SETUP_USER */
  111. struct txmon_fw2sw_fes_setup_user user_setup;
  112. };
  113. #endif /* _TXMON_TLVS_H_ */