Commit e11e8729 authored by Romain Perier's avatar Romain Perier Committed by David S. Miller

net: arc_emac: Add support for ndo_do_ioctl net_device_ops operation

This operation is required for handling ioctl commands like SIOCGMIIREG,
when debugging MDIO registers from userspace.

This commit adds support for this operation.
Signed-off-by: default avatarRomain Perier <romain.perier@collabora.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f4b2a420
...@@ -720,6 +720,18 @@ static int arc_emac_set_address(struct net_device *ndev, void *p) ...@@ -720,6 +720,18 @@ static int arc_emac_set_address(struct net_device *ndev, void *p)
return 0; return 0;
} }
static int arc_emac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
if (!netif_running(dev))
return -EINVAL;
if (!dev->phydev)
return -ENODEV;
return phy_mii_ioctl(dev->phydev, rq, cmd);
}
static const struct net_device_ops arc_emac_netdev_ops = { static const struct net_device_ops arc_emac_netdev_ops = {
.ndo_open = arc_emac_open, .ndo_open = arc_emac_open,
.ndo_stop = arc_emac_stop, .ndo_stop = arc_emac_stop,
...@@ -727,6 +739,7 @@ static const struct net_device_ops arc_emac_netdev_ops = { ...@@ -727,6 +739,7 @@ static const struct net_device_ops arc_emac_netdev_ops = {
.ndo_set_mac_address = arc_emac_set_address, .ndo_set_mac_address = arc_emac_set_address,
.ndo_get_stats = arc_emac_stats, .ndo_get_stats = arc_emac_stats,
.ndo_set_rx_mode = arc_emac_set_rx_mode, .ndo_set_rx_mode = arc_emac_set_rx_mode,
.ndo_do_ioctl = arc_emac_ioctl,
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = arc_emac_poll_controller, .ndo_poll_controller = arc_emac_poll_controller,
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment