cfg_mlme_power.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /*
  2. * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 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. /**
  20. * DOC: This file contains centralized definitions of converged configuration.
  21. */
  22. #ifndef __CFG_MLME_POWER_H
  23. #define __CFG_MLME_POWER_H
  24. /*
  25. * <cfg>
  26. * max_tx_power_24 - max tx power allowed for 2.4 ghz
  27. * @Min: 0 minimum length of tx power
  28. * @Max: default data length of tx power in string format
  29. * @Default: 1, 14, 20
  30. *
  31. * This ini contains the string in the form of first_channel number,
  32. * number of channels and max tx power triplets
  33. */
  34. #define CFG_MAX_TX_POWER_2_4_DATA "1, 14, 20"
  35. #define CFG_MAX_TX_POWER_2_4 CFG_STRING( \
  36. "max_tx_power_24", \
  37. 0, \
  38. sizeof(CFG_MAX_TX_POWER_2_4_DATA) - 1, \
  39. CFG_MAX_TX_POWER_2_4_DATA, \
  40. "max tx power 24")
  41. /*
  42. * <cfg>
  43. * max_tx_power_5 - max tx power allowed for 5 ghz
  44. * @Min: 0 minimum length of tx power
  45. * @Max: default data length of tx power in string format
  46. * @Default: 36, 126, 20
  47. *
  48. * This ini contains the string in the form of first_channel number,
  49. * number of channels and max tx power triplets
  50. */
  51. #define CFG_MAX_TX_POWER_5_DATA "36, 126, 20"
  52. #define CFG_MAX_TX_POWER_5 CFG_STRING( \
  53. "max_tx_power_5", \
  54. 0, \
  55. sizeof(CFG_MAX_TX_POWER_5_DATA) - 1, \
  56. CFG_MAX_TX_POWER_5_DATA, \
  57. "max tx power 5")
  58. /*
  59. * <ini>
  60. * gPowerUsage - power usage name
  61. * @Min: "Min" - minimum power usage
  62. * @Max: "Max" - maximum power usage
  63. * @Default: "Mod"
  64. *
  65. * Usage: Internal/External
  66. *
  67. * </ini>
  68. */
  69. #define CFG_POWER_USAGE CFG_INI_STRING( \
  70. "gPowerUsage", \
  71. 0, \
  72. 3, \
  73. "Mod", \
  74. "power usage")
  75. /*
  76. * <ini>
  77. * TxPower2g - Limit power in case of 2.4ghz
  78. * @Min: 0
  79. * @Max: 30
  80. * @Default: 30
  81. *
  82. * Usage: Internal/External
  83. *
  84. * </ini>
  85. */
  86. #define CFG_SET_TXPOWER_LIMIT2G CFG_INI_UINT( \
  87. "TxPower2g", \
  88. 0, \
  89. 30, \
  90. 30, \
  91. CFG_VALUE_OR_DEFAULT, \
  92. "power limit 2g")
  93. /*
  94. * <ini>
  95. * TxPower5g - Limit power in case of 5ghz
  96. * @Min: 0
  97. * @Max: 30
  98. * @Default: 30
  99. *
  100. * Usage: Internal/External
  101. *
  102. * </ini>
  103. */
  104. #define CFG_SET_TXPOWER_LIMIT5G CFG_INI_UINT( \
  105. "TxPower5g", \
  106. 0, \
  107. 30, \
  108. 30, \
  109. CFG_VALUE_OR_DEFAULT, \
  110. "power limit 5g")
  111. /*
  112. * <cfg>
  113. * current_tx_power_level - current tx power level
  114. * @Min: 0
  115. * @Max: 128
  116. * @Default: 27
  117. */
  118. #define CFG_CURRENT_TX_POWER_LEVEL CFG_UINT( \
  119. "current_tx_power_level", \
  120. 0, \
  121. 128, \
  122. 27, \
  123. CFG_VALUE_OR_DEFAULT, \
  124. "current tx power level")
  125. /*
  126. * <cfg>
  127. * local_power_constraint - local power constraint
  128. * @Min: 0
  129. * @Max: 255
  130. * @Default: 0
  131. */
  132. #define CFG_LOCAL_POWER_CONSTRAINT CFG_UINT( \
  133. "local_power_constraint", \
  134. 0, \
  135. 255, \
  136. 0, \
  137. CFG_VALUE_OR_DEFAULT, \
  138. "local power constraint")
  139. /*
  140. * <ini>
  141. * skip_tpe_consideration - Skip TPE IE value in tx power calculation for
  142. * 2G/5G bands
  143. * @Min: 0
  144. * @Max: 1
  145. * @Default: 1
  146. *
  147. * This ini is to determine if the TPE IE should be considered in the Tx power
  148. * calculation. If the ini is set, host will consider TPE IE in case of 6GHz
  149. * only (skip over in 2GHz or 5GHz case). If the ini is not set, honor the TPE
  150. * IE values in all bands.
  151. *
  152. * Related: None
  153. *
  154. * Supported Feature: Transmit power calculation (TPC)
  155. *
  156. * Usage: External
  157. *
  158. * </ini>
  159. */
  160. #define CFG_SKIP_TPE_CONSIDERATION CFG_INI_BOOL("skip_tpe_consideration", \
  161. true, \
  162. "consider TPE IE in tx power")
  163. #define CFG_MLME_POWER_ALL \
  164. CFG(CFG_MAX_TX_POWER_2_4) \
  165. CFG(CFG_MAX_TX_POWER_5) \
  166. CFG(CFG_POWER_USAGE) \
  167. CFG(CFG_SET_TXPOWER_LIMIT2G) \
  168. CFG(CFG_SET_TXPOWER_LIMIT5G) \
  169. CFG(CFG_CURRENT_TX_POWER_LEVEL) \
  170. CFG(CFG_LOCAL_POWER_CONSTRAINT) \
  171. CFG(CFG_SKIP_TPE_CONSIDERATION)
  172. #endif /* __CFG_MLME_POWER_H */