xref: /wlan-dirver/qca-wifi-host-cmn/target_if/cfr/inc/target_if_cfr_enh.h (revision e11f459adedbe4ff0ee2a3365a57986d1921df18)
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 /* enum macrx_freeze_tlv_version: Reported by uCode in enh_dma_header
151  * MACRX_FREEZE_TLV_VERSION_1: Single MU UL user info reported by MAC.
152  * This is used in Cypress/HastingsPrime chips. Corresponding structures are
153  * macrx_freeze_capture_channel and 1 uplink_user_setup_info.
154  *
155  * MACRX_FREEZE_TLV_VERSION_2: Upto 4 MU UL user info reported by MAC.
156  * This is used in Maple/Spruce/Moselle chips. Corresponding structures are
157  * macrx_freeze_capture_channel and 2 uplink_user_setup_info.
158  *
159  * MACRX_FREEZE_TLV_VERSION_3: Upto 37 MU UL user info reported by MAC.
160  * This is used in Pine chip. The corresponding structures are
161  * macrx_freeze_capture_channel_v3 and 37 uplink_user_setup_info.
162  *
163  * MACRX_FREEZE_TLV_VERSION_4: Upto 37 MU UL user info reported by MAC.
164  * This is used in Hamilton 1/2.
165  *
166  * MACRX_FREEZE_TLV_VERSION_5: Upto 37 MU UL user info reported by MAC.
167  * This is used in Waikiki chipsets.
168  */
169 enum macrx_freeze_tlv_version {
170 	MACRX_FREEZE_TLV_VERSION_1 = 1,
171 	MACRX_FREEZE_TLV_VERSION_2 = 2,
172 	MACRX_FREEZE_TLV_VERSION_3 = 3,
173 	MACRX_FREEZE_TLV_VERSION_4 = 4,
174 	MACRX_FREEZE_TLV_VERSION_5 = 5,
175 	MACRX_FREEZE_TLV_VERSION_MAX
176 };
177 
178 /* Max 4 users in MU case for Maple */
179 #define MAPLE_CFR_MU_USERS 4
180 
181 #define MAPLE_MAX_HEADER_LENGTH_WORDS 16
182 
183 #define MAPLE_MAX_DATA_LENGTH_BYTES 4096
184 
185 /* Max size :
186  * sizeof(csi_cfr_header) + 64 bytes(cfr uCode header) +
187  * 4096 bytes(cfr payload)
188  */
189 #define STREAMFS_MAX_SUBBUF_MAPLE \
190 	(sizeof(struct csi_cfr_header) + \
191 	 (MAPLE_MAX_HEADER_LENGTH_WORDS * 4) + \
192 	 MAPLE_MAX_DATA_LENGTH_BYTES)
193 
194 /*
195  * RelayFS memory required:
196  * Max sub buffer size * Number of sub buffers
197  *
198  * Cascade: (2200B  * 1100) ~= 2MB
199  * Dakota:  (1100B  * 2200) ~= 2MB
200  * Hawkeye: (8200B  * 255 ) ~= 2MB
201  * Cypress: (16438B * 255 ) ~= 4MB
202  * Pine   : (16894B * 255 ) ~= 4MB
203  * Maple  : (4470B *  255 ) ~= 1MB
204  *
205  */
206 #define STREAMFS_NUM_SUBBUF_MAPLE 255
207 
208 enum UCODE_UPLOAD_HEADER_VERSION {
209 	UPLOAD_HEADER_VERSION_1 = 1,
210 	UPLOAD_HEADER_VERSION_2 = 2,
211 	UPLOAD_HEADER_VERSION_3 = 3,
212 	UPLOAD_HEADER_VERSION_4 = 4,
213 	UPLOAD_HEADER_VERSION_8 = 8,
214 	UPLOAD_HEADER_VERSION_9 = 9,
215 	UPLOAD_HEADER_VERSION_MAX
216 };
217 
218 /*
219  * @tag: ucode fills this with 0xBA
220  *
221  * @length: length of CFR header in words (32-bit)
222  *
223  * @upload_done: ucode sets this to 1 to indicate DMA completion
224  *
225  * @capture_type:
226  *
227  *			0 - None
228  *			1 - RTT-H (Nss = 1, Nrx)
229  *			2 - Debug-H (Nss, Nrx)
230  *			3 - Reserved
231  *			5 - RTT-H + CIR(Nss, Nrx)
232  *
233  * @preamble_type:
234  *
235  *			0 - Legacy
236  *			1 - HT
237  *			2 - VHT
238  *			3 - HE
239  *
240  * @nss:
241  *
242  *			0 - 1-stream
243  *			1 - 2-stream
244  *			..	..
245  *			7 - 8-stream
246  *
247  *@num_chains:
248  *
249  *			0 - 1-chain
250  *			1 - 2-chain
251  *			..  ..
252  *			7 - 8-chain
253  *
254  *@upload_bw_pkt:
255  *
256  *			0 - 20 MHz
257  *			1 - 40 MHz
258  *			2 - 80 MHz
259  *			3 - 160 MHz
260  *
261  * @sw_peer_id_valid: Indicates whether sw_peer_id field is valid or not,
262  * sent from MAC to PHY via the MACRX_FREEZE_CAPTURE_CHANNEL TLV
263  *
264  * @sw_peer_id: Indicates peer id based on AST search, sent from MAC to PHY
265  * via the MACRX_FREEZE_CAPTURE_CHANNEL TLV
266  *
267  * @phy_ppdu_id: sent from PHY to MAC, copied to MACRX_FREEZE_CAPTURE_CHANNEL
268  * TLV
269  *
270  * @total_bytes: Total size of CFR payload (FFT bins)
271  *
272  * @header_version:
273  *
274  *			1 - HKV2/Hastings
275  *			2 - Cypress
276  *			3 - Hasting Prime
277  *			4 - Pine
278  *			8 - Hamilton
279  *			9 - Waikiki
280  *
281  * @target_id:
282  *
283  *			1 - Hastings
284  *			2 - Cypress
285  *			3 - Hastings Prime
286  *			4 - Pine
287  *
288  * @cfr_fmt:
289  *
290  *			0 - raw (32-bit format)
291  *			1 - compressed (24-bit format)
292  *
293  * @mu_rx_data_incl: Indicates whether CFR header contains UL-MU-MIMO info
294  *
295  * @freeze_data_incl: Indicates whether CFR header contains
296  * MACRX_FREEZE_CAPTURE_CHANNEL TLV
297  *
298  * @freeze_tlv_version: Indicates the version of freeze_tlv
299  *			1 - HSP, Cypress
300  *			2 - Maple/Spruce/Moselle
301  *			3 - Pine
302  *
303  * @decimation_factor: FFT bins decimation
304  * @mu_rx_num_users: Number of users in UL-MU-PPDU
305  */
306 struct whal_cfir_enhanced_hdr {
307 	uint16_t tag              :  8,
308 		 length           :  6,
309 		 rsvd1            :  2;
310 
311 	uint16_t upload_done        :  1,
312 		 capture_type       :  3,
313 		 preamble_type      :  2,
314 		 nss                :  3,
315 		 num_chains         :  3,
316 		 upload_pkt_bw      :  3,
317 		 sw_peer_id_valid   :  1;
318 
319 	uint16_t sw_peer_id         : 16;
320 
321 	uint16_t phy_ppdu_id        : 16;
322 
323 	uint16_t total_bytes;
324 
325 	uint16_t header_version     :4,
326 		 target_id          :4,
327 		 cfr_fmt            :1,
328 		 rsvd2              :1,
329 		 mu_rx_data_incl    :1,
330 		 freeze_data_incl   :1,
331 		 freeze_tlv_version :4;
332 
333 	uint16_t mu_rx_num_users   :8,
334 		 decimation_factor :4,
335 		 rsvd3             :4;
336 
337 	uint16_t rsvd4;
338 };
339 
340 /*
341  * freeze_tlv v1/v2 used by Hastings/Cypress/Maple/Spruce/Moselle supports upto
342  * 4 UL MU users
343  *
344  * @freeze:
345  *		0: Allow channel capture
346  *		1: Freeze channel capture
347  *
348  * @capture_reason: Field only valid when the freeze field is 1. Indicates why
349  * the MAC asked to capture the channel
350  *		0: freeze_reason_TM
351  *		1: freeze_reason_FTM
352  *		2: freeze_reason_ACK_resp_to_TM_FTM
353  *		3: freeze_reason_TA_RA_TYPE_FILTER
354  *		4: freeze readon NDP_NDP
355  *		5: freeze_reason_ALL_PACKET
356  *
357  * @packet_type: Packet type of captured packets.
358  *		0: Management
359  *		1: Control
360  *		2: Data
361  *		3: Extension
362  *
363  * @packet_sub_type: packet subtype of the captured packets.
364  * @sw_peer_id_valid: It is valid only when the freeze field is set to 1.
365  *		0: no TA address search on the received frame has been
366  *		   performed. This is due to the frame not having a TA address
367  *		   (like ACK frame), or the received frame being from an other
368  *		   AP to which this device is not associated.
369  *		1: field sw_peer_id will contain valid information.
370  *		   This implies that a (successful) address search has been
371  *		   performed on the TA address of the received frame.
372  *
373  * @sw_peer_id: Valid only when sw_peer_id_valid field is set. It is an
374  * identifier that allows SW to double check that the CSI info stored belongs
375  * to the device with this SW identifier.
376  *
377  * @phy_ppdu_id: ppdu_id of ppdu which has channel capture performed. Field
378  * only valid when the freeze field is set to 1.
379  *
380  * @packet_ta_lower_16: Packet’s lower 16bits transmit address in MAC header.
381  *
382  * @packet_ta_mid_16: Packet’s middle 16bits transmit address in MAC header.
383  *
384  * @packet_ta_upper_16: Packet’s upper 16bits transmit address in MAC header.
385  *
386  * @packet_ra_lower_16: Packet’s lower 16bits receive address in MAC header.
387  *
388  * @packet_ra_mid_16: Packet’s middle 16bits receive address in MAC header.
389  *
390  * @packet_ra_upper_16: Packet’s upper 16bits receive address in MAC header.
391  *
392  * @tsf_timestamp_15_0: MAC side 64bit TSF timestamp when this TLV is sent to
393  * PHY. Bits [15:0].
394  *
395  * @tsf_timestamp_31_16: MAC side 64bit TSF timestamp when this TLV is sent to
396  * PHY. Bits [31:16].
397  *
398  * @tsf_timestamp_47_32: MAC side 64bit TSF timestamp when this TLV is sent to
399  * PHY. Bits [47:32].
400  *
401  * @tsf_timestamp_63_48: MAC side 64bit TSF timestamp when this TLV is sent to
402  * PHY. Bits [63:48].
403  *
404  * @user_index_or_user_mask_5_0: When freeze_tlv_version is 1, this field from
405  * MAC, indicate to PHY which user's channel information need to be uploaded.
406  * When freeze_tlv_version is 2 & MU_SUPPORT_IN_TLV is 1, this field indicates
407  * bitmap of users upto 4 to which channel capture need to be uploaded. And if
408  * freeze_tlv_version is 2 & MU_SUPPORT_IN_TLV is 0, this field indicate to PHY
409  * which user's channel information need to be uploaded
410  *
411  * @directed: Indicate the frame is directed to us or not when NDPA/NDP capture
412  * or FTM/TM/ACK capture. 1=directed. For other modes, it is 0.
413  */
414 struct macrx_freeze_capture_channel {
415 	uint16_t freeze                          :  1, //[0]
416 		 capture_reason                  :  3, //[3:1]
417 		 packet_type                     :  2, //[5:4]
418 		 packet_sub_type                 :  4, //[9:6]
419 		 reserved                        :  5, //[14:10]
420 		 sw_peer_id_valid                :  1; //[15]
421 	uint16_t sw_peer_id                      : 16; //[15:0]
422 	uint16_t phy_ppdu_id                     : 16; //[15:0]
423 	uint16_t packet_ta_lower_16              : 16; //[15:0]
424 	uint16_t packet_ta_mid_16                : 16; //[15:0]
425 	uint16_t packet_ta_upper_16              : 16; //[15:0]
426 	uint16_t packet_ra_lower_16              : 16; //[15:0]
427 	uint16_t packet_ra_mid_16                : 16; //[15:0]
428 	uint16_t packet_ra_upper_16              : 16; //[15:0]
429 	uint16_t tsf_timestamp_15_0              : 16; //[15:0]
430 	uint16_t tsf_timestamp_31_16             : 16; //[15:0]
431 	uint16_t tsf_timestamp_47_32             : 16; //[15:0]
432 	uint16_t tsf_timestamp_63_48             : 16; //[15:0]
433 	uint16_t user_index_or_user_mask_5_0     :  6, //[5:0]
434 		 directed                        :  1, //[6]
435 		 reserved_13                     :  9; //[15:7]
436 };
437 
438 /*
439  * freeze_tlv v3 used by Pine
440  *
441  * @freeze:
442  *		0: Allow channel capture
443  *		1: Freeze channel capture
444  *
445  * @capture_reason: Field only valid when the freeze field is 1. Indicates why
446  * the MAC asked to capture the channel
447  *		0: freeze_reason_TM
448  *		1: freeze_reason_FTM
449  *		2: freeze_reason_ACK_resp_to_TM_FTM
450  *		3: freeze_reason_TA_RA_TYPE_FILTER
451  *		4: freeze readon NDP_NDP
452  *		5: freeze_reason_ALL_PACKET
453  *
454  * @packet_type: Packet type of captured packets.
455  *		0: Management
456  *		1: Control
457  *		2: Data
458  *		3: Extension
459  *
460  * @packet_sub_type: packet subtype of the captured packets.
461  *
462  * @directed: Indicate the frame is directed to us or not when NDPA/NDP capture
463  * or FTM/TM/ACK capture. 1=directed. For other modes, it is 0.
464  *
465  * @sw_peer_id_valid: It is valid only when the freeze field is set to 1.
466  *		0: no TA address search on the received frame has been
467  *		   performed. This is due to the frame not having a TA address
468  *		   (like ACK frame), or the received frame being from an other
469  *		   AP to which this device is not associated.
470  *		1: field sw_peer_id will contain valid information.
471  *		   This implies that a (successful) address search has been
472  *		   performed on the TA address of the received frame.
473  *
474  * @sw_peer_id: Valid only when sw_peer_id_valid field is set. It is an
475  * identifier that allows SW to double check that the CSI info stored belongs
476  * to the device with this SW identifier.
477  *
478  * @phy_ppdu_id: ppdu_id of ppdu which has channel capture performed. Field
479  * only valid when the freeze field is set to 1.
480  *
481  * @packet_ta_lower_16: Packet’s lower 16bits transmit address in MAC header.
482  *
483  * @packet_ta_mid_16: Packet’s middle 16bits transmit address in MAC header.
484  *
485  * @packet_ta_upper_16: Packet’s upper 16bits transmit address in MAC header.
486  *
487  * @packet_ra_lower_16: Packet’s lower 16bits receive address in MAC header.
488  *
489  * @packet_ra_mid_16: Packet’s middle 16bits receive address in MAC header.
490  *
491  * @packet_ra_upper_16: Packet’s upper 16bits receive address in MAC header.
492  *
493  * @tsf_timestamp_15_0: MAC side 64bit TSF timestamp when this TLV is sent to
494  * PHY. Bits [15:0].
495  *
496  * @tsf_timestamp_31_16: MAC side 64bit TSF timestamp when this TLV is sent to
497  * PHY. Bits [31:16].
498  *
499  * @tsf_timestamp_47_32: MAC side 64bit TSF timestamp when this TLV is sent to
500  * PHY. Bits [47:32].
501  *
502  * @tsf_63_48_or_user_mask_36_32: Indicates to PHY which user's channel info
503  * need to be uploaded. Only valid in UL MU case with MU_SUPPORT_IN_TLV = 1.
504  * Otherwise this indicates to PHY MSBs 63:48 of the MAC side 64bit TSF
505  * timestamp when this TLV is sent to PHY.
506  *
507  * @user_index_or_user_mask_15_0: Indicate to PHY which user's channel info
508  * need to be uploaded in UL MU case with MU_SUPPORT_IN_TLV = 1. Otherwise it
509  * indicate PHY which user’s channel information need to be uploaded.
510  *
511  * @user_mask_31_16: Indicate to PHY which user’s channel information need to
512  * be uploaded. Only valid in UL MU case with MU_SUPPORT_IN_TLV = 1.
513  */
514 struct macrx_freeze_capture_channel_v3 {
515 	uint16_t freeze                          :  1, //[0]
516 		 capture_reason                  :  3, //[3:1]
517 		 packet_type                     :  2, //[5:4]
518 		 packet_sub_type                 :  4, //[9:6]
519 		 directed                        :  1, //[10]
520 		 reserved                        :  4, //[14:11]
521 		 sw_peer_id_valid                :  1; //[15]
522 	uint16_t sw_peer_id                      : 16; //[15:0]
523 	uint16_t phy_ppdu_id                     : 16; //[15:0]
524 	uint16_t packet_ta_lower_16              : 16; //[15:0]
525 	uint16_t packet_ta_mid_16                : 16; //[15:0]
526 	uint16_t packet_ta_upper_16              : 16; //[15:0]
527 	uint16_t packet_ra_lower_16              : 16; //[15:0]
528 	uint16_t packet_ra_mid_16                : 16; //[15:0]
529 	uint16_t packet_ra_upper_16              : 16; //[15:0]
530 	uint16_t tsf_timestamp_15_0              : 16; //[15:0]
531 	uint16_t tsf_timestamp_31_16             : 16; //[15:0]
532 	uint16_t tsf_timestamp_47_32             : 16; //[15:0]
533 	uint16_t tsf_63_48_or_user_mask_36_32    : 16; //[15:0]
534 	uint16_t user_index_or_user_mask_15_0    : 16; //[15:0]
535 	uint16_t user_mask_31_16                 : 16; //[15:0]
536 };
537 
538 struct uplink_user_setup_info {
539 	uint32_t bw_info_valid                   :  1, //[0]
540 		 uplink_receive_type             :  2, //[2:1]
541 		 reserved_0a                     :  1, //[3]
542 		 uplink_11ax_mcs                 :  4, //[7:4]
543 		 ru_width                        :  7, //[14:8]
544 		 reserved_0b                     :  1, //[15]
545 		 nss                             :  3, //[18:16]
546 		 stream_offset                   :  3, //[21:19]
547 		 sta_dcm                         :  1, //[22]
548 		 sta_coding                      :  1, //[23]
549 		 ru_start_index                  :  7, //[30:24]
550 		 reserved_0c                     :  1; //[31]
551 };
552 
553 struct macrx_freeze_capture_channel_v5 {
554 	uint16_t freeze                          :  1, //[0]
555 		 capture_reason                  :  3, //[3:1]
556 		 packet_type                     :  2, //[5:4]
557 		 packet_sub_type                 :  4, //[9:6]
558 		 reserved                        :  5, //[14:10]
559 		 sw_peer_id_valid                :  1; //[15]
560 	uint16_t sw_peer_id                      : 16; //[15:0]
561 	uint16_t phy_ppdu_id                     : 16; //[15:0]
562 	uint16_t packet_ta_lower_16              : 16; //[15:0]
563 	uint16_t packet_ta_mid_16                : 16; //[15:0]
564 	uint16_t packet_ta_upper_16              : 16; //[15:0]
565 	uint16_t packet_ra_lower_16              : 16; //[15:0]
566 	uint16_t packet_ra_mid_16                : 16; //[15:0]
567 	uint16_t packet_ra_upper_16              : 16; //[15:0]
568 	uint16_t tsf_timestamp_15_0              : 16; //[15:0]
569 	uint16_t tsf_timestamp_31_16             : 16; //[15:0]
570 	uint16_t tsf_timestamp_47_32             : 16; //[15:0]
571 	uint16_t tsf_timestamp_63_48             : 16; //[15:0]
572 	uint16_t user_index_or_user_mask_5_0     :  6, //[5:0]
573 		 directed                        :  1, //[6]
574 		 reserved_13                     :  9; //[15:7]
575 	uint16_t user_mask_21_6                  : 16; //[15:0]
576 	uint16_t user_mask_36_22                 : 15, //[14:0]
577 		 reserved_15a                    :  1; //[15]
578 };
579 
580 struct uplink_user_setup_info_v2 {
581 	uint32_t bw_info_valid                   :  1, //[0]
582 		 uplink_receive_type             :  2, //[2:1]
583 		 reserved_0a                     :  1, //[3]
584 		 uplink_11ax_mcs                 :  4, //[7:4]
585 		 nss                             :  3, //[10:8]
586 		 stream_offset                   :  3, //[13:11]
587 		 sta_dcm                         :  1, //[14]
588 		 sta_coding                      :  1, //[15]
589 		 ru_type_80_0                    :  4, //[19:16]
590 		 ru_type_80_1                    :  4, //[23:20]
591 		 ru_type_80_2                    :  4, //[27:24]
592 		 ru_type_80_3                    :  4; //[31:28]
593 	uint32_t ru_start_index_80_0             :  6, //[5:0]
594 		 reserved_1a                     :  2, //[7:6]
595 		 ru_start_index_80_1             :  6, //[13:8]
596 		 reserved_1b                     :  2, //[15:14]
597 		 ru_start_index_80_2             :  6, //[21:16]
598 		 reserved_1c                     :  2, //[23:22]
599 		 ru_start_index_80_3             :  6, //[29:24]
600 		 reserved_1d                     :  2; //[31-30]
601 };
602 
603 /**
604  * cfr_enh_init_pdev() - Inits cfr pdev and registers necessary handlers.
605  * @psoc: pointer to psoc object
606  * @pdev: pointer to pdev object
607  *
608  * Return: Registration status for necessary handlers
609  */
610 QDF_STATUS cfr_enh_init_pdev(
611 		struct wlan_objmgr_psoc *psoc,
612 		struct wlan_objmgr_pdev *pdev);
613 
614 /**
615  * cfr_enh_deinit_pdev() - De-inits corresponding pdev and handlers.
616  * @psoc: pointer to psoc object
617  * @pdev: pointer to pdev object
618  *
619  * Return: De-registration status for necessary handlers
620  */
621 QDF_STATUS cfr_enh_deinit_pdev(
622 		struct wlan_objmgr_psoc *psoc,
623 		struct wlan_objmgr_pdev *pdev);
624 
625 /**
626  * target_if_cfr_start_lut_age_timer() - Start timer to flush aged-out LUT
627  * entries
628  * @pdev: pointer to pdev object
629  *
630  * Return: None
631  */
632 void target_if_cfr_start_lut_age_timer(struct wlan_objmgr_pdev *pdev);
633 
634 /**
635  * target_if_cfr_stop_lut_age_timer() - Stop timer to flush aged-out LUT
636  * entries
637  * @pdev: pointer to pdev object
638  *
639  * Return: None
640  */
641 void target_if_cfr_stop_lut_age_timer(struct wlan_objmgr_pdev *pdev);
642 
643 /**
644  * target_if_cfr_dump_lut_enh() - Dump all valid LUT entries
645  * @pdev: objmgr PDEV
646  *
647  * Return: none
648  */
649 void target_if_cfr_dump_lut_enh(struct wlan_objmgr_pdev *pdev);
650 
651 /**
652  * target_if_cfr_config_rcc() - Start repetitive channel capture
653  * @pdev: pointer to pdev object
654  * @rcc_param: rcc configurations
655  *
656  * Return: Success/Failure status
657  */
658 QDF_STATUS target_if_cfr_config_rcc(struct wlan_objmgr_pdev *pdev,
659 				    struct cfr_rcc_param *rcc_param);
660 
661 /**
662  *  target_if_cfr_default_ta_ra_config() - Configure default values to all
663  *  params(BW/NSS/TA/RA) in TA_RA mode
664  * @rcc_param: rcc configurations
665  * @allvalid: Indicates whether all TA_RA params are valid or not.
666  *            It could be either 0 or 1.
667  *            1: should be sent to FW during CFR initialization
668  *            0: should be set, after a successful commit session.
669  * @reset_cfg: This bitmap is being used to determine which groups'
670  *            parameters are needed to be reset to its default state.
671  */
672 void target_if_cfr_default_ta_ra_config(struct cfr_rcc_param *rcc_param,
673 					bool allvalid, uint16_t reset_cfg);
674 
675 /**
676  * target_if_cfr_rx_tlv_process() - Process PPDU status TLVs and store info in
677  * lookup table
678  * @pdev: PDEV object
679  * @nbuf: ppdu info
680  *
681  * Return: none
682  */
683 void target_if_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf);
684 
685 /**
686  * target_if_cfr_update_global_cfg() - Update global config after a successful
687  * commit
688  * @pdev: pointer to pdev object
689  *
690  * Return: None
691  */
692 void target_if_cfr_update_global_cfg(struct wlan_objmgr_pdev *pdev);
693 #else
694 static inline QDF_STATUS cfr_enh_init_pdev(
695 		struct wlan_objmgr_psoc *psoc,
696 		struct wlan_objmgr_pdev *pdev)
697 {
698 	return QDF_STATUS_SUCCESS;
699 }
700 
701 static inline QDF_STATUS cfr_enh_deinit_pdev(
702 		struct wlan_objmgr_psoc *psoc,
703 		struct wlan_objmgr_pdev *pdev)
704 {
705 	return QDF_STATUS_SUCCESS;
706 }
707 #endif
708 #endif
709