Skip to contentSkip to conversation

Libertas: coding style cleanup in ethtool.c

PATCH In review Bing Zhao 2 participants 4 messages Nov 10, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Bing Zhao

author
#0 lore raw

PATCH 1/2 Libertas: coding style cleanup in ethtool.c

---
 drivers/net/wireless/libertas/ethtool.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/wireless/libertas/ethtool.c +8 -4
index 039b555..6efa388 100644
@@ -175,10 +175,14 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
 	if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY))
 		return -EOPNOTSUPP;
 
-	if (wol->wolopts & WAKE_UCAST) criteria |= EHS_WAKE_ON_UNICAST_DATA;
-	if (wol->wolopts & WAKE_MCAST) criteria |= EHS_WAKE_ON_MULTICAST_DATA;
-	if (wol->wolopts & WAKE_BCAST) criteria |= EHS_WAKE_ON_BROADCAST_DATA;
-	if (wol->wolopts & WAKE_PHY)   criteria |= EHS_WAKE_ON_MAC_EVENT;
+	if (wol->wolopts & WAKE_UCAST)
+		criteria |= EHS_WAKE_ON_UNICAST_DATA;
+	if (wol->wolopts & WAKE_MCAST)
+		criteria |= EHS_WAKE_ON_MULTICAST_DATA;
+	if (wol->wolopts & WAKE_BCAST)
+		criteria |= EHS_WAKE_ON_BROADCAST_DATA;
+	if (wol->wolopts & WAKE_PHY)
+		criteria |= EHS_WAKE_ON_MAC_EVENT;
 
 	return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
 }
Signature · 1 line
1.5.3.6
author
#1 lore raw

PATCH 2/2 Libertas: fix issues while configuring host sleep using ethtool wol

Configuration of wake-on-lan for unicast, multicast, broadcast, physical activity was not working. Kernel panic issue was there when user tries to disable WOL. Fixed them.

---
 drivers/net/wireless/libertas/ethtool.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/libertas/ethtool.c +2 -3
index 6efa388..53d56ab 100644
@@ -169,9 +169,6 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
 	struct lbs_private *priv = dev->ml_priv;
 	uint32_t criteria = 0;
 
-	if (priv->wol_criteria == 0xffffffff && wol->wolopts)
-		return -EOPNOTSUPP;
-
 	if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY))
 		return -EOPNOTSUPP;
 
@@ -183,6 +180,8 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
 		criteria |= EHS_WAKE_ON_BROADCAST_DATA;
 	if (wol->wolopts & WAKE_PHY)
 		criteria |= EHS_WAKE_ON_MAC_EVENT;
+	if (wol->wolopts == 0)
+		criteria |= EHS_REMOVE_WAKEUP;
 
 	return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
 }
Signature · 1 line
1.5.3.6
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] Libertas: fix issues while configuring host sleep using ethtool wol

Quoted 6 lines · Bing Zhao

Configuration of wake-on-lan for unicast, multicast, broadcast, physical activity was not working. Kernel panic issue was there when user tries to disable WOL. Fixed them.

Quoted 27 lines
---
 drivers/net/wireless/libertas/ethtool.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/libertas/ethtool.c +2 -3
index 6efa388..53d56ab 100644
@@ -169,9 +169,6 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
 	struct lbs_private *priv = dev->ml_priv;
 	uint32_t criteria = 0;
 
-	if (priv->wol_criteria == 0xffffffff && wol->wolopts)
-		return -EOPNOTSUPP;
-
 	if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY))
 		return -EOPNOTSUPP;
 
@@ -183,6 +180,8 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
 		criteria |= EHS_WAKE_ON_BROADCAST_DATA;
 	if (wol->wolopts & WAKE_PHY)
 		criteria |= EHS_WAKE_ON_MAC_EVENT;
+	if (wol->wolopts == 0)
+		criteria |= EHS_REMOVE_WAKEUP;
 
 	return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
 }
Acked-by on v1 1/2
#3 lore raw
In reply to Bing Zhao
Quoted 1 line · Bing Zhao
Quoted 27 lines
---
 drivers/net/wireless/libertas/ethtool.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/wireless/libertas/ethtool.c +8 -4
index 039b555..6efa388 100644
@@ -175,10 +175,14 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
 	if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY))
 		return -EOPNOTSUPP;
 
-	if (wol->wolopts & WAKE_UCAST) criteria |= EHS_WAKE_ON_UNICAST_DATA;
-	if (wol->wolopts & WAKE_MCAST) criteria |= EHS_WAKE_ON_MULTICAST_DATA;
-	if (wol->wolopts & WAKE_BCAST) criteria |= EHS_WAKE_ON_BROADCAST_DATA;
-	if (wol->wolopts & WAKE_PHY)   criteria |= EHS_WAKE_ON_MAC_EVENT;
+	if (wol->wolopts & WAKE_UCAST)
+		criteria |= EHS_WAKE_ON_UNICAST_DATA;
+	if (wol->wolopts & WAKE_MCAST)
+		criteria |= EHS_WAKE_ON_MULTICAST_DATA;
+	if (wol->wolopts & WAKE_BCAST)
+		criteria |= EHS_WAKE_ON_BROADCAST_DATA;
+	if (wol->wolopts & WAKE_PHY)
+		criteria |= EHS_WAKE_ON_MAC_EVENT;
 
 	return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
 }