return 0;
}
-static int rtl8366rb_read_phy_reg(struct rtl8366rb *rtl,
+static int rtl8366rb_read_phy_reg(struct rtl8366_smi *smi,
u32 phy_no, u32 page, u32 addr, u32 *data)
{
- struct rtl8366_smi *smi = &rtl->smi;
u32 reg;
int ret;
return 0;
}
-static int rtl8366rb_write_phy_reg(struct rtl8366rb *rtl,
+static int rtl8366rb_write_phy_reg(struct rtl8366_smi *smi,
u32 phy_no, u32 page, u32 addr, u32 data)
{
- struct rtl8366_smi *smi = &rtl->smi;
u32 reg;
int ret;
static int rtl8366rb_mii_read(struct mii_bus *bus, int addr, int reg)
{
- struct rtl8366rb *rtl = smi_to_rtl8366rb(bus->priv);
+ struct rtl8366_smi *smi = bus->priv;
u32 val = 0;
int err;
- err = rtl8366rb_read_phy_reg(rtl, addr, 0, reg, &val);
+ err = rtl8366rb_read_phy_reg(smi, addr, 0, reg, &val);
if (err)
return 0xffff;
static int rtl8366rb_mii_write(struct mii_bus *bus, int addr, int reg, u16 val)
{
- struct rtl8366rb *rtl = smi_to_rtl8366rb(bus->priv);
+ struct rtl8366_smi *smi = bus->priv;
u32 t;
int err;
- err = rtl8366rb_write_phy_reg(rtl, addr, 0, reg, val);
+ err = rtl8366rb_write_phy_reg(smi, addr, 0, reg, val);
/* flush write */
- (void) rtl8366rb_read_phy_reg(rtl, addr, 0, reg, &t);
+ (void) rtl8366rb_read_phy_reg(smi, addr, 0, reg, &t);
return err;
}
return 0;
}
-static int rtl8366s_read_phy_reg(struct rtl8366s *rtl,
+static int rtl8366s_read_phy_reg(struct rtl8366_smi *smi,
u32 phy_no, u32 page, u32 addr, u32 *data)
{
- struct rtl8366_smi *smi = &rtl->smi;
u32 reg;
int ret;
return 0;
}
-static int rtl8366s_write_phy_reg(struct rtl8366s *rtl,
+static int rtl8366s_write_phy_reg(struct rtl8366_smi *smi,
u32 phy_no, u32 page, u32 addr, u32 data)
{
- struct rtl8366_smi *smi = &rtl->smi;
u32 reg;
int ret;
static int rtl8366s_mii_read(struct mii_bus *bus, int addr, int reg)
{
- struct rtl8366s *rtl = smi_to_rtl8366s(bus->priv);
+ struct rtl8366_smi *smi = bus->priv;
u32 val = 0;
int err;
- err = rtl8366s_read_phy_reg(rtl, addr, 0, reg, &val);
+ err = rtl8366s_read_phy_reg(smi, addr, 0, reg, &val);
if (err)
return 0xffff;
static int rtl8366s_mii_write(struct mii_bus *bus, int addr, int reg, u16 val)
{
- struct rtl8366s *rtl = smi_to_rtl8366s(bus->priv);
+ struct rtl8366_smi *smi = bus->priv;
u32 t;
int err;
- err = rtl8366s_write_phy_reg(rtl, addr, 0, reg, val);
+ err = rtl8366s_write_phy_reg(smi, addr, 0, reg, val);
/* flush write */
- (void) rtl8366s_read_phy_reg(rtl, addr, 0, reg, &t);
+ (void) rtl8366s_read_phy_reg(smi, addr, 0, reg, &t);
return err;
}