1 Index: linux-2.6.23/drivers/net/phy/phy.c
2 ===================================================================
3 --- linux-2.6.23.orig/drivers/net/phy/phy.c 2007-10-14 00:05:26.000000000 +0200
4 +++ linux-2.6.23/drivers/net/phy/phy.c 2007-10-14 00:44:21.000000000 +0200
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.23/include/linux/phy.h
57 ===================================================================
58 --- linux-2.6.23.orig/include/linux/phy.h 2007-10-14 00:05:15.000000000 +0200
59 +++ linux-2.6.23/include/linux/phy.h 2007-10-14 00:18:54.000000000 +0200
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);