coex_tx_req.h 20 KB

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