Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d19b5149 authored by Sergey Matyukevich's avatar Sergey Matyukevich Committed by David S. Miller
Browse files

ucc_geth driver: add ioctl



ioctl operation (ndo_do_ioctl) is added to make mii-tools work

Signed-off-by: default avatarSergey Matyukevich <geomatsi@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 43d28b65
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -3702,6 +3702,19 @@ static phy_interface_t to_phy_interface(const char *phy_connection_type)
	return PHY_INTERFACE_MODE_MII;
	return PHY_INTERFACE_MODE_MII;
}
}


static int ucc_geth_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct ucc_geth_private *ugeth = netdev_priv(dev);

	if (!netif_running(dev))
		return -EINVAL;

	if (!ugeth->phydev)
		return -ENODEV;

	return phy_mii_ioctl(ugeth->phydev, if_mii(rq), cmd);
}

static const struct net_device_ops ucc_geth_netdev_ops = {
static const struct net_device_ops ucc_geth_netdev_ops = {
	.ndo_open		= ucc_geth_open,
	.ndo_open		= ucc_geth_open,
	.ndo_stop		= ucc_geth_close,
	.ndo_stop		= ucc_geth_close,
@@ -3711,6 +3724,7 @@ static const struct net_device_ops ucc_geth_netdev_ops = {
	.ndo_change_mtu		= eth_change_mtu,
	.ndo_change_mtu		= eth_change_mtu,
	.ndo_set_multicast_list	= ucc_geth_set_multi,
	.ndo_set_multicast_list	= ucc_geth_set_multi,
	.ndo_tx_timeout		= ucc_geth_timeout,
	.ndo_tx_timeout		= ucc_geth_timeout,
	.ndo_do_ioctl		= ucc_geth_ioctl,
#ifdef CONFIG_NET_POLL_CONTROLLER
#ifdef CONFIG_NET_POLL_CONTROLLER
	.ndo_poll_controller	= ucc_netpoll,
	.ndo_poll_controller	= ucc_netpoll,
#endif
#endif