Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1702739 > unrolled thread
| Started by | Romain Perier <romain.perier@collabora.com> |
|---|---|
| First post | 2017-08-03 09:50 +0200 |
| Last post | 2017-08-04 00:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] net: arc_emac: Add support for ndo_do_ioctl net_device_ops operation Romain Perier <romain.perier@collabora.com> - 2017-08-03 09:50 +0200
Re: [PATCH] net: arc_emac: Add support for ndo_do_ioctl net_device_ops operation David Miller <davem@davemloft.net> - 2017-08-04 00:20 +0200
| From | Romain Perier <romain.perier@collabora.com> |
|---|---|
| Date | 2017-08-03 09:50 +0200 |
| Subject | [PATCH] net: arc_emac: Add support for ndo_do_ioctl net_device_ops operation |
| Message-ID | <uaj3n-5gj-33@gated-at.bofh.it> |
This operation is required for handling ioctl commands like SIOCGMIIREG,
when debugging MDIO registers from userspace.
This commit adds support for this operation.
Signed-off-by: Romain Perier <romain.perier@collabora.com>
---
drivers/net/ethernet/arc/emac_main.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index 68de2f2652f2..3241af1ce718 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -720,6 +720,18 @@ static int arc_emac_set_address(struct net_device *ndev, void *p)
return 0;
}
+static int arc_emac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+{
+ if (!netif_running(dev))
+ return -EINVAL;
+
+ if (!dev->phydev)
+ return -ENODEV;
+
+ return phy_mii_ioctl(dev->phydev, rq, cmd);
+}
+
+
static const struct net_device_ops arc_emac_netdev_ops = {
.ndo_open = arc_emac_open,
.ndo_stop = arc_emac_stop,
@@ -727,6 +739,7 @@ static const struct net_device_ops arc_emac_netdev_ops = {
.ndo_set_mac_address = arc_emac_set_address,
.ndo_get_stats = arc_emac_stats,
.ndo_set_rx_mode = arc_emac_set_rx_mode,
+ .ndo_do_ioctl = arc_emac_ioctl,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = arc_emac_poll_controller,
#endif
--
2.11.0
[toc] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-08-04 00:20 +0200 |
| Subject | Re: [PATCH] net: arc_emac: Add support for ndo_do_ioctl net_device_ops operation |
| Message-ID | <uawDg-6my-7@gated-at.bofh.it> |
| In reply to | #1702739 |
From: Romain Perier <romain.perier@collabora.com> Date: Thu, 3 Aug 2017 09:49:03 +0200 > This operation is required for handling ioctl commands like SIOCGMIIREG, > when debugging MDIO registers from userspace. > > This commit adds support for this operation. > > Signed-off-by: Romain Perier <romain.perier@collabora.com> Applied, thanks.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web