Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28b04113 authored by Richard Cochran's avatar Richard Cochran Committed by David S. Miller
Browse files

net: preserve ifreq parameter when calling generic phy_mii_ioctl().



The phy_mii_ioctl() function unnecessarily throws away the original ifreq.
We need access to the ifreq in order to support PHYs that can perform
hardware time stamping.

Two maverick drivers filter the ioctl commands passed to phy_mii_ioctl().
This is unnecessary since phylib will check the command in any case.

Signed-off-by: default avatarRichard Cochran <richard.cochran@omicron.at>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4507a715
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -782,7 +782,8 @@ static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd)

	if (!netif_running(dev))
		return -EINVAL;
	return phy_mii_ioctl(port->phydev, if_mii(req), cmd);

	return phy_mii_ioctl(port->phydev, req, cmd);
}

/* ethtool support */
+1 −1
Original line number Diff line number Diff line
@@ -978,7 +978,7 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
	if (!aup->phy_dev)
		return -EINVAL; /* PHY not controllable */

	return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd);
	return phy_mii_ioctl(aup->phy_dev, rq, cmd);
}

static const struct net_device_ops au1000_netdev_ops = {
+1 −1
Original line number Diff line number Diff line
@@ -1496,7 +1496,7 @@ static int bcm_enet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
	if (priv->has_phy) {
		if (!priv->phydev)
			return -ENODEV;
		return phy_mii_ioctl(priv->phydev, if_mii(rq), cmd);
		return phy_mii_ioctl(priv->phydev, rq, cmd);
	} else {
		struct mii_if_info mii;

+1 −4
Original line number Diff line number Diff line
@@ -846,11 +846,8 @@ static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
		return -EINVAL;
	if (!priv->phy)
		return -EINVAL;
	if ((cmd == SIOCGMIIPHY) || (cmd == SIOCGMIIREG) ||
	    (cmd == SIOCSMIIREG))
		return phy_mii_ioctl(priv->phy, if_mii(ifr), cmd);

	return -EOPNOTSUPP;
	return phy_mii_ioctl(priv->phy, ifr, cmd);
}

static int cpmac_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+1 −1
Original line number Diff line number Diff line
@@ -797,7 +797,7 @@ static int dnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
	if (!phydev)
		return -ENODEV;

	return phy_mii_ioctl(phydev, if_mii(rq), cmd);
	return phy_mii_ioctl(phydev, rq, cmd);
}

static void dnet_get_drvinfo(struct net_device *dev,
Loading