示例#1
0
static void uec_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{
	struct ucc_geth_private *ugeth = netdev_priv(netdev);
	struct phy_device *phydev = ugeth->phydev;

	if (phydev && phydev->irq)
		wol->supported |= WAKE_PHY;
	if (qe_alive_during_sleep())
		wol->supported |= WAKE_MAGIC;

	wol->wolopts = ugeth->wol_en;
}
示例#2
0
static int uec_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{
	struct ucc_geth_private *ugeth = netdev_priv(netdev);
	struct phy_device *phydev = ugeth->phydev;

	if (wol->wolopts & ~(WAKE_PHY | WAKE_MAGIC))
		return -EINVAL;
	else if (wol->wolopts & WAKE_PHY && (!phydev || !phydev->irq))
		return -EINVAL;
	else if (wol->wolopts & WAKE_MAGIC && !qe_alive_during_sleep())
		return -EINVAL;

	ugeth->wol_en = wol->wolopts;
	device_set_wakeup_enable(&netdev->dev, ugeth->wol_en);

	return 0;
}
示例#3
0
static int qe_resume(struct platform_device *ofdev)
{
	if (!qe_alive_during_sleep())
		qe_reset();
	return 0;
}