Commit 8d8bdfe8 authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by David S. Miller

ll_temac: Add support for phy_mii_ioctl

This patch enables the ioctl support for the driver. So userspace
programs like mii-tool can work.

Resend in merge window
Signed-off-by: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2563fa59
...@@ -915,12 +915,26 @@ temac_poll_controller(struct net_device *ndev) ...@@ -915,12 +915,26 @@ temac_poll_controller(struct net_device *ndev)
} }
#endif #endif
static int temac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
{
struct temac_local *lp = netdev_priv(ndev);
if (!netif_running(ndev))
return -EINVAL;
if (!lp->phy_dev)
return -EINVAL;
return phy_mii_ioctl(lp->phy_dev, rq, cmd);
}
static const struct net_device_ops temac_netdev_ops = { static const struct net_device_ops temac_netdev_ops = {
.ndo_open = temac_open, .ndo_open = temac_open,
.ndo_stop = temac_stop, .ndo_stop = temac_stop,
.ndo_start_xmit = temac_start_xmit, .ndo_start_xmit = temac_start_xmit,
.ndo_set_mac_address = netdev_set_mac_address, .ndo_set_mac_address = netdev_set_mac_address,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
.ndo_do_ioctl = temac_ioctl,
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = temac_poll_controller, .ndo_poll_controller = temac_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