Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright(c) 2009-2012  Realtek Corporation.*/
0003 
0004 #ifndef __RTL92S_PHY_H__
0005 #define __RTL92S_PHY_H__
0006 
0007 #define MAX_TXPWR_IDX_NMODE_92S     63
0008 #define MAX_DOZE_WAITING_TIMES_9x   64
0009 
0010 /* Channel switch:The size of
0011  * command tables for switch channel */
0012 #define MAX_PRECMD_CNT          16
0013 #define MAX_RFDEPENDCMD_CNT     16
0014 #define MAX_POSTCMD_CNT         16
0015 
0016 #define RF90_PATH_MAX           4
0017 #define RF6052_MAX_PATH         2
0018 
0019 enum version_8192s {
0020     VERSION_8192S_ACUT,
0021     VERSION_8192S_BCUT,
0022     VERSION_8192S_CCUT
0023 };
0024 
0025 enum swchnlcmd_id {
0026     CMDID_END,
0027     CMDID_SET_TXPOWEROWER_LEVEL,
0028     CMDID_BBREGWRITE10,
0029     CMDID_WRITEPORT_ULONG,
0030     CMDID_WRITEPORT_USHORT,
0031     CMDID_WRITEPORT_UCHAR,
0032     CMDID_RF_WRITEREG,
0033 };
0034 
0035 struct swchnlcmd {
0036     enum swchnlcmd_id cmdid;
0037     u32 para1;
0038     u32 para2;
0039     u32 msdelay;
0040 };
0041 
0042 enum baseband_config_type {
0043     /* Radio Path A */
0044     BASEBAND_CONFIG_PHY_REG = 0,
0045     /* Radio Path B */
0046     BASEBAND_CONFIG_AGC_TAB = 1,
0047 };
0048 
0049 #define hal_get_firmwareversion(rtlpriv) \
0050     (((struct rt_firmware *)(rtlpriv->rtlhal.pfirmware))->firmwareversion)
0051 
0052 u32 rtl92s_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask);
0053 void rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask,
0054                u32 data);
0055 void rtl92s_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation);
0056 u32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
0057                 u32 regaddr, u32 bitmask);
0058 void rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
0059                u32 regaddr, u32 bitmask, u32 data);
0060 void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
0061                 enum nl80211_channel_type ch_type);
0062 u8 rtl92s_phy_sw_chnl(struct ieee80211_hw *hw);
0063 bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
0064                    enum rf_pwrstate rfpower_state);
0065 bool rtl92s_phy_mac_config(struct ieee80211_hw *hw);
0066 void rtl92s_phy_switch_ephy_parameter(struct ieee80211_hw *hw);
0067 bool rtl92s_phy_bb_config(struct ieee80211_hw *hw);
0068 bool rtl92s_phy_rf_config(struct ieee80211_hw *hw);
0069 void rtl92s_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw);
0070 void rtl92s_phy_set_txpower(struct ieee80211_hw *hw, u8 channel);
0071 bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fwcmd_io);
0072 void rtl92s_phy_chk_fwcmd_iodone(struct ieee80211_hw *hw);
0073 void rtl92s_phy_set_beacon_hwreg(struct ieee80211_hw *hw, u16 beaconinterval);
0074 u8 rtl92s_phy_config_rf(struct ieee80211_hw *hw, enum radio_path rfpath) ;
0075 
0076 #endif
0077