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