[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <361f63095be92df10e8e953af3b981cdac58d98e.1576520432.git.richardcochran@gmail.com>
Date: Mon, 16 Dec 2019 10:32:56 -0800
From: Richard Cochran <richardcochran@...il.com>
To: netdev@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org,
David Miller <davem@...emloft.net>,
Michal Simek <michal.simek@...inx.com>,
Radhey Shyam Pandey <radhey.shyam.pandey@...inx.com>
Subject: [PATCH net-next 3/3] net: axienet: Pass ioctls to the phy.
In order to allow PHY drivers to handle ioctls, the MAC driver must pass
the calls through. However, the axienet driver does not support ioctls
at all. This patch fixes the issue by handing off the invocations to the
PHY appropriately.
Signed-off-by: Richard Cochran <richardcochran@...il.com>
---
.../net/ethernet/xilinx/xilinx_axienet_main.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 05fa7371c39a..d0b996f220f5 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1067,6 +1067,23 @@ static int axienet_change_mtu(struct net_device *ndev, int new_mtu)
return 0;
}
+static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+{
+ if (!netif_running(dev))
+ return -EINVAL;
+
+ switch (cmd) {
+ case SIOCGMIIPHY:
+ case SIOCGMIIREG:
+ case SIOCSMIIREG:
+ case SIOCSHWTSTAMP:
+ case SIOCGHWTSTAMP:
+ return phy_mii_ioctl(dev->phydev, rq, cmd);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
#ifdef CONFIG_NET_POLL_CONTROLLER
/**
* axienet_poll_controller - Axi Ethernet poll mechanism.
@@ -1095,6 +1112,7 @@ static const struct net_device_ops axienet_netdev_ops = {
.ndo_set_mac_address = netdev_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = axienet_set_multicast_list,
+ .ndo_do_ioctl = axienet_ioctl,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = axienet_poll_controller,
#endif
--
2.20.1
Powered by blists - more mailing lists