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