Patchwork [net-2.6,4/4] igb: check both function bits in status register in wol exception

login
register
mail settings
Submitter Jeff Kirsher
Date Dec. 23, 2009, 11:21 p.m.
Message ID <20091223232145.16146.15465.stgit@localhost.localdomain>
Download mbox | patch
Permalink /patch/41706/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jeff Kirsher - Dec. 23, 2009, 11:21 p.m.
From: Alexander Duyck <alexander.h.duyck@intel.com>

The ethtool code for enabling Wake on Lan was not correctly checking the
status register bits so as a result ports 0 and 2 were both being allowed
to set WOL to enabled even though it is only supported on the first port
for our adapters.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_ethtool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


--
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
David Miller - Dec. 24, 2009, 4:55 a.m.
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 23 Dec 2009 15:21:46 -0800

> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> The ethtool code for enabling Wake on Lan was not correctly checking the
> status register bits so as a result ports 0 and 2 were both being allowed
> to set WOL to enabled even though it is only supported on the first port
> for our adapters.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.
--
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

Patch

diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index ac9d527..f771a6c 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1795,7 +1795,7 @@  static int igb_wol_exclusion(struct igb_adapter *adapter,
 		/* dual port cards only support WoL on port A from now on
 		 * unless it was enabled in the eeprom for port B
 		 * so exclude FUNC_1 ports from having WoL enabled */
-		if (rd32(E1000_STATUS) & E1000_STATUS_FUNC_1 &&
+		if ((rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) &&
 		    !adapter->eeprom_wol) {
 			wol->supported = 0;
 			break;