coex_tx_req.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef _COEX_TX_REQ_H_
  16. #define _COEX_TX_REQ_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_COEX_TX_REQ 4
  20. #define NUM_OF_QWORDS_COEX_TX_REQ 2
  21. struct coex_tx_req {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. uint32_t tx_pwr : 8, // [7:0]
  24. min_tx_pwr : 8, // [15:8]
  25. nss : 3, // [18:16]
  26. tx_chain_mask : 8, // [26:19]
  27. bw : 3, // [29:27]
  28. reserved_0 : 2; // [31:30]
  29. uint32_t alt_tx_pwr : 8, // [7:0]
  30. alt_min_tx_pwr : 8, // [15:8]
  31. alt_nss : 3, // [18:16]
  32. alt_tx_chain_mask : 8, // [26:19]
  33. alt_bw : 3, // [29:27]
  34. reserved_1 : 2; // [31:30]
  35. uint32_t tx_pwr_1 : 8, // [7:0]
  36. alt_tx_pwr_1 : 8, // [15:8]
  37. wlan_request_duration : 16; // [31:16]
  38. uint32_t wlan_pkt_type : 4, // [3:0]
  39. coex_tx_reason : 2, // [5:4]
  40. response_frame_type : 5, // [10:6]
  41. wlan_low_priority_slicing_allowed : 1, // [11:11]
  42. wlan_high_priority_slicing_allowed : 1, // [12:12]
  43. sch_tx_burst_ongoing : 1, // [13:13]
  44. coex_tx_priority : 4, // [17:14]
  45. reserved_3a : 14; // [31:18]
  46. #else
  47. uint32_t reserved_0 : 2, // [31:30]
  48. bw : 3, // [29:27]
  49. tx_chain_mask : 8, // [26:19]
  50. nss : 3, // [18:16]
  51. min_tx_pwr : 8, // [15:8]
  52. tx_pwr : 8; // [7:0]
  53. uint32_t reserved_1 : 2, // [31:30]
  54. alt_bw : 3, // [29:27]
  55. alt_tx_chain_mask : 8, // [26:19]
  56. alt_nss : 3, // [18:16]
  57. alt_min_tx_pwr : 8, // [15:8]
  58. alt_tx_pwr : 8; // [7:0]
  59. uint32_t wlan_request_duration : 16, // [31:16]
  60. alt_tx_pwr_1 : 8, // [15:8]
  61. tx_pwr_1 : 8; // [7:0]
  62. uint32_t reserved_3a : 14, // [31:18]
  63. coex_tx_priority : 4, // [17:14]
  64. sch_tx_burst_ongoing : 1, // [13:13]
  65. wlan_high_priority_slicing_allowed : 1, // [12:12]
  66. wlan_low_priority_slicing_allowed : 1, // [11:11]
  67. response_frame_type : 5, // [10:6]
  68. coex_tx_reason : 2, // [5:4]
  69. wlan_pkt_type : 4; // [3:0]
  70. #endif
  71. };
  72. /* Description TX_PWR
  73. Default (desired) transmit parameter
  74. Transmit Power in s6.2 format.
  75. In units of 0.25 dBm
  76. <legal all>
  77. */
  78. #define COEX_TX_REQ_TX_PWR_OFFSET 0x0000000000000000
  79. #define COEX_TX_REQ_TX_PWR_LSB 0
  80. #define COEX_TX_REQ_TX_PWR_MSB 7
  81. #define COEX_TX_REQ_TX_PWR_MASK 0x00000000000000ff
  82. /* Description MIN_TX_PWR
  83. Default (desired) transmit parameter
  84. Minimum allowed Transmit Power in s6.2 format.
  85. In units of 0.25 dBm
  86. <legal all>
  87. */
  88. #define COEX_TX_REQ_MIN_TX_PWR_OFFSET 0x0000000000000000
  89. #define COEX_TX_REQ_MIN_TX_PWR_LSB 8
  90. #define COEX_TX_REQ_MIN_TX_PWR_MSB 15
  91. #define COEX_TX_REQ_MIN_TX_PWR_MASK 0x000000000000ff00
  92. /* Description NSS
  93. Default (desired) transmit parameter
  94. Number of spatial streams.
  95. <enum 0 1_spatial_stream>Single spatial stream
  96. <enum 1 2_spatial_streams>2 spatial streams
  97. <enum 2 3_spatial_streams>3 spatial streams
  98. <enum 3 4_spatial_streams>4 spatial streams
  99. <enum 4 5_spatial_streams>5 spatial streams
  100. <enum 5 6_spatial_streams>6 spatial streams
  101. <enum 6 7_spatial_streams>7 spatial streams
  102. <enum 7 8_spatial_streams>8 spatial streams
  103. */
  104. #define COEX_TX_REQ_NSS_OFFSET 0x0000000000000000
  105. #define COEX_TX_REQ_NSS_LSB 16
  106. #define COEX_TX_REQ_NSS_MSB 18
  107. #define COEX_TX_REQ_NSS_MASK 0x0000000000070000
  108. /* Description TX_CHAIN_MASK
  109. Default (desired) transmit parameter
  110. Chain mask to support up to 8 antennas.
  111. <legal 1-255>
  112. */
  113. #define COEX_TX_REQ_TX_CHAIN_MASK_OFFSET 0x0000000000000000
  114. #define COEX_TX_REQ_TX_CHAIN_MASK_LSB 19
  115. #define COEX_TX_REQ_TX_CHAIN_MASK_MSB 26
  116. #define COEX_TX_REQ_TX_CHAIN_MASK_MASK 0x0000000007f80000
  117. /* Description BW
  118. Default (desired) transmit parameter
  119. The BW of the upcoming transmission.
  120. <enum 0 20_mhz>20 Mhz BW
  121. <enum 1 40_mhz>40 Mhz BW
  122. <enum 2 80_mhz>80 Mhz BW
  123. <enum 3 160_mhz>160 Mhz BW
  124. <enum 4 320_mhz>320 Mhz BW
  125. <enum 5 240_mhz>240 Mhz BW
  126. */
  127. #define COEX_TX_REQ_BW_OFFSET 0x0000000000000000
  128. #define COEX_TX_REQ_BW_LSB 27
  129. #define COEX_TX_REQ_BW_MSB 29
  130. #define COEX_TX_REQ_BW_MASK 0x0000000038000000
  131. /* Description RESERVED_0
  132. <legal 0>
  133. */
  134. #define COEX_TX_REQ_RESERVED_0_OFFSET 0x0000000000000000
  135. #define COEX_TX_REQ_RESERVED_0_LSB 30
  136. #define COEX_TX_REQ_RESERVED_0_MSB 31
  137. #define COEX_TX_REQ_RESERVED_0_MASK 0x00000000c0000000
  138. /* Description ALT_TX_PWR
  139. Coex related AlternativeTransmit parameter
  140. Transmit Power in s6.2 format.
  141. In units of 0.25 dBm
  142. <legal all>
  143. */
  144. #define COEX_TX_REQ_ALT_TX_PWR_OFFSET 0x0000000000000000
  145. #define COEX_TX_REQ_ALT_TX_PWR_LSB 32
  146. #define COEX_TX_REQ_ALT_TX_PWR_MSB 39
  147. #define COEX_TX_REQ_ALT_TX_PWR_MASK 0x000000ff00000000
  148. /* Description ALT_MIN_TX_PWR
  149. Coex related Alternative Transmit parameter
  150. Minimum allowed Transmit Power in s6.2 format.
  151. In units of 0.25 dBm
  152. <legal all>
  153. */
  154. #define COEX_TX_REQ_ALT_MIN_TX_PWR_OFFSET 0x0000000000000000
  155. #define COEX_TX_REQ_ALT_MIN_TX_PWR_LSB 40
  156. #define COEX_TX_REQ_ALT_MIN_TX_PWR_MSB 47
  157. #define COEX_TX_REQ_ALT_MIN_TX_PWR_MASK 0x0000ff0000000000
  158. /* Description ALT_NSS
  159. Coex related Alternative Transmit parameter
  160. Number of spatial streams.
  161. <enum 0 1_spatial_stream>Single spatial stream
  162. <enum 1 2_spatial_streams>2 spatial streams
  163. <enum 2 3_spatial_streams>3 spatial streams
  164. <enum 3 4_spatial_streams>4 spatial streams
  165. <enum 4 5_spatial_streams>5 spatial streams
  166. <enum 5 6_spatial_streams>6 spatial streams
  167. <enum 6 7_spatial_streams>7 spatial streams
  168. <enum 7 8_spatial_streams>8 spatial streams
  169. */
  170. #define COEX_TX_REQ_ALT_NSS_OFFSET 0x0000000000000000
  171. #define COEX_TX_REQ_ALT_NSS_LSB 48
  172. #define COEX_TX_REQ_ALT_NSS_MSB 50
  173. #define COEX_TX_REQ_ALT_NSS_MASK 0x0007000000000000
  174. /* Description ALT_TX_CHAIN_MASK
  175. Coex related Alternative Transmit parameter
  176. Chain mask to support up to 8 antennas.
  177. <legal 1-255>
  178. */
  179. #define COEX_TX_REQ_ALT_TX_CHAIN_MASK_OFFSET 0x0000000000000000
  180. #define COEX_TX_REQ_ALT_TX_CHAIN_MASK_LSB 51
  181. #define COEX_TX_REQ_ALT_TX_CHAIN_MASK_MSB 58
  182. #define COEX_TX_REQ_ALT_TX_CHAIN_MASK_MASK 0x07f8000000000000
  183. /* Description ALT_BW
  184. Coex related Alternative Transmit parameter.
  185. The BW of the upcoming transmission.
  186. <enum 0 20_mhz>20 Mhz BW
  187. <enum 1 40_mhz>40 Mhz BW
  188. <enum 2 80_mhz>80 Mhz BW
  189. <enum 3 160_mhz>160 Mhz BW
  190. <enum 4 320_mhz>320 Mhz BW
  191. <enum 5 240_mhz>240 Mhz BW
  192. */
  193. #define COEX_TX_REQ_ALT_BW_OFFSET 0x0000000000000000
  194. #define COEX_TX_REQ_ALT_BW_LSB 59
  195. #define COEX_TX_REQ_ALT_BW_MSB 61
  196. #define COEX_TX_REQ_ALT_BW_MASK 0x3800000000000000
  197. /* Description RESERVED_1
  198. <legal 0>
  199. */
  200. #define COEX_TX_REQ_RESERVED_1_OFFSET 0x0000000000000000
  201. #define COEX_TX_REQ_RESERVED_1_LSB 62
  202. #define COEX_TX_REQ_RESERVED_1_MSB 63
  203. #define COEX_TX_REQ_RESERVED_1_MASK 0xc000000000000000
  204. /* Description TX_PWR_1
  205. Default (desired) transmit parameter for the second chain
  206. Transmit Power in s6.2 format.
  207. In units of 0.25 dBm
  208. Note that there is no Min value for this
  209. <legal all>
  210. */
  211. #define COEX_TX_REQ_TX_PWR_1_OFFSET 0x0000000000000008
  212. #define COEX_TX_REQ_TX_PWR_1_LSB 0
  213. #define COEX_TX_REQ_TX_PWR_1_MSB 7
  214. #define COEX_TX_REQ_TX_PWR_1_MASK 0x00000000000000ff
  215. /* Description ALT_TX_PWR_1
  216. Alternate (desired) transmit parameter for the second chain
  217. Transmit Power in s6.2 format.
  218. In units of 0.25 dBm
  219. Note that there is no Min value for this
  220. <legal all>
  221. */
  222. #define COEX_TX_REQ_ALT_TX_PWR_1_OFFSET 0x0000000000000008
  223. #define COEX_TX_REQ_ALT_TX_PWR_1_LSB 8
  224. #define COEX_TX_REQ_ALT_TX_PWR_1_MSB 15
  225. #define COEX_TX_REQ_ALT_TX_PWR_1_MASK 0x000000000000ff00
  226. /* Description WLAN_REQUEST_DURATION
  227. The amount of time PDG might use for the upcoming transmission
  228. and corresponding reception if there is one...
  229. <legal all>
  230. */
  231. #define COEX_TX_REQ_WLAN_REQUEST_DURATION_OFFSET 0x0000000000000008
  232. #define COEX_TX_REQ_WLAN_REQUEST_DURATION_LSB 16
  233. #define COEX_TX_REQ_WLAN_REQUEST_DURATION_MSB 31
  234. #define COEX_TX_REQ_WLAN_REQUEST_DURATION_MASK 0x00000000ffff0000
  235. /* Description WLAN_PKT_TYPE
  236. Packet type:
  237. <enum 0 dot11a>802.11a PPDU type
  238. <enum 1 dot11b>802.11b PPDU type
  239. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  240. <enum 3 dot11ac>802.11ac PPDU type
  241. <enum 4 dot11ax>802.11ax PPDU type
  242. <enum 5 dot11ba>802.11ba (WUR) PPDU type
  243. <enum 6 dot11be>802.11be PPDU type
  244. <enum 7 dot11az>802.11az (ranging) PPDU type
  245. <enum 8 dot11n_gf>802.11n Green Field PPDU type (unsupported
  246. & aborted)
  247. */
  248. #define COEX_TX_REQ_WLAN_PKT_TYPE_OFFSET 0x0000000000000008
  249. #define COEX_TX_REQ_WLAN_PKT_TYPE_LSB 32
  250. #define COEX_TX_REQ_WLAN_PKT_TYPE_MSB 35
  251. #define COEX_TX_REQ_WLAN_PKT_TYPE_MASK 0x0000000f00000000
  252. /* Description COEX_TX_REASON
  253. <enum 0 cxc_fes_protection_frame> RTS, CTS2Self or
  254. 11h protection type transmission preceding the regular PPDU
  255. portion of the coming FES.
  256. <enum 1 cxc_fes_after_protection > Regular PPDU transmission
  257. that follows the transmission of medium protection frames:.
  258. <enum 2 cxc_fes_only> Regular PPDU transmission without
  259. preceding medium protection frame exchanges.
  260. <enum 3 cxc_response_frame>
  261. HW generated response frame.
  262. Details of the response frame type provided in field: Response_frame_type
  263. <legal 0-3>
  264. */
  265. #define COEX_TX_REQ_COEX_TX_REASON_OFFSET 0x0000000000000008
  266. #define COEX_TX_REQ_COEX_TX_REASON_LSB 36
  267. #define COEX_TX_REQ_COEX_TX_REASON_MSB 37
  268. #define COEX_TX_REQ_COEX_TX_REASON_MASK 0x0000003000000000
  269. /* Description RESPONSE_FRAME_TYPE
  270. Coex related field
  271. <enum 0 Resp_Non_11ah_ACK >
  272. <enum 1 Resp_Non_11ah_BA >
  273. <enum 2 Resp_Non_11ah_CTS >
  274. <enum 3 Resp_AH_NDP_CTS>
  275. <enum 4 Resp_AH_NDP_ACK>
  276. <enum 5 Resp_AH_NDP_BA>
  277. <enum 6 Resp_AH_NDP_MOD_ACK>
  278. <enum 7 Resp_AH_Normal_ACK>
  279. <enum 8 Resp_AH_Normal_BA>
  280. <enum 9 Resp_RTT_ACK>
  281. <enum 10 Resp_CBF_RESPONSE>
  282. <enum 11 Resp_MBA>
  283. <enum 12 Resp_Ranging_NDP>
  284. <enum 13 Resp_LMR_RESPONSE>
  285. <enum 14 Resp_TRIGGER_RESPONSE_BASIC>
  286. <enum 15 Resp_TRIGGER_RESPONSE_BUF_SIZE>
  287. <enum 16 Resp_TRIGGER_RESPONSE_BRPOLL>
  288. <enum 17 Resp_TRIGGER_RESPONSE_CTS>
  289. <enum 18 Resp_TRIGGER_RESPONSE_OTHER>
  290. <legal 0-18>
  291. */
  292. #define COEX_TX_REQ_RESPONSE_FRAME_TYPE_OFFSET 0x0000000000000008
  293. #define COEX_TX_REQ_RESPONSE_FRAME_TYPE_LSB 38
  294. #define COEX_TX_REQ_RESPONSE_FRAME_TYPE_MSB 42
  295. #define COEX_TX_REQ_RESPONSE_FRAME_TYPE_MASK 0x000007c000000000
  296. /* Description WLAN_LOW_PRIORITY_SLICING_ALLOWED
  297. When set, COEX is allowed to invoke 'tx slicing' algorithms
  298. when WLAN tx is low priority when compared to BT activity,
  299. to get to more optimal throughput. Value 0 will disable
  300. this feature
  301. <legal all>
  302. */
  303. #define COEX_TX_REQ_WLAN_LOW_PRIORITY_SLICING_ALLOWED_OFFSET 0x0000000000000008
  304. #define COEX_TX_REQ_WLAN_LOW_PRIORITY_SLICING_ALLOWED_LSB 43
  305. #define COEX_TX_REQ_WLAN_LOW_PRIORITY_SLICING_ALLOWED_MSB 43
  306. #define COEX_TX_REQ_WLAN_LOW_PRIORITY_SLICING_ALLOWED_MASK 0x0000080000000000
  307. /* Description WLAN_HIGH_PRIORITY_SLICING_ALLOWED
  308. When set, COEX is allowed to invoke 'tx slicing' algorithms
  309. when WLAN tx is high priority when compared to BT activity,
  310. to get to more optimal throughput. Value 0 will disable
  311. this feature.
  312. <legal all>
  313. */
  314. #define COEX_TX_REQ_WLAN_HIGH_PRIORITY_SLICING_ALLOWED_OFFSET 0x0000000000000008
  315. #define COEX_TX_REQ_WLAN_HIGH_PRIORITY_SLICING_ALLOWED_LSB 44
  316. #define COEX_TX_REQ_WLAN_HIGH_PRIORITY_SLICING_ALLOWED_MSB 44
  317. #define COEX_TX_REQ_WLAN_HIGH_PRIORITY_SLICING_ALLOWED_MASK 0x0000100000000000
  318. /* Description SCH_TX_BURST_ONGOING
  319. 0: No action
  320. 1: The next scheduling command needs to start at SIFS time
  321. after finishing the frame transmissions in this command.
  322. This allows for SIFS based bursting
  323. <legal all>
  324. */
  325. #define COEX_TX_REQ_SCH_TX_BURST_ONGOING_OFFSET 0x0000000000000008
  326. #define COEX_TX_REQ_SCH_TX_BURST_ONGOING_LSB 45
  327. #define COEX_TX_REQ_SCH_TX_BURST_ONGOING_MSB 45
  328. #define COEX_TX_REQ_SCH_TX_BURST_ONGOING_MASK 0x0000200000000000
  329. /* Description COEX_TX_PRIORITY
  330. Transmit priority. Used for Coex weight table look up in
  331. case of regular FES transmission. This value is typically
  332. programmed in relationship to the backoff engine. In case
  333. of self_gen tx, the value comes from a programmable register
  334. in the TXPCU. For BA and ACK packets, this is related to
  335. AC of the incoming frame. .
  336. For a request type of "fes", the field is copied over from
  337. the scheduling command TLV.
  338. <legal all>
  339. */
  340. #define COEX_TX_REQ_COEX_TX_PRIORITY_OFFSET 0x0000000000000008
  341. #define COEX_TX_REQ_COEX_TX_PRIORITY_LSB 46
  342. #define COEX_TX_REQ_COEX_TX_PRIORITY_MSB 49
  343. #define COEX_TX_REQ_COEX_TX_PRIORITY_MASK 0x0003c00000000000
  344. /* Description RESERVED_3A
  345. <legal 0>
  346. */
  347. #define COEX_TX_REQ_RESERVED_3A_OFFSET 0x0000000000000008
  348. #define COEX_TX_REQ_RESERVED_3A_LSB 50
  349. #define COEX_TX_REQ_RESERVED_3A_MSB 63
  350. #define COEX_TX_REQ_RESERVED_3A_MASK 0xfffc000000000000
  351. #endif // COEX_TX_REQ