cfg_coex.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. /*
  2. * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-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_COEX_H
  23. #define __CFG_COEX_H
  24. /*
  25. * <ini>
  26. * gSetBTCMode - Config BTC mode
  27. * @Min: 0
  28. * @Max: 2
  29. * @Default: 0
  30. *
  31. * 0 - TDD
  32. * 1 - FDD
  33. * 2 - Hybrid
  34. *
  35. * Usage: External
  36. *
  37. * </ini>
  38. */
  39. #define CFG_BTC_MODE CFG_INI_UINT( \
  40. "gSetBTCMode", \
  41. 0, \
  42. 2, \
  43. 0, \
  44. CFG_VALUE_OR_DEFAULT, \
  45. "BTC mode")
  46. /*
  47. * <ini>
  48. * gSetAntennaIsolation - Set Antenna Isolation
  49. * @Min: 0
  50. * @Max: 255
  51. * @Default: 25
  52. *
  53. * Usage: External
  54. *
  55. * </ini>
  56. */
  57. #define CFG_ANTENNA_ISOLATION CFG_INI_UINT( \
  58. "gSetAntennaIsolation", \
  59. 0, \
  60. 255, \
  61. 25, \
  62. CFG_VALUE_OR_DEFAULT, \
  63. "Antenna Isolation")
  64. /*
  65. * <ini>
  66. * gSetMaxTxPowerForBTC - Set Max WLAN Tx power in COEX scenario
  67. * @Min: 0
  68. * @Max: 100
  69. * @Default: 100
  70. *
  71. * Usage: External
  72. *
  73. * </ini>
  74. */
  75. #define CFG_MAX_TX_POWER_FOR_BTC CFG_INI_UINT( \
  76. "gSetMaxTxPowerForBTC", \
  77. 0, \
  78. 100, \
  79. 100, \
  80. CFG_VALUE_OR_DEFAULT, \
  81. "Max Tx Power for BTC")
  82. /*
  83. * <ini>
  84. * gSetWlanLowRssiThreshold - Set WLAN low RSSI threshold for BTC mode switching
  85. * @Min: -100
  86. * @Max: 0
  87. * @Default: -80
  88. *
  89. * Usage: External
  90. *
  91. * </ini>
  92. */
  93. #define CFG_WLAN_LOW_RSSI_THRESHOLD CFG_INI_INT( \
  94. "gSetWlanLowRssiThreshold", \
  95. -100, \
  96. 0, \
  97. -80, \
  98. CFG_VALUE_OR_DEFAULT, \
  99. "WLAN Low RSSI Threshold")
  100. /*
  101. * <ini>
  102. * gSetBtLowRssiThreshold - Set BT low RSSI threshold for BTC mode switching
  103. * @Min: -100
  104. * @Max: 0
  105. * @Default: -65
  106. *
  107. * Usage: External
  108. *
  109. * </ini>
  110. */
  111. #define CFG_BT_LOW_RSSI_THRESHOLD CFG_INI_INT( \
  112. "gSetBtLowRssiThreshold", \
  113. -100, \
  114. 0, \
  115. -65, \
  116. CFG_VALUE_OR_DEFAULT, \
  117. "BT Low RSSI Threshold")
  118. /*
  119. * <ini>
  120. * gSetBtInterferenceLowLL - Set lower limit of low level BT interference
  121. * @Min: -100
  122. * @Max: 100
  123. * @Default: -25
  124. *
  125. * Usage: External
  126. *
  127. * </ini>
  128. */
  129. #define CFG_BT_INTERFERENCE_LOW_LL CFG_INI_INT( \
  130. "gSetBtInterferenceLowLL", \
  131. -100, \
  132. 100, \
  133. -25, \
  134. CFG_VALUE_OR_DEFAULT, \
  135. "BT Interference Low LL")
  136. /*
  137. * <ini>
  138. * gSetBtInterferenceLowUL - Set upper limit of low level BT interference
  139. * @Min: -100
  140. * @Max: 100
  141. * @Default: -21
  142. *
  143. * Usage: External
  144. *
  145. * </ini>
  146. */
  147. #define CFG_BT_INTERFERENCE_LOW_UL CFG_INI_INT( \
  148. "gSetBtInterferenceLowUL", \
  149. -100, \
  150. 100, \
  151. -21, \
  152. CFG_VALUE_OR_DEFAULT, \
  153. "BT Interference Low UL")
  154. /*
  155. * <ini>
  156. * gSetBtInterferenceMediumLL - Set lower limit of medium level BT interference
  157. * @Min: -100
  158. * @Max: 100
  159. * @Default: -20
  160. *
  161. * Usage: External
  162. *
  163. * </ini>
  164. */
  165. #define CFG_BT_INTERFERENCE_MEDIUM_LL CFG_INI_INT( \
  166. "gSetBtInterferenceMediumLL", \
  167. -100, \
  168. 100, \
  169. -20, \
  170. CFG_VALUE_OR_DEFAULT, \
  171. "BT Interference Medium LL")
  172. /*
  173. * <ini>
  174. * gSetBtInterferenceMediumUL - Set upper limit of medium level BT interference
  175. * @Min: -100
  176. * @Max: 100
  177. * @Default: -16
  178. *
  179. * Usage: External
  180. *
  181. * </ini>
  182. */
  183. #define CFG_BT_INTERFERENCE_MEDIUM_UL CFG_INI_INT( \
  184. "gSetBtInterferenceMediumUL", \
  185. -100, \
  186. 100, \
  187. -16, \
  188. CFG_VALUE_OR_DEFAULT, \
  189. "BT Interference Medium UL")
  190. /*
  191. * <ini>
  192. * gSetBtInterferenceHighLL - Set lower limit of high level BT interference
  193. * @Min: -100
  194. * @Max: 100
  195. * @Default: -15
  196. *
  197. * Usage: External
  198. *
  199. * </ini>
  200. */
  201. #define CFG_BT_INTERFERENCE_HIGH_LL CFG_INI_INT( \
  202. "gSetBtInterferenceHighLL", \
  203. -100, \
  204. 100, \
  205. -15, \
  206. CFG_VALUE_OR_DEFAULT, \
  207. "BT Interference High LL")
  208. /*
  209. * <ini>
  210. * gSetBtInterferenceHighUL - Set upper limit of high level BT interference
  211. * @Min: -100
  212. * @Max: 100
  213. * @Default: -11
  214. *
  215. * Usage: External
  216. *
  217. * </ini>
  218. */
  219. #define CFG_BT_INTERFERENCE_HIGH_UL CFG_INI_INT( \
  220. "gSetBtInterferenceHighUL", \
  221. -100, \
  222. 100, \
  223. -11, \
  224. CFG_VALUE_OR_DEFAULT, \
  225. "BT Interference High UL")
  226. #ifdef FEATURE_MPTA_HELPER
  227. /*
  228. * <ini>
  229. * gMPTAHelperEnable - Enable MPTA Helper
  230. * @Min: 0
  231. * @Max: 1
  232. * @Default: 0
  233. *
  234. * This ini is used to enable or disable coex MPTA Helper.
  235. *
  236. * Usage: External
  237. *
  238. * </ini>
  239. */
  240. #define CFG_COEX_MPTA_HELPER CFG_INI_BOOL( \
  241. "gMPTAHelperEnable", \
  242. 0, \
  243. "Enable/Disable MPTA Helper")
  244. #define COEX_MPTA_HELPER_CFG CFG(CFG_COEX_MPTA_HELPER)
  245. #else
  246. #define COEX_MPTA_HELPER_CFG
  247. #endif
  248. /*
  249. * <ini>
  250. * gBtScoAllowWlan2GScan - Allow wlan 2g scan when BT SCO connection is on
  251. * @Min: 0
  252. * @Max: 1
  253. * @Default: 1
  254. *
  255. * 0 - Disable
  256. * 1 - Enable
  257. *
  258. * This ini is used to enable or disable wlan 2g scan
  259. * when BT SCO connection is on.
  260. *
  261. * Usage: External
  262. *
  263. * </ini>
  264. */
  265. #define CFG_BT_SCO_ALLOW_WLAN_2G_SCAN CFG_INI_BOOL( \
  266. "gBtScoAllowWlan2GScan", \
  267. 1, \
  268. "Bt Sco Allow Wlan 2G Scan")
  269. /*
  270. * <ini>
  271. * ble_scan_coex_policy - Ini to configure coex policy
  272. * @Min: 0
  273. * @Max: 1
  274. * @Default: 0
  275. *
  276. * 0 - Better BLE Advertiser reception performance
  277. * 1 - Better WLAN performance
  278. *
  279. * This ini is used to control the performance of ble scan case,’0’ to place
  280. * more emphasis on BLE Scan results , ‘1’ to place more emphasis on WLAN
  281. * performance
  282. *
  283. * Usage: External
  284. *
  285. * </ini>
  286. */
  287. #define CFG_BLE_SCAN_COEX_POLICY CFG_INI_BOOL( \
  288. "ble_scan_coex_policy", \
  289. 0, \
  290. "BLE scan Coex policy")
  291. #ifdef FEATURE_COEX_CONFIG
  292. /*
  293. * <ini>
  294. * gThreeWayCoexConfigLegacyEnable - Enable coex config legacy feature
  295. * @Min: 0
  296. * @Max: 1
  297. * @Default: 0
  298. *
  299. * This ini is used to enable or disable three way coex config legacy feature.
  300. * This feature is designed only for non-mobile solution.
  301. * When the feature is disabled, Firmware use the default configuration to
  302. * set the coex priority of three antenna(WLAN, BT, ZIGBEE).
  303. * when enable this feature, customer can use the vendor command to set antenna
  304. * coex priority dynamically.
  305. *
  306. * Supported Feature: three way coex config
  307. *
  308. * Usage: External
  309. *
  310. * </ini>
  311. */
  312. #define CFG_THREE_WAY_COEX_CONFIG_LEGACY CFG_INI_BOOL( \
  313. "gThreeWayCoexConfigLegacyEnable", \
  314. 0, \
  315. "Enable/Disable COEX Config Legacy")
  316. #define THREE_WAY_COEX_CONFIG_LEGACY_CFG CFG(CFG_THREE_WAY_COEX_CONFIG_LEGACY)
  317. #else
  318. #define THREE_WAY_COEX_CONFIG_LEGACY_CFG
  319. #endif
  320. #ifdef FEATURE_BTC_CHAIN_MODE
  321. /*
  322. * <ini>
  323. * gSetInitChainModeForBTC - Used to set init chain mode for BTC
  324. * @Min: 0
  325. * @Max: 0xFF
  326. * @Default: 0xFF
  327. *
  328. * This ini is used to set init chain mode for BTC, default value
  329. * should be set to the same as macro WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED(0xFF),
  330. * only below values can be set:
  331. * 0 - init WLAN 2.4G to support 2x2.
  332. * It means chains of BT and WLAN 2.4G are shared, or BT is OFF.
  333. * 1 - init WLAN 2.4G as 1x1, chains of BT and WLAN 2.4G are separated,
  334. * fixed FDD.
  335. * 2 - init WLAN 2.4G as 1x1, chains of BT and WLAN 2.4G are separated,
  336. * hybrid mode
  337. * 0xFF - no need to send init chain mode for BTC to firmware.
  338. *
  339. * Supported Feature: init chain mode for BTC
  340. *
  341. * Usage: External
  342. *
  343. * </ini>
  344. */
  345. #define CFG_SET_INIT_CHAIN_MODE_FOR_BTC CFG_INI_UINT( \
  346. "gSetInitChainModeForBTC", \
  347. 0, \
  348. 0xFF, \
  349. 0xFF, \
  350. CFG_VALUE_OR_DEFAULT, \
  351. "Init Chain Mode For BTC")
  352. #define SET_INIT_CHAIN_MODE_FOR_BTC_CFG CFG(CFG_SET_INIT_CHAIN_MODE_FOR_BTC)
  353. #else
  354. #define SET_INIT_CHAIN_MODE_FOR_BTC_CFG
  355. #endif
  356. #ifdef FEATURE_COEX_TPUT_SHAPING_CONFIG
  357. /*
  358. * <ini>
  359. * coex_tput_shaping_enable - Ini to enable wifi configure traffic shaping
  360. * @Min: 0
  361. * @Max: 1
  362. * @Default: 0
  363. *
  364. * 0 - traffic shaping is disable
  365. * 1 - traffic shaping is enable
  366. *
  367. * This ini is used to enable and disable wifi traffic shaping
  368. *
  369. * Usage: External
  370. *
  371. * </ini>
  372. */
  373. #define CFG_TPUT_SHAPING_ENABLE CFG_INI_BOOL( \
  374. "coex_tput_shaping_enable", \
  375. 0, \
  376. "coex_tput_shaping_enable")
  377. #define TPUT_SHAPING_ENABLE_CFG CFG(CFG_TPUT_SHAPING_ENABLE)
  378. #else
  379. #define TPUT_SHAPING_ENABLE_CFG
  380. #endif
  381. #define CFG_COEX_ALL \
  382. CFG(CFG_BTC_MODE) \
  383. CFG(CFG_ANTENNA_ISOLATION) \
  384. CFG(CFG_MAX_TX_POWER_FOR_BTC) \
  385. CFG(CFG_WLAN_LOW_RSSI_THRESHOLD) \
  386. CFG(CFG_BT_LOW_RSSI_THRESHOLD) \
  387. CFG(CFG_BT_INTERFERENCE_LOW_LL) \
  388. CFG(CFG_BT_INTERFERENCE_LOW_UL) \
  389. CFG(CFG_BT_INTERFERENCE_MEDIUM_LL) \
  390. CFG(CFG_BT_INTERFERENCE_MEDIUM_UL) \
  391. CFG(CFG_BT_INTERFERENCE_HIGH_LL) \
  392. CFG(CFG_BT_INTERFERENCE_HIGH_UL) \
  393. COEX_MPTA_HELPER_CFG \
  394. CFG(CFG_BT_SCO_ALLOW_WLAN_2G_SCAN) \
  395. THREE_WAY_COEX_CONFIG_LEGACY_CFG \
  396. SET_INIT_CHAIN_MODE_FOR_BTC_CFG \
  397. CFG(CFG_BLE_SCAN_COEX_POLICY) \
  398. TPUT_SHAPING_ENABLE_CFG
  399. #endif