summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2017-02-20 15:54:18 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-12-12 07:32:35 (GMT)
commit220cadfa3828a8f6e8bd6970f0dd82b18edde131 (patch)
tree11db941b59716e8f4d7fef87571e7b062ea5b0f3
parentde443224501e6469bd9eefc5351ca717e0a0a300 (diff)
downloadlinux-220cadfa3828a8f6e8bd6970f0dd82b18edde131.tar.xz
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 bc5a334..e2ca107 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)
return err;
}
+static int dpaa_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
+{
+ if (!net_dev->phydev)
+ return -EINVAL;
+ return phy_mii_ioctl(net_dev->phydev, rq, cmd);
+}
+
static const struct net_device_ops dpaa_ops = {
.ndo_open = dpaa_open,
.ndo_start_xmit = dpaa_start_xmit,
@@ -2342,6 +2349,7 @@ static const struct net_device_ops dpaa_ops = {
.ndo_set_mac_address = dpaa_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = dpaa_set_rx_mode,
+ .ndo_do_ioctl = dpaa_ioctl,
};
static int dpaa_napi_add(struct net_device *net_dev)