/* ks8695_nwayreset - Restart the autonegotiation on the port. @ndev: The network device to restart autoneotiation on  */
static int ks8695_nwayreset(struct net_device *ndev)
/* ks8695_nwayreset - Restart the autonegotiation on the port. @ndev: The network device to restart autoneotiation on  */
static int ks8695_nwayreset(struct net_device *ndev)
{
	struct ks8695_priv *ksp = netdev_priv(ndev);
	u32 ctrl;
	switch (ksp->dtype) {
	case KS8695_DTYPE_HPNA:
		return -EINVAL;
	case KS8695_DTYPE_WAN:
		ctrl = readl(ksp->phyiface_regs + KS8695_WMC);
		if ((ctrl & WMC_WAND) == 0)
			writel(ctrl | WMC_WANR,
			       ksp->phyiface_regs + KS8695_WMC);
		else
			return -EINVAL;
		break;
	case KS8695_DTYPE_LAN:
		return -EOPNOTSUPP;
	}
	return 0;
}