18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2012  Realtek Corporation.*/
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef __RTL92S_PHY_H__
58c2ecf20Sopenharmony_ci#define __RTL92S_PHY_H__
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#define MAX_TXPWR_IDX_NMODE_92S		63
88c2ecf20Sopenharmony_ci#define MAX_DOZE_WAITING_TIMES_9x	64
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/* Channel switch:The size of
118c2ecf20Sopenharmony_ci * command tables for switch channel */
128c2ecf20Sopenharmony_ci#define MAX_PRECMD_CNT			16
138c2ecf20Sopenharmony_ci#define MAX_RFDEPENDCMD_CNT		16
148c2ecf20Sopenharmony_ci#define MAX_POSTCMD_CNT			16
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define RF90_PATH_MAX			4
178c2ecf20Sopenharmony_ci#define RF6052_MAX_PATH			2
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_cienum version_8192s {
208c2ecf20Sopenharmony_ci	VERSION_8192S_ACUT,
218c2ecf20Sopenharmony_ci	VERSION_8192S_BCUT,
228c2ecf20Sopenharmony_ci	VERSION_8192S_CCUT
238c2ecf20Sopenharmony_ci};
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_cienum swchnlcmd_id {
268c2ecf20Sopenharmony_ci	CMDID_END,
278c2ecf20Sopenharmony_ci	CMDID_SET_TXPOWEROWER_LEVEL,
288c2ecf20Sopenharmony_ci	CMDID_BBREGWRITE10,
298c2ecf20Sopenharmony_ci	CMDID_WRITEPORT_ULONG,
308c2ecf20Sopenharmony_ci	CMDID_WRITEPORT_USHORT,
318c2ecf20Sopenharmony_ci	CMDID_WRITEPORT_UCHAR,
328c2ecf20Sopenharmony_ci	CMDID_RF_WRITEREG,
338c2ecf20Sopenharmony_ci};
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_cistruct swchnlcmd {
368c2ecf20Sopenharmony_ci	enum swchnlcmd_id cmdid;
378c2ecf20Sopenharmony_ci	u32 para1;
388c2ecf20Sopenharmony_ci	u32 para2;
398c2ecf20Sopenharmony_ci	u32 msdelay;
408c2ecf20Sopenharmony_ci};
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_cienum baseband_config_type {
438c2ecf20Sopenharmony_ci	/* Radio Path A */
448c2ecf20Sopenharmony_ci	BASEBAND_CONFIG_PHY_REG = 0,
458c2ecf20Sopenharmony_ci	/* Radio Path B */
468c2ecf20Sopenharmony_ci	BASEBAND_CONFIG_AGC_TAB = 1,
478c2ecf20Sopenharmony_ci};
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#define hal_get_firmwareversion(rtlpriv) \
508c2ecf20Sopenharmony_ci	(((struct rt_firmware *)(rtlpriv->rtlhal.pfirmware))->firmwareversion)
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciu32 rtl92s_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask);
538c2ecf20Sopenharmony_civoid rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask,
548c2ecf20Sopenharmony_ci			   u32 data);
558c2ecf20Sopenharmony_civoid rtl92s_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation);
568c2ecf20Sopenharmony_ciu32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
578c2ecf20Sopenharmony_ci			    u32 regaddr, u32 bitmask);
588c2ecf20Sopenharmony_civoid rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw,	enum radio_path rfpath,
598c2ecf20Sopenharmony_ci			   u32 regaddr, u32 bitmask, u32 data);
608c2ecf20Sopenharmony_civoid rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
618c2ecf20Sopenharmony_ci			    enum nl80211_channel_type ch_type);
628c2ecf20Sopenharmony_ciu8 rtl92s_phy_sw_chnl(struct ieee80211_hw *hw);
638c2ecf20Sopenharmony_cibool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
648c2ecf20Sopenharmony_ci				   enum rf_pwrstate rfpower_state);
658c2ecf20Sopenharmony_cibool rtl92s_phy_mac_config(struct ieee80211_hw *hw);
668c2ecf20Sopenharmony_civoid rtl92s_phy_switch_ephy_parameter(struct ieee80211_hw *hw);
678c2ecf20Sopenharmony_cibool rtl92s_phy_bb_config(struct ieee80211_hw *hw);
688c2ecf20Sopenharmony_cibool rtl92s_phy_rf_config(struct ieee80211_hw *hw);
698c2ecf20Sopenharmony_civoid rtl92s_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw);
708c2ecf20Sopenharmony_civoid rtl92s_phy_set_txpower(struct ieee80211_hw *hw, u8	channel);
718c2ecf20Sopenharmony_cibool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fwcmd_io);
728c2ecf20Sopenharmony_civoid rtl92s_phy_chk_fwcmd_iodone(struct ieee80211_hw *hw);
738c2ecf20Sopenharmony_civoid rtl92s_phy_set_beacon_hwreg(struct ieee80211_hw *hw, u16 beaconinterval);
748c2ecf20Sopenharmony_ciu8 rtl92s_phy_config_rf(struct ieee80211_hw *hw, enum radio_path rfpath) ;
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#endif
778c2ecf20Sopenharmony_ci
78