* [PATCH net] net: bcmgenet: properly disable password matching
@ 2015-03-04 19:43 Florian Fainelli
2015-03-06 2:16 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2015-03-04 19:43 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
bcmgenet_set_wol() correctly sets MPD_PW_EN when a password is specified
to match magic packets against, however, when we switch from a
password-matching to a matching without password we would leave this bit
turned on, and GENET would only match magic packets with passwords.
This can be reproduced using the following sequence:
ethtool -s eth0 wol g
ethtool -s eth0 wol s sopass 00:11:22:33:44:55
ethtool -s eth0 wol g
The simple fix is to clear the MPD_PWD_EN bit when WAKE_MAGICSECURE is
not set.
Fixes: c51de7f3976b ("net: bcmgenet: add Wake-on-LAN support code")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
index 149a0d70c108..b97122926d3a 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
@@ -73,15 +73,17 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
if (wol->wolopts & ~(WAKE_MAGIC | WAKE_MAGICSECURE))
return -EINVAL;
+ reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL);
if (wol->wolopts & WAKE_MAGICSECURE) {
bcmgenet_umac_writel(priv, get_unaligned_be16(&wol->sopass[0]),
UMAC_MPD_PW_MS);
bcmgenet_umac_writel(priv, get_unaligned_be32(&wol->sopass[2]),
UMAC_MPD_PW_LS);
- reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL);
reg |= MPD_PW_EN;
- bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL);
+ } else {
+ reg &= ~MPD_PW_EN;
}
+ bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL);
/* Flag the device and relevant IRQ as wakeup capable */
if (wol->wolopts) {
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: bcmgenet: properly disable password matching
2015-03-04 19:43 [PATCH net] net: bcmgenet: properly disable password matching Florian Fainelli
@ 2015-03-06 2:16 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-03-06 2:16 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 4 Mar 2015 11:43:03 -0800
> bcmgenet_set_wol() correctly sets MPD_PW_EN when a password is specified
> to match magic packets against, however, when we switch from a
> password-matching to a matching without password we would leave this bit
> turned on, and GENET would only match magic packets with passwords.
>
> This can be reproduced using the following sequence:
>
> ethtool -s eth0 wol g
> ethtool -s eth0 wol s sopass 00:11:22:33:44:55
> ethtool -s eth0 wol g
>
> The simple fix is to clear the MPD_PWD_EN bit when WAKE_MAGICSECURE is
> not set.
>
> Fixes: c51de7f3976b ("net: bcmgenet: add Wake-on-LAN support code")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Applied, thanks Florian.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-06 2:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 19:43 [PATCH net] net: bcmgenet: properly disable password matching Florian Fainelli
2015-03-06 2:16 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).