/* stmmac_ioctl - Entry point for the Ioctl @dev: Device pointer. @rq: An IOCTL specefic structure, that can contain a pointer to a proprietary structure used to pass information to the driver. @cmd: IOCTL command Description: Currently there are no special functionality supported in IOCTL, just the phy_mii_ioctl(...) can be invoked.  */
static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
/* stmmac_ioctl - Entry point for the Ioctl @dev: Device pointer. @rq: An IOCTL specefic structure, that can contain a pointer to a proprietary structure used to pass information to the driver. @cmd: IOCTL command Description: Currently there are no special functionality supported in IOCTL, just the phy_mii_ioctl(...) can be invoked.  */
static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct stmmac_priv *priv = netdev_priv(dev);
	int ret = -EOPNOTSUPP;
	if (!netif_running(dev))
		return -EINVAL;
	switch (cmd) {
	case SIOCGMIIPHY:
	case SIOCGMIIREG:
	case SIOCSMIIREG:
		if (!priv->phydev)
			return -EINVAL;
		spin_lock(&priv->lock);
		ret = phy_mii_ioctl(priv->phydev, if_mii(rq), cmd);
		spin_unlock(&priv->lock);
	default:
		break;
	}
	return ret;
}