GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / rtlwifi / phydm / phydm_psd.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2016  Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * The full GNU General Public License is included in this distribution in the
15  * file called LICENSE.
16  *
17  * Contact Information:
18  * wlanfae <wlanfae@realtek.com>
19  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20  * Hsinchu 300, Taiwan.
21  *
22  * Larry Finger <Larry.Finger@lwfinger.net>
23  *
24  *****************************************************************************/
25
26 #ifndef __PHYDMPSD_H__
27 #define __PHYDMPSD_H__
28
29 /*#define PSD_VERSION   "1.0"*/ /*2016.09.22  Dino*/
30 #define PSD_VERSION "1.1" /*2016.10.07  Dino, Add Option for PSD Tone index
31                            *Selection
32                            */
33
34 #define STOP_TRX_SUCCESS 1
35 #define STOP_TRX_FAIL 0
36
37 struct psd_info {
38         u8 psd_in_progress;
39         u32 psd_reg;
40         u32 psd_report_reg;
41         u8 psd_pwr_common_offset;
42         u16 sw_avg_time;
43         u16 fft_smp_point;
44         u32 initial_gain_backup;
45         u32 rf_0x18_bkp;
46         u16 psd_fc_channel;
47         u32 psd_bw_rf_reg;
48         u8 psd_result[128];
49         u8 noise_k_en;
50 };
51
52 u32 phydm_get_psd_data(void *dm_void, u32 psd_tone_idx, u32 igi);
53
54 void phydm_psd_debug(void *dm_void, char input[][16], u32 *_used, char *output,
55                      u32 *_out_len, u32 input_num);
56
57 void phydm_psd(void *dm_void, u32 igi, u16 start_point, u16 stop_point);
58
59 void phydm_psd_para_setting(void *dm_void, u8 sw_avg_time, u8 hw_avg_time,
60                             u8 i_q_setting, u16 fft_smp_point, u8 ant_sel,
61                             u8 psd_input, u8 channel, u8 noise_k_en);
62
63 void phydm_psd_init(void *dm_void);
64
65 u8 phydm_get_psd_result_table(void *dm_void, int index);
66
67 #endif