cfg_hif.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. * Copyright (c) 2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef _CFG_HIF_H_
  20. #define _CFG_HIF_H_
  21. /* Min/Max/default CE status srng timer threshold */
  22. #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MIN 0
  23. #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MAX 4096
  24. #ifdef WLAN_WAR_CE_DISABLE_SRNG_TIMER_IRQ
  25. #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT 0
  26. #else
  27. #define WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT 4096
  28. #endif
  29. /* Min/Max/default CE status srng batch count threshold */
  30. #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MIN 0
  31. #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MAX 512
  32. #define WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_DEFAULT 1
  33. #ifdef WLAN_CE_INTERRUPT_THRESHOLD_CONFIG
  34. /*
  35. * <ini>
  36. * ce_status_ring_timer_thresh - ce status srng timer threshold
  37. * @Min: 0
  38. * @Max: 4096
  39. * @Default: 0
  40. *
  41. * This ini specifies the timer threshold for CE status srng to
  42. * indicate the interrupt to be fired whenever the timer threshold
  43. * runs out.
  44. *
  45. * Supported Feature: interrupt threshold for CE status srng
  46. *
  47. * Usage: Internal
  48. *
  49. * </ini>
  50. */
  51. #define CFG_CE_STATUS_RING_TIMER_THRESHOLD \
  52. CFG_INI_UINT("ce_status_ring_timer_threshold", \
  53. WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MIN, \
  54. WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_MAX, \
  55. WLAN_CFG_CE_STATUS_RING_TIMER_THRESH_DEFAULT, \
  56. CFG_VALUE_OR_DEFAULT, \
  57. "CE Status ring timer threshold")
  58. #define CFG_RING_TIMER_THRESHOLD CFG(CFG_CE_STATUS_RING_TIMER_THRESHOLD)
  59. /*
  60. * <ini>
  61. * ce_status_ring_batch_count_thresh - ce status srng batch count threshold
  62. * @Min: 0
  63. * @Max: 512
  64. * @Default: 1
  65. *
  66. * This ini specifies the batch count threshold for CE status srng to
  67. * indicate the interrupt to be fired for a given number of packets in
  68. * the ring.
  69. *
  70. * Supported Feature: interrupt threshold for CE status srng
  71. *
  72. * Usage: Internal
  73. *
  74. * </ini>
  75. */
  76. #define CFG_CE_STATUS_RING_BATCH_COUNT_THRESHOLD \
  77. CFG_INI_UINT("ce_status_ring_batch_count_threshold", \
  78. WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MIN, \
  79. WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_MAX, \
  80. WLAN_CFG_CE_STATUS_RING_BATCH_COUNT_THRESH_DEFAULT, \
  81. CFG_VALUE_OR_DEFAULT, \
  82. "CE Status ring batch count threshold")
  83. #define CFG_BATCH_COUNT_THRESHOLD CFG(CFG_CE_STATUS_RING_BATCH_COUNT_THRESHOLD)
  84. #else
  85. #define CFG_RING_TIMER_THRESHOLD
  86. #define CFG_BATCH_COUNT_THRESHOLD
  87. #endif /* WLAN_CE_INTERRUPT_THRESHOLD_CONFIG */
  88. /*
  89. * <ini>
  90. * gDisableWakeIrq - Disable wake IRQ or not
  91. * @Min: 0
  92. * @Max: 1
  93. * @Default: 0
  94. *
  95. * This ini controls driver to disable wake IRQ or not.
  96. * Disable wake IRQ for one MSI mode.
  97. * If you want to support wake IRQ. Please allocate at least
  98. * 2 MSI vector. The first is for wake IRQ while the others
  99. * share the second vector.
  100. *
  101. * Related: None.
  102. *
  103. * Supported Feature: wake IRQ
  104. *
  105. * Usage: Internal/External
  106. *
  107. * </ini>
  108. */
  109. #define CFG_DISABLE_WAKE_IRQ CFG_INI_BOOL( \
  110. "gDisableWakeIrq", \
  111. 0, \
  112. "Disable wake IRQ")
  113. /*
  114. * <ini>
  115. * irq_affine_audio_use_case - IRQ affinity for audio use case supported
  116. * @Min: 0
  117. * @Max: 1
  118. * @Default: 0
  119. *
  120. * This ini controls driver to enable IRQ affinity for Pro audio use case.
  121. *
  122. * Related: None.
  123. *
  124. * Supported Feature: IRQ Affinity
  125. *
  126. * Usage: External
  127. *
  128. * </ini>
  129. */
  130. #define CFG_IRQ_AFFINE_AUDIO_USE_CASE CFG_INI_BOOL( \
  131. "irq_affine_audio_use_case", \
  132. 0, \
  133. "Enable IRQ affinity for audio use case")
  134. #define CFG_HIF \
  135. CFG_RING_TIMER_THRESHOLD \
  136. CFG_BATCH_COUNT_THRESHOLD \
  137. CFG(CFG_DISABLE_WAKE_IRQ) \
  138. CFG(CFG_IRQ_AFFINE_AUDIO_USE_CASE)
  139. #endif /* _CFG_HIF_H_ */