162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* Copyright(c) 2009-2012 Realtek Corporation.*/ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#ifndef __RTL92S_PHY_H__ 562306a36Sopenharmony_ci#define __RTL92S_PHY_H__ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#define MAX_TXPWR_IDX_NMODE_92S 63 862306a36Sopenharmony_ci#define MAX_DOZE_WAITING_TIMES_9x 64 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci/* Channel switch:The size of 1162306a36Sopenharmony_ci * command tables for switch channel */ 1262306a36Sopenharmony_ci#define MAX_PRECMD_CNT 16 1362306a36Sopenharmony_ci#define MAX_RFDEPENDCMD_CNT 16 1462306a36Sopenharmony_ci#define MAX_POSTCMD_CNT 16 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#define RF90_PATH_MAX 4 1762306a36Sopenharmony_ci#define RF6052_MAX_PATH 2 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_cienum version_8192s { 2062306a36Sopenharmony_ci VERSION_8192S_ACUT, 2162306a36Sopenharmony_ci VERSION_8192S_BCUT, 2262306a36Sopenharmony_ci VERSION_8192S_CCUT 2362306a36Sopenharmony_ci}; 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_cienum swchnlcmd_id { 2662306a36Sopenharmony_ci CMDID_END, 2762306a36Sopenharmony_ci CMDID_SET_TXPOWEROWER_LEVEL, 2862306a36Sopenharmony_ci CMDID_BBREGWRITE10, 2962306a36Sopenharmony_ci CMDID_WRITEPORT_ULONG, 3062306a36Sopenharmony_ci CMDID_WRITEPORT_USHORT, 3162306a36Sopenharmony_ci CMDID_WRITEPORT_UCHAR, 3262306a36Sopenharmony_ci CMDID_RF_WRITEREG, 3362306a36Sopenharmony_ci}; 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_cistruct swchnlcmd { 3662306a36Sopenharmony_ci enum swchnlcmd_id cmdid; 3762306a36Sopenharmony_ci u32 para1; 3862306a36Sopenharmony_ci u32 para2; 3962306a36Sopenharmony_ci u32 msdelay; 4062306a36Sopenharmony_ci}; 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_cienum baseband_config_type { 4362306a36Sopenharmony_ci /* Radio Path A */ 4462306a36Sopenharmony_ci BASEBAND_CONFIG_PHY_REG = 0, 4562306a36Sopenharmony_ci /* Radio Path B */ 4662306a36Sopenharmony_ci BASEBAND_CONFIG_AGC_TAB = 1, 4762306a36Sopenharmony_ci}; 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci#define hal_get_firmwareversion(rtlpriv) \ 5062306a36Sopenharmony_ci (((struct rt_firmware *)(rtlpriv->rtlhal.pfirmware))->firmwareversion) 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ciu32 rtl92s_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask); 5362306a36Sopenharmony_civoid rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask, 5462306a36Sopenharmony_ci u32 data); 5562306a36Sopenharmony_civoid rtl92s_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation); 5662306a36Sopenharmony_ciu32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath, 5762306a36Sopenharmony_ci u32 regaddr, u32 bitmask); 5862306a36Sopenharmony_civoid rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath, 5962306a36Sopenharmony_ci u32 regaddr, u32 bitmask, u32 data); 6062306a36Sopenharmony_civoid rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw, 6162306a36Sopenharmony_ci enum nl80211_channel_type ch_type); 6262306a36Sopenharmony_ciu8 rtl92s_phy_sw_chnl(struct ieee80211_hw *hw); 6362306a36Sopenharmony_cibool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw, 6462306a36Sopenharmony_ci enum rf_pwrstate rfpower_state); 6562306a36Sopenharmony_cibool rtl92s_phy_mac_config(struct ieee80211_hw *hw); 6662306a36Sopenharmony_civoid rtl92s_phy_switch_ephy_parameter(struct ieee80211_hw *hw); 6762306a36Sopenharmony_cibool rtl92s_phy_bb_config(struct ieee80211_hw *hw); 6862306a36Sopenharmony_cibool rtl92s_phy_rf_config(struct ieee80211_hw *hw); 6962306a36Sopenharmony_civoid rtl92s_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw); 7062306a36Sopenharmony_civoid rtl92s_phy_set_txpower(struct ieee80211_hw *hw, u8 channel); 7162306a36Sopenharmony_cibool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fwcmd_io); 7262306a36Sopenharmony_civoid rtl92s_phy_chk_fwcmd_iodone(struct ieee80211_hw *hw); 7362306a36Sopenharmony_civoid rtl92s_phy_set_beacon_hwreg(struct ieee80211_hw *hw, u16 beaconinterval); 7462306a36Sopenharmony_ciu8 rtl92s_phy_config_rf(struct ieee80211_hw *hw, enum radio_path rfpath) ; 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ci#endif 7762306a36Sopenharmony_ci 78