Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: axienet: Add mii-tool support

mii-tool is useful for debugging, and all it requires to work is to wire
up the ioctl ops function pointer.
Add this to the axienet driver to enable mii-tool.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andre Przywara and committed by
David S. Miller
2a9b65ea c30cb8f0

+11
+11
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
··· 1171 1171 } 1172 1172 #endif 1173 1173 1174 + static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1175 + { 1176 + struct axienet_local *lp = netdev_priv(dev); 1177 + 1178 + if (!netif_running(dev)) 1179 + return -EINVAL; 1180 + 1181 + return phylink_mii_ioctl(lp->phylink, rq, cmd); 1182 + } 1183 + 1174 1184 static const struct net_device_ops axienet_netdev_ops = { 1175 1185 .ndo_open = axienet_open, 1176 1186 .ndo_stop = axienet_stop, ··· 1188 1178 .ndo_change_mtu = axienet_change_mtu, 1189 1179 .ndo_set_mac_address = netdev_set_mac_address, 1190 1180 .ndo_validate_addr = eth_validate_addr, 1181 + .ndo_do_ioctl = axienet_ioctl, 1191 1182 .ndo_set_rx_mode = axienet_set_multicast_list, 1192 1183 #ifdef CONFIG_NET_POLL_CONTROLLER 1193 1184 .ndo_poll_controller = axienet_poll_controller,