Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright(c) 2009-2014  Realtek Corporation.*/
0003 
0004 #ifndef __PHY_COMMON__
0005 #define __PHY_COMMON__
0006 
0007 #define RT_CANNOT_IO(hw)            false
0008 
0009 enum swchnlcmd_id {
0010     CMDID_END,
0011     CMDID_SET_TXPOWEROWER_LEVEL,
0012     CMDID_BBREGWRITE10,
0013     CMDID_WRITEPORT_ULONG,
0014     CMDID_WRITEPORT_USHORT,
0015     CMDID_WRITEPORT_UCHAR,
0016     CMDID_RF_WRITEREG,
0017 };
0018 
0019 struct swchnlcmd {
0020     enum swchnlcmd_id cmdid;
0021     u32 para1;
0022     u32 para2;
0023     u32 msdelay;
0024 };
0025 
0026 u32 rtl8723_phy_query_bb_reg(struct ieee80211_hw *hw,
0027                  u32 regaddr, u32 bitmask);
0028 void rtl8723_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr,
0029                   u32 bitmask, u32 data);
0030 u32 rtl8723_phy_calculate_bit_shift(u32 bitmask);
0031 u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
0032                    enum radio_path rfpath, u32 offset);
0033 void rtl8723_phy_rf_serial_write(struct ieee80211_hw *hw,
0034                  enum radio_path rfpath,
0035                  u32 offset, u32 data);
0036 long rtl8723_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw,
0037                   enum wireless_mode wirelessmode,
0038                   u8 txpwridx);
0039 void rtl8723_phy_init_bb_rf_reg_def(struct ieee80211_hw *hw);
0040 bool rtl8723_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
0041                       u32 cmdtableidx,
0042                       u32 cmdtablesz,
0043                       enum swchnlcmd_id cmdid,
0044                       u32 para1, u32 para2,
0045                       u32 msdelay);
0046 void rtl8723_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw,
0047                     bool iqk_ok,
0048                     long result[][8],
0049                     u8 final_candidate,
0050                     bool btxonly);
0051 void rtl8723_save_adda_registers(struct ieee80211_hw *hw, u32 *addareg,
0052                  u32 *addabackup, u32 registernum);
0053 void rtl8723_phy_save_mac_registers(struct ieee80211_hw *hw,
0054                     u32 *macreg, u32 *macbackup);
0055 void rtl8723_phy_reload_adda_registers(struct ieee80211_hw *hw,
0056                        u32 *addareg, u32 *addabackup,
0057                        u32 regiesternum);
0058 void rtl8723_phy_reload_mac_registers(struct ieee80211_hw *hw,
0059                       u32 *macreg, u32 *macbackup);
0060 void rtl8723_phy_path_adda_on(struct ieee80211_hw *hw, u32 *addareg,
0061                   bool is_patha_on, bool is2t);
0062 void rtl8723_phy_mac_setting_calibration(struct ieee80211_hw *hw,
0063                      u32 *macreg, u32 *macbackup);
0064 void rtl8723_phy_path_a_standby(struct ieee80211_hw *hw);
0065 void rtl8723_phy_pi_mode_switch(struct ieee80211_hw *hw, bool pi_mode);
0066 
0067 #endif