ar71xx: fix compile error in r40969, refresh patches
[openwrt/staging/yousong.git] / target / linux / ar71xx / patches-3.10 / 424-net-phy-add-phy_mmd_read_write-functions.patch
1 --- a/drivers/net/phy/phy.c
2 +++ b/drivers/net/phy/phy.c
3 @@ -1009,6 +1009,12 @@ static int phy_read_mmd_indirect(struct
4 return ret;
5 }
6
7 +int phy_read_mmd(struct phy_device *phydev, int prtad, int devad, int addr)
8 +{
9 + return phy_read_mmd_indirect(phydev->bus, prtad, devad, phydev->addr);
10 +}
11 +EXPORT_SYMBOL(phy_read_mmd);
12 +
13 /**
14 * phy_write_mmd_indirect - writes data to the MMD registers
15 * @bus: the target MII bus
16 @@ -1034,6 +1040,12 @@ static void phy_write_mmd_indirect(struc
17 bus->write(bus, addr, MII_MMD_DATA, data);
18 }
19
20 +void phy_write_mmd(struct phy_device *phydev, int prtad, int devad, u16 data)
21 +{
22 + phy_write_mmd_indirect(phydev->bus, prtad, devad, phydev->addr, data);
23 +}
24 +EXPORT_SYMBOL(phy_write_mmd);
25 +
26 /**
27 * phy_init_eee - init and check the EEE feature
28 * @phydev: target phy_device struct
29 --- a/include/linux/phy.h
30 +++ b/include/linux/phy.h
31 @@ -580,6 +580,9 @@ int phy_register_fixup_for_uid(u32 phy_u
32 int (*run)(struct phy_device *));
33 int phy_scan_fixups(struct phy_device *phydev);
34
35 +int phy_read_mmd(struct phy_device *phydev, int prtad, int devad, int addr);
36 +void phy_write_mmd(struct phy_device *phydev, int prtad, int devad, u16 data);
37 +
38 int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
39 int phy_get_eee_err(struct phy_device *phydev);
40 int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);