xref: /wlan-driver/fw-api/hw/qca5018/ht_sig_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020, The Linux Foundation. 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 _HT_SIG_INFO_H_
18 #define _HT_SIG_INFO_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 
23 // ################ START SUMMARY #################
24 //
25 //	Dword	Fields
26 //	0	mcs[6:0], cbw[7], length[23:8], reserved_0[31:24]
27 //	1	smoothing[0], not_sounding[1], ht_reserved[2], aggregation[3], stbc[5:4], fec_coding[6], short_gi[7], num_ext_sp_str[9:8], crc[17:10], signal_tail[23:18], reserved_1[31:24]
28 //
29 // ################ END SUMMARY #################
30 
31 #define NUM_OF_DWORDS_HT_SIG_INFO 2
32 
33 struct ht_sig_info {
34              uint32_t mcs                             :  7, //[6:0]
35                       cbw                             :  1, //[7]
36                       length                          : 16, //[23:8]
37                       reserved_0                      :  8; //[31:24]
38              uint32_t smoothing                       :  1, //[0]
39                       not_sounding                    :  1, //[1]
40                       ht_reserved                     :  1, //[2]
41                       aggregation                     :  1, //[3]
42                       stbc                            :  2, //[5:4]
43                       fec_coding                      :  1, //[6]
44                       short_gi                        :  1, //[7]
45                       num_ext_sp_str                  :  2, //[9:8]
46                       crc                             :  8, //[17:10]
47                       signal_tail                     :  6, //[23:18]
48                       reserved_1                      :  8; //[31:24]
49 };
50 
51 /*
52 
53 mcs
54 
55 			Modulation Coding Scheme:
56 
57 			0-7 are used for single stream
58 
59 			8-15 are used for 2 streams
60 
61 			16-23 are used for 3 streams
62 
63 			24-31 are used for 4 streams
64 
65 			32 is used for duplicate HT20 (unsupported)
66 
67 			33-76 is used for unequal modulation (unsupported)
68 
69 			77-127 is reserved.
70 
71 			<legal 0-31>
72 
73 cbw
74 
75 			Packet bandwidth:
76 
77 			<enum 0     ht_20_mhz>
78 
79 			<enum 1     ht_40_mhz>
80 
81 			<legal 0-1>
82 
83 length
84 
85 			This is the MPDU or A-MPDU length in octets of the PPDU
86 
87 			<legal all>
88 
89 reserved_0
90 
91 			This field is not part of HT-SIG
92 
93 			Reserved: Should be set to 0 by the MAC and ignored by
94 			the PHY <legal 0>
95 
96 smoothing
97 
98 			Field indicates if smoothing is needed
99 
100 			E_num 0     do_smoothing Unsupported setting: indicates
101 			smoothing is often used for beamforming
102 
103 
104 			<legal 1>
105 
106 not_sounding
107 
108 			E_num 0     sounding Unsupported setting: indicates
109 			sounding is used
110 
111 			<enum 1     no_sounding>  Indicates no sounding is used
112 
113 			<legal 1>
114 
115 ht_reserved
116 
117 			Reserved: Should be set to 1 by the MAC and ignored by
118 			the PHY
119 
120 			<legal 1>
121 
122 aggregation
123 
124 			<enum 0     mpdu> Indicates MPDU format
125 
126 			<enum 1     a_mpdu> Indicates A-MPDU format
127 
128 			<legal 0-1>
129 
130 stbc
131 
132 			<enum 0     no_stbc> Indicates no STBC
133 
134 			<enum 1     1_str_stbc> Indicates 1 stream STBC
135 
136 			E_num 2     2_str_stbc Indicates 2 stream STBC
137 			(Unsupported)
138 
139 			<legal 0-1>
140 
141 fec_coding
142 
143 			<enum 0     ht_bcc>  Indicates BCC coding
144 
145 			<enum 1     ht_ldpc>  Indicates LDPC coding
146 
147 			<legal 0-1>
148 
149 short_gi
150 
151 			<enum 0     ht_normal_gi>  Indicates normal guard
152 			interval
153 
154 
155 			<legal 0-1>
156 
157 num_ext_sp_str
158 
159 			Number of extension spatial streams: (Used for TxBF)
160 
161 			<enum 0     0_ext_sp_str>  No extension spatial streams
162 
163 			E_num 1     1_ext_sp_str  Not supported: 1 extension
164 			spatial streams
165 
166 			E_num 2     2_ext_sp_str  Not supported:  2 extension
167 			spatial streams
168 
169 			<legal 0>
170 
171 crc
172 
173 			The CRC protects the HT-SIG (HT-SIG[0][23:0] and
174 			HT-SIG[1][9:0]. The generator polynomial is G(D) = D8 + D2 +
175 			D + 1.  <legal all>
176 
177 signal_tail
178 
179 			The 6 bits of tail is always set to 0 is used to flush
180 			the BCC encoder and decoder.  <legal 0>
181 
182 reserved_1
183 
184 			This field is not part of HT-SIG:
185 
186 			Reserved: Should be set to 0 by the MAC and ignored by
187 			the PHY.  <legal 0>
188 */
189 
190 
191 /* Description		HT_SIG_INFO_0_MCS
192 
193 			Modulation Coding Scheme:
194 
195 			0-7 are used for single stream
196 
197 			8-15 are used for 2 streams
198 
199 			16-23 are used for 3 streams
200 
201 			24-31 are used for 4 streams
202 
203 			32 is used for duplicate HT20 (unsupported)
204 
205 			33-76 is used for unequal modulation (unsupported)
206 
207 			77-127 is reserved.
208 
209 			<legal 0-31>
210 */
211 #define HT_SIG_INFO_0_MCS_OFFSET                                     0x00000000
212 #define HT_SIG_INFO_0_MCS_LSB                                        0
213 #define HT_SIG_INFO_0_MCS_MASK                                       0x0000007f
214 
215 /* Description		HT_SIG_INFO_0_CBW
216 
217 			Packet bandwidth:
218 
219 			<enum 0     ht_20_mhz>
220 
221 			<enum 1     ht_40_mhz>
222 
223 			<legal 0-1>
224 */
225 #define HT_SIG_INFO_0_CBW_OFFSET                                     0x00000000
226 #define HT_SIG_INFO_0_CBW_LSB                                        7
227 #define HT_SIG_INFO_0_CBW_MASK                                       0x00000080
228 
229 /* Description		HT_SIG_INFO_0_LENGTH
230 
231 			This is the MPDU or A-MPDU length in octets of the PPDU
232 
233 			<legal all>
234 */
235 #define HT_SIG_INFO_0_LENGTH_OFFSET                                  0x00000000
236 #define HT_SIG_INFO_0_LENGTH_LSB                                     8
237 #define HT_SIG_INFO_0_LENGTH_MASK                                    0x00ffff00
238 
239 /* Description		HT_SIG_INFO_0_RESERVED_0
240 
241 			This field is not part of HT-SIG
242 
243 			Reserved: Should be set to 0 by the MAC and ignored by
244 			the PHY <legal 0>
245 */
246 #define HT_SIG_INFO_0_RESERVED_0_OFFSET                              0x00000000
247 #define HT_SIG_INFO_0_RESERVED_0_LSB                                 24
248 #define HT_SIG_INFO_0_RESERVED_0_MASK                                0xff000000
249 
250 /* Description		HT_SIG_INFO_1_SMOOTHING
251 
252 			Field indicates if smoothing is needed
253 
254 			E_num 0     do_smoothing Unsupported setting: indicates
255 			smoothing is often used for beamforming
256 
257 
258 			<legal 1>
259 */
260 #define HT_SIG_INFO_1_SMOOTHING_OFFSET                               0x00000004
261 #define HT_SIG_INFO_1_SMOOTHING_LSB                                  0
262 #define HT_SIG_INFO_1_SMOOTHING_MASK                                 0x00000001
263 
264 /* Description		HT_SIG_INFO_1_NOT_SOUNDING
265 
266 			E_num 0     sounding Unsupported setting: indicates
267 			sounding is used
268 
269 			<enum 1     no_sounding>  Indicates no sounding is used
270 
271 			<legal 1>
272 */
273 #define HT_SIG_INFO_1_NOT_SOUNDING_OFFSET                            0x00000004
274 #define HT_SIG_INFO_1_NOT_SOUNDING_LSB                               1
275 #define HT_SIG_INFO_1_NOT_SOUNDING_MASK                              0x00000002
276 
277 /* Description		HT_SIG_INFO_1_HT_RESERVED
278 
279 			Reserved: Should be set to 1 by the MAC and ignored by
280 			the PHY
281 
282 			<legal 1>
283 */
284 #define HT_SIG_INFO_1_HT_RESERVED_OFFSET                             0x00000004
285 #define HT_SIG_INFO_1_HT_RESERVED_LSB                                2
286 #define HT_SIG_INFO_1_HT_RESERVED_MASK                               0x00000004
287 
288 /* Description		HT_SIG_INFO_1_AGGREGATION
289 
290 			<enum 0     mpdu> Indicates MPDU format
291 
292 			<enum 1     a_mpdu> Indicates A-MPDU format
293 
294 			<legal 0-1>
295 */
296 #define HT_SIG_INFO_1_AGGREGATION_OFFSET                             0x00000004
297 #define HT_SIG_INFO_1_AGGREGATION_LSB                                3
298 #define HT_SIG_INFO_1_AGGREGATION_MASK                               0x00000008
299 
300 /* Description		HT_SIG_INFO_1_STBC
301 
302 			<enum 0     no_stbc> Indicates no STBC
303 
304 			<enum 1     1_str_stbc> Indicates 1 stream STBC
305 
306 			E_num 2     2_str_stbc Indicates 2 stream STBC
307 			(Unsupported)
308 
309 			<legal 0-1>
310 */
311 #define HT_SIG_INFO_1_STBC_OFFSET                                    0x00000004
312 #define HT_SIG_INFO_1_STBC_LSB                                       4
313 #define HT_SIG_INFO_1_STBC_MASK                                      0x00000030
314 
315 /* Description		HT_SIG_INFO_1_FEC_CODING
316 
317 			<enum 0     ht_bcc>  Indicates BCC coding
318 
319 			<enum 1     ht_ldpc>  Indicates LDPC coding
320 
321 			<legal 0-1>
322 */
323 #define HT_SIG_INFO_1_FEC_CODING_OFFSET                              0x00000004
324 #define HT_SIG_INFO_1_FEC_CODING_LSB                                 6
325 #define HT_SIG_INFO_1_FEC_CODING_MASK                                0x00000040
326 
327 /* Description		HT_SIG_INFO_1_SHORT_GI
328 
329 			<enum 0     ht_normal_gi>  Indicates normal guard
330 			interval
331 
332 
333 			<legal 0-1>
334 */
335 #define HT_SIG_INFO_1_SHORT_GI_OFFSET                                0x00000004
336 #define HT_SIG_INFO_1_SHORT_GI_LSB                                   7
337 #define HT_SIG_INFO_1_SHORT_GI_MASK                                  0x00000080
338 
339 /* Description		HT_SIG_INFO_1_NUM_EXT_SP_STR
340 
341 			Number of extension spatial streams: (Used for TxBF)
342 
343 			<enum 0     0_ext_sp_str>  No extension spatial streams
344 
345 			E_num 1     1_ext_sp_str  Not supported: 1 extension
346 			spatial streams
347 
348 			E_num 2     2_ext_sp_str  Not supported:  2 extension
349 			spatial streams
350 
351 			<legal 0>
352 */
353 #define HT_SIG_INFO_1_NUM_EXT_SP_STR_OFFSET                          0x00000004
354 #define HT_SIG_INFO_1_NUM_EXT_SP_STR_LSB                             8
355 #define HT_SIG_INFO_1_NUM_EXT_SP_STR_MASK                            0x00000300
356 
357 /* Description		HT_SIG_INFO_1_CRC
358 
359 			The CRC protects the HT-SIG (HT-SIG[0][23:0] and
360 			HT-SIG[1][9:0]. The generator polynomial is G(D) = D8 + D2 +
361 			D + 1.  <legal all>
362 */
363 #define HT_SIG_INFO_1_CRC_OFFSET                                     0x00000004
364 #define HT_SIG_INFO_1_CRC_LSB                                        10
365 #define HT_SIG_INFO_1_CRC_MASK                                       0x0003fc00
366 
367 /* Description		HT_SIG_INFO_1_SIGNAL_TAIL
368 
369 			The 6 bits of tail is always set to 0 is used to flush
370 			the BCC encoder and decoder.  <legal 0>
371 */
372 #define HT_SIG_INFO_1_SIGNAL_TAIL_OFFSET                             0x00000004
373 #define HT_SIG_INFO_1_SIGNAL_TAIL_LSB                                18
374 #define HT_SIG_INFO_1_SIGNAL_TAIL_MASK                               0x00fc0000
375 
376 /* Description		HT_SIG_INFO_1_RESERVED_1
377 
378 			This field is not part of HT-SIG:
379 
380 			Reserved: Should be set to 0 by the MAC and ignored by
381 			the PHY.  <legal 0>
382 */
383 #define HT_SIG_INFO_1_RESERVED_1_OFFSET                              0x00000004
384 #define HT_SIG_INFO_1_RESERVED_1_LSB                                 24
385 #define HT_SIG_INFO_1_RESERVED_1_MASK                                0xff000000
386 
387 
388 #endif // _HT_SIG_INFO_H_
389