Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265745
b: refs/heads/master
c: 3172d3a
h: refs/heads/master
i:
  265743: 7abb2a3
v: v3
  • Loading branch information
Deepak Sikri authored and David S. Miller committed Sep 15, 2011
1 parent 5138b54 commit 4e683ff
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26a051cc2c4ccac8d124906a3df946044037b76d
refs/heads/master: 3172d3afa998ffb8f1971746ca960cbe98d62444
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/stmicro/stmmac/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ struct stmmac_priv {
spinlock_t lock;
int wolopts;
int wolenabled;
int wol_irq;
#ifdef CONFIG_STMMAC_TIMER
struct stmmac_timer *tm;
#endif
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
if (wol->wolopts) {
pr_info("stmmac: wakeup enable\n");
device_set_wakeup_enable(priv->device, 1);
enable_irq_wake(dev->irq);
enable_irq_wake(priv->wol_irq);
} else {
device_set_wakeup_enable(priv->device, 0);
disable_irq_wake(dev->irq);
disable_irq_wake(priv->wol_irq);
}

spin_lock_irq(&priv->lock);
Expand Down
14 changes: 13 additions & 1 deletion trunk/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ static int stmmac_mac_device_setup(struct net_device *dev)

if (device_can_wakeup(priv->device)) {
priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */
enable_irq_wake(dev->irq);
enable_irq_wake(priv->wol_irq);
}

return 0;
Expand Down Expand Up @@ -1588,6 +1588,18 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
pr_info("\tPMT module supported\n");
device_set_wakeup_capable(&pdev->dev, 1);
}
/*
* On some platforms e.g. SPEAr the wake up irq differs from the mac irq
* The external wake up irq can be passed through the platform code
* named as "eth_wake_irq"
*
* In case the wake up interrupt is not passed from the platform
* so the driver will continue to use the mac irq (ndev->irq)
*/
priv->wol_irq = platform_get_irq_byname(pdev, "eth_wake_irq");
if (priv->wol_irq == -ENXIO)
priv->wol_irq = ndev->irq;


platform_set_drvdata(pdev, ndev);

Expand Down

0 comments on commit 4e683ff

Please sign in to comment.