1 Index: linux-2.6.25.4/drivers/net/phy/phy.c
2 ===================================================================
3 --- linux-2.6.25.4.orig/drivers/net/phy/phy.c
4 +++ linux-2.6.25.4/drivers/net/phy/phy.c
5 @@ -348,6 +348,50 @@ int phy_ethtool_gset(struct phy_device *
7 EXPORT_SYMBOL(phy_ethtool_gset);
9 +int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr)
13 + struct ethtool_cmd ecmd = { ETHTOOL_GSET };
14 + struct ethtool_value edata = { ETHTOOL_GLINK };
16 + if (get_user(cmd, (u32 *) useraddr))
21 + phy_ethtool_gset(phydev, &ecmd);
22 + if (copy_to_user(useraddr, &ecmd, sizeof(ecmd)))
27 + if (copy_from_user(&ecmd, useraddr, sizeof(ecmd)))
29 + return phy_ethtool_sset(phydev, &ecmd);
31 + case ETHTOOL_NWAY_RST:
32 + /* if autoneg is off, it's an error */
33 + tmp = phy_read(phydev, MII_BMCR);
34 + if (tmp & BMCR_ANENABLE) {
35 + tmp |= (BMCR_ANRESTART);
36 + phy_write(phydev, MII_BMCR, tmp);
42 + edata.data = (phy_read(phydev,
43 + MII_BMSR) & BMSR_LSTATUS) ? 1 : 0;
44 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
51 +EXPORT_SYMBOL(phy_ethtool_ioctl);
54 * phy_mii_ioctl - generic PHY MII ioctl interface
55 * @phydev: the phy_device struct
56 Index: linux-2.6.25.4/include/linux/phy.h
57 ===================================================================
58 --- linux-2.6.25.4.orig/include/linux/phy.h
59 +++ linux-2.6.25.4/include/linux/phy.h
60 @@ -399,6 +399,7 @@ void phy_start_machine(struct phy_device
61 void phy_stop_machine(struct phy_device *phydev);
62 int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
63 int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
64 +int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr);
65 int phy_mii_ioctl(struct phy_device *phydev,
66 struct mii_ioctl_data *mii_data, int cmd);
67 int phy_start_interrupts(struct phy_device *phydev);