xref: /wlan-dirver/qca-wifi-host-cmn/target_if/cfr/inc/target_if_cfr_enh.h (revision 689990d5df106ae79275687b40b8144dd8fee6ff)
1 /*
2  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef _TARGET_IF_CFR_ENH_H_
21 #define _TARGET_IF_CFR_ENH_H_
22 
23 #ifdef WLAN_ENH_CFR_ENABLE
24 /*
25  * Memory requirements :
26  *
27  *  1. DMA header :
28  *
29  * Legacy DMA header(QCA8074V2) : 2 words (length = 8 bytes)
30  * Enhanced DMA header(QCA6018) : Upto 16 words depending on no. of MU users
31  *                       in UL-MU-PPDU (Max length = 64 bytes)
32  *
33  * Fixed 4 words for whal_cfir_enhanced_hdr + freeze TLV
34  *                                          + uplink_user_info TLV (MAX 4)
35  *
36  * mu_rx_num_users -> No. of words in CFR DMA header
37  * 0 -> 12  =  4 + 7(freeze TLV) + 1(for 64-bit alignment)
38  * 1 -> 12  =  4 + 7(freeze TLV) + 1(user1)
39  * 2 -> 14  =  4 + 7(freeze TLV) + 2(users 1,2) + 1(for 64-bit alignment)
40  * 3 -> 14  =  4 + 7(freeze TLV) + 3(users 1,2,3)
41  * 4 -> 16  =  4 + 7(freeze TLV) + 4(users 1,2,3,4) + 1(for 64-bit alignment)
42  *
43  *
44  * 2. CFR data size for max BW/Nss/Nrx
45  *
46  *	Cypress : Max BW = 80 MHz
47  *			 NSS = 2
48  *			 Nrx = 2
49  *			 Size of one tone = 4 bytes
50  *
51  *		a. RTT-H - 2048 bytes
52  *
53  *		b. Debug-H (MIMO CFR) - 16016 bytes
54  *
55  *		c. RTT-H + CIR - 10240 bytes = 2048(RTT-H) + 8192(CIR)
56  */
57 
58 /* Max 4 users in MU case */
59 #define CYP_CFR_MU_USERS 4
60 
61 #define CYP_MAX_HEADER_LENGTH_WORDS 16
62 
63 /* payload_len = Max(2048, 16016, 10240) = 16064 (64-bit alignment) */
64 #define CYP_MAX_DATA_LENGTH_BYTES 16064
65 
66 /* in ms */
67 #define LUT_AGE_TIMER 3000
68 #define LUT_AGE_THRESHOLD 3000
69 
70 /* Max size :
71  * sizeof(csi_cfr_header) + 64 bytes(cfr header) + 16064 bytes(cfr payload)
72  */
73 #define STREAMFS_MAX_SUBBUF_CYP \
74 	(sizeof(struct csi_cfr_header) + \
75 	 (CYP_MAX_HEADER_LENGTH_WORDS * 4) + \
76 	 CYP_MAX_DATA_LENGTH_BYTES)
77 
78 #define STREAMFS_NUM_SUBBUF_CYP 255
79 
80 /* Max 37 users in MU case for Pine */
81 #define PINE_CFR_MU_USERS 37
82 
83 #define PINE_MAX_HEADER_LENGTH_WORDS 50
84 
85 #define PINE_MAX_DATA_LENGTH_BYTES 16384
86 
87 /* Max size :
88  * sizeof(csi_cfr_header) + 200 bytes(cfr header) + 16384 bytes(cfr payload)
89  */
90 #define STREAMFS_MAX_SUBBUF_PINE \
91 	(sizeof(struct csi_cfr_header) + \
92 	 (PINE_MAX_HEADER_LENGTH_WORDS * 4) + \
93 	 PINE_MAX_DATA_LENGTH_BYTES)
94 
95 #define STREAMFS_NUM_SUBBUF_PINE 255
96 
97 /* Max 37 users in MU case for Waikiki */
98 #define WAIKIKI_CFR_MU_USERS 37
99 
100 #define WAIKIKI_MAX_HEADER_LENGTH_WORDS 88
101 
102 #define WAIKIKI_MAX_DATA_LENGTH_BYTES 64512
103 
104 /* Max size :
105  * sizeof(csi_cfr_header) + 352 bytes(cfr header) + 64512 bytes(cfr payload)
106  * where cfr_header size = rtt upload header len + freeze_tlv len +
107  *                         uplink user setup info + alignment/reserved bytes
108  *                       = 16bytes + 32bytes + (8bytes * 37users) + 8bytes
109  */
110 #define STREAMFS_MAX_SUBBUF_WAIKIKI \
111 	(sizeof(struct csi_cfr_header) + \
112 	 (WAIKIKI_MAX_HEADER_LENGTH_WORDS * 4) + \
113 	 WAIKIKI_MAX_DATA_LENGTH_BYTES)
114 
115 #define STREAMFS_NUM_SUBBUF_WAIKIKI  127
116 
117 /* Max 4 users in MU case for Spruce */
118 #define SPRUCE_CFR_MU_USERS 4
119 
120 #define SPRUCE_MAX_HEADER_LENGTH_WORDS 16
121 
122 #define SPRUCE_MAX_DATA_LENGTH_BYTES 16384
123 
124 /* Max size :
125  * sizeof(csi_cfr_header) + 200 bytes(cfr header) + 16384 bytes(cfr payload)
126  */
127 #define STREAMFS_MAX_SUBBUF_SPRUCE \
128 	(sizeof(struct csi_cfr_header) + \
129 	 (SPRUCE_MAX_HEADER_LENGTH_WORDS * 4) + \
130 	 SPRUCE_MAX_DATA_LENGTH_BYTES)
131 
132 #define STREAMFS_NUM_SUBBUF_SPRUCE 255
133 
134 /* Max 4 users in MU case for QCN6432 */
135 #define QCN6432_CFR_MU_USERS 4
136 
137 #define QCN6432_MAX_HEADER_LENGTH_WORDS 22
138 
139 #define QCN6432_MAX_DATA_LENGTH_BYTES 8192
140 
141 /* Max size :
142  * sizeof(csi_cfr_header) + 88 bytes(cfr header) + 8192 bytes(cfr payload)
143  */
144 #define STREAMFS_MAX_SUBBUF_QCN6432 \
145 	(sizeof(struct csi_cfr_header) + \
146 	 (QCN6432_MAX_HEADER_LENGTH_WORDS * 4) + \
147 	 QCN6432_MAX_DATA_LENGTH_BYTES)
148 
149 #define STREAMFS_NUM_SUBBUF_QCN6432 255
150 
151 /* Max 4 users in MU case for QCA5332 */
152 #define QCA5332_CFR_MU_USERS 4
153 
154 #define QCA5332_MAX_HEADER_LENGTH_WORDS 22
155 
156 #define QCA5332_MAX_DATA_LENGTH_BYTES 8192
157 
158 /* Max size :
159  * sizeof(csi_cfr_header) + 88 bytes(cfr header) + 8192 bytes(cfr payload)
160  * where cfr_header size = rtt upload header len + freeze_tlv len +
161  *                         uplink user setup info + alignment/reserved bytes
162  *                       = 16bytes + 32bytes + (8bytes * 4users) + 8bytes
163  */
164 #define STREAMFS_MAX_SUBBUF_QCA5332 \
165 	(sizeof(struct csi_cfr_header) + \
166 	 (QCA5332_MAX_HEADER_LENGTH_WORDS * 4) + \
167 	QCA5332_MAX_DATA_LENGTH_BYTES)
168 
169 #define STREAMFS_NUM_SUBBUF_QCA5332 255
170 
171 /* enum macrx_freeze_tlv_version: Reported by uCode in enh_dma_header
172  * MACRX_FREEZE_TLV_VERSION_1: Single MU UL user info reported by MAC.
173  * This is used in Cypress/HastingsPrime chips. Corresponding structures are
174  * macrx_freeze_capture_channel and 1 uplink_user_setup_info.
175  *
176  * MACRX_FREEZE_TLV_VERSION_2: Upto 4 MU UL user info reported by MAC.
177  * This is used in Maple/Spruce/Moselle chips. Corresponding structures are
178  * macrx_freeze_capture_channel and 2 uplink_user_setup_info.
179  *
180  * MACRX_FREEZE_TLV_VERSION_3: Upto 37 MU UL user info reported by MAC.
181  * This is used in Pine chip. The corresponding structures are
182  * macrx_freeze_capture_channel_v3 and 37 uplink_user_setup_info.
183  *
184  * MACRX_FREEZE_TLV_VERSION_4: Upto 37 MU UL user info reported by MAC.
185  * This is used in Hamilton 1/2.
186  *
187  * MACRX_FREEZE_TLV_VERSION_5: Upto 37 MU UL user info reported by MAC.
188  * This is used in Waikiki chipsets.
189  */
190 enum macrx_freeze_tlv_version {
191 	MACRX_FREEZE_TLV_VERSION_1 = 1,
192 	MACRX_FREEZE_TLV_VERSION_2 = 2,
193 	MACRX_FREEZE_TLV_VERSION_3 = 3,
194 	MACRX_FREEZE_TLV_VERSION_4 = 4,
195 	MACRX_FREEZE_TLV_VERSION_5 = 5,
196 	MACRX_FREEZE_TLV_VERSION_MAX
197 };
198 
199 /* Max 4 users in MU case for Maple */
200 #define MAPLE_CFR_MU_USERS 4
201 
202 #define MAPLE_MAX_HEADER_LENGTH_WORDS 16
203 
204 #define MAPLE_MAX_DATA_LENGTH_BYTES 4096
205 
206 /* Max size :
207  * sizeof(csi_cfr_header) + 64 bytes(cfr uCode header) +
208  * 4096 bytes(cfr payload)
209  */
210 #define STREAMFS_MAX_SUBBUF_MAPLE \
211 	(sizeof(struct csi_cfr_header) + \
212 	 (MAPLE_MAX_HEADER_LENGTH_WORDS * 4) + \
213 	 MAPLE_MAX_DATA_LENGTH_BYTES)
214 
215 /*
216  * RelayFS memory required:
217  * Max sub buffer size * Number of sub buffers
218  *
219  * Cascade: (2200B  * 1100) ~= 2MB
220  * Dakota:  (1100B  * 2200) ~= 2MB
221  * Hawkeye: (8200B  * 255 ) ~= 2MB
222  * Cypress: (16438B * 255 ) ~= 4MB
223  * Pine   : (16894B * 255 ) ~= 4MB
224  * Maple  : (4470B *  255 ) ~= 1MB
225  *
226  */
227 #define STREAMFS_NUM_SUBBUF_MAPLE 255
228 
229 enum UCODE_UPLOAD_HEADER_VERSION {
230 	UPLOAD_HEADER_VERSION_1 = 1,
231 	UPLOAD_HEADER_VERSION_2 = 2,
232 	UPLOAD_HEADER_VERSION_3 = 3,
233 	UPLOAD_HEADER_VERSION_4 = 4,
234 	UPLOAD_HEADER_VERSION_8 = 8,
235 	UPLOAD_HEADER_VERSION_9 = 9,
236 	UPLOAD_HEADER_VERSION_MAX
237 };
238 
239 /*
240  * @tag: ucode fills this with 0xBA
241  *
242  * @length: length of CFR header in words (32-bit)
243  *
244  * @upload_done: ucode sets this to 1 to indicate DMA completion
245  *
246  * @capture_type:
247  *
248  *			0 - None
249  *			1 - RTT-H (Nss = 1, Nrx)
250  *			2 - Debug-H (Nss, Nrx)
251  *			3 - Reserved
252  *			5 - RTT-H + CIR(Nss, Nrx)
253  *
254  * @preamble_type:
255  *
256  *			0 - Legacy
257  *			1 - HT
258  *			2 - VHT
259  *			3 - HE
260  *
261  * @nss:
262  *
263  *			0 - 1-stream
264  *			1 - 2-stream
265  *			..	..
266  *			7 - 8-stream
267  *
268  *@num_chains:
269  *
270  *			0 - 1-chain
271  *			1 - 2-chain
272  *			..  ..
273  *			7 - 8-chain
274  *
275  *@upload_bw_pkt:
276  *
277  *			0 - 20 MHz
278  *			1 - 40 MHz
279  *			2 - 80 MHz
280  *			3 - 160 MHz
281  *
282  * @sw_peer_id_valid: Indicates whether sw_peer_id field is valid or not,
283  * sent from MAC to PHY via the MACRX_FREEZE_CAPTURE_CHANNEL TLV
284  *
285  * @sw_peer_id: Indicates peer id based on AST search, sent from MAC to PHY
286  * via the MACRX_FREEZE_CAPTURE_CHANNEL TLV
287  *
288  * @phy_ppdu_id: sent from PHY to MAC, copied to MACRX_FREEZE_CAPTURE_CHANNEL
289  * TLV
290  *
291  * @total_bytes: Total size of CFR payload (FFT bins)
292  *
293  * @header_version:
294  *
295  *			1 - HKV2/Hastings
296  *			2 - Cypress
297  *			3 - Hasting Prime
298  *			4 - Pine
299  *			8 - Hamilton
300  *			9 - Waikiki
301  *
302  * @target_id:
303  *
304  *			1 - Hastings
305  *			2 - Cypress
306  *			3 - Hastings Prime
307  *			4 - Pine
308  *
309  * @cfr_fmt:
310  *
311  *			0 - raw (32-bit format)
312  *			1 - compressed (24-bit format)
313  *
314  * @mu_rx_data_incl: Indicates whether CFR header contains UL-MU-MIMO info
315  *
316  * @freeze_data_incl: Indicates whether CFR header contains
317  * MACRX_FREEZE_CAPTURE_CHANNEL TLV
318  *
319  * @freeze_tlv_version: Indicates the version of freeze_tlv
320  *			1 - HSP, Cypress
321  *			2 - Maple/Spruce/Moselle
322  *			3 - Pine
323  *
324  * @decimation_factor: FFT bins decimation
325  * @mu_rx_num_users: Number of users in UL-MU-PPDU
326  */
327 struct whal_cfir_enhanced_hdr {
328 	uint16_t tag              :  8,
329 		 length           :  6,
330 		 rsvd1            :  2;
331 
332 	uint16_t upload_done        :  1,
333 		 capture_type       :  3,
334 		 preamble_type      :  2,
335 		 nss                :  3,
336 		 num_chains         :  3,
337 		 upload_pkt_bw      :  3,
338 		 sw_peer_id_valid   :  1;
339 
340 	uint16_t sw_peer_id         : 16;
341 
342 	uint16_t phy_ppdu_id        : 16;
343 
344 	uint16_t total_bytes;
345 
346 	uint16_t header_version     :4,
347 		 target_id          :4,
348 		 cfr_fmt            :1,
349 		 rsvd2              :1,
350 		 mu_rx_data_incl    :1,
351 		 freeze_data_incl   :1,
352 		 freeze_tlv_version :4;
353 
354 	uint16_t mu_rx_num_users   :8,
355 		 decimation_factor :4,
356 		 rsvd3             :4;
357 
358 	uint16_t rsvd4;
359 };
360 
361 /*
362  * freeze_tlv v1/v2 used by Hastings/Cypress/Maple/Spruce/Moselle supports upto
363  * 4 UL MU users
364  *
365  * @freeze:
366  *		0: Allow channel capture
367  *		1: Freeze channel capture
368  *
369  * @capture_reason: Field only valid when the freeze field is 1. Indicates why
370  * the MAC asked to capture the channel
371  *		0: freeze_reason_TM
372  *		1: freeze_reason_FTM
373  *		2: freeze_reason_ACK_resp_to_TM_FTM
374  *		3: freeze_reason_TA_RA_TYPE_FILTER
375  *		4: freeze readon NDP_NDP
376  *		5: freeze_reason_ALL_PACKET
377  *
378  * @packet_type: Packet type of captured packets.
379  *		0: Management
380  *		1: Control
381  *		2: Data
382  *		3: Extension
383  *
384  * @packet_sub_type: packet subtype of the captured packets.
385  * @sw_peer_id_valid: It is valid only when the freeze field is set to 1.
386  *		0: no TA address search on the received frame has been
387  *		   performed. This is due to the frame not having a TA address
388  *		   (like ACK frame), or the received frame being from an other
389  *		   AP to which this device is not associated.
390  *		1: field sw_peer_id will contain valid information.
391  *		   This implies that a (successful) address search has been
392  *		   performed on the TA address of the received frame.
393  *
394  * @sw_peer_id: Valid only when sw_peer_id_valid field is set. It is an
395  * identifier that allows SW to double check that the CSI info stored belongs
396  * to the device with this SW identifier.
397  *
398  * @phy_ppdu_id: ppdu_id of ppdu which has channel capture performed. Field
399  * only valid when the freeze field is set to 1.
400  *
401  * @packet_ta_lower_16: Packet’s lower 16bits transmit address in MAC header.
402  *
403  * @packet_ta_mid_16: Packet’s middle 16bits transmit address in MAC header.
404  *
405  * @packet_ta_upper_16: Packet’s upper 16bits transmit address in MAC header.
406  *
407  * @packet_ra_lower_16: Packet’s lower 16bits receive address in MAC header.
408  *
409  * @packet_ra_mid_16: Packet’s middle 16bits receive address in MAC header.
410  *
411  * @packet_ra_upper_16: Packet’s upper 16bits receive address in MAC header.
412  *
413  * @tsf_timestamp_15_0: MAC side 64bit TSF timestamp when this TLV is sent to
414  * PHY. Bits [15:0].
415  *
416  * @tsf_timestamp_31_16: MAC side 64bit TSF timestamp when this TLV is sent to
417  * PHY. Bits [31:16].
418  *
419  * @tsf_timestamp_47_32: MAC side 64bit TSF timestamp when this TLV is sent to
420  * PHY. Bits [47:32].
421  *
422  * @tsf_timestamp_63_48: MAC side 64bit TSF timestamp when this TLV is sent to
423  * PHY. Bits [63:48].
424  *
425  * @user_index_or_user_mask_5_0: When freeze_tlv_version is 1, this field from
426  * MAC, indicate to PHY which user's channel information need to be uploaded.
427  * When freeze_tlv_version is 2 & MU_SUPPORT_IN_TLV is 1, this field indicates
428  * bitmap of users upto 4 to which channel capture need to be uploaded. And if
429  * freeze_tlv_version is 2 & MU_SUPPORT_IN_TLV is 0, this field indicate to PHY
430  * which user's channel information need to be uploaded
431  *
432  * @directed: Indicate the frame is directed to us or not when NDPA/NDP capture
433  * or FTM/TM/ACK capture. 1=directed. For other modes, it is 0.
434  */
435 struct macrx_freeze_capture_channel {
436 	uint16_t freeze                          :  1, //[0]
437 		 capture_reason                  :  3, //[3:1]
438 		 packet_type                     :  2, //[5:4]
439 		 packet_sub_type                 :  4, //[9:6]
440 		 reserved                        :  5, //[14:10]
441 		 sw_peer_id_valid                :  1; //[15]
442 	uint16_t sw_peer_id                      : 16; //[15:0]
443 	uint16_t phy_ppdu_id                     : 16; //[15:0]
444 	uint16_t packet_ta_lower_16              : 16; //[15:0]
445 	uint16_t packet_ta_mid_16                : 16; //[15:0]
446 	uint16_t packet_ta_upper_16              : 16; //[15:0]
447 	uint16_t packet_ra_lower_16              : 16; //[15:0]
448 	uint16_t packet_ra_mid_16                : 16; //[15:0]
449 	uint16_t packet_ra_upper_16              : 16; //[15:0]
450 	uint16_t tsf_timestamp_15_0              : 16; //[15:0]
451 	uint16_t tsf_timestamp_31_16             : 16; //[15:0]
452 	uint16_t tsf_timestamp_47_32             : 16; //[15:0]
453 	uint16_t tsf_timestamp_63_48             : 16; //[15:0]
454 	uint16_t user_index_or_user_mask_5_0     :  6, //[5:0]
455 		 directed                        :  1, //[6]
456 		 reserved_13                     :  9; //[15:7]
457 };
458 
459 /*
460  * freeze_tlv v3 used by Pine
461  *
462  * @freeze:
463  *		0: Allow channel capture
464  *		1: Freeze channel capture
465  *
466  * @capture_reason: Field only valid when the freeze field is 1. Indicates why
467  * the MAC asked to capture the channel
468  *		0: freeze_reason_TM
469  *		1: freeze_reason_FTM
470  *		2: freeze_reason_ACK_resp_to_TM_FTM
471  *		3: freeze_reason_TA_RA_TYPE_FILTER
472  *		4: freeze readon NDP_NDP
473  *		5: freeze_reason_ALL_PACKET
474  *
475  * @packet_type: Packet type of captured packets.
476  *		0: Management
477  *		1: Control
478  *		2: Data
479  *		3: Extension
480  *
481  * @packet_sub_type: packet subtype of the captured packets.
482  *
483  * @directed: Indicate the frame is directed to us or not when NDPA/NDP capture
484  * or FTM/TM/ACK capture. 1=directed. For other modes, it is 0.
485  *
486  * @sw_peer_id_valid: It is valid only when the freeze field is set to 1.
487  *		0: no TA address search on the received frame has been
488  *		   performed. This is due to the frame not having a TA address
489  *		   (like ACK frame), or the received frame being from an other
490  *		   AP to which this device is not associated.
491  *		1: field sw_peer_id will contain valid information.
492  *		   This implies that a (successful) address search has been
493  *		   performed on the TA address of the received frame.
494  *
495  * @sw_peer_id: Valid only when sw_peer_id_valid field is set. It is an
496  * identifier that allows SW to double check that the CSI info stored belongs
497  * to the device with this SW identifier.
498  *
499  * @phy_ppdu_id: ppdu_id of ppdu which has channel capture performed. Field
500  * only valid when the freeze field is set to 1.
501  *
502  * @packet_ta_lower_16: Packet’s lower 16bits transmit address in MAC header.
503  *
504  * @packet_ta_mid_16: Packet’s middle 16bits transmit address in MAC header.
505  *
506  * @packet_ta_upper_16: Packet’s upper 16bits transmit address in MAC header.
507  *
508  * @packet_ra_lower_16: Packet’s lower 16bits receive address in MAC header.
509  *
510  * @packet_ra_mid_16: Packet’s middle 16bits receive address in MAC header.
511  *
512  * @packet_ra_upper_16: Packet’s upper 16bits receive address in MAC header.
513  *
514  * @tsf_timestamp_15_0: MAC side 64bit TSF timestamp when this TLV is sent to
515  * PHY. Bits [15:0].
516  *
517  * @tsf_timestamp_31_16: MAC side 64bit TSF timestamp when this TLV is sent to
518  * PHY. Bits [31:16].
519  *
520  * @tsf_timestamp_47_32: MAC side 64bit TSF timestamp when this TLV is sent to
521  * PHY. Bits [47:32].
522  *
523  * @tsf_63_48_or_user_mask_36_32: Indicates to PHY which user's channel info
524  * need to be uploaded. Only valid in UL MU case with MU_SUPPORT_IN_TLV = 1.
525  * Otherwise this indicates to PHY MSBs 63:48 of the MAC side 64bit TSF
526  * timestamp when this TLV is sent to PHY.
527  *
528  * @user_index_or_user_mask_15_0: Indicate to PHY which user's channel info
529  * need to be uploaded in UL MU case with MU_SUPPORT_IN_TLV = 1. Otherwise it
530  * indicate PHY which user’s channel information need to be uploaded.
531  *
532  * @user_mask_31_16: Indicate to PHY which user’s channel information need to
533  * be uploaded. Only valid in UL MU case with MU_SUPPORT_IN_TLV = 1.
534  */
535 struct macrx_freeze_capture_channel_v3 {
536 	uint16_t freeze                          :  1, //[0]
537 		 capture_reason                  :  3, //[3:1]
538 		 packet_type                     :  2, //[5:4]
539 		 packet_sub_type                 :  4, //[9:6]
540 		 directed                        :  1, //[10]
541 		 reserved                        :  4, //[14:11]
542 		 sw_peer_id_valid                :  1; //[15]
543 	uint16_t sw_peer_id                      : 16; //[15:0]
544 	uint16_t phy_ppdu_id                     : 16; //[15:0]
545 	uint16_t packet_ta_lower_16              : 16; //[15:0]
546 	uint16_t packet_ta_mid_16                : 16; //[15:0]
547 	uint16_t packet_ta_upper_16              : 16; //[15:0]
548 	uint16_t packet_ra_lower_16              : 16; //[15:0]
549 	uint16_t packet_ra_mid_16                : 16; //[15:0]
550 	uint16_t packet_ra_upper_16              : 16; //[15:0]
551 	uint16_t tsf_timestamp_15_0              : 16; //[15:0]
552 	uint16_t tsf_timestamp_31_16             : 16; //[15:0]
553 	uint16_t tsf_timestamp_47_32             : 16; //[15:0]
554 	uint16_t tsf_63_48_or_user_mask_36_32    : 16; //[15:0]
555 	uint16_t user_index_or_user_mask_15_0    : 16; //[15:0]
556 	uint16_t user_mask_31_16                 : 16; //[15:0]
557 };
558 
559 struct uplink_user_setup_info {
560 	uint32_t bw_info_valid                   :  1, //[0]
561 		 uplink_receive_type             :  2, //[2:1]
562 		 reserved_0a                     :  1, //[3]
563 		 uplink_11ax_mcs                 :  4, //[7:4]
564 		 ru_width                        :  7, //[14:8]
565 		 reserved_0b                     :  1, //[15]
566 		 nss                             :  3, //[18:16]
567 		 stream_offset                   :  3, //[21:19]
568 		 sta_dcm                         :  1, //[22]
569 		 sta_coding                      :  1, //[23]
570 		 ru_start_index                  :  7, //[30:24]
571 		 reserved_0c                     :  1; //[31]
572 };
573 
574 struct macrx_freeze_capture_channel_v5 {
575 	uint16_t freeze                          :  1, //[0]
576 		 capture_reason                  :  3, //[3:1]
577 		 packet_type                     :  2, //[5:4]
578 		 packet_sub_type                 :  4, //[9:6]
579 		 reserved                        :  5, //[14:10]
580 		 sw_peer_id_valid                :  1; //[15]
581 	uint16_t sw_peer_id                      : 16; //[15:0]
582 	uint16_t phy_ppdu_id                     : 16; //[15:0]
583 	uint16_t packet_ta_lower_16              : 16; //[15:0]
584 	uint16_t packet_ta_mid_16                : 16; //[15:0]
585 	uint16_t packet_ta_upper_16              : 16; //[15:0]
586 	uint16_t packet_ra_lower_16              : 16; //[15:0]
587 	uint16_t packet_ra_mid_16                : 16; //[15:0]
588 	uint16_t packet_ra_upper_16              : 16; //[15:0]
589 	uint16_t tsf_timestamp_15_0              : 16; //[15:0]
590 	uint16_t tsf_timestamp_31_16             : 16; //[15:0]
591 	uint16_t tsf_timestamp_47_32             : 16; //[15:0]
592 	uint16_t tsf_timestamp_63_48             : 16; //[15:0]
593 	uint16_t user_index_or_user_mask_5_0     :  6, //[5:0]
594 		 directed                        :  1, //[6]
595 		 reserved_13                     :  9; //[15:7]
596 	uint16_t user_mask_21_6                  : 16; //[15:0]
597 	uint16_t user_mask_36_22                 : 15, //[14:0]
598 		 reserved_15a                    :  1; //[15]
599 };
600 
601 struct uplink_user_setup_info_v2 {
602 	uint32_t bw_info_valid                   :  1, //[0]
603 		 uplink_receive_type             :  2, //[2:1]
604 		 reserved_0a                     :  1, //[3]
605 		 uplink_11ax_mcs                 :  4, //[7:4]
606 		 nss                             :  3, //[10:8]
607 		 stream_offset                   :  3, //[13:11]
608 		 sta_dcm                         :  1, //[14]
609 		 sta_coding                      :  1, //[15]
610 		 ru_type_80_0                    :  4, //[19:16]
611 		 ru_type_80_1                    :  4, //[23:20]
612 		 ru_type_80_2                    :  4, //[27:24]
613 		 ru_type_80_3                    :  4; //[31:28]
614 	uint32_t ru_start_index_80_0             :  6, //[5:0]
615 		 reserved_1a                     :  2, //[7:6]
616 		 ru_start_index_80_1             :  6, //[13:8]
617 		 reserved_1b                     :  2, //[15:14]
618 		 ru_start_index_80_2             :  6, //[21:16]
619 		 reserved_1c                     :  2, //[23:22]
620 		 ru_start_index_80_3             :  6, //[29:24]
621 		 reserved_1d                     :  2; //[31-30]
622 };
623 
624 /**
625  * cfr_enh_init_pdev() - Inits cfr pdev and registers necessary handlers.
626  * @psoc: pointer to psoc object
627  * @pdev: pointer to pdev object
628  *
629  * Return: Registration status for necessary handlers
630  */
631 QDF_STATUS cfr_enh_init_pdev(
632 		struct wlan_objmgr_psoc *psoc,
633 		struct wlan_objmgr_pdev *pdev);
634 
635 /**
636  * cfr_enh_deinit_pdev() - De-inits corresponding pdev and handlers.
637  * @psoc: pointer to psoc object
638  * @pdev: pointer to pdev object
639  *
640  * Return: De-registration status for necessary handlers
641  */
642 QDF_STATUS cfr_enh_deinit_pdev(
643 		struct wlan_objmgr_psoc *psoc,
644 		struct wlan_objmgr_pdev *pdev);
645 
646 /**
647  * target_if_cfr_start_lut_age_timer() - Start timer to flush aged-out LUT
648  * entries
649  * @pdev: pointer to pdev object
650  *
651  * Return: None
652  */
653 void target_if_cfr_start_lut_age_timer(struct wlan_objmgr_pdev *pdev);
654 
655 /**
656  * target_if_cfr_stop_lut_age_timer() - Stop timer to flush aged-out LUT
657  * entries
658  * @pdev: pointer to pdev object
659  *
660  * Return: None
661  */
662 void target_if_cfr_stop_lut_age_timer(struct wlan_objmgr_pdev *pdev);
663 
664 /**
665  * target_if_cfr_dump_lut_enh() - Dump all valid LUT entries
666  * @pdev: objmgr PDEV
667  *
668  * Return: none
669  */
670 void target_if_cfr_dump_lut_enh(struct wlan_objmgr_pdev *pdev);
671 
672 /**
673  * target_if_cfr_config_rcc() - Start repetitive channel capture
674  * @pdev: pointer to pdev object
675  * @rcc_param: rcc configurations
676  *
677  * Return: Success/Failure status
678  */
679 QDF_STATUS target_if_cfr_config_rcc(struct wlan_objmgr_pdev *pdev,
680 				    struct cfr_rcc_param *rcc_param);
681 
682 /**
683  *  target_if_cfr_default_ta_ra_config() - Configure default values to all
684  *  params(BW/NSS/TA/RA) in TA_RA mode
685  * @rcc_param: rcc configurations
686  * @allvalid: Indicates whether all TA_RA params are valid or not.
687  *            It could be either 0 or 1.
688  *            1: should be sent to FW during CFR initialization
689  *            0: should be set, after a successful commit session.
690  * @reset_cfg: This bitmap is being used to determine which groups'
691  *            parameters are needed to be reset to its default state.
692  */
693 void target_if_cfr_default_ta_ra_config(struct cfr_rcc_param *rcc_param,
694 					bool allvalid, uint16_t reset_cfg);
695 
696 /**
697  * target_if_cfr_rx_tlv_process() - Process PPDU status TLVs and store info in
698  * lookup table
699  * @pdev: PDEV object
700  * @nbuf: ppdu info
701  *
702  * Return: none
703  */
704 void target_if_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf);
705 
706 /**
707  * target_if_cfr_update_global_cfg() - Update global config after a successful
708  * commit
709  * @pdev: pointer to pdev object
710  *
711  * Return: None
712  */
713 void target_if_cfr_update_global_cfg(struct wlan_objmgr_pdev *pdev);
714 #else
715 static inline QDF_STATUS cfr_enh_init_pdev(
716 		struct wlan_objmgr_psoc *psoc,
717 		struct wlan_objmgr_pdev *pdev)
718 {
719 	return QDF_STATUS_SUCCESS;
720 }
721 
722 static inline QDF_STATUS cfr_enh_deinit_pdev(
723 		struct wlan_objmgr_psoc *psoc,
724 		struct wlan_objmgr_pdev *pdev)
725 {
726 	return QDF_STATUS_SUCCESS;
727 }
728 #endif
729 #endif
730