summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2019-11-07 11:39:37 +0300
committerDavid S. Miller <davem@davemloft.net>2019-11-08 02:25:17 +0300
commita613bafec516bcca3658d054bdc339008d20ac8a (patch)
treea66553b0aa259e37866b00ebefa7093b5b8c22ba /drivers/net
parent630d4e75dd2969bf7da40beb3d4704356d12ae39 (diff)
downloadlinux-a613bafec516bcca3658d054bdc339008d20ac8a.tar.xz
enetc: add ioctl() support for PHY-related ops
If there is an attached PHY try to handle the requested ioctl with its handler, which allows the userspace to access PHY registers, for example. This will make mii-diag and similar tools work. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/freescale/enetc/enetc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index b6ff89307409..25af207f1962 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
@@ -1599,7 +1599,10 @@ int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
if (cmd == SIOCGHWTSTAMP)
return enetc_hwtstamp_get(ndev, rq);
#endif
- return -EINVAL;
+
+ if (!ndev->phydev)
+ return -EINVAL;
+ return phy_mii_ioctl(ndev->phydev, rq, cmd);
}
int enetc_alloc_msix(struct enetc_ndev_priv *priv)