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 _MACTX_U_SIG_EHT_SU_MU_H_
18 #define _MACTX_U_SIG_EHT_SU_MU_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 #include "u_sig_eht_su_mu_info.h"
23 #define NUM_OF_DWORDS_MACTX_U_SIG_EHT_SU_MU 2
24 
25 #define NUM_OF_QWORDS_MACTX_U_SIG_EHT_SU_MU 1
26 
27 
28 struct mactx_u_sig_eht_su_mu {
29 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
30              struct   u_sig_eht_su_mu_info                                      mactx_u_sig_eht_su_mu_info_details;
31 #else
32              struct   u_sig_eht_su_mu_info                                      mactx_u_sig_eht_su_mu_info_details;
33 #endif
34 };
35 
36 
37 /* Description		MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS
38 
39 			See detailed description of the STRUCT
40 */
41 
42 
43 /* Description		PHY_VERSION
44 
45 			<enum 0 U_SIG_VERSION_EHT>
46 			Values 1 - 7 are reserved.
47 			<legal 0
48 */
49 
50 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_PHY_VERSION_OFFSET 0x0000000000000000
51 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_PHY_VERSION_LSB    0
52 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_PHY_VERSION_MSB    2
53 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_PHY_VERSION_MASK   0x0000000000000007
54 
55 
56 /* Description		TRANSMIT_BW
57 
58 			Bandwidth of the PPDU
59 
60 			<enum 0 U_SIG_BW20> 20 MHz
61 			<enum 1 U_SIG_BW40> 40 MHz
62 			<enum 2 U_SIG_BW80> 80 MHz
63 			<enum 3 U_SIG_BW160> 160 MHz
64 			<enum 4 U_SIG_BW320> 320 MHz
65 			<enum 5 U_SIG_BW320_2> DO NOT USE
66 
67 			Microcode remaps 'U_SIG_BW320' based on channelization.
68 
69 			On RX side, field used by MAC HW
70 			<legal all>
71 */
72 
73 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TRANSMIT_BW_OFFSET 0x0000000000000000
74 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TRANSMIT_BW_LSB    3
75 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TRANSMIT_BW_MSB    5
76 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TRANSMIT_BW_MASK   0x0000000000000038
77 
78 
79 /* Description		DL_UL_FLAG
80 
81 			Differentiates between DL and UL transmission
82 
83 			<enum 0 DL_UL_FLAG_IS_DL_OR_TDLS>
84 			<enum 1 DL_UL_FLAG_IS_UL>
85 			<legal all>
86 */
87 
88 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DL_UL_FLAG_OFFSET  0x0000000000000000
89 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DL_UL_FLAG_LSB     6
90 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DL_UL_FLAG_MSB     6
91 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DL_UL_FLAG_MASK    0x0000000000000040
92 
93 
94 /* Description		BSS_COLOR_ID
95 
96 			BSS color ID
97 
98 			Field used by MAC HW
99 			<legal all>
100 */
101 
102 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_BSS_COLOR_ID_OFFSET 0x0000000000000000
103 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_BSS_COLOR_ID_LSB   7
104 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_BSS_COLOR_ID_MSB   12
105 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_BSS_COLOR_ID_MASK  0x0000000000001f80
106 
107 
108 /* Description		TXOP_DURATION
109 
110 			Indicates the remaining time in the current TXOP
111 
112 			Field used by MAC HW
113 			 <legal all>
114 */
115 
116 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TXOP_DURATION_OFFSET 0x0000000000000000
117 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TXOP_DURATION_LSB  13
118 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TXOP_DURATION_MSB  19
119 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TXOP_DURATION_MASK 0x00000000000fe000
120 
121 
122 /* Description		DISREGARD_0A
123 
124 			Note: spec indicates this shall be set to 1s
125 			<legal 31>
126 */
127 
128 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DISREGARD_0A_OFFSET 0x0000000000000000
129 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DISREGARD_0A_LSB   20
130 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DISREGARD_0A_MSB   24
131 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DISREGARD_0A_MASK  0x0000000001f00000
132 
133 
134 /* Description		VALIDATE_0B
135 
136 			Note: spec indicates this shall be set to 1
137 			<legal 1>
138 */
139 
140 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_0B_OFFSET 0x0000000000000000
141 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_0B_LSB    25
142 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_0B_MSB    25
143 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_0B_MASK   0x0000000002000000
144 
145 
146 /* Description		RESERVED_0C
147 
148 			<legal 0>
149 */
150 
151 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RESERVED_0C_OFFSET 0x0000000000000000
152 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RESERVED_0C_LSB    26
153 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RESERVED_0C_MSB    31
154 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RESERVED_0C_MASK   0x00000000fc000000
155 
156 
157 /* Description		EHT_PPDU_SIG_CMN_TYPE
158 
159 			<enum 3 EHT_PPDU_SIG_rsvd> DO NOT USE
160 			<enum 0 EHT_PPDU_SIG_TB_or_DL_OFDMA> Need to look at both
161 			 EHT-SIG content channels for DL OFDMA (including OFDMA+MU-MIMO)
162 
163 			<enum 2 EHT_PPDU_SIG_DL_MU_MIMO> Need to look at both EHT-SIG
164 			 content channels
165 			<enum 1 EHT_PPDU_SIG_SU> Need to look at only one EHT-SIG
166 			 content channel
167 			<legal all>
168 */
169 
170 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_EHT_PPDU_SIG_CMN_TYPE_OFFSET 0x0000000000000000
171 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_EHT_PPDU_SIG_CMN_TYPE_LSB 32
172 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_EHT_PPDU_SIG_CMN_TYPE_MSB 33
173 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_EHT_PPDU_SIG_CMN_TYPE_MASK 0x0000000300000000
174 
175 
176 /* Description		VALIDATE_1A
177 
178 			Note: spec indicates this shall be set to 1
179 			<legal 1>
180 */
181 
182 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_1A_OFFSET 0x0000000000000000
183 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_1A_LSB    34
184 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_1A_MSB    34
185 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_1A_MASK   0x0000000400000000
186 
187 
188 /* Description		PUNCTURED_CHANNEL_INFORMATION
189 
190 			For OFDMA BW 20 MHz or 40 MHz:
191 			Set to all 1s, i.e. 31
192 
193 			For OFDMA of higher BW:
194 			Bit 3 = lowest 20 MHz in the current 80 MHz
195 			Bit 6 = highest 20 MHz in the current 80 MHz
196 			Bit 7 = 1
197 
198 			Each bit indicates whether the 20 MHz is modulated or punctured
199 
200 			0 = punctured
201 			1 = modulated
202 
203 			For non-OFDMA:
204 			Set to a 5-bit value encoding the puncture pattern, a.k.a. 'U_sig_puncture_pattern_encoding'
205 			elsewhere in the data structures
206 
207 			<legal all>
208 */
209 
210 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_PUNCTURED_CHANNEL_INFORMATION_OFFSET 0x0000000000000000
211 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_PUNCTURED_CHANNEL_INFORMATION_LSB 35
212 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_PUNCTURED_CHANNEL_INFORMATION_MSB 39
213 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_PUNCTURED_CHANNEL_INFORMATION_MASK 0x000000f800000000
214 
215 
216 /* Description		VALIDATE_1B
217 
218 			Note: spec indicates this shall be set to 1
219 			<legal 1>
220 */
221 
222 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_1B_OFFSET 0x0000000000000000
223 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_1B_LSB    40
224 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_1B_MSB    40
225 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_VALIDATE_1B_MASK   0x0000010000000000
226 
227 
228 /* Description		MCS_OF_EHT_SIG
229 
230 			Indicates the MCS of EHT-SIG
231 			0 - 1: MCS 0 - 1
232 			2: MCS 3
233 			3: MCS 0 with DCM
234 			<legal all>
235 */
236 
237 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_MCS_OF_EHT_SIG_OFFSET 0x0000000000000000
238 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_MCS_OF_EHT_SIG_LSB 41
239 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_MCS_OF_EHT_SIG_MSB 42
240 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_MCS_OF_EHT_SIG_MASK 0x0000060000000000
241 
242 
243 /* Description		NUM_EHT_SIG_SYMBOLS
244 
245 			Number of symbols
246 
247 			The actual number of symbols is 1 larger than indicated
248 			in this field.
249 
250 			<legal all>
251 */
252 
253 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_NUM_EHT_SIG_SYMBOLS_OFFSET 0x0000000000000000
254 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_NUM_EHT_SIG_SYMBOLS_LSB 43
255 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_NUM_EHT_SIG_SYMBOLS_MSB 47
256 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_NUM_EHT_SIG_SYMBOLS_MASK 0x0000f80000000000
257 
258 
259 /* Description		CRC
260 
261 			CRC for U-SIG contents
262 			<legal all>
263 */
264 
265 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_CRC_OFFSET         0x0000000000000000
266 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_CRC_LSB            48
267 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_CRC_MSB            51
268 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_CRC_MASK           0x000f000000000000
269 
270 
271 /* Description		TAIL
272 
273 			<legal 0>
274 */
275 
276 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TAIL_OFFSET        0x0000000000000000
277 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TAIL_LSB           52
278 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TAIL_MSB           57
279 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_TAIL_MASK          0x03f0000000000000
280 
281 
282 /* Description		DOT11AX_SU_EXTENDED
283 
284 			TX side:
285 			Set to 0
286 
287 			RX side: On RX side, evaluated by MAC HW
288 
289 			This is the only way for MAC RX to know that this was a
290 			U_SIG_EHT_SU received in extended range format.
291 
292 			When set, the 11be frame is of the extended range format.
293 
294 			<legal all>
295 */
296 
297 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DOT11AX_SU_EXTENDED_OFFSET 0x0000000000000000
298 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DOT11AX_SU_EXTENDED_LSB 58
299 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DOT11AX_SU_EXTENDED_MSB 58
300 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_DOT11AX_SU_EXTENDED_MASK 0x0400000000000000
301 
302 
303 /* Description		RESERVED_1D
304 
305 			<legal 0>
306 */
307 
308 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RESERVED_1D_OFFSET 0x0000000000000000
309 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RESERVED_1D_LSB    59
310 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RESERVED_1D_MSB    61
311 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RESERVED_1D_MASK   0x3800000000000000
312 
313 
314 /* Description		RX_NDP
315 
316 			TX side:
317 			Set to 0
318 
319 			RX side: On RX side, looked at by MAC HW
320 
321 			When set, PHY has received an (expected) NDP frame
322 			<legal all>
323 */
324 
325 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RX_NDP_OFFSET      0x0000000000000000
326 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RX_NDP_LSB         62
327 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RX_NDP_MSB         62
328 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RX_NDP_MASK        0x4000000000000000
329 
330 
331 /* Description		RX_INTEGRITY_CHECK_PASSED
332 
333 			TX side: Set to 0
334 			RX side: Set to 1 if PHY determines the U-SIG CRC check
335 			has passed, else set to 0
336 
337 			<legal all>
338 */
339 
340 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RX_INTEGRITY_CHECK_PASSED_OFFSET 0x0000000000000000
341 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RX_INTEGRITY_CHECK_PASSED_LSB 63
342 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RX_INTEGRITY_CHECK_PASSED_MSB 63
343 #define MACTX_U_SIG_EHT_SU_MU_MACTX_U_SIG_EHT_SU_MU_INFO_DETAILS_RX_INTEGRITY_CHECK_PASSED_MASK 0x8000000000000000
344 
345 
346 
347 #endif   // MACTX_U_SIG_EHT_SU_MU
348