xref: /wlan-driver/fw-api/hw/qcn6432/ht_sig_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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 _HT_SIG_INFO_H_
18 #define _HT_SIG_INFO_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 #define NUM_OF_DWORDS_HT_SIG_INFO 2
23 
24 
25 struct ht_sig_info {
26 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
27              uint32_t mcs                                                     :  7, // [6:0]
28                       cbw                                                     :  1, // [7:7]
29                       length                                                  : 16, // [23:8]
30                       reserved_0                                              :  8; // [31:24]
31              uint32_t smoothing                                               :  1, // [0:0]
32                       not_sounding                                            :  1, // [1:1]
33                       ht_reserved                                             :  1, // [2:2]
34                       aggregation                                             :  1, // [3:3]
35                       stbc                                                    :  2, // [5:4]
36                       fec_coding                                              :  1, // [6:6]
37                       short_gi                                                :  1, // [7:7]
38                       num_ext_sp_str                                          :  2, // [9:8]
39                       crc                                                     :  8, // [17:10]
40                       signal_tail                                             :  6, // [23:18]
41                       reserved_1                                              :  7, // [30:24]
42                       rx_integrity_check_passed                               :  1; // [31:31]
43 #else
44              uint32_t reserved_0                                              :  8, // [31:24]
45                       length                                                  : 16, // [23:8]
46                       cbw                                                     :  1, // [7:7]
47                       mcs                                                     :  7; // [6:0]
48              uint32_t rx_integrity_check_passed                               :  1, // [31:31]
49                       reserved_1                                              :  7, // [30:24]
50                       signal_tail                                             :  6, // [23:18]
51                       crc                                                     :  8, // [17:10]
52                       num_ext_sp_str                                          :  2, // [9:8]
53                       short_gi                                                :  1, // [7:7]
54                       fec_coding                                              :  1, // [6:6]
55                       stbc                                                    :  2, // [5:4]
56                       aggregation                                             :  1, // [3:3]
57                       ht_reserved                                             :  1, // [2:2]
58                       not_sounding                                            :  1, // [1:1]
59                       smoothing                                               :  1; // [0:0]
60 #endif
61 };
62 
63 
64 /* Description		MCS
65 
66 			Modulation Coding Scheme:
67 			0-7 are used for single stream
68 			8-15 are used for 2 streams
69 			16-23 are used for 3 streams
70 			24-31 are used for 4 streams
71 			32 is used for duplicate HT20 (unsupported)
72 			33-76 is used for unequal modulation (unsupported)
73 			77-127 is reserved.
74 			<legal 0-31>
75 */
76 
77 #define HT_SIG_INFO_MCS_OFFSET                                                      0x00000000
78 #define HT_SIG_INFO_MCS_LSB                                                         0
79 #define HT_SIG_INFO_MCS_MSB                                                         6
80 #define HT_SIG_INFO_MCS_MASK                                                        0x0000007f
81 
82 
83 /* Description		CBW
84 
85 			Packet bandwidth:
86 			<enum 0     ht_20_mhz>
87 			<enum 1     ht_40_mhz>
88 			<legal 0-1>
89 */
90 
91 #define HT_SIG_INFO_CBW_OFFSET                                                      0x00000000
92 #define HT_SIG_INFO_CBW_LSB                                                         7
93 #define HT_SIG_INFO_CBW_MSB                                                         7
94 #define HT_SIG_INFO_CBW_MASK                                                        0x00000080
95 
96 
97 /* Description		LENGTH
98 
99 			This is the MPDU or A-MPDU length in octets of the PPDU
100 			<legal all>
101 */
102 
103 #define HT_SIG_INFO_LENGTH_OFFSET                                                   0x00000000
104 #define HT_SIG_INFO_LENGTH_LSB                                                      8
105 #define HT_SIG_INFO_LENGTH_MSB                                                      23
106 #define HT_SIG_INFO_LENGTH_MASK                                                     0x00ffff00
107 
108 
109 /* Description		RESERVED_0
110 
111 			This field is not part of HT-SIG
112 			Reserved: Should be set to 0 by the MAC and ignored by the
113 			 PHY <legal 0>
114 */
115 
116 #define HT_SIG_INFO_RESERVED_0_OFFSET                                               0x00000000
117 #define HT_SIG_INFO_RESERVED_0_LSB                                                  24
118 #define HT_SIG_INFO_RESERVED_0_MSB                                                  31
119 #define HT_SIG_INFO_RESERVED_0_MASK                                                 0xff000000
120 
121 
122 /* Description		SMOOTHING
123 
124 			Field indicates if smoothing is needed
125 			E_num 0     do_smoothing Unsupported setting: indicates
126 			smoothing is often used for beamforming
127 			<enum 1     no_smoothing> Indicates no smoothing is used
128 
129 			<legal 1>
130 */
131 
132 #define HT_SIG_INFO_SMOOTHING_OFFSET                                                0x00000004
133 #define HT_SIG_INFO_SMOOTHING_LSB                                                   0
134 #define HT_SIG_INFO_SMOOTHING_MSB                                                   0
135 #define HT_SIG_INFO_SMOOTHING_MASK                                                  0x00000001
136 
137 
138 /* Description		NOT_SOUNDING
139 
140 			E_num 0     sounding Unsupported setting: indicates sounding
141 			 is used
142 			<enum 1     no_sounding>  Indicates no sounding is used
143 			<legal 1>
144 */
145 
146 #define HT_SIG_INFO_NOT_SOUNDING_OFFSET                                             0x00000004
147 #define HT_SIG_INFO_NOT_SOUNDING_LSB                                                1
148 #define HT_SIG_INFO_NOT_SOUNDING_MSB                                                1
149 #define HT_SIG_INFO_NOT_SOUNDING_MASK                                               0x00000002
150 
151 
152 /* Description		HT_RESERVED
153 
154 			Reserved: Should be set to 1 by the MAC and ignored by the
155 			 PHY
156 			<legal 1>
157 */
158 
159 #define HT_SIG_INFO_HT_RESERVED_OFFSET                                              0x00000004
160 #define HT_SIG_INFO_HT_RESERVED_LSB                                                 2
161 #define HT_SIG_INFO_HT_RESERVED_MSB                                                 2
162 #define HT_SIG_INFO_HT_RESERVED_MASK                                                0x00000004
163 
164 
165 /* Description		AGGREGATION
166 
167 			<enum 0     mpdu> Indicates MPDU format
168 			<enum 1     a_mpdu> Indicates A-MPDU format
169 			<legal 0-1>
170 */
171 
172 #define HT_SIG_INFO_AGGREGATION_OFFSET                                              0x00000004
173 #define HT_SIG_INFO_AGGREGATION_LSB                                                 3
174 #define HT_SIG_INFO_AGGREGATION_MSB                                                 3
175 #define HT_SIG_INFO_AGGREGATION_MASK                                                0x00000008
176 
177 
178 /* Description		STBC
179 
180 			<enum 0     no_stbc> Indicates no STBC
181 			<enum 1     1_str_stbc> Indicates 1 stream STBC
182 			E_num 2     2_str_stbc Indicates 2 stream STBC (Unsupported)
183 
184 			<legal 0-1>
185 */
186 
187 #define HT_SIG_INFO_STBC_OFFSET                                                     0x00000004
188 #define HT_SIG_INFO_STBC_LSB                                                        4
189 #define HT_SIG_INFO_STBC_MSB                                                        5
190 #define HT_SIG_INFO_STBC_MASK                                                       0x00000030
191 
192 
193 /* Description		FEC_CODING
194 
195 			<enum 0     ht_bcc>  Indicates BCC coding
196 			<enum 1     ht_ldpc>  Indicates LDPC coding
197 			<legal 0-1>
198 */
199 
200 #define HT_SIG_INFO_FEC_CODING_OFFSET                                               0x00000004
201 #define HT_SIG_INFO_FEC_CODING_LSB                                                  6
202 #define HT_SIG_INFO_FEC_CODING_MSB                                                  6
203 #define HT_SIG_INFO_FEC_CODING_MASK                                                 0x00000040
204 
205 
206 /* Description		SHORT_GI
207 
208 			<enum 0     ht_normal_gi>  Indicates normal guard interval
209 
210 			<enum 1     ht_short_gi>  Indicates short guard interval
211 
212 			<legal 0-1>
213 */
214 
215 #define HT_SIG_INFO_SHORT_GI_OFFSET                                                 0x00000004
216 #define HT_SIG_INFO_SHORT_GI_LSB                                                    7
217 #define HT_SIG_INFO_SHORT_GI_MSB                                                    7
218 #define HT_SIG_INFO_SHORT_GI_MASK                                                   0x00000080
219 
220 
221 /* Description		NUM_EXT_SP_STR
222 
223 			Number of extension spatial streams: (Used for TxBF)
224 			<enum 0     0_ext_sp_str>  No extension spatial streams
225 			E_num 1     1_ext_sp_str  Not supported: 1 extension spatial
226 			 streams
227 			E_num 2     2_ext_sp_str  Not supported:  2 extension spatial
228 			 streams
229 			<legal 0>
230 */
231 
232 #define HT_SIG_INFO_NUM_EXT_SP_STR_OFFSET                                           0x00000004
233 #define HT_SIG_INFO_NUM_EXT_SP_STR_LSB                                              8
234 #define HT_SIG_INFO_NUM_EXT_SP_STR_MSB                                              9
235 #define HT_SIG_INFO_NUM_EXT_SP_STR_MASK                                             0x00000300
236 
237 
238 /* Description		CRC
239 
240 			The CRC protects the HT-SIG (HT-SIG[0][23:0] and HT-SIG[1][9:0].
241 			The generator polynomial is G(D) = D8 + D2 + D + 1.  <legal
242 			 all>
243 */
244 
245 #define HT_SIG_INFO_CRC_OFFSET                                                      0x00000004
246 #define HT_SIG_INFO_CRC_LSB                                                         10
247 #define HT_SIG_INFO_CRC_MSB                                                         17
248 #define HT_SIG_INFO_CRC_MASK                                                        0x0003fc00
249 
250 
251 /* Description		SIGNAL_TAIL
252 
253 			The 6 bits of tail is always set to 0 is used to flush the
254 			 BCC encoder and decoder.  <legal 0>
255 */
256 
257 #define HT_SIG_INFO_SIGNAL_TAIL_OFFSET                                              0x00000004
258 #define HT_SIG_INFO_SIGNAL_TAIL_LSB                                                 18
259 #define HT_SIG_INFO_SIGNAL_TAIL_MSB                                                 23
260 #define HT_SIG_INFO_SIGNAL_TAIL_MASK                                                0x00fc0000
261 
262 
263 /* Description		RESERVED_1
264 
265 			This field is not part of HT-SIG:
266 			Reserved: Should be set to 0 by the MAC and ignored by the
267 			 PHY.  <legal 0>
268 */
269 
270 #define HT_SIG_INFO_RESERVED_1_OFFSET                                               0x00000004
271 #define HT_SIG_INFO_RESERVED_1_LSB                                                  24
272 #define HT_SIG_INFO_RESERVED_1_MSB                                                  30
273 #define HT_SIG_INFO_RESERVED_1_MASK                                                 0x7f000000
274 
275 
276 /* Description		RX_INTEGRITY_CHECK_PASSED
277 
278 			TX side: Set to 0
279 			RX side: Set to 1 if PHY determines the HT-SIG CRC check
280 			 has passed, else set to 0
281 
282 			<legal all>
283 */
284 
285 #define HT_SIG_INFO_RX_INTEGRITY_CHECK_PASSED_OFFSET                                0x00000004
286 #define HT_SIG_INFO_RX_INTEGRITY_CHECK_PASSED_LSB                                   31
287 #define HT_SIG_INFO_RX_INTEGRITY_CHECK_PASSED_MSB                                   31
288 #define HT_SIG_INFO_RX_INTEGRITY_CHECK_PASSED_MASK                                  0x80000000
289 
290 
291 
292 #endif   // HT_SIG_INFO
293