Commit a613bafe authored by Michael Walle's avatar Michael Walle Committed by David S. Miller
Browse files

enetc: add ioctl() support for PHY-related ops



If there is an attached PHY try to handle the requested ioctl with its
handler, which allows the userspace to access PHY registers, for
example. This will make mii-diag and similar tools work.

Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 630d4e75
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1599,7 +1599,10 @@ int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
	if (cmd == SIOCGHWTSTAMP)
		return enetc_hwtstamp_get(ndev, rq);
#endif

	if (!ndev->phydev)
		return -EINVAL;
	return phy_mii_ioctl(ndev->phydev, rq, cmd);
}

int enetc_alloc_msix(struct enetc_ndev_priv *priv)