xref: /wlan-driver/fw-api/hw/qca6290/11ax/v2/receive_user_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016-2018 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 #ifndef _RECEIVE_USER_INFO_H_
20 #define _RECEIVE_USER_INFO_H_
21 #if !defined(__ASSEMBLER__)
22 #endif
23 
24 
25 // ################ START SUMMARY #################
26 //
27 //	Dword	Fields
28 //	0	phy_ppdu_id[15:0], user_rssi[23:16], pkt_type[27:24], stbc[28], reception_type[31:29]
29 //	1	rate_mcs[3:0], sgi[5:4], receive_bandwidth[7:6], mimo_ss_bitmap[15:8], ofdma_ru_allocation[23:16], ofdma_user_index[30:24], ofdma_content_channel[31]
30 //
31 // ################ END SUMMARY #################
32 
33 #define NUM_OF_DWORDS_RECEIVE_USER_INFO 2
34 
35 struct receive_user_info {
36              uint32_t phy_ppdu_id                     : 16, //[15:0]
37                       user_rssi                       :  8, //[23:16]
38                       pkt_type                        :  4, //[27:24]
39                       stbc                            :  1, //[28]
40                       reception_type                  :  3; //[31:29]
41              uint32_t rate_mcs                        :  4, //[3:0]
42                       sgi                             :  2, //[5:4]
43                       receive_bandwidth               :  2, //[7:6]
44                       mimo_ss_bitmap                  :  8, //[15:8]
45                       ofdma_ru_allocation             :  8, //[23:16]
46                       ofdma_user_index                :  7, //[30:24]
47                       ofdma_content_channel           :  1; //[31]
48 };
49 
50 /*
51 
52 phy_ppdu_id
53 
54 			A ppdu counter value that PHY increments for every PPDU
55 			received. The counter value wraps around
56 
57 			<legal all>
58 
59 user_rssi
60 
61 			RSSI for this user
62 
63 			Frequency domain RSSI measurement for this user. Based
64 			on the channel estimate.
65 
66 
67 
68 			<legal all>
69 
70 pkt_type
71 
72 			Packet type:
73 
74 
75 
76 			<enum 0 dot11a>802.11a PPDU type
77 
78 			<enum 1 dot11b>802.11b PPDU type
79 
80 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
81 
82 			<enum 3 dot11ac>802.11ac PPDU type
83 
84 			<enum 4 dot11ax>802.11ax PPDU type
85 
86 stbc
87 
88 			When set, use STBC transmission rates
89 
90 reception_type
91 
92 			Indicates what type of reception this is.
93 
94 			<enum 0     reception_type_SU > Basic SU reception (not
95 			part of OFDMA or MIMO)
96 
97 			<enum 1     reception_type_MU_MIMO > This is related to
98 			DL type of reception
99 
100 			<enum 2     reception_type_MU_OFDMA >  This is related
101 			to DL type of reception
102 
103 			<enum 3     reception_type_MU_OFDMA_MIMO >  This is
104 			related to DL type of reception
105 
106 			<enum 4     reception_type_UL_MU_MIMO > This is related
107 			to UL type of reception
108 
109 			<enum 5     reception_type_UL_MU_OFDMA >  This is
110 			related to UL type of reception
111 
112 			<enum 6     reception_type_UL_MU_OFDMA_MIMO >  This is
113 			related to UL type of reception
114 
115 
116 
117 			<legal 0-6>
118 
119 rate_mcs
120 
121 			For details, refer to  MCS_TYPE description
122 
123 			<legal all>
124 
125 sgi
126 
127 			Field only valid when pkt type is HT, VHT or HE.
128 
129 
130 
131 			<enum 0     gi_0_8_us > Legacy normal GI.  Can also be
132 			used for HE
133 
134 			<enum 1     gi_0_4_us > Legacy short GI.  Can also be
135 			used for HE
136 
137 			<enum 2     gi_1_6_us > HE related GI
138 
139 			<enum 3     gi_3_2_us > HE related GI
140 
141 			<legal 0 - 3>
142 
143 receive_bandwidth
144 
145 			Full receive Bandwidth
146 
147 
148 
149 			<enum 0     full_rx_bw_20_mhz>
150 
151 			<enum 1      full_rx_bw_40_mhz>
152 
153 			<enum 2      full_rx_bw_80_mhz>
154 
155 			<enum 3      full_rx_bw_160_mhz>
156 
157 
158 
159 			<legal 0-3>
160 
161 mimo_ss_bitmap
162 
163 			Field only valid in case of MIMO type reception
164 
165 
166 
167 			Bitmap, with each bit indicating if the related spatial
168 			stream is used for this STA
169 
170 			LSB related to SS 0
171 
172 
173 
174 			0: spatial stream not used for this reception
175 
176 			1: spatial stream used for this reception
177 
178 
179 
180 			<legal all>
181 
182 ofdma_ru_allocation
183 
184 			Field only valid in case of OFDMA type receptions (DL
185 			and UL)
186 
187 
188 
189 			Indicates the RU number associated with this user.
190 
191 
192 
193 			In case of reception where the transmission was DL MU
194 			OFDMA, this field provides the RU pattern. Note that fields
195 			ofdma_user_index and Content_channel are needed to determine
196 			which RU was actually assigned to this user.
197 
198 
199 
200 			In case of reception where the transmission was UL MU
201 			OFDMA, this field contains everything needed to determine
202 			the actual RU
203 
204 			<legal all>
205 
206 ofdma_user_index
207 
208 			Field only valid in the of DL MU OFDMA reception
209 
210 
211 
212 			The user number within the RU_allocation.
213 
214 
215 
216 			This is needed for SW to determine the exact RU position
217 			within the reception.
218 
219 			<legal all>
220 
221 ofdma_content_channel
222 
223 			Field only valid in the of DL MU OFDMA/MIMO reception
224 
225 
226 
227 			In case of DL MU reception, this field indicates the
228 			content channel number where PHY found the RU information
229 			for this user
230 
231 
232 
233 			This is needed for SW to determine the exact RU position
234 			within the reception.
235 
236 
237 
238 			<enum 0      content_channel_1>
239 
240 			<enum 1      content_channel_2>
241 
242 
243 
244 			<legal all>
245 */
246 
247 
248 /* Description		RECEIVE_USER_INFO_0_PHY_PPDU_ID
249 
250 			A ppdu counter value that PHY increments for every PPDU
251 			received. The counter value wraps around
252 
253 			<legal all>
254 */
255 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_OFFSET                       0x00000000
256 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_LSB                          0
257 #define RECEIVE_USER_INFO_0_PHY_PPDU_ID_MASK                         0x0000ffff
258 
259 /* Description		RECEIVE_USER_INFO_0_USER_RSSI
260 
261 			RSSI for this user
262 
263 			Frequency domain RSSI measurement for this user. Based
264 			on the channel estimate.
265 
266 
267 
268 			<legal all>
269 */
270 #define RECEIVE_USER_INFO_0_USER_RSSI_OFFSET                         0x00000000
271 #define RECEIVE_USER_INFO_0_USER_RSSI_LSB                            16
272 #define RECEIVE_USER_INFO_0_USER_RSSI_MASK                           0x00ff0000
273 
274 /* Description		RECEIVE_USER_INFO_0_PKT_TYPE
275 
276 			Packet type:
277 
278 
279 
280 			<enum 0 dot11a>802.11a PPDU type
281 
282 			<enum 1 dot11b>802.11b PPDU type
283 
284 			<enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
285 
286 			<enum 3 dot11ac>802.11ac PPDU type
287 
288 			<enum 4 dot11ax>802.11ax PPDU type
289 */
290 #define RECEIVE_USER_INFO_0_PKT_TYPE_OFFSET                          0x00000000
291 #define RECEIVE_USER_INFO_0_PKT_TYPE_LSB                             24
292 #define RECEIVE_USER_INFO_0_PKT_TYPE_MASK                            0x0f000000
293 
294 /* Description		RECEIVE_USER_INFO_0_STBC
295 
296 			When set, use STBC transmission rates
297 */
298 #define RECEIVE_USER_INFO_0_STBC_OFFSET                              0x00000000
299 #define RECEIVE_USER_INFO_0_STBC_LSB                                 28
300 #define RECEIVE_USER_INFO_0_STBC_MASK                                0x10000000
301 
302 /* Description		RECEIVE_USER_INFO_0_RECEPTION_TYPE
303 
304 			Indicates what type of reception this is.
305 
306 			<enum 0     reception_type_SU > Basic SU reception (not
307 			part of OFDMA or MIMO)
308 
309 			<enum 1     reception_type_MU_MIMO > This is related to
310 			DL type of reception
311 
312 			<enum 2     reception_type_MU_OFDMA >  This is related
313 			to DL type of reception
314 
315 			<enum 3     reception_type_MU_OFDMA_MIMO >  This is
316 			related to DL type of reception
317 
318 			<enum 4     reception_type_UL_MU_MIMO > This is related
319 			to UL type of reception
320 
321 			<enum 5     reception_type_UL_MU_OFDMA >  This is
322 			related to UL type of reception
323 
324 			<enum 6     reception_type_UL_MU_OFDMA_MIMO >  This is
325 			related to UL type of reception
326 
327 
328 
329 			<legal 0-6>
330 */
331 #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_OFFSET                    0x00000000
332 #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_LSB                       29
333 #define RECEIVE_USER_INFO_0_RECEPTION_TYPE_MASK                      0xe0000000
334 
335 /* Description		RECEIVE_USER_INFO_1_RATE_MCS
336 
337 			For details, refer to  MCS_TYPE description
338 
339 			<legal all>
340 */
341 #define RECEIVE_USER_INFO_1_RATE_MCS_OFFSET                          0x00000004
342 #define RECEIVE_USER_INFO_1_RATE_MCS_LSB                             0
343 #define RECEIVE_USER_INFO_1_RATE_MCS_MASK                            0x0000000f
344 
345 /* Description		RECEIVE_USER_INFO_1_SGI
346 
347 			Field only valid when pkt type is HT, VHT or HE.
348 
349 
350 
351 			<enum 0     gi_0_8_us > Legacy normal GI.  Can also be
352 			used for HE
353 
354 			<enum 1     gi_0_4_us > Legacy short GI.  Can also be
355 			used for HE
356 
357 			<enum 2     gi_1_6_us > HE related GI
358 
359 			<enum 3     gi_3_2_us > HE related GI
360 
361 			<legal 0 - 3>
362 */
363 #define RECEIVE_USER_INFO_1_SGI_OFFSET                               0x00000004
364 #define RECEIVE_USER_INFO_1_SGI_LSB                                  4
365 #define RECEIVE_USER_INFO_1_SGI_MASK                                 0x00000030
366 
367 /* Description		RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH
368 
369 			Full receive Bandwidth
370 
371 
372 
373 			<enum 0     full_rx_bw_20_mhz>
374 
375 			<enum 1      full_rx_bw_40_mhz>
376 
377 			<enum 2      full_rx_bw_80_mhz>
378 
379 			<enum 3      full_rx_bw_160_mhz>
380 
381 
382 
383 			<legal 0-3>
384 */
385 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_OFFSET                 0x00000004
386 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_LSB                    6
387 #define RECEIVE_USER_INFO_1_RECEIVE_BANDWIDTH_MASK                   0x000000c0
388 
389 /* Description		RECEIVE_USER_INFO_1_MIMO_SS_BITMAP
390 
391 			Field only valid in case of MIMO type reception
392 
393 
394 
395 			Bitmap, with each bit indicating if the related spatial
396 			stream is used for this STA
397 
398 			LSB related to SS 0
399 
400 
401 
402 			0: spatial stream not used for this reception
403 
404 			1: spatial stream used for this reception
405 
406 
407 
408 			<legal all>
409 */
410 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_OFFSET                    0x00000004
411 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_LSB                       8
412 #define RECEIVE_USER_INFO_1_MIMO_SS_BITMAP_MASK                      0x0000ff00
413 
414 /* Description		RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION
415 
416 			Field only valid in case of OFDMA type receptions (DL
417 			and UL)
418 
419 
420 
421 			Indicates the RU number associated with this user.
422 
423 
424 
425 			In case of reception where the transmission was DL MU
426 			OFDMA, this field provides the RU pattern. Note that fields
427 			ofdma_user_index and Content_channel are needed to determine
428 			which RU was actually assigned to this user.
429 
430 
431 
432 			In case of reception where the transmission was UL MU
433 			OFDMA, this field contains everything needed to determine
434 			the actual RU
435 
436 			<legal all>
437 */
438 #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_OFFSET               0x00000004
439 #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_LSB                  16
440 #define RECEIVE_USER_INFO_1_OFDMA_RU_ALLOCATION_MASK                 0x00ff0000
441 
442 /* Description		RECEIVE_USER_INFO_1_OFDMA_USER_INDEX
443 
444 			Field only valid in the of DL MU OFDMA reception
445 
446 
447 
448 			The user number within the RU_allocation.
449 
450 
451 
452 			This is needed for SW to determine the exact RU position
453 			within the reception.
454 
455 			<legal all>
456 */
457 #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_OFFSET                  0x00000004
458 #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_LSB                     24
459 #define RECEIVE_USER_INFO_1_OFDMA_USER_INDEX_MASK                    0x7f000000
460 
461 /* Description		RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL
462 
463 			Field only valid in the of DL MU OFDMA/MIMO reception
464 
465 
466 
467 			In case of DL MU reception, this field indicates the
468 			content channel number where PHY found the RU information
469 			for this user
470 
471 
472 
473 			This is needed for SW to determine the exact RU position
474 			within the reception.
475 
476 
477 
478 			<enum 0      content_channel_1>
479 
480 			<enum 1      content_channel_2>
481 
482 
483 
484 			<legal all>
485 */
486 #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_OFFSET             0x00000004
487 #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_LSB                31
488 #define RECEIVE_USER_INFO_1_OFDMA_CONTENT_CHANNEL_MASK               0x80000000
489 
490 
491 #endif // _RECEIVE_USER_INFO_H_
492