cfg_mlme_chainmask.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. /*
  2. * Copyright (c) 2012-2019, 2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021 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_CHAINMASK_H
  23. #define __CFG_CHAINMASK_H
  24. /*
  25. * <ini>
  26. * gSetTxChainmask1x1 - Sets Transmit chain mask.
  27. * @Min: 0
  28. * @Max: 3
  29. * @Default: 1
  30. *
  31. * This ini Sets Transmit chain mask.
  32. *
  33. * If gEnable2x2 is disabled, gSetTxChainmask1x1 and gSetRxChainmask1x1 values
  34. * are taken into account. If chainmask value exceeds the maximum number of
  35. * chains supported by target, the max number of chains is used. By default,
  36. * chain0 is selected for both Tx and Rx.
  37. * gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0.
  38. * gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1.
  39. * gSetTxChainmask1x1=3 or gSetRxChainmask1x1=3 to select both chains.
  40. *
  41. * Supported Feature: 11AC
  42. *
  43. * Usage: External
  44. *
  45. * </ini>
  46. */
  47. #define CFG_VHT_ENABLE_1x1_TX_CHAINMASK CFG_INI_UINT( \
  48. "gSetTxChainmask1x1", \
  49. 0, \
  50. 3, \
  51. 1, \
  52. CFG_VALUE_OR_DEFAULT, \
  53. "1x1 VHT Tx Chainmask")
  54. /*
  55. * <ini>
  56. * gSetRxChainmask1x1 - Sets Receive chain mask.
  57. * @Min: 0
  58. * @Max: 3
  59. * @Default: 1
  60. *
  61. * This ini is used to set Receive chain mask.
  62. *
  63. * If gEnable2x2 is disabled, gSetTxChainmask1x1 and gSetRxChainmask1x1 values
  64. * are taken into account. If chainmask value exceeds the maximum number of
  65. * chains supported by target, the max number of chains is used. By default,
  66. * chain0 is selected for both Tx and Rx.
  67. * gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0.
  68. * gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1.
  69. * gSetTxChainmask1x1=3 or gSetRxChainmask1x1=3 to select both chains.
  70. *
  71. * Supported Feature: 11AC
  72. *
  73. * Usage: External
  74. *
  75. * </ini>
  76. */
  77. #define CFG_VHT_ENABLE_1x1_RX_CHAINMASK CFG_INI_UINT( \
  78. "gSetRxChainmask1x1", \
  79. 0, \
  80. 3, \
  81. 1, \
  82. CFG_VALUE_OR_DEFAULT, \
  83. "1x1 VHT Rx Chainmask")
  84. /*
  85. * <ini>
  86. * gCckChainMaskEnable - Used to enable/disable Cck ChainMask
  87. * @Min: 0
  88. * @Max: 1
  89. * @Default: 0
  90. *
  91. * This ini is used to set default Cck ChainMask
  92. * 0: disable the cck tx chain mask (default)
  93. * 1: enable the cck tx chain mask
  94. *
  95. * Related: None
  96. *
  97. * Supported Feature: STA
  98. *
  99. * Usage: Internal/External
  100. *
  101. * </ini>
  102. */
  103. #define CFG_TX_CHAIN_MASK_CCK CFG_INI_BOOL( \
  104. "gCckChainMaskEnable", \
  105. 0, \
  106. "Set default CCK Tx Chainmask")
  107. /*
  108. * <ini>
  109. * gTxChainMask1ss - Enables/disables tx chain mask1ss, used by Rome
  110. * @Min: 0
  111. * @Max: 3
  112. * @Default: 0
  113. *
  114. * This ini is used to set default tx chain mask for 1ss
  115. *
  116. * gTxChainMask1ss=0 : 1ss data tx chain mask set to 3 and self gen chain mask
  117. * set to 3. This is default setting of fw side. For 1x1 case, WIFI will
  118. * using chain0 to sent 1ss data and selfgen packets. 2x2 case, WIFI will
  119. * using chain0 and chain1 to sent 1ss data and selfgen packets.
  120. *
  121. * gTxChainMask1ss=1 : 1ss data tx chain mask set to 2 and self gen chain mask
  122. * set to 2. This setting can work only when 2x2 case, WIFI will use chain1
  123. * to sent 1ss data packets and selfgen packets, this can improve BTC
  124. * performance a little, but have side affect when chain0 and chain1 RSSI
  125. * is unbalance or green AP is enabled. So we recommend not using it.
  126. *
  127. * gTxChainMask1ss=2 : 1ss data tx chain mask set to 3 and self gen chain mask
  128. * set to 2. This setting never used before.
  129. *
  130. * gTxChainMask1ss=3 : 1ss data tx chain mask set to 2 and self gen chain mask
  131. * set to 3. This setting never used before.
  132. *
  133. * Related: None
  134. *
  135. * Supported Feature: STA/SAP
  136. *
  137. * Usage: Internal/External
  138. *
  139. * </ini>
  140. */
  141. #define CFG_TX_CHAIN_MASK_1SS CFG_INI_UINT( \
  142. "gTxChainMask1ss", \
  143. 0, \
  144. 3, \
  145. 0, \
  146. CFG_VALUE_OR_DEFAULT, \
  147. "1SS Tx Chainmask")
  148. /*
  149. * <ini>
  150. * g11bNumTxChains - Number of Tx Chanins in 11b mode
  151. * @Min: 0
  152. * @Max: 2
  153. * @Default: 0
  154. *
  155. * Number of Tx Chanins in 11b mode
  156. *
  157. *
  158. * Related: None
  159. *
  160. * Supported Feature: connection
  161. *
  162. * Usage: External
  163. *
  164. * </ini>
  165. */
  166. #define CFG_11B_NUM_TX_CHAIN CFG_INI_UINT( \
  167. "g11bNumTxChains", \
  168. 0, \
  169. 2, \
  170. 0, \
  171. CFG_VALUE_OR_DEFAULT, \
  172. "11b Num Tx chains")
  173. /*
  174. * <ini>
  175. * g11agNumTxChains - Number of Tx Chanins in 11ag mode
  176. * @Min: 0
  177. * @Max: 2
  178. * @Default: 0
  179. *
  180. * Number of Tx Chanins in 11ag mode
  181. *
  182. *
  183. * Related: None
  184. *
  185. * Supported Feature: connection
  186. *
  187. * Usage: External
  188. *
  189. * </ini>
  190. */
  191. #define CFG_11AG_NUM_TX_CHAIN CFG_INI_UINT( \
  192. "g11agNumTxChains", \
  193. 0, \
  194. 2, \
  195. 0, \
  196. CFG_VALUE_OR_DEFAULT, \
  197. "11ag Num Tx chains")
  198. /*
  199. * <ini>
  200. * tx_chain_mask_2g - tx chain mask for 2g
  201. * @Min: 0
  202. * @Max: 4
  203. * @Default: 0
  204. *
  205. * This ini will set tx chain mask for 2g. To use the ini, make sure:
  206. * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0,
  207. * gDualMacFeatureDisable = 1
  208. * gEnable2x2 = 0
  209. *
  210. * tx_chain_mask_2g=0 : don't care
  211. * tx_chain_mask_2g=1 : for 2g tx use chain 0
  212. * tx_chain_mask_2g=2 : for 2g tx use chain 1
  213. * tx_chain_mask_2g=3 : for 2g tx can use either chain
  214. *
  215. * QCN7605 DBS chip has 3 RF chains.
  216. * Chain0 for 2G, Chain1 for 2G/5G, Chain2 for 5G.
  217. * DBS mode need 3 bits to map chainmask and halphy.
  218. * In HW design, PHYA0 always Connects to shared RF chain1.
  219. * tx_chain_mask_2g=4 : for 2g tx chain use PHYB and chain 0
  220. *
  221. * Related: None
  222. *
  223. * Supported Feature: All profiles
  224. *
  225. * Usage: External
  226. *
  227. * </ini>
  228. */
  229. #define CFG_TX_CHAIN_MASK_2G CFG_INI_UINT( \
  230. "tx_chain_mask_2g", \
  231. 0, \
  232. 4, \
  233. 0, \
  234. CFG_VALUE_OR_DEFAULT, \
  235. "2.4G Tx Chainmask")
  236. /*
  237. * <ini>
  238. * rx_chain_mask_2g - rx chain mask for 2g
  239. * @Min: 0
  240. * @Max: 4
  241. * @Default: 0
  242. *
  243. * This ini will set rx chain mask for 2g. To use the ini, make sure:
  244. * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0,
  245. * gDualMacFeatureDisable = 1
  246. * gEnable2x2 = 0
  247. *
  248. * rx_chain_mask_2g=0 : don't care
  249. * rx_chain_mask_2g=1 : for 2g rx use chain 0
  250. * rx_chain_mask_2g=2 : for 2g rx use chain 1
  251. * rx_chain_mask_2g=3 : for 2g rx can use either chain
  252. *
  253. * QCN7605 DBS chip has 3 RF chains.
  254. * Chain0 for 2G, Chain1 for 2G/5G, Chain2 for 5G.
  255. * DBS mode need 3 bits to map chainmask and halphy.
  256. * In HW design, PHYA0 always Connects to shared RF chain1.
  257. * rx_chain_mask_2g=4 : for 2g rx chain use PHYB and chain 0
  258. *
  259. * Related: None
  260. *
  261. * Supported Feature: All profiles
  262. *
  263. * Usage: External
  264. *
  265. * </ini>
  266. */
  267. #define CFG_RX_CHAIN_MASK_2G CFG_INI_UINT( \
  268. "rx_chain_mask_2g", \
  269. 0, \
  270. 4, \
  271. 0, \
  272. CFG_VALUE_OR_DEFAULT, \
  273. "2.4G Rx Chainmask")
  274. /*
  275. * <ini>
  276. * tx_chain_mask_5g - tx chain mask for 5g
  277. * @Min: 0
  278. * @Max: 6
  279. * @Default: 0
  280. *
  281. * This ini will set tx chain mask for 5g. To use the ini, make sure:
  282. * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0,
  283. * gDualMacFeatureDisable = 1
  284. * gEnable2x2 = 0
  285. *
  286. * tx_chain_mask_5g=0 : don't care
  287. * tx_chain_mask_5g=1 : for 5g tx use chain 0, Genoa use chain 1
  288. * tx_chain_mask_5g=2 : for 5g tx use chain 1, Genoa use chain 2
  289. * tx_chain_mask_5g=3 : for 5g tx can use either chain
  290. *
  291. * QCN7605 DBS chip has 3 RF chains.
  292. * Chain0 for 2G, Chain1 for 2G/5G, Chain2 for 5G.
  293. * DBS mode need 3 bits to map chainmask and halphy.
  294. * In HW design, PHYA0 always Connects to shared RF chain1.
  295. * tx_chain_mask_5g=4 : for 5g tx chain use PHYB and chain 2
  296. * tx_chain_mask_5g=5 : for 5g tx chain use PHYA and chain 1
  297. * tx_chain_mask_5g=6 : for 5g tx chain use PHYA and chain 2
  298. *
  299. * Related: None
  300. *
  301. * Supported Feature: All profiles
  302. *
  303. * Usage: External
  304. *
  305. * </ini>
  306. */
  307. #define CFG_TX_CHAIN_MASK_5G CFG_INI_UINT( \
  308. "tx_chain_mask_5g", \
  309. 0, \
  310. 6, \
  311. 0, \
  312. CFG_VALUE_OR_DEFAULT, \
  313. "5Ghz Tx Chainmask")
  314. /*
  315. * <ini>
  316. * rx_chain_mask_5g - rx chain mask for 5g
  317. * @Min: 0
  318. * @Max: 6
  319. * @Default: 0
  320. *
  321. * This ini will set rx chain mask for 5g. To use the ini, make sure:
  322. * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0,
  323. * gDualMacFeatureDisable = 1
  324. * gEnable2x2 = 0
  325. *
  326. * rx_chain_mask_5g=0 : don't care
  327. * rx_chain_mask_5g=1 : for 5g rx use chain 0, Genoa use chain 1
  328. * rx_chain_mask_5g=2 : for 5g rx use chain 1, Genoa use chain 2
  329. * rx_chain_mask_5g=3 : for 5g rx can use either chain
  330. *
  331. * QCN7605 DBS chip has 3 RF chains.
  332. * Chain0 for 2G, Chain1 for 2G/5G, Chain2 for 5G.
  333. * DBS mode need 3 bits to map halphy and chain.
  334. * HW design, PHYA0 always Connects to shared RF chain1.
  335. * rx_chain_mask_5g=4 : for 5g rx chain use PHYB and chain 2
  336. * rx_chain_mask_5g=5 : for 5g rx chain use PHYA and chain 1
  337. * rx_chain_mask_5g=6 : for 5g rx chain use PHYB and chain 2
  338. *
  339. * Related: None
  340. *
  341. * Supported Feature: All profiles
  342. *
  343. * Usage: External
  344. *
  345. * </ini>
  346. */
  347. #define CFG_RX_CHAIN_MASK_5G CFG_INI_UINT( \
  348. "rx_chain_mask_5g", \
  349. 0, \
  350. 6, \
  351. 0, \
  352. CFG_VALUE_OR_DEFAULT, \
  353. "5Ghz Rx Chainmask")
  354. /*
  355. * <ini>
  356. * enable_bt_chain_separation - Enables/disables bt /wlan chainmask assignment
  357. * @Min: 0
  358. * @Max: 1
  359. * @Default: 0
  360. *
  361. * This ini disables/enables chainmask setting on 2x2, mainly used for ROME
  362. * BT/WLAN chainmask assignment.
  363. *
  364. * 0, Disable
  365. * 1, Enable
  366. *
  367. * Related: NA
  368. *
  369. * Supported Feature: 11n/11ac
  370. *
  371. * Usage: External
  372. *
  373. * </ini>
  374. */
  375. #define CFG_ENABLE_BT_CHAIN_SEPARATION CFG_INI_BOOL( \
  376. "enableBTChainSeparation", \
  377. 0, \
  378. "Enable/disable BT chainmask assignment")
  379. #define CFG_CHAINMASK_ALL \
  380. CFG(CFG_VHT_ENABLE_1x1_TX_CHAINMASK) \
  381. CFG(CFG_VHT_ENABLE_1x1_RX_CHAINMASK) \
  382. CFG(CFG_TX_CHAIN_MASK_CCK) \
  383. CFG(CFG_TX_CHAIN_MASK_1SS) \
  384. CFG(CFG_11B_NUM_TX_CHAIN) \
  385. CFG(CFG_11AG_NUM_TX_CHAIN) \
  386. CFG(CFG_TX_CHAIN_MASK_2G) \
  387. CFG(CFG_RX_CHAIN_MASK_2G) \
  388. CFG(CFG_TX_CHAIN_MASK_5G) \
  389. CFG(CFG_RX_CHAIN_MASK_5G) \
  390. CFG(CFG_ENABLE_BT_CHAIN_SEPARATION)
  391. #endif /* __CFG_CHAINMASK_H */