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