linux/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c

// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2009-2014  Realtek Corporation.*/

#include "../wifi.h"
#include "../pci.h"
#include "../ps.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
#include "rf.h"
#include "dm.h"
#include "table.h"

static u32 _rtl92ee_phy_rf_serial_read(struct ieee80211_hw *hw,
				       enum radio_path rfpath, u32 offset);
static void _rtl92ee_phy_rf_serial_write(struct ieee80211_hw *hw,
					 enum radio_path rfpath, u32 offset,
					 u32 data);
static bool _rtl92ee_phy_bb8192ee_config_parafile(struct ieee80211_hw *hw);
static bool _rtl92ee_phy_config_mac_with_headerfile(struct ieee80211_hw *hw);
static bool phy_config_bb_with_hdr_file(struct ieee80211_hw *hw,
					u8 configtype);
static bool phy_config_bb_with_pghdrfile(struct ieee80211_hw *hw,
					 u8 configtype);
static void phy_init_bb_rf_register_def(struct ieee80211_hw *hw);
static bool _rtl92ee_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
					      u32 cmdtableidx, u32 cmdtablesz,
					      enum swchnlcmd_id cmdid,
					      u32 para1, u32 para2,
					      u32 msdelay);
static bool _rtl92ee_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
					      u8 channel, u8 *stage,
					      u8 *step, u32 *delay);
static long _rtl92ee_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw,
					  enum wireless_mode wirelessmode,
					  u8 txpwridx);
static void rtl92ee_phy_set_rf_on(struct ieee80211_hw *hw);
static void rtl92ee_phy_set_io(struct ieee80211_hw *hw);

u32 rtl92ee_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
{}

void rtl92ee_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr,
			    u32 bitmask, u32 data)
{}

u32 rtl92ee_phy_query_rf_reg(struct ieee80211_hw *hw,
			     enum radio_path rfpath, u32 regaddr, u32 bitmask)
{}

void rtl92ee_phy_set_rf_reg(struct ieee80211_hw *hw,
			    enum radio_path rfpath,
			    u32 addr, u32 bitmask, u32 data)
{}

static u32 _rtl92ee_phy_rf_serial_read(struct ieee80211_hw *hw,
				       enum radio_path rfpath, u32 offset)
{}

static void _rtl92ee_phy_rf_serial_write(struct ieee80211_hw *hw,
					 enum radio_path rfpath, u32 offset,
					 u32 data)
{}

bool rtl92ee_phy_mac_config(struct ieee80211_hw *hw)
{}

bool rtl92ee_phy_bb_config(struct ieee80211_hw *hw)
{}

bool rtl92ee_phy_rf_config(struct ieee80211_hw *hw)
{}

static bool _check_condition(struct ieee80211_hw *hw,
			     const u32  condition)
{}

static void _rtl92ee_config_rf_reg(struct ieee80211_hw *hw, u32 addr, u32 data,
				   enum radio_path rfpath, u32 regaddr)
{}

static void _rtl92ee_config_rf_radio_a(struct ieee80211_hw *hw,
				       u32 addr, u32 data)
{}

static void _rtl92ee_config_rf_radio_b(struct ieee80211_hw *hw,
				       u32 addr, u32 data)
{}

static void _rtl92ee_config_bb_reg(struct ieee80211_hw *hw,
				   u32 addr, u32 data)
{}

static void _rtl92ee_phy_init_tx_power_by_rate(struct ieee80211_hw *hw)
{}

static void _rtl92ee_phy_set_txpower_by_rate_base(struct ieee80211_hw *hw,
						  u8 band, u8 path,
						  u8 rate_section, u8 txnum,
						  u8 value)
{}

static u8 _rtl92ee_phy_get_txpower_by_rate_base(struct ieee80211_hw *hw,
						u8 band, u8 path, u8 txnum,
						u8 rate_section)
{}

static void _rtl92ee_phy_store_txpower_by_rate_base(struct ieee80211_hw *hw)
{}

static void _phy_convert_txpower_dbm_to_relative_value(u32 *data, u8 start,
						       u8 end, u8 base)
{}

static void phy_convert_txpwr_dbm_to_rel_val(struct ieee80211_hw *hw)
{}

static void _rtl92ee_phy_txpower_by_rate_configuration(struct ieee80211_hw *hw)
{}

static bool _rtl92ee_phy_bb8192ee_config_parafile(struct ieee80211_hw *hw)
{}

static bool _rtl92ee_phy_config_mac_with_headerfile(struct ieee80211_hw *hw)
{}

#define READ_NEXT_PAIR(v1, v2, i)

static bool phy_config_bb_with_hdr_file(struct ieee80211_hw *hw,
					u8 configtype)
{}

static u8 _rtl92ee_get_rate_section_index(u32 regaddr)
{}

static void _rtl92ee_store_tx_power_by_rate(struct ieee80211_hw *hw,
					    enum band_type band,
					    enum radio_path rfpath,
					    u32 txnum, u32 regaddr,
					    u32 bitmask, u32 data)
{}

static bool phy_config_bb_with_pghdrfile(struct ieee80211_hw *hw,
					 u8 configtype)
{}

#define READ_NEXT_RF_PAIR(v1, v2, i)

bool rtl92ee_phy_config_rf_with_headerfile(struct ieee80211_hw  *hw,
					   enum radio_path rfpath)
{}

void rtl92ee_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw)
{}

static void phy_init_bb_rf_register_def(struct ieee80211_hw *hw)
{}

void rtl92ee_phy_get_txpower_level(struct ieee80211_hw *hw, long *powerlevel)
{}

static u8 _rtl92ee_phy_get_ratesection_intxpower_byrate(enum radio_path path,
							u8 rate)
{}

static u8 _rtl92ee_get_txpower_by_rate(struct ieee80211_hw *hw,
				       enum band_type band,
				       enum radio_path rf, u8 rate)
{}

static u8 _rtl92ee_get_txpower_index(struct ieee80211_hw *hw,
				     enum radio_path rfpath, u8 rate,
				     u8 bw, u8 channel)
{}

static void _rtl92ee_set_txpower_index(struct ieee80211_hw *hw, u8 pwr_idx,
				       enum radio_path rfpath, u8 rate)
{}

static void phy_set_txpower_index_by_rate_array(struct ieee80211_hw *hw,
						enum radio_path rfpath, u8 bw,
						u8 channel, u8 *rates, u8 size)
{}

static void phy_set_txpower_index_by_rate_section(struct ieee80211_hw *hw,
						  enum radio_path rfpath,
						  u8 channel,
						  enum rate_section section)
{}

void rtl92ee_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel)
{}

static long _rtl92ee_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw,
					  enum wireless_mode wirelessmode,
					  u8 txpwridx)
{}

void rtl92ee_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
{}

void rtl92ee_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
{}

void rtl92ee_phy_set_bw_mode(struct ieee80211_hw *hw,
			     enum nl80211_channel_type ch_type)
{}

void rtl92ee_phy_sw_chnl_callback(struct ieee80211_hw *hw)
{}

u8 rtl92ee_phy_sw_chnl(struct ieee80211_hw *hw)
{}

static bool _rtl92ee_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
					      u8 channel, u8 *stage, u8 *step,
					      u32 *delay)
{}

static bool _rtl92ee_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
					      u32 cmdtableidx, u32 cmdtablesz,
					      enum swchnlcmd_id cmdid,
					      u32 para1, u32 para2, u32 msdelay)
{}

static u8 _rtl92ee_phy_path_a_iqk(struct ieee80211_hw *hw, bool config_pathb)
{}

static u8 _rtl92ee_phy_path_b_iqk(struct ieee80211_hw *hw)
{}

static u8 _rtl92ee_phy_path_a_rx_iqk(struct ieee80211_hw *hw, bool config_pathb)
{}

static u8 _rtl92ee_phy_path_b_rx_iqk(struct ieee80211_hw *hw, bool config_pathb)
{}

static void _rtl92ee_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw,
						bool b_iqk_ok, long result[][8],
						u8 final_candidate,
						bool btxonly)
{}

static void _rtl92ee_phy_path_b_fill_iqk_matrix(struct ieee80211_hw *hw,
						bool b_iqk_ok, long result[][8],
						u8 final_candidate,
						bool btxonly)
{}

static void _rtl92ee_phy_save_adda_registers(struct ieee80211_hw *hw,
					     u32 *addareg, u32 *addabackup,
					     u32 registernum)
{}

static void _rtl92ee_phy_save_mac_registers(struct ieee80211_hw *hw,
					    u32 *macreg, u32 *macbackup)
{}

static void _rtl92ee_phy_reload_adda_registers(struct ieee80211_hw *hw,
					       u32 *addareg, u32 *addabackup,
					       u32 regiesternum)
{}

static void _rtl92ee_phy_reload_mac_registers(struct ieee80211_hw *hw,
					      u32 *macreg, u32 *macbackup)
{}

static void _rtl92ee_phy_path_adda_on(struct ieee80211_hw *hw, u32 *addareg,
				      bool is_patha_on, bool is2t)
{}

static void _rtl92ee_phy_mac_setting_calibration(struct ieee80211_hw *hw,
						 u32 *macreg, u32 *macbackup)
{}

static void _rtl92ee_phy_path_a_standby(struct ieee80211_hw *hw)
{}

static bool _rtl92ee_phy_simularity_compare(struct ieee80211_hw *hw,
					    long result[][8], u8 c1, u8 c2)
{}

static void _rtl92ee_phy_iq_calibrate(struct ieee80211_hw *hw,
				      long result[][8], u8 t, bool is2t)
{}

static void _rtl92ee_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t)
{}

static void _rtl92ee_phy_set_rfpath_switch(struct ieee80211_hw *hw,
					   bool bmain, bool is2t)
{}

#undef IQK_ADDA_REG_NUM
#undef IQK_DELAY_TIME

static u8 rtl92ee_get_rightchnlplace_for_iqk(u8 chnl)
{}

void rtl92ee_phy_iq_calibrate(struct ieee80211_hw *hw, bool b_recovery)
{}

void rtl92ee_phy_lc_calibrate(struct ieee80211_hw *hw)
{}

void rtl92ee_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta)
{}

void rtl92ee_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain)
{}

bool rtl92ee_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
{}

static void rtl92ee_phy_set_io(struct ieee80211_hw *hw)
{}

static void rtl92ee_phy_set_rf_on(struct ieee80211_hw *hw)
{}

static void _rtl92ee_phy_set_rf_sleep(struct ieee80211_hw *hw)
{}

static bool _rtl92ee_phy_set_rf_power_state(struct ieee80211_hw *hw,
					    enum rf_pwrstate rfpwr_state)
{}

bool rtl92ee_phy_set_rf_power_state(struct ieee80211_hw *hw,
				    enum rf_pwrstate rfpwr_state)
{}