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: Michael Walle <michael@walle.cc>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
        if (cmd == SIOCGHWTSTAMP)
                return enetc_hwtstamp_get(ndev, rq);
 #endif
-       return -EINVAL;
+
+       if (!ndev->phydev)
+               return -EINVAL;
+       return phy_mii_ioctl(ndev->phydev, rq, cmd);
 }
 
 int enetc_alloc_msix(struct enetc_ndev_priv *priv)