xref: /wlan-driver/fw-api/hw/qca5332/vht_sig_a_info.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 _VHT_SIG_A_INFO_H_
27 #define _VHT_SIG_A_INFO_H_
28 #if !defined(__ASSEMBLER__)
29 #endif
30 
31 #define NUM_OF_DWORDS_VHT_SIG_A_INFO 2
32 
33 
34 struct vht_sig_a_info {
35 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
36              uint32_t bandwidth                                               :  2, // [1:0]
37                       vhta_reserved_0                                         :  1, // [2:2]
38                       stbc                                                    :  1, // [3:3]
39                       group_id                                                :  6, // [9:4]
40                       n_sts                                                   : 12, // [21:10]
41                       txop_ps_not_allowed                                     :  1, // [22:22]
42                       vhta_reserved_0b                                        :  1, // [23:23]
43                       reserved_0                                              :  8; // [31:24]
44              uint32_t gi_setting                                              :  2, // [1:0]
45                       su_mu_coding                                            :  1, // [2:2]
46                       ldpc_extra_symbol                                       :  1, // [3:3]
47                       mcs                                                     :  4, // [7:4]
48                       beamformed                                              :  1, // [8:8]
49                       vhta_reserved_1                                         :  1, // [9:9]
50                       crc                                                     :  8, // [17:10]
51                       tail                                                    :  6, // [23:18]
52                       reserved_1                                              :  7, // [30:24]
53                       rx_integrity_check_passed                               :  1; // [31:31]
54 #else
55              uint32_t reserved_0                                              :  8, // [31:24]
56                       vhta_reserved_0b                                        :  1, // [23:23]
57                       txop_ps_not_allowed                                     :  1, // [22:22]
58                       n_sts                                                   : 12, // [21:10]
59                       group_id                                                :  6, // [9:4]
60                       stbc                                                    :  1, // [3:3]
61                       vhta_reserved_0                                         :  1, // [2:2]
62                       bandwidth                                               :  2; // [1:0]
63              uint32_t rx_integrity_check_passed                               :  1, // [31:31]
64                       reserved_1                                              :  7, // [30:24]
65                       tail                                                    :  6, // [23:18]
66                       crc                                                     :  8, // [17:10]
67                       vhta_reserved_1                                         :  1, // [9:9]
68                       beamformed                                              :  1, // [8:8]
69                       mcs                                                     :  4, // [7:4]
70                       ldpc_extra_symbol                                       :  1, // [3:3]
71                       su_mu_coding                                            :  1, // [2:2]
72                       gi_setting                                              :  2; // [1:0]
73 #endif
74 };
75 
76 
77 /* Description		BANDWIDTH
78 
79 			Packet bandwidth
80 
81 			<enum 0    20_MHZ_11AC>
82 			<enum 1    40_MHZ_11AC>
83 			<enum 2    80_MHZ_11AC>
84 			<enum 3    160_MHZ_11AC>
85 
86 			<legal 0-3>
87 */
88 
89 #define VHT_SIG_A_INFO_BANDWIDTH_OFFSET                                             0x00000000
90 #define VHT_SIG_A_INFO_BANDWIDTH_LSB                                                0
91 #define VHT_SIG_A_INFO_BANDWIDTH_MSB                                                1
92 #define VHT_SIG_A_INFO_BANDWIDTH_MASK                                               0x00000003
93 
94 
95 /* Description		VHTA_RESERVED_0
96 
97 			Reserved.  Set to 1 by MAC, PHY should ignore
98 			<legal 1>
99 */
100 
101 #define VHT_SIG_A_INFO_VHTA_RESERVED_0_OFFSET                                       0x00000000
102 #define VHT_SIG_A_INFO_VHTA_RESERVED_0_LSB                                          2
103 #define VHT_SIG_A_INFO_VHTA_RESERVED_0_MSB                                          2
104 #define VHT_SIG_A_INFO_VHTA_RESERVED_0_MASK                                         0x00000004
105 
106 
107 /* Description		STBC
108 
109 			Space time block coding:
110 			<enum 0     stbc_disabled>  Indicates STBC is disabled
111 			<enum 1     stbc_enabled>  Indicates STBC is enabled on
112 			all streams
113 			<legal 0-1>
114 */
115 
116 #define VHT_SIG_A_INFO_STBC_OFFSET                                                  0x00000000
117 #define VHT_SIG_A_INFO_STBC_LSB                                                     3
118 #define VHT_SIG_A_INFO_STBC_MSB                                                     3
119 #define VHT_SIG_A_INFO_STBC_MASK                                                    0x00000008
120 
121 
122 /* Description		GROUP_ID
123 
124 			In a SU VHT PPDU, if the PPDU carries MPDU(s) addressed
125 			to an AP or to a mesh STA, the Group ID field is set to
126 			0, otherwise it is set to 63.  In an NDP PPDU the Group
127 			ID is set according to IEEE 802.11ac_D1.0 Section 9.30.6
128 			 (Transmission of a VHT NDP). For a MU-MIMO PPDU the Group
129 			 ID is set as in 802.11ac_D1.0 Section 22.3.11.3 (Group
130 			ID).  <legal all>
131 */
132 
133 #define VHT_SIG_A_INFO_GROUP_ID_OFFSET                                              0x00000000
134 #define VHT_SIG_A_INFO_GROUP_ID_LSB                                                 4
135 #define VHT_SIG_A_INFO_GROUP_ID_MSB                                                 9
136 #define VHT_SIG_A_INFO_GROUP_ID_MASK                                                0x000003f0
137 
138 
139 /* Description		N_STS
140 
141 			For MU:
142 			3 bits/user with maximum of 4 users (user u uses
143 			vht_sig_a[0][10+3u] - vht_sig_a[0][12+3u]), u = 0, 1, 2,
144 			3)
145 			Set to 0 for 0 space time streams
146 			Set to 1 for 1 space time stream
147 			Set to 2 for 2 space time streams
148 			Set to 3 for 3 space time streams
149 			Set to 4 for 4 space time streams (not supported in Wifi
150 			 3.0)
151 			Values 5-7 are reserved
152 			In this field, references to user "u" should be interpreted
153 			 as MU user "u". As described in the previous chapter in
154 			 this document (see chapter on User number), the MU user
155 			 value for a given client is defined for each MU group that
156 			 the client participates in. The MU user number is not related
157 			 to the internal user number that is used within the BFer.
158 
159 
160 
161 			For SU:
162 			vht_sig_a[0][12:10]
163 			Set to 0 for 1 space time stream
164 			Set to 1 for 2 space time streams
165 			Set to 2 for 3 space time streams
166 			Set to 3 for 4 space time streams
167 			Set to 4 for 5 space time streams
168 			Set to 5 for 6 space time streams
169 			Set to 6 for 7 space time streams
170 			Set to 7 for 8 space time streams
171 
172 			vht_sig_a[0][21:13]
173 			Partial AID:
174 			Set to the value of the TXVECTOR parameter PARTIAL_AID.
175 			Partial AID provides an abbreviated indication of the intended
176 			 recipient(s) of the frame (see IEEE802.11ac_D1.0 Section
177 			 9.17a (Partial AID in VHT PPDUs)).
178 			<legal all>
179 */
180 
181 #define VHT_SIG_A_INFO_N_STS_OFFSET                                                 0x00000000
182 #define VHT_SIG_A_INFO_N_STS_LSB                                                    10
183 #define VHT_SIG_A_INFO_N_STS_MSB                                                    21
184 #define VHT_SIG_A_INFO_N_STS_MASK                                                   0x003ffc00
185 
186 
187 /* Description		TXOP_PS_NOT_ALLOWED
188 
189 			E_num 0     txop_ps_allowed  Not supported: If set to by
190 			 VHT AP if it allows non-AP VHT STAs in TXOP power save
191 			mode to enter Doze state during a TXOP
192 			<enum 1     no_txop_ps_allowed> Otherwise
193 			<legal 1>
194 */
195 
196 #define VHT_SIG_A_INFO_TXOP_PS_NOT_ALLOWED_OFFSET                                   0x00000000
197 #define VHT_SIG_A_INFO_TXOP_PS_NOT_ALLOWED_LSB                                      22
198 #define VHT_SIG_A_INFO_TXOP_PS_NOT_ALLOWED_MSB                                      22
199 #define VHT_SIG_A_INFO_TXOP_PS_NOT_ALLOWED_MASK                                     0x00400000
200 
201 
202 /* Description		VHTA_RESERVED_0B
203 
204 			Reserved: Should be set to 1 by the MAC and ignored by the
205 			 PHY  <legal 1>
206 */
207 
208 #define VHT_SIG_A_INFO_VHTA_RESERVED_0B_OFFSET                                      0x00000000
209 #define VHT_SIG_A_INFO_VHTA_RESERVED_0B_LSB                                         23
210 #define VHT_SIG_A_INFO_VHTA_RESERVED_0B_MSB                                         23
211 #define VHT_SIG_A_INFO_VHTA_RESERVED_0B_MASK                                        0x00800000
212 
213 
214 /* Description		RESERVED_0
215 
216 			This field is not part of HT-SIG:
217 			Reserved: Should be set to 0 by the MAC and ignored by the
218 			 PHY <legal 0>
219 */
220 
221 #define VHT_SIG_A_INFO_RESERVED_0_OFFSET                                            0x00000000
222 #define VHT_SIG_A_INFO_RESERVED_0_LSB                                               24
223 #define VHT_SIG_A_INFO_RESERVED_0_MSB                                               31
224 #define VHT_SIG_A_INFO_RESERVED_0_MASK                                              0xff000000
225 
226 
227 /* Description		GI_SETTING
228 
229 			<enum 0     normal_gi>  Indicates short guard interval is
230 			 not used in the data field
231 			<enum 1     short_gi>  Indicates short guard interval is
232 			 used in the data field
233 			<enum 3     short_gi_ambiguity>  Indicates short guard interval
234 			 is used in the data field and NSYM mod 10 = 9
235 			NSYM is defined in IEEE802.11ac_D1.0 Section 22.4.3 (TXTIME
236 			 and PSDU_LENGTH calculation).
237 			<legal 0,1,3>
238 */
239 
240 #define VHT_SIG_A_INFO_GI_SETTING_OFFSET                                            0x00000004
241 #define VHT_SIG_A_INFO_GI_SETTING_LSB                                               0
242 #define VHT_SIG_A_INFO_GI_SETTING_MSB                                               1
243 #define VHT_SIG_A_INFO_GI_SETTING_MASK                                              0x00000003
244 
245 
246 /* Description		SU_MU_CODING
247 
248 			For an SU PPDU, B2 is set to 0 for BCC, 1 for LDPC For an
249 			 MU PPDU, if the MU[0] NSTS field is nonzero(#6773), then
250 			 B2 indicates the coding used for user 0; set to 0 for BCC
251 			 and 1 for LDPC. If the MU[0] NSTS field is 0, then this
252 			 field is reserved and set to 1
253 */
254 
255 #define VHT_SIG_A_INFO_SU_MU_CODING_OFFSET                                          0x00000004
256 #define VHT_SIG_A_INFO_SU_MU_CODING_LSB                                             2
257 #define VHT_SIG_A_INFO_SU_MU_CODING_MSB                                             2
258 #define VHT_SIG_A_INFO_SU_MU_CODING_MASK                                            0x00000004
259 
260 
261 /* Description		LDPC_EXTRA_SYMBOL
262 
263 			Set to 1 if the LDPC PPDU encoding process (if an SU PPDU),
264 			or at least one LDPC user's PPDU encoding process (if an
265 			 MU PPDU), results in an extra OFDM symbol (or symbols)
266 			as described in 22.3.10.5.4 (LDPC coding) and 22.3.10.5.5
267 			 (Encoding process for MU PPDUs). Set to 0 otherwise.
268 */
269 
270 #define VHT_SIG_A_INFO_LDPC_EXTRA_SYMBOL_OFFSET                                     0x00000004
271 #define VHT_SIG_A_INFO_LDPC_EXTRA_SYMBOL_LSB                                        3
272 #define VHT_SIG_A_INFO_LDPC_EXTRA_SYMBOL_MSB                                        3
273 #define VHT_SIG_A_INFO_LDPC_EXTRA_SYMBOL_MASK                                       0x00000008
274 
275 
276 /* Description		MCS
277 
278 			For SU:
279 			Set to 0 for BPSK 1/2
280 			Set to 1 for QPSK 1/2
281 			Set to 2 for QPSK 3/4
282 			Set to 3 for 16-QAM 1/2
283 			Set to 4 for 16-QAM 3/4
284 			Set to 5 for 64-QAM 2/3
285 			Set to 6 for 64-QAM 3/4
286 			Set to 7 for 64-QAM 5/6
287 			Set to 8 for 256-QAM 3/4
288 			Set to 9 for 256-QAM 5/6
289 			For MU:
290 			If NSTS for user 1 is non-zero, then vht_sig_a[1][4] indicates
291 			 coding for user 1: set to 0 for BCC, 1 for LDPC.
292 			If NSTS for user 1 is set to 0, then vht_sig_a[1][4] is
293 			reserved and set to 1.
294 			If NSTS for user 2 is non-zero, then vht_sig_a[1][5] indicates
295 			 coding for user 2: set to 0 for BCC, 1 for LDPC.
296 			If NSTS for user 2 is set to 0, then vht_sig_a[1][5] is
297 			reserved and set to 1.
298 			If NSTS for user 3 is non-zero, then vht_sig_a[1][6] indicates
299 			 coding for user 3: set to 0 for BCC, 1 for LDPC.
300 			If NSTS for user 3 is set to 0, then vht_sig_a[1][6] is
301 			reserved and set to 1.
302 			vht_sig_a[1][7] is reserved and set to 1
303 			<legal 0-15>
304 */
305 
306 #define VHT_SIG_A_INFO_MCS_OFFSET                                                   0x00000004
307 #define VHT_SIG_A_INFO_MCS_LSB                                                      4
308 #define VHT_SIG_A_INFO_MCS_MSB                                                      7
309 #define VHT_SIG_A_INFO_MCS_MASK                                                     0x000000f0
310 
311 
312 /* Description		BEAMFORMED
313 
314 			For SU:
315 			Set to 1 if a Beamforming steering matrix is applied to
316 			the waveform in an SU transmission as described in IEEE802.11ac_D1.0
317 			 Section 19.3.11.11.2 (Spatial mapping), set to 0 otherwise.
318 
319 			For MU:
320 			Reserved and set to 1
321 			<legal 0-1>
322 */
323 
324 #define VHT_SIG_A_INFO_BEAMFORMED_OFFSET                                            0x00000004
325 #define VHT_SIG_A_INFO_BEAMFORMED_LSB                                               8
326 #define VHT_SIG_A_INFO_BEAMFORMED_MSB                                               8
327 #define VHT_SIG_A_INFO_BEAMFORMED_MASK                                              0x00000100
328 
329 
330 /* Description		VHTA_RESERVED_1
331 
332 			Reserved and set to 1.  <legal 1>
333 */
334 
335 #define VHT_SIG_A_INFO_VHTA_RESERVED_1_OFFSET                                       0x00000004
336 #define VHT_SIG_A_INFO_VHTA_RESERVED_1_LSB                                          9
337 #define VHT_SIG_A_INFO_VHTA_RESERVED_1_MSB                                          9
338 #define VHT_SIG_A_INFO_VHTA_RESERVED_1_MASK                                         0x00000200
339 
340 
341 /* Description		CRC
342 
343 			CRC calculated as in IEEE802.11ac_D1.0 Section 19.3.9.4.4
344 			 (CRC calculation for HTSIG) with C7 in vht_sig_a[1][10],
345 			etc.  <legal all>
346 */
347 
348 #define VHT_SIG_A_INFO_CRC_OFFSET                                                   0x00000004
349 #define VHT_SIG_A_INFO_CRC_LSB                                                      10
350 #define VHT_SIG_A_INFO_CRC_MSB                                                      17
351 #define VHT_SIG_A_INFO_CRC_MASK                                                     0x0003fc00
352 
353 
354 /* Description		TAIL
355 
356 			Used to terminate the trellis of the convolutional decoder.
357 			 Set to 0.  <legal 0>
358 */
359 
360 #define VHT_SIG_A_INFO_TAIL_OFFSET                                                  0x00000004
361 #define VHT_SIG_A_INFO_TAIL_LSB                                                     18
362 #define VHT_SIG_A_INFO_TAIL_MSB                                                     23
363 #define VHT_SIG_A_INFO_TAIL_MASK                                                    0x00fc0000
364 
365 
366 /* Description		RESERVED_1
367 
368 			This field is not part of HT-SIG:
369 			Reserved: Should be set to 0 by the MAC and ignored by the
370 			 PHY <legal 0>
371 */
372 
373 #define VHT_SIG_A_INFO_RESERVED_1_OFFSET                                            0x00000004
374 #define VHT_SIG_A_INFO_RESERVED_1_LSB                                               24
375 #define VHT_SIG_A_INFO_RESERVED_1_MSB                                               30
376 #define VHT_SIG_A_INFO_RESERVED_1_MASK                                              0x7f000000
377 
378 
379 /* Description		RX_INTEGRITY_CHECK_PASSED
380 
381 			TX side: Set to 0
382 			RX side: Set to 1 if PHY determines the VHT-SIG-A CRC check
383 			 has passed, else set to 0
384 
385 			<legal all>
386 */
387 
388 #define VHT_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_OFFSET                             0x00000004
389 #define VHT_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_LSB                                31
390 #define VHT_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_MSB                                31
391 #define VHT_SIG_A_INFO_RX_INTEGRITY_CHECK_PASSED_MASK                               0x80000000
392 
393 
394 
395 #endif   // VHT_SIG_A_INFO
396