xref: /wlan-driver/fw-api/hw/qcn6432/coex_tx_req.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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 
17 #ifndef _COEX_TX_REQ_H_
18 #define _COEX_TX_REQ_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 #define NUM_OF_DWORDS_COEX_TX_REQ 4
23 
24 #define NUM_OF_QWORDS_COEX_TX_REQ 2
25 
26 
27 struct coex_tx_req {
28 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
29              uint32_t tx_pwr                                                  :  8, // [7:0]
30                       min_tx_pwr                                              :  8, // [15:8]
31                       nss                                                     :  3, // [18:16]
32                       tx_chain_mask                                           :  8, // [26:19]
33                       bw                                                      :  3, // [29:27]
34                       reserved_0                                              :  2; // [31:30]
35              uint32_t alt_tx_pwr                                              :  8, // [7:0]
36                       alt_min_tx_pwr                                          :  8, // [15:8]
37                       alt_nss                                                 :  3, // [18:16]
38                       alt_tx_chain_mask                                       :  8, // [26:19]
39                       alt_bw                                                  :  3, // [29:27]
40                       reserved_1                                              :  2; // [31:30]
41              uint32_t tx_pwr_1                                                :  8, // [7:0]
42                       alt_tx_pwr_1                                            :  8, // [15:8]
43                       wlan_request_duration                                   : 16; // [31:16]
44              uint32_t wlan_pkt_type                                           :  4, // [3:0]
45                       coex_tx_reason                                          :  2, // [5:4]
46                       response_frame_type                                     :  5, // [10:6]
47                       wlan_low_priority_slicing_allowed                       :  1, // [11:11]
48                       wlan_high_priority_slicing_allowed                      :  1, // [12:12]
49                       sch_tx_burst_ongoing                                    :  1, // [13:13]
50                       coex_tx_priority                                        :  4, // [17:14]
51                       reserved_3a                                             : 14; // [31:18]
52 #else
53              uint32_t reserved_0                                              :  2, // [31:30]
54                       bw                                                      :  3, // [29:27]
55                       tx_chain_mask                                           :  8, // [26:19]
56                       nss                                                     :  3, // [18:16]
57                       min_tx_pwr                                              :  8, // [15:8]
58                       tx_pwr                                                  :  8; // [7:0]
59              uint32_t reserved_1                                              :  2, // [31:30]
60                       alt_bw                                                  :  3, // [29:27]
61                       alt_tx_chain_mask                                       :  8, // [26:19]
62                       alt_nss                                                 :  3, // [18:16]
63                       alt_min_tx_pwr                                          :  8, // [15:8]
64                       alt_tx_pwr                                              :  8; // [7:0]
65              uint32_t wlan_request_duration                                   : 16, // [31:16]
66                       alt_tx_pwr_1                                            :  8, // [15:8]
67                       tx_pwr_1                                                :  8; // [7:0]
68              uint32_t reserved_3a                                             : 14, // [31:18]
69                       coex_tx_priority                                        :  4, // [17:14]
70                       sch_tx_burst_ongoing                                    :  1, // [13:13]
71                       wlan_high_priority_slicing_allowed                      :  1, // [12:12]
72                       wlan_low_priority_slicing_allowed                       :  1, // [11:11]
73                       response_frame_type                                     :  5, // [10:6]
74                       coex_tx_reason                                          :  2, // [5:4]
75                       wlan_pkt_type                                           :  4; // [3:0]
76 #endif
77 };
78 
79 
80 /* Description		TX_PWR
81 
82 			Default (desired) transmit parameter
83 
84 			Transmit Power in s6.2 format.
85 			In units of 0.25 dBm
86 			<legal all>
87 */
88 
89 #define COEX_TX_REQ_TX_PWR_OFFSET                                                   0x0000000000000000
90 #define COEX_TX_REQ_TX_PWR_LSB                                                      0
91 #define COEX_TX_REQ_TX_PWR_MSB                                                      7
92 #define COEX_TX_REQ_TX_PWR_MASK                                                     0x00000000000000ff
93 
94 
95 /* Description		MIN_TX_PWR
96 
97 			Default (desired) transmit parameter
98 
99 
100 			Minimum allowed Transmit Power in s6.2 format.
101 			In units of 0.25 dBm
102 			<legal all>
103 */
104 
105 #define COEX_TX_REQ_MIN_TX_PWR_OFFSET                                               0x0000000000000000
106 #define COEX_TX_REQ_MIN_TX_PWR_LSB                                                  8
107 #define COEX_TX_REQ_MIN_TX_PWR_MSB                                                  15
108 #define COEX_TX_REQ_MIN_TX_PWR_MASK                                                 0x000000000000ff00
109 
110 
111 /* Description		NSS
112 
113 			Default (desired) transmit parameter
114 
115 			Number of spatial streams.
116 
117 			<enum 0 1_spatial_stream>Single spatial stream
118 			<enum 1 2_spatial_streams>2 spatial streams
119 			<enum 2 3_spatial_streams>3 spatial streams
120 			<enum 3 4_spatial_streams>4 spatial streams
121 			<enum 4 5_spatial_streams>5 spatial streams
122 			<enum 5 6_spatial_streams>6 spatial streams
123 			<enum 6 7_spatial_streams>7 spatial streams
124 			<enum 7 8_spatial_streams>8 spatial streams
125 */
126 
127 #define COEX_TX_REQ_NSS_OFFSET                                                      0x0000000000000000
128 #define COEX_TX_REQ_NSS_LSB                                                         16
129 #define COEX_TX_REQ_NSS_MSB                                                         18
130 #define COEX_TX_REQ_NSS_MASK                                                        0x0000000000070000
131 
132 
133 /* Description		TX_CHAIN_MASK
134 
135 			Default (desired) transmit parameter
136 
137 
138 			Chain mask to support up to 8 antennas.
139 			<legal 1-255>
140 */
141 
142 #define COEX_TX_REQ_TX_CHAIN_MASK_OFFSET                                            0x0000000000000000
143 #define COEX_TX_REQ_TX_CHAIN_MASK_LSB                                               19
144 #define COEX_TX_REQ_TX_CHAIN_MASK_MSB                                               26
145 #define COEX_TX_REQ_TX_CHAIN_MASK_MASK                                              0x0000000007f80000
146 
147 
148 /* Description		BW
149 
150 			Default (desired) transmit parameter
151 
152 			The BW of the upcoming transmission.
153 
154 			<enum 0 20_mhz>20 Mhz BW
155 			<enum 1 40_mhz>40 Mhz BW
156 			<enum 2 80_mhz>80 Mhz BW
157 			<enum 3 160_mhz>160 Mhz BW
158 			<enum 4 320_mhz>320 Mhz BW
159 			<enum 5 240_mhz>240 Mhz BW
160 */
161 
162 #define COEX_TX_REQ_BW_OFFSET                                                       0x0000000000000000
163 #define COEX_TX_REQ_BW_LSB                                                          27
164 #define COEX_TX_REQ_BW_MSB                                                          29
165 #define COEX_TX_REQ_BW_MASK                                                         0x0000000038000000
166 
167 
168 /* Description		RESERVED_0
169 
170 			<legal 0>
171 */
172 
173 #define COEX_TX_REQ_RESERVED_0_OFFSET                                               0x0000000000000000
174 #define COEX_TX_REQ_RESERVED_0_LSB                                                  30
175 #define COEX_TX_REQ_RESERVED_0_MSB                                                  31
176 #define COEX_TX_REQ_RESERVED_0_MASK                                                 0x00000000c0000000
177 
178 
179 /* Description		ALT_TX_PWR
180 
181 			Coex related AlternativeTransmit parameter
182 
183 			Transmit Power in s6.2 format.
184 			In units of 0.25 dBm
185 			<legal all>
186 */
187 
188 #define COEX_TX_REQ_ALT_TX_PWR_OFFSET                                               0x0000000000000000
189 #define COEX_TX_REQ_ALT_TX_PWR_LSB                                                  32
190 #define COEX_TX_REQ_ALT_TX_PWR_MSB                                                  39
191 #define COEX_TX_REQ_ALT_TX_PWR_MASK                                                 0x000000ff00000000
192 
193 
194 /* Description		ALT_MIN_TX_PWR
195 
196 			Coex related Alternative Transmit parameter
197 
198 			Minimum allowed Transmit Power in s6.2 format.
199 			In units of 0.25 dBm
200 			<legal all>
201 */
202 
203 #define COEX_TX_REQ_ALT_MIN_TX_PWR_OFFSET                                           0x0000000000000000
204 #define COEX_TX_REQ_ALT_MIN_TX_PWR_LSB                                              40
205 #define COEX_TX_REQ_ALT_MIN_TX_PWR_MSB                                              47
206 #define COEX_TX_REQ_ALT_MIN_TX_PWR_MASK                                             0x0000ff0000000000
207 
208 
209 /* Description		ALT_NSS
210 
211 			Coex related Alternative Transmit parameter
212 
213 			Number of spatial streams.
214 
215 			<enum 0 1_spatial_stream>Single spatial stream
216 			<enum 1 2_spatial_streams>2 spatial streams
217 			<enum 2 3_spatial_streams>3 spatial streams
218 			<enum 3 4_spatial_streams>4 spatial streams
219 			<enum 4 5_spatial_streams>5 spatial streams
220 			<enum 5 6_spatial_streams>6 spatial streams
221 			<enum 6 7_spatial_streams>7 spatial streams
222 			<enum 7 8_spatial_streams>8 spatial streams
223 */
224 
225 #define COEX_TX_REQ_ALT_NSS_OFFSET                                                  0x0000000000000000
226 #define COEX_TX_REQ_ALT_NSS_LSB                                                     48
227 #define COEX_TX_REQ_ALT_NSS_MSB                                                     50
228 #define COEX_TX_REQ_ALT_NSS_MASK                                                    0x0007000000000000
229 
230 
231 /* Description		ALT_TX_CHAIN_MASK
232 
233 			Coex related Alternative Transmit parameter
234 
235 			Chain mask to support up to 8 antennas.
236 
237 			<legal 1-255>
238 */
239 
240 #define COEX_TX_REQ_ALT_TX_CHAIN_MASK_OFFSET                                        0x0000000000000000
241 #define COEX_TX_REQ_ALT_TX_CHAIN_MASK_LSB                                           51
242 #define COEX_TX_REQ_ALT_TX_CHAIN_MASK_MSB                                           58
243 #define COEX_TX_REQ_ALT_TX_CHAIN_MASK_MASK                                          0x07f8000000000000
244 
245 
246 /* Description		ALT_BW
247 
248 			Coex related Alternative Transmit parameter.
249 
250 			The BW of the upcoming transmission.
251 
252 			<enum 0 20_mhz>20 Mhz BW
253 			<enum 1 40_mhz>40 Mhz BW
254 			<enum 2 80_mhz>80 Mhz BW
255 			<enum 3 160_mhz>160 Mhz BW
256 			<enum 4 320_mhz>320 Mhz BW
257 			<enum 5 240_mhz>240 Mhz BW
258 */
259 
260 #define COEX_TX_REQ_ALT_BW_OFFSET                                                   0x0000000000000000
261 #define COEX_TX_REQ_ALT_BW_LSB                                                      59
262 #define COEX_TX_REQ_ALT_BW_MSB                                                      61
263 #define COEX_TX_REQ_ALT_BW_MASK                                                     0x3800000000000000
264 
265 
266 /* Description		RESERVED_1
267 
268 			<legal 0>
269 */
270 
271 #define COEX_TX_REQ_RESERVED_1_OFFSET                                               0x0000000000000000
272 #define COEX_TX_REQ_RESERVED_1_LSB                                                  62
273 #define COEX_TX_REQ_RESERVED_1_MSB                                                  63
274 #define COEX_TX_REQ_RESERVED_1_MASK                                                 0xc000000000000000
275 
276 
277 /* Description		TX_PWR_1
278 
279 			Default (desired) transmit parameter for the second chain
280 
281 
282 			Transmit Power in s6.2 format.
283 			In units of 0.25 dBm
284 
285 			Note that there is no Min value for this
286 			<legal all>
287 */
288 
289 #define COEX_TX_REQ_TX_PWR_1_OFFSET                                                 0x0000000000000008
290 #define COEX_TX_REQ_TX_PWR_1_LSB                                                    0
291 #define COEX_TX_REQ_TX_PWR_1_MSB                                                    7
292 #define COEX_TX_REQ_TX_PWR_1_MASK                                                   0x00000000000000ff
293 
294 
295 /* Description		ALT_TX_PWR_1
296 
297 			Alternate (desired) transmit parameter for the second chain
298 
299 
300 			Transmit Power in s6.2 format.
301 			In units of 0.25 dBm
302 
303 			Note that there is no Min value for this
304 			<legal all>
305 */
306 
307 #define COEX_TX_REQ_ALT_TX_PWR_1_OFFSET                                             0x0000000000000008
308 #define COEX_TX_REQ_ALT_TX_PWR_1_LSB                                                8
309 #define COEX_TX_REQ_ALT_TX_PWR_1_MSB                                                15
310 #define COEX_TX_REQ_ALT_TX_PWR_1_MASK                                               0x000000000000ff00
311 
312 
313 /* Description		WLAN_REQUEST_DURATION
314 
315 			The amount of time PDG might use for the upcoming transmission
316 			 and corresponding reception if there is one...
317 			<legal all>
318 */
319 
320 #define COEX_TX_REQ_WLAN_REQUEST_DURATION_OFFSET                                    0x0000000000000008
321 #define COEX_TX_REQ_WLAN_REQUEST_DURATION_LSB                                       16
322 #define COEX_TX_REQ_WLAN_REQUEST_DURATION_MSB                                       31
323 #define COEX_TX_REQ_WLAN_REQUEST_DURATION_MASK                                      0x00000000ffff0000
324 
325 
326 /* Description		WLAN_PKT_TYPE
327 
328 			Packet type:
329 			<enum 0 dot11a>802.11a PPDU type
330 			<enum 1 dot11b>802.11b PPDU type
331 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
332 			<enum 3 dot11ac>802.11ac PPDU type
333 			<enum 4 dot11ax>802.11ax PPDU type
334 			<enum 5 dot11ba>802.11ba (WUR) PPDU type
335 			<enum 6 dot11be>802.11be PPDU type
336 			<enum 7 dot11az>802.11az (ranging) PPDU type
337 			<enum 8 dot11n_gf>802.11n Green Field PPDU type (unsupported
338 			 & aborted)
339 */
340 
341 #define COEX_TX_REQ_WLAN_PKT_TYPE_OFFSET                                            0x0000000000000008
342 #define COEX_TX_REQ_WLAN_PKT_TYPE_LSB                                               32
343 #define COEX_TX_REQ_WLAN_PKT_TYPE_MSB                                               35
344 #define COEX_TX_REQ_WLAN_PKT_TYPE_MASK                                              0x0000000f00000000
345 
346 
347 /* Description		COEX_TX_REASON
348 
349 			<enum 0     cxc_fes_protection_frame>  RTS, CTS2Self or
350 			11h protection type transmission preceding the regular PPDU
351 			 portion of the coming FES.
352 			<enum 1     cxc_fes_after_protection >  Regular PPDU transmission
353 			 that follows the transmission of medium protection frames:.
354 
355 			<enum 2     cxc_fes_only>  Regular PPDU transmission without
356 			 preceding medium protection frame exchanges.
357 
358 			<enum 3 cxc_response_frame>
359 			HW generated response frame.
360 			Details of the response frame type provided in field: Response_frame_type
361 
362 
363 			<legal 0-3>
364 */
365 
366 #define COEX_TX_REQ_COEX_TX_REASON_OFFSET                                           0x0000000000000008
367 #define COEX_TX_REQ_COEX_TX_REASON_LSB                                              36
368 #define COEX_TX_REQ_COEX_TX_REASON_MSB                                              37
369 #define COEX_TX_REQ_COEX_TX_REASON_MASK                                             0x0000003000000000
370 
371 
372 /* Description		RESPONSE_FRAME_TYPE
373 
374 			Coex related field
375 			<enum 0 Resp_Non_11ah_ACK >
376 			<enum 1 Resp_Non_11ah_BA >
377 			<enum 2 Resp_Non_11ah_CTS >
378 			<enum 3 Resp_AH_NDP_CTS>
379 			<enum 4 Resp_AH_NDP_ACK>
380 			<enum 5 Resp_AH_NDP_BA>
381 			<enum 6 Resp_AH_NDP_MOD_ACK>
382 			<enum 7 Resp_AH_Normal_ACK>
383 			<enum 8 Resp_AH_Normal_BA>
384 			<enum 9  Resp_RTT_ACK>
385 			<enum 10 Resp_CBF_RESPONSE>
386 			<enum 11 Resp_MBA>
387 			<enum 12 Resp_Ranging_NDP>
388 			<enum 13 Resp_LMR_RESPONSE>
389 			<enum 14 Resp_TRIGGER_RESPONSE_BASIC>
390 			<enum 15 Resp_TRIGGER_RESPONSE_BUF_SIZE>
391 			<enum 16 Resp_TRIGGER_RESPONSE_BRPOLL>
392 			<enum 17 Resp_TRIGGER_RESPONSE_CTS>
393 			<enum 18 Resp_TRIGGER_RESPONSE_OTHER>
394 
395 			<legal 0-18>
396 */
397 
398 #define COEX_TX_REQ_RESPONSE_FRAME_TYPE_OFFSET                                      0x0000000000000008
399 #define COEX_TX_REQ_RESPONSE_FRAME_TYPE_LSB                                         38
400 #define COEX_TX_REQ_RESPONSE_FRAME_TYPE_MSB                                         42
401 #define COEX_TX_REQ_RESPONSE_FRAME_TYPE_MASK                                        0x000007c000000000
402 
403 
404 /* Description		WLAN_LOW_PRIORITY_SLICING_ALLOWED
405 
406 			When set, COEX is allowed to invoke 'tx slicing' algorithms
407 			 when WLAN tx is low priority when compared to BT activity,
408 			to get to more optimal throughput. Value 0 will disable
409 			this feature
410 			<legal all>
411 */
412 
413 #define COEX_TX_REQ_WLAN_LOW_PRIORITY_SLICING_ALLOWED_OFFSET                        0x0000000000000008
414 #define COEX_TX_REQ_WLAN_LOW_PRIORITY_SLICING_ALLOWED_LSB                           43
415 #define COEX_TX_REQ_WLAN_LOW_PRIORITY_SLICING_ALLOWED_MSB                           43
416 #define COEX_TX_REQ_WLAN_LOW_PRIORITY_SLICING_ALLOWED_MASK                          0x0000080000000000
417 
418 
419 /* Description		WLAN_HIGH_PRIORITY_SLICING_ALLOWED
420 
421 			When set, COEX is allowed to invoke 'tx slicing' algorithms
422 			 when WLAN tx is high priority when compared to BT activity,
423 			to get to more optimal throughput. Value 0 will disable
424 			this feature.
425 			<legal all>
426 */
427 
428 #define COEX_TX_REQ_WLAN_HIGH_PRIORITY_SLICING_ALLOWED_OFFSET                       0x0000000000000008
429 #define COEX_TX_REQ_WLAN_HIGH_PRIORITY_SLICING_ALLOWED_LSB                          44
430 #define COEX_TX_REQ_WLAN_HIGH_PRIORITY_SLICING_ALLOWED_MSB                          44
431 #define COEX_TX_REQ_WLAN_HIGH_PRIORITY_SLICING_ALLOWED_MASK                         0x0000100000000000
432 
433 
434 /* Description		SCH_TX_BURST_ONGOING
435 
436 			0: No action
437 			1: The next scheduling command needs to start at SIFS time
438 			 after finishing the frame transmissions in this command.
439 			This allows for SIFS based bursting
440 			<legal all>
441 */
442 
443 #define COEX_TX_REQ_SCH_TX_BURST_ONGOING_OFFSET                                     0x0000000000000008
444 #define COEX_TX_REQ_SCH_TX_BURST_ONGOING_LSB                                        45
445 #define COEX_TX_REQ_SCH_TX_BURST_ONGOING_MSB                                        45
446 #define COEX_TX_REQ_SCH_TX_BURST_ONGOING_MASK                                       0x0000200000000000
447 
448 
449 /* Description		COEX_TX_PRIORITY
450 
451 			Transmit priority. Used for Coex weight table look up in
452 			 case of regular FES transmission. This value is typically
453 			 programmed in relationship to the backoff engine. In case
454 			 of self_gen tx,  the value comes from a programmable register
455 			 in the TXPCU. For BA and ACK packets, this is related to
456 			 AC of the incoming frame. .
457 
458 			For a request type of "fes", the field is copied over from
459 			 the scheduling command TLV.
460 			<legal all>
461 */
462 
463 #define COEX_TX_REQ_COEX_TX_PRIORITY_OFFSET                                         0x0000000000000008
464 #define COEX_TX_REQ_COEX_TX_PRIORITY_LSB                                            46
465 #define COEX_TX_REQ_COEX_TX_PRIORITY_MSB                                            49
466 #define COEX_TX_REQ_COEX_TX_PRIORITY_MASK                                           0x0003c00000000000
467 
468 
469 /* Description		RESERVED_3A
470 
471 			<legal 0>
472 */
473 
474 #define COEX_TX_REQ_RESERVED_3A_OFFSET                                              0x0000000000000008
475 #define COEX_TX_REQ_RESERVED_3A_LSB                                                 50
476 #define COEX_TX_REQ_RESERVED_3A_MSB                                                 63
477 #define COEX_TX_REQ_RESERVED_3A_MASK                                                0xfffc000000000000
478 
479 
480 
481 #endif   // COEX_TX_REQ
482