aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/mvpp2.c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-07-27 23:21:36 +0200
committerDavid S. Miller <davem@davemloft.net>2014-07-29 16:47:43 -0700
commitbd695a5f0ccf7b38982c426d86055ff3591c9b5b (patch)
tree08e9da3531f5c72c0b82f0151913e571e564550b /drivers/net/ethernet/marvell/mvpp2.c
parentnet: mvpp2: fix 10 Mbit/s usage (diff)
downloadlinux-dev-bd695a5f0ccf7b38982c426d86055ff3591c9b5b.tar.xz
linux-dev-bd695a5f0ccf7b38982c426d86055ff3591c9b5b.zip
net: mvpp2: implement ioctl() operation for PHY ioctls
This commit implements the ->ndo_do_ioctl() operation so that the PHY-related ioctl() calls can work from userspace, which allows applications like mii-tool or mii-diag to do their job. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvpp2.c')
-rw-r--r--drivers/net/ethernet/marvell/mvpp2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 3cae3d2abe7e..ece83f101526 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5714,6 +5714,21 @@ mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
return stats;
}
+static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+ struct mvpp2_port *port = netdev_priv(dev);
+ int ret;
+
+ if (!port->phy_dev)
+ return -ENOTSUPP;
+
+ ret = phy_mii_ioctl(port->phy_dev, ifr, cmd);
+ if (!ret)
+ mvpp2_link_event(dev);
+
+ return ret;
+}
+
/* Ethtool methods */
/* Get settings (phy address, speed) for ethtools */
@@ -5868,6 +5883,7 @@ static const struct net_device_ops mvpp2_netdev_ops = {
.ndo_set_mac_address = mvpp2_set_mac_address,
.ndo_change_mtu = mvpp2_change_mtu,
.ndo_get_stats64 = mvpp2_get_stats64,
+ .ndo_do_ioctl = mvpp2_ioctl,
};
static const struct ethtool_ops mvpp2_eth_tool_ops = {