Hello! On 12/12/2016 07:09 PM, Niklas Söderlund wrote: Not the complete review yet, just some superficial comments.
Add generic functionality to support Wake-on-Lan using MagicPacket which
LAN.
are supported by at least a few versions of sh_eth. Only add functionality for WoL, no specific sh_eth version are marked to support WoL yet.
[...]
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 05b0dc5..87640b9 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
@@ -3150,15 +3187,67 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
[...]
+static int sh_eth_wol_restore(struct net_device *ndev) +{ + struct sh_eth_private *mdp = netdev_priv(ndev); + int ret; + + napi_enable(&mdp->napi); + + /* Disable MagicPacket */ + sh_eth_modify(ndev, ECMR, ECMR_PMDE, 0); + + /* The device need to be reset to restore MagicPacket logic
Needs. [...]
index d050f37..4ceed00 100644 --- a/drivers/net/ethernet/renesas/sh_eth.h +++ b/drivers/net/ethernet/renesas/sh_eth.h @@ -493,6 +493,7 @@ struct sh_eth_cpu_data { unsigned shift_rd0:1; /* shift Rx descriptor word 0 right by 16 */ unsigned rmiimode:1; /* EtherC has RMIIMODE register */ unsigned rtrate:1; /* EtherC has RTRATE register */ + unsigned magic:1; /* EtherC has ECMR.PMDE and ECSR.MPD */
After looking at the SH7734/63 manuals it became obvious that PMDE was a result of typo, the bit is called MPDE actually, the current name doesn't make sense anyway. Care to fix?
MBR, Sergei