aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2017-02-20 10:54:18 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-20 22:21:23 -0500
commit1763413ac2c15f80fa2c2e308ecbf1a1b550a4c3 (patch)
tree3fe17b5983ec7fb9939c622dd96918f7d826dfdd
parent2cf8a897116a4433ca579aff8b0813d8fb2c4473 (diff)
dpaa_eth: implement ioctl() for PHY-related ops
This commit adds the ndo_do_ioctl() callback 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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/freescale/dpaa/dpaa_eth.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index bc5a3347fd4a..e2ca107f9d94 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2333,6 +2333,13 @@ static int dpaa_eth_stop(struct net_device *net_dev)
2333 return err; 2333 return err;
2334} 2334}
2335 2335
2336static int dpaa_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
2337{
2338 if (!net_dev->phydev)
2339 return -EINVAL;
2340 return phy_mii_ioctl(net_dev->phydev, rq, cmd);
2341}
2342
2336static const struct net_device_ops dpaa_ops = { 2343static const struct net_device_ops dpaa_ops = {
2337 .ndo_open = dpaa_open, 2344 .ndo_open = dpaa_open,
2338 .ndo_start_xmit = dpaa_start_xmit, 2345 .ndo_start_xmit = dpaa_start_xmit,
@@ -2342,6 +2349,7 @@ static const struct net_device_ops dpaa_ops = {
2342 .ndo_set_mac_address = dpaa_set_mac_address, 2349 .ndo_set_mac_address = dpaa_set_mac_address,
2343 .ndo_validate_addr = eth_validate_addr, 2350 .ndo_validate_addr = eth_validate_addr,
2344 .ndo_set_rx_mode = dpaa_set_rx_mode, 2351 .ndo_set_rx_mode = dpaa_set_rx_mode,
2352 .ndo_do_ioctl = dpaa_ioctl,
2345}; 2353};
2346 2354
2347static int dpaa_napi_add(struct net_device *net_dev) 2355static int dpaa_napi_add(struct net_device *net_dev)