0001
0002 #ifndef _R819XU_PHY_H
0003 #define _R819XU_PHY_H
0004
0005
0006 #define MAX_PRECMD_CNT 16
0007 #define MAX_RFDEPENDCMD_CNT 16
0008 #define MAX_POSTCMD_CNT 16
0009
0010 enum baseband_config_type {
0011 BASEBAND_CONFIG_PHY_REG = 0,
0012 BASEBAND_CONFIG_AGC_TAB = 1,
0013 };
0014
0015 enum switch_chan_cmd_id {
0016 CMD_ID_END,
0017 CMD_ID_SET_TX_PWR_LEVEL,
0018 CMD_ID_WRITE_PORT_ULONG,
0019 CMD_ID_WRITE_PORT_USHORT,
0020 CMD_ID_WRITE_PORT_UCHAR,
0021 CMD_ID_RF_WRITE_REG,
0022 };
0023
0024
0025
0026 struct sw_chnl_cmd {
0027 enum switch_chan_cmd_id cmd_id;
0028 u32 para_1;
0029 u32 para_2;
0030 u32 ms_delay;
0031 } __packed;
0032
0033 enum hw90_block_e {
0034 HW90_BLOCK_MAC = 0,
0035 HW90_BLOCK_PHY0 = 1,
0036 HW90_BLOCK_PHY1 = 2,
0037 HW90_BLOCK_RF = 3,
0038 HW90_BLOCK_MAXIMUM = 4,
0039 };
0040
0041 enum rf90_radio_path_e {
0042 RF90_PATH_A = 0,
0043 RF90_PATH_B = 1,
0044 RF90_PATH_C = 2,
0045 RF90_PATH_D = 3,
0046 RF90_PATH_MAX
0047 };
0048
0049 u8 rtl8192_phy_CheckIsLegalRFPath(struct net_device *dev, u32 e_rfpath);
0050 void rtl8192_setBBreg(struct net_device *dev, u32 reg_addr,
0051 u32 bitmask, u32 data);
0052 u32 rtl8192_QueryBBReg(struct net_device *dev, u32 reg_addr, u32 bitmask);
0053 void rtl8192_phy_SetRFReg(struct net_device *dev,
0054 enum rf90_radio_path_e e_rfpath,
0055 u32 reg_addr, u32 bitmask, u32 data);
0056 u32 rtl8192_phy_QueryRFReg(struct net_device *dev,
0057 enum rf90_radio_path_e e_rfpath,
0058 u32 reg_addr, u32 bitmask);
0059 void rtl8192_phy_configmac(struct net_device *dev);
0060 u8 rtl8192_phy_checkBBAndRF(struct net_device *dev,
0061 enum hw90_block_e CheckBlock,
0062 enum rf90_radio_path_e e_rfpath);
0063 void rtl8192_BBConfig(struct net_device *dev);
0064 void rtl8192_phy_getTxPower(struct net_device *dev);
0065 void rtl8192_phy_setTxPower(struct net_device *dev, u8 channel);
0066 void rtl8192_phy_RFConfig(struct net_device *dev);
0067 void rtl8192_phy_updateInitGain(struct net_device *dev);
0068 u8 rtl8192_phy_ConfigRFWithHeaderFile(struct net_device *dev,
0069 enum rf90_radio_path_e e_rfpath);
0070
0071 u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel);
0072 void rtl8192_SetBWMode(struct net_device *dev,
0073 enum ht_channel_width bandwidth,
0074 enum ht_extension_chan_offset offset);
0075 void rtl8192_SwChnl_WorkItem(struct net_device *dev);
0076 void rtl8192_SetBWModeWorkItem(struct net_device *dev);
0077 bool rtl8192_SetRFPowerState(struct net_device *dev,
0078 RT_RF_POWER_STATE eRFPowerState);
0079 void InitialGain819xUsb(struct net_device *dev, u8 Operation);
0080
0081 void InitialGainOperateWorkItemCallBack(struct work_struct *work);
0082
0083 #endif