diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2011-03-10 06:52:13 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-14 15:02:14 -0700 |
commit | af1dc13e607c1d1a909e21ee87aafbe7b9d4ae81 (patch) | |
tree | f1651a8643c90b238b259c01dd91fa56fb9d632c /drivers/net/phy | |
parent | dc187cb381f1bceb30498861ece510245c43ed9f (diff) | |
download | linux-af1dc13e607c1d1a909e21ee87aafbe7b9d4ae81.tar.bz2 |
phylib: SIOCGMIIREG/SIOCSMIIREG: allow access to all mdio addresses
phylib would silently ignore the phy_id argument to these ioctls and
perform the read/write with the active phydev address, whereas most
non-phylib drivers seem to allow access to all mdio addresses
(E.G. pcnet_cs).
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/phy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index a8445c72fc13..f7670330f988 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -319,7 +319,8 @@ int phy_mii_ioctl(struct phy_device *phydev, /* fall through */ case SIOCGMIIREG: - mii_data->val_out = phy_read(phydev, mii_data->reg_num); + mii_data->val_out = mdiobus_read(phydev->bus, mii_data->phy_id, + mii_data->reg_num); break; case SIOCSMIIREG: @@ -350,8 +351,9 @@ int phy_mii_ioctl(struct phy_device *phydev, } } - phy_write(phydev, mii_data->reg_num, val); - + mdiobus_write(phydev->bus, mii_data->phy_id, + mii_data->reg_num, val); + if (mii_data->reg_num == MII_BMCR && val & BMCR_RESET && phydev->drv->config_init) { |