xref: /wlan-driver/fw-api/hw/qca5332/pdg_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 _PDG_TX_REQ_H_
27 #define _PDG_TX_REQ_H_
28 #if !defined(__ASSEMBLER__)
29 #endif
30 
31 #define NUM_OF_DWORDS_PDG_TX_REQ 2
32 
33 #define NUM_OF_QWORDS_PDG_TX_REQ 1
34 
35 
36 struct pdg_tx_req {
37 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
38              uint32_t tx_reason                                               :  2, // [1:0]
39                       use_puncture_pattern                                    :  2, // [3:2]
40                       req_bw                                                  :  3, // [6:4]
41                       puncture_pattern_number                                 :  6, // [12:7]
42                       reserved_0b                                             :  1, // [13:13]
43                       req_paprd                                               :  1, // [14:14]
44                       duration_field_boundary_valid                           :  1, // [15:15]
45                       duration_field_boundary                                 : 16; // [31:16]
46              uint32_t puncture_subband_mask                                   : 16, // [15:0]
47                       reserved_0c                                             : 16; // [31:16]
48 #else
49              uint32_t duration_field_boundary                                 : 16, // [31:16]
50                       duration_field_boundary_valid                           :  1, // [15:15]
51                       req_paprd                                               :  1, // [14:14]
52                       reserved_0b                                             :  1, // [13:13]
53                       puncture_pattern_number                                 :  6, // [12:7]
54                       req_bw                                                  :  3, // [6:4]
55                       use_puncture_pattern                                    :  2, // [3:2]
56                       tx_reason                                               :  2; // [1:0]
57              uint32_t reserved_0c                                             : 16, // [31:16]
58                       puncture_subband_mask                                   : 16; // [15:0]
59 #endif
60 };
61 
62 
63 /* Description		TX_REASON
64 
65 			<enum 0     tx_fes_protection_frame>  RTS, CTS2Self or 11h
66 			 protection type transmission preceding the regular PPDU
67 			 portion of the coming FES.
68 			<enum 1     tx_fes_after_protection >  Regular PPDU transmission
69 			 that follows the transmission of medium protection frames:.
70 
71 			<enum 2     tx_fes_only>  Regular PPDU transmission without
72 			 preceding medium protection frame exchanges.
73 
74 			Note: Response frame transmissions are initiated with the
75 			 PDG_RESPONSE TLV
76 
77 			<legal 0-2>
78 */
79 
80 #define PDG_TX_REQ_TX_REASON_OFFSET                                                 0x0000000000000000
81 #define PDG_TX_REQ_TX_REASON_LSB                                                    0
82 #define PDG_TX_REQ_TX_REASON_MSB                                                    1
83 #define PDG_TX_REQ_TX_REASON_MASK                                                   0x0000000000000003
84 
85 
86 /* Description		USE_PUNCTURE_PATTERN
87 
88 			When set, the transmission is based on puncture pattern
89 			selection
90 			<enum 0 NO_PUNCTURE> No puncturing
91 			<enum 1 PUNCTURE_FROM_TX_SETUP> Scheme 1 puncturing using
92 			 'TX_PUNCTURE_SETUP' settings
93 			<enum 2 PUNCTURE_RESPONSE_FROM_RX> DO NOT USE
94 			<enum 3 PUNCTURE_FROM_ALL_ALLOWED_MODES> New scheme 2 puncturing
95 			 in Beryllium based on the field puncture_subband_mask selected
96 			 from up to 37 allowed modes in TXPCU registers
97 			<legal 0-3>
98 */
99 
100 #define PDG_TX_REQ_USE_PUNCTURE_PATTERN_OFFSET                                      0x0000000000000000
101 #define PDG_TX_REQ_USE_PUNCTURE_PATTERN_LSB                                         2
102 #define PDG_TX_REQ_USE_PUNCTURE_PATTERN_MSB                                         3
103 #define PDG_TX_REQ_USE_PUNCTURE_PATTERN_MASK                                        0x000000000000000c
104 
105 
106 /* Description		REQ_BW
107 
108 			Field not valid when use_puncture_pattern is set to PUNCTURE_FROM_TX_SETUP
109 
110 
111 			The BW of the upcoming transmission.
112 			Note: Coex might have changed this from the original request.
113 
114 
115 			<enum 0 20_mhz>20 Mhz BW
116 			<enum 1 40_mhz>40 Mhz BW
117 			<enum 2 80_mhz>80 Mhz BW
118 			<enum 3 160_mhz>160 Mhz BW
119 			<enum 4 320_mhz>320 Mhz BW
120 			<enum 5 240_mhz>240 Mhz BW
121 */
122 
123 #define PDG_TX_REQ_REQ_BW_OFFSET                                                    0x0000000000000000
124 #define PDG_TX_REQ_REQ_BW_LSB                                                       4
125 #define PDG_TX_REQ_REQ_BW_MSB                                                       6
126 #define PDG_TX_REQ_REQ_BW_MASK                                                      0x0000000000000070
127 
128 
129 /* Description		PUNCTURE_PATTERN_NUMBER
130 
131 			Field only valid when "use_puncture_pattern" is set.
132 
133 			The pattern number in case punctured transmission is enabled
134 
135 			<legal all>
136 */
137 
138 #define PDG_TX_REQ_PUNCTURE_PATTERN_NUMBER_OFFSET                                   0x0000000000000000
139 #define PDG_TX_REQ_PUNCTURE_PATTERN_NUMBER_LSB                                      7
140 #define PDG_TX_REQ_PUNCTURE_PATTERN_NUMBER_MSB                                      12
141 #define PDG_TX_REQ_PUNCTURE_PATTERN_NUMBER_MASK                                     0x0000000000001f80
142 
143 
144 /* Description		RESERVED_0B
145 
146 			<legal 0>
147 */
148 
149 #define PDG_TX_REQ_RESERVED_0B_OFFSET                                               0x0000000000000000
150 #define PDG_TX_REQ_RESERVED_0B_LSB                                                  13
151 #define PDG_TX_REQ_RESERVED_0B_MSB                                                  13
152 #define PDG_TX_REQ_RESERVED_0B_MASK                                                 0x0000000000002000
153 
154 
155 /* Description		REQ_PAPRD
156 
157 			Indicate this is a 'PAPRD' packet request. Exist in NS,
158 			Helium?
159 			This is a calibration related request.
160 			Field copied over from the scheduling command TLV.
161 
162 			TODO: check the usage
163 			 <legal 0>
164 */
165 
166 #define PDG_TX_REQ_REQ_PAPRD_OFFSET                                                 0x0000000000000000
167 #define PDG_TX_REQ_REQ_PAPRD_LSB                                                    14
168 #define PDG_TX_REQ_REQ_PAPRD_MSB                                                    14
169 #define PDG_TX_REQ_REQ_PAPRD_MASK                                                   0x0000000000004000
170 
171 
172 /* Description		DURATION_FIELD_BOUNDARY_VALID
173 
174 			When set, PDG should take the 'duration_field_boundary'
175 			value into account when it is calculating the TX and RX
176 			boundaries for the upcoming transmission. Both RX and TX
177 			 should not go beyond this time duration provided.
178 
179 			<legal all>
180 */
181 
182 #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_VALID_OFFSET                             0x0000000000000000
183 #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_VALID_LSB                                15
184 #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_VALID_MSB                                15
185 #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_VALID_MASK                               0x0000000000008000
186 
187 
188 /* Description		DURATION_FIELD_BOUNDARY
189 
190 			Field only valid when 'Duration_field_boundary_valid' is
191 			 set
192 
193 			Amount of time to both TX and RX boundaries that PDG should
194 			 take into account for the upcoming transmission.
195 			<legal all>
196 */
197 
198 #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_OFFSET                                   0x0000000000000000
199 #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_LSB                                      16
200 #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_MSB                                      31
201 #define PDG_TX_REQ_DURATION_FIELD_BOUNDARY_MASK                                     0x00000000ffff0000
202 
203 
204 /* Description		PUNCTURE_SUBBAND_MASK
205 
206 			Field only valid when use_puncture_pattern is set to PUNCTURE_FROM_ALL_ALLOWED_MODES
207 
208 
209 			This mask indicates which 20 Mhz channels are actively used
210 			 in this transmission.
211 
212 			Bit 0: primary 20 Mhz
213 			Bit 1: secondary 20 MHz
214 			Etc.
215 			<legal all>
216 */
217 
218 #define PDG_TX_REQ_PUNCTURE_SUBBAND_MASK_OFFSET                                     0x0000000000000000
219 #define PDG_TX_REQ_PUNCTURE_SUBBAND_MASK_LSB                                        32
220 #define PDG_TX_REQ_PUNCTURE_SUBBAND_MASK_MSB                                        47
221 #define PDG_TX_REQ_PUNCTURE_SUBBAND_MASK_MASK                                       0x0000ffff00000000
222 
223 
224 /* Description		RESERVED_0C
225 
226 			Reserved for future power bits: Generator should set to
227 			0, consumer shall ignore <legal 0>
228 */
229 
230 #define PDG_TX_REQ_RESERVED_0C_OFFSET                                               0x0000000000000000
231 #define PDG_TX_REQ_RESERVED_0C_LSB                                                  48
232 #define PDG_TX_REQ_RESERVED_0C_MSB                                                  63
233 #define PDG_TX_REQ_RESERVED_0C_MASK                                                 0xffff000000000000
234 
235 
236 
237 #endif   // PDG_TX_REQ
238