xref: /wlan-driver/fw-api/hw/qca6290/v2/receive_user_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 //
20 // DO NOT EDIT!  This file is automatically generated
21 //               These definitions are tied to a particular hardware layout
22 
23 
24 #ifndef _RECEIVE_USER_INFO_H_
25 #define _RECEIVE_USER_INFO_H_
26 #if !defined(__ASSEMBLER__)
27 #endif
28 
29 
30 // ################ START SUMMARY #################
31 //
32 //	Dword	Fields
33 //	0	phy_ppdu_id[15:0], user_rssi[23:16], pkt_type[27:24], stbc[28], sgi[30:29], reserved_0[31]
34 //	1	rate_mcs[3:0], reception_type[5:4], receive_bandwidth[7:6], mimo_ss_bitmap[15:8], user_ru_allocation[23:16], nss[26:24], reserved_1b[31:27]
35 //
36 // ################ END SUMMARY #################
37 
38 #define NUM_OF_DWORDS_RECEIVE_USER_INFO 2
39 
40 struct receive_user_info {
41              uint32_t phy_ppdu_id                     : 16, //[15:0]
42                       user_rssi                       :  8, //[23:16]
43                       pkt_type                        :  4, //[27:24]
44                       stbc                            :  1, //[28]
45                       sgi                             :  2, //[30:29]
46                       reserved_0                      :  1; //[31]
47              uint32_t rate_mcs                        :  4, //[3:0]
48                       reception_type                  :  2, //[5:4]
49                       receive_bandwidth               :  2, //[7:6]
50                       mimo_ss_bitmap                  :  8, //[15:8]
51                       user_ru_allocation              :  8, //[23:16]
52                       nss                             :  3, //[26:24]
53                       reserved_1b                     :  5; //[31:27]
54 };
55 
56 /*
57 
58 phy_ppdu_id
59 
60 			A ppdu counter value that PHY increments for every PPDU
61 			received. The counter value wraps around
62 
63 			<legal all>
64 
65 user_rssi
66 
67 			RSSI for this user
68 
69 			Frequency domain RSSI measurement for this user. Based
70 			on the channel estimate.
71 
72 
73 
74 			<legal all>
75 
76 pkt_type
77 
78 			Packet type:
79 
80 
81 
82 			<enum 0 dot11a>802.11a PPDU type
83 
84 			<enum 1 dot11b>802.11b PPDU type
85 
86 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
87 
88 			<enum 3 dot11ac>802.11ac PPDU type
89 
90 			<enum 4 dot11ax>802.11ax PPDU type
91 
92 stbc
93 
94 			When set, use STBC transmission rates
95 
96 sgi
97 
98 			Field only valid when pkt type is HT, VHT or HE.
99 
100 
101 
102 			<enum 0     gi_0_8_us > Legacy normal GI.  Can also be
103 			used for HE
104 
105 			<enum 1     gi_0_4_us > Legacy short GI.  Can also be
106 			used for HE
107 
108 			<enum 2     gi_1_6_us > HE related GI
109 
110 			<enum 3     gi_3_2_us > HE related GI
111 
112 			<legal 0 - 3>
113 
114 reserved_0
115 
116 			<legal 0>
117 
118 rate_mcs
119 
120 			For details, refer to  MCS_TYPE description
121 
122 			<legal all>
123 
124 reception_type
125 
126 			Indicates what type of reception this is.
127 
128 			<enum 0     reception_type_SU >
129 
130 			<enum 1     reception_type_MU_MIMO >
131 
132 			<enum 2     reception_type_MU_OFDMA >
133 
134 			<enum 3     reception_type_MU_OFDMA_MIMO >
135 
136 			<legal all>
137 
138 receive_bandwidth
139 
140 			Full receive Bandwidth
141 
142 
143 
144 			<enum 0     full_rx_bw_20_mhz>
145 
146 			<enum 1      full_rx_bw_40_mhz>
147 
148 			<enum 2      full_rx_bw_80_mhz>
149 
150 			<enum 3      full_rx_bw_160_mhz>
151 
152 
153 
154 			<legal 0-3>
155 
156 mimo_ss_bitmap
157 
158 			Field only valid in case of MIMO type reception
159 
160 
161 
162 			Bitmap, with each bit indicating if the related spatial
163 			stream is used for this STA
164 
165 			LSB related to SS 0
166 
167 
168 
169 			0: spatial stream not used for this reception
170 
171 			1: spatial stream used for this reception
172 
173 
174 
175 			<legal all>
176 
177 user_ru_allocation
178 
179 			Field only valid in case of OFDMA uplink type reception
180 
181 
182 
183 			Indicates the RU number for this user
184 
185 			<legal 0-73>
186 
187 nss
188 
189 			Number of Spatial Streams occupied by the User
190 
191 			<enum 0 1_spatial_stream>Single spatial stream
192 
193 			<enum 1 2_spatial_streams>2 spatial streams
194 
195 			<enum 2 3_spatial_streams>3 spatial streams
196 
197 			<enum 3 4_spatial_streams>4 spatial streams
198 
199 			<enum 4 5_spatial_streams>5 spatial streams
200 
201 			<enum 5 6_spatial_streams>6 spatial streams
202 
203 			<enum 6 7_spatial_streams>7 spatial streams
204 
205 			<enum 7 8_spatial_streams>8 spatial streams
206 
207 reserved_1b
208 
209 			<legal 0>
210 */
211 
212 
213 /* Description		RECEIVE_USER_INFO_0_PHY_PPDU_ID
214 
215 			A ppdu counter value that PHY increments for every PPDU
216 			received. The counter value wraps around
217 
218 			<legal all>
219 */
220 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_OFFSET                       0x00000000
221 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_LSB                          0
222 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_MASK                         0x0000ffff
223 
224 /* Description		RECEIVE_USER_INFO_0_USER_RSSI
225 
226 			RSSI for this user
227 
228 			Frequency domain RSSI measurement for this user. Based
229 			on the channel estimate.
230 
231 
232 
233 			<legal all>
234 */
235 #define RECEIVE_USER_INFO_0_USER_RSSI_OFFSET                         0x00000000
236 #define RECEIVE_USER_INFO_0_USER_RSSI_LSB                            16
237 #define RECEIVE_USER_INFO_0_USER_RSSI_MASK                           0x00ff0000
238 
239 /* Description		RECEIVE_USER_INFO_0_PKT_TYPE
240 
241 			Packet type:
242 
243 
244 
245 			<enum 0 dot11a>802.11a PPDU type
246 
247 			<enum 1 dot11b>802.11b PPDU type
248 
249 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
250 
251 			<enum 3 dot11ac>802.11ac PPDU type
252 
253 			<enum 4 dot11ax>802.11ax PPDU type
254 */
255 #define RECEIVE_USER_INFO_0_PKT_TYPE_OFFSET                          0x00000000
256 #define RECEIVE_USER_INFO_0_PKT_TYPE_LSB                             24
257 #define RECEIVE_USER_INFO_0_PKT_TYPE_MASK                            0x0f000000
258 
259 /* Description		RECEIVE_USER_INFO_0_STBC
260 
261 			When set, use STBC transmission rates
262 */
263 #define RECEIVE_USER_INFO_0_STBC_OFFSET                              0x00000000
264 #define RECEIVE_USER_INFO_0_STBC_LSB                                 28
265 #define RECEIVE_USER_INFO_0_STBC_MASK                                0x10000000
266 
267 /* Description		RECEIVE_USER_INFO_0_SGI
268 
269 			Field only valid when pkt type is HT, VHT or HE.
270 
271 
272 
273 			<enum 0     gi_0_8_us > Legacy normal GI.  Can also be
274 			used for HE
275 
276 			<enum 1     gi_0_4_us > Legacy short GI.  Can also be
277 			used for HE
278 
279 			<enum 2     gi_1_6_us > HE related GI
280 
281 			<enum 3     gi_3_2_us > HE related GI
282 
283 			<legal 0 - 3>
284 */
285 #define RECEIVE_USER_INFO_0_SGI_OFFSET                               0x00000000
286 #define RECEIVE_USER_INFO_0_SGI_LSB                                  29
287 #define RECEIVE_USER_INFO_0_SGI_MASK                                 0x60000000
288 
289 /* Description		RECEIVE_USER_INFO_0_RESERVED_0
290 
291 			<legal 0>
292 */
293 #define RECEIVE_USER_INFO_0_RESERVED_0_OFFSET                        0x00000000
294 #define RECEIVE_USER_INFO_0_RESERVED_0_LSB                           31
295 #define RECEIVE_USER_INFO_0_RESERVED_0_MASK                          0x80000000
296 
297 /* Description		RECEIVE_USER_INFO_1_RATE_MCS
298 
299 			For details, refer to  MCS_TYPE description
300 
301 			<legal all>
302 */
303 #define RECEIVE_USER_INFO_1_RATE_MCS_OFFSET                          0x00000004
304 #define RECEIVE_USER_INFO_1_RATE_MCS_LSB                             0
305 #define RECEIVE_USER_INFO_1_RATE_MCS_MASK                            0x0000000f
306 
307 /* Description		RECEIVE_USER_INFO_1_RECEPTION_TYPE
308 
309 			Indicates what type of reception this is.
310 
311 			<enum 0     reception_type_SU >
312 
313 			<enum 1     reception_type_MU_MIMO >
314 
315 			<enum 2     reception_type_MU_OFDMA >
316 
317 			<enum 3     reception_type_MU_OFDMA_MIMO >
318 
319 			<legal all>
320 */
321 #define RECEIVE_USER_INFO_1_RECEPTION_TYPE_OFFSET                    0x00000004
322 #define RECEIVE_USER_INFO_1_RECEPTION_TYPE_LSB                       4
323 #define RECEIVE_USER_INFO_1_RECEPTION_TYPE_MASK                      0x00000030
324 
325 /* Description		RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH
326 
327 			Full receive Bandwidth
328 
329 
330 
331 			<enum 0     full_rx_bw_20_mhz>
332 
333 			<enum 1      full_rx_bw_40_mhz>
334 
335 			<enum 2      full_rx_bw_80_mhz>
336 
337 			<enum 3      full_rx_bw_160_mhz>
338 
339 
340 
341 			<legal 0-3>
342 */
343 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_OFFSET                 0x00000004
344 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_LSB                    6
345 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_MASK                   0x000000c0
346 
347 /* Description		RECEIVE_USER_INFO_1_MIMO_SS_BITMAP
348 
349 			Field only valid in case of MIMO type reception
350 
351 
352 
353 			Bitmap, with each bit indicating if the related spatial
354 			stream is used for this STA
355 
356 			LSB related to SS 0
357 
358 
359 
360 			0: spatial stream not used for this reception
361 
362 			1: spatial stream used for this reception
363 
364 
365 
366 			<legal all>
367 */
368 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_OFFSET                    0x00000004
369 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_LSB                       8
370 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_MASK                      0x0000ff00
371 
372 /* Description		RECEIVE_USER_INFO_1_USER_RU_ALLOCATION
373 
374 			Field only valid in case of OFDMA uplink type reception
375 
376 
377 
378 			Indicates the RU number for this user
379 
380 			<legal 0-73>
381 */
382 #define RECEIVE_USER_INFO_1_USER_RU_ALLOCATION_OFFSET                0x00000004
383 #define RECEIVE_USER_INFO_1_USER_RU_ALLOCATION_LSB                   16
384 #define RECEIVE_USER_INFO_1_USER_RU_ALLOCATION_MASK                  0x00ff0000
385 
386 /* Description		RECEIVE_USER_INFO_1_NSS
387 
388 			Number of Spatial Streams occupied by the User
389 
390 			<enum 0 1_spatial_stream>Single spatial stream
391 
392 			<enum 1 2_spatial_streams>2 spatial streams
393 
394 			<enum 2 3_spatial_streams>3 spatial streams
395 
396 			<enum 3 4_spatial_streams>4 spatial streams
397 
398 			<enum 4 5_spatial_streams>5 spatial streams
399 
400 			<enum 5 6_spatial_streams>6 spatial streams
401 
402 			<enum 6 7_spatial_streams>7 spatial streams
403 
404 			<enum 7 8_spatial_streams>8 spatial streams
405 */
406 #define RECEIVE_USER_INFO_1_NSS_OFFSET                               0x00000004
407 #define RECEIVE_USER_INFO_1_NSS_LSB                                  24
408 #define RECEIVE_USER_INFO_1_NSS_MASK                                 0x07000000
409 
410 /* Description		RECEIVE_USER_INFO_1_RESERVED_1B
411 
412 			<legal 0>
413 */
414 #define RECEIVE_USER_INFO_1_RESERVED_1B_OFFSET                       0x00000004
415 #define RECEIVE_USER_INFO_1_RESERVED_1B_LSB                          27
416 #define RECEIVE_USER_INFO_1_RESERVED_1B_MASK                         0xf8000000
417 
418 
419 #endif // _RECEIVE_USER_INFO_H_
420