Skip to content

Commit 8d8bdfe

Browse files
ribaldadavem330
authored andcommitted
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: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2563fa5 commit 8d8bdfe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/net/ethernet/xilinx/ll_temac_main.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,12 +915,26 @@ temac_poll_controller(struct net_device *ndev)
915915
}
916916
#endif
917917

918+
static int temac_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
919+
{
920+
struct temac_local *lp = netdev_priv(ndev);
921+
922+
if (!netif_running(ndev))
923+
return -EINVAL;
924+
925+
if (!lp->phy_dev)
926+
return -EINVAL;
927+
928+
return phy_mii_ioctl(lp->phy_dev, rq, cmd);
929+
}
930+
918931
static const struct net_device_ops temac_netdev_ops = {
919932
.ndo_open = temac_open,
920933
.ndo_stop = temac_stop,
921934
.ndo_start_xmit = temac_start_xmit,
922935
.ndo_set_mac_address = netdev_set_mac_address,
923936
.ndo_validate_addr = eth_validate_addr,
937+
.ndo_do_ioctl = temac_ioctl,
924938
#ifdef CONFIG_NET_POLL_CONTROLLER
925939
.ndo_poll_controller = temac_poll_controller,
926940
#endif

0 commit comments

Comments
 (0)