diff mbox

atl1: use magic packet wake-on-lan only

Message ID 20081109150530.3eb555f9@osprey.hogchain.net
State Accepted, archived
Delegated to: Jeff Garzik
Headers show

Commit Message

J. K. Cliburn Nov. 9, 2008, 9:05 p.m. UTC
atl1: use magic packet wake-on-lan only

Of the various WOL options provided in include/linux/ethtool.h, the
L1 NIC supports only magic packet.  Remove all options except magic
packet from the atl1 driver.

Signed-off-by: Jay Cliburn <jcliburn@gmail.com>
---
 drivers/net/atlx/atl1.c |   17 +++--------------
 1 files changed, 3 insertions(+), 14 deletions(-)

Comments

Chris Snook Nov. 10, 2008, 6:42 p.m. UTC | #1
J. K. Cliburn wrote:
> atl1: use magic packet wake-on-lan only
> 
> Of the various WOL options provided in include/linux/ethtool.h, the
> L1 NIC supports only magic packet.  Remove all options except magic
> packet from the atl1 driver.

Technically, we could implement the rest via the programmable 
pattern-matching hardware, but that would be an immense amount of work.

-- Chris
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J. K. Cliburn Nov. 12, 2008, 12:35 a.m. UTC | #2
On Mon, 10 Nov 2008 13:42:25 -0500
Chris Snook <csnook@redhat.com> wrote:

> J. K. Cliburn wrote:
> > atl1: use magic packet wake-on-lan only
> > 
> > Of the various WOL options provided in include/linux/ethtool.h, the
> > L1 NIC supports only magic packet.  Remove all options except magic
> > packet from the atl1 driver.
> 
> Technically, we could implement the rest via the programmable 
> pattern-matching hardware, but that would be an immense amount of
> work.

Thanks for the pointer to the pattern matching capability.  I had
forgotten about it.

What prompted the patch was a user asking some questions off-list about
the L1 and WOL, and I realized the atl1 driver was advertising WOL
options that weren't implemented.

I think the magic-packet-only patch I submitted to Jeff is still
relevant, but I'm going to explore the pattern matching capability and
see if we can implement some additional WOL options.  IMHO, though,
those should be provided in a separate (future) patch.  Do you agree?

Jay
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chris Snook Nov. 12, 2008, 5:37 p.m. UTC | #3
J. K. Cliburn wrote:
> On Mon, 10 Nov 2008 13:42:25 -0500
> Chris Snook <csnook@redhat.com> wrote:
> 
>> J. K. Cliburn wrote:
>>> atl1: use magic packet wake-on-lan only
>>>
>>> Of the various WOL options provided in include/linux/ethtool.h, the
>>> L1 NIC supports only magic packet.  Remove all options except magic
>>> packet from the atl1 driver.
>> Technically, we could implement the rest via the programmable 
>> pattern-matching hardware, but that would be an immense amount of
>> work.
> 
> Thanks for the pointer to the pattern matching capability.  I had
> forgotten about it.
> 
> What prompted the patch was a user asking some questions off-list about
> the L1 and WOL, and I realized the atl1 driver was advertising WOL
> options that weren't implemented.
> 
> I think the magic-packet-only patch I submitted to Jeff is still
> relevant, but I'm going to explore the pattern matching capability and
> see if we can implement some additional WOL options.  IMHO, though,
> those should be provided in a separate (future) patch.  Do you agree?
> 
> Jay

Completely.  Programming the pattern matching hardware is a lot more 
involved than setting a single bit in the hardware.

Are there any other NICs that have pattern-matching WoLAN capability? 
If so, how do their drivers take advantage of them?  If it turns out to 
be a widely underutilized feature, it might make sense to let ethtool do 
the dirty work.

-- Chris
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 09ed2fd..611a86e 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -3384,14 +3384,8 @@  static void atl1_get_wol(struct net_device *netdev,
 {
 	struct atl1_adapter *adapter = netdev_priv(netdev);
 
-	wol->supported = WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | WAKE_MAGIC;
+	wol->supported = WAKE_MAGIC;
 	wol->wolopts = 0;
-	if (adapter->wol & ATLX_WUFC_EX)
-		wol->wolopts |= WAKE_UCAST;
-	if (adapter->wol & ATLX_WUFC_MC)
-		wol->wolopts |= WAKE_MCAST;
-	if (adapter->wol & ATLX_WUFC_BC)
-		wol->wolopts |= WAKE_BCAST;
 	if (adapter->wol & ATLX_WUFC_MAG)
 		wol->wolopts |= WAKE_MAGIC;
 	return;
@@ -3402,15 +3396,10 @@  static int atl1_set_wol(struct net_device *netdev,
 {
 	struct atl1_adapter *adapter = netdev_priv(netdev);
 
-	if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
+	if (wol->wolopts & (WAKE_PHY | WAKE_UCAST | WAKE_MCAST | WAKE_BCAST |
+		WAKE_ARP | WAKE_MAGICSECURE))
 		return -EOPNOTSUPP;
 	adapter->wol = 0;
-	if (wol->wolopts & WAKE_UCAST)
-		adapter->wol |= ATLX_WUFC_EX;
-	if (wol->wolopts & WAKE_MCAST)
-		adapter->wol |= ATLX_WUFC_MC;
-	if (wol->wolopts & WAKE_BCAST)
-		adapter->wol |= ATLX_WUFC_BC;
 	if (wol->wolopts & WAKE_MAGIC)
 		adapter->wol |= ATLX_WUFC_MAG;
 	return 0;