1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2016  Realtek Corporation.
5  *
6  * Contact Information:
7  * wlanfae <wlanfae@realtek.com>
8  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
9  * Hsinchu 300, Taiwan.
10  *
11  * Larry Finger <Larry.Finger@lwfinger.net>
12  *
13  *****************************************************************************/
14 
15 #ifndef __PHYDMPSD_H__
16 #define __PHYDMPSD_H__
17 
18 /*#define PSD_VERSION	"1.0"*/ /*2016.09.22  Dino*/
19 #define PSD_VERSION "1.1" /*2016.10.07  Dino, Add Option for PSD Tone index
20 			   *Selection
21 			   */
22 
23 #define STOP_TRX_SUCCESS 1
24 #define STOP_TRX_FAIL 0
25 
26 struct psd_info {
27 	u8 psd_in_progress;
28 	u32 psd_reg;
29 	u32 psd_report_reg;
30 	u8 psd_pwr_common_offset;
31 	u16 sw_avg_time;
32 	u16 fft_smp_point;
33 	u32 initial_gain_backup;
34 	u32 rf_0x18_bkp;
35 	u16 psd_fc_channel;
36 	u32 psd_bw_rf_reg;
37 	u8 psd_result[128];
38 	u8 noise_k_en;
39 };
40 
41 u32 phydm_get_psd_data(void *dm_void, u32 psd_tone_idx, u32 igi);
42 
43 void phydm_psd_debug(void *dm_void, char input[][16], u32 *_used, char *output,
44 		     u32 *_out_len, u32 input_num);
45 
46 void phydm_psd(void *dm_void, u32 igi, u16 start_point, u16 stop_point);
47 
48 void phydm_psd_para_setting(void *dm_void, u8 sw_avg_time, u8 hw_avg_time,
49 			    u8 i_q_setting, u16 fft_smp_point, u8 ant_sel,
50 			    u8 psd_input, u8 channel, u8 noise_k_en);
51 
52 void phydm_psd_init(void *dm_void);
53 
54 u8 phydm_get_psd_result_table(void *dm_void, int index);
55 
56 #endif
57