* [PATCH] phylib: SIOCGMIIREG/SIOCSMIIREG: allow access to all mdio addresses
@ 2011-03-10 16:52 Peter Korsgaard
2011-03-14 22:02 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Peter Korsgaard @ 2011-03-10 16:52 UTC (permalink / raw)
To: davem, netdev; +Cc: Peter Korsgaard
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>
---
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 a8445c7..f767033 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) {
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] phylib: SIOCGMIIREG/SIOCSMIIREG: allow access to all mdio addresses
2011-03-10 16:52 [PATCH] phylib: SIOCGMIIREG/SIOCSMIIREG: allow access to all mdio addresses Peter Korsgaard
@ 2011-03-14 22:02 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-03-14 22:02 UTC (permalink / raw)
To: jacmet; +Cc: netdev
From: Peter Korsgaard <jacmet@sunsite.dk>
Date: Thu, 10 Mar 2011 17:52:13 +0100
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-14 22:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-10 16:52 [PATCH] phylib: SIOCGMIIREG/SIOCSMIIREG: allow access to all mdio addresses Peter Korsgaard
2011-03-14 22:02 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).