# --------------------------------------------
# 02/10/18	jeb.j.cramer@intel.com	1.742.1.10
# e1000 8/11:
# * Forcing 1000/fd is easier to undo with ethtool
# * Adapters supporting WoL capabilities are now an inclusive versus
#   exclusive list
# 
# --------------------------------------------
#
diff -Nru a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
--- a/drivers/net/e1000/e1000_ethtool.c	Wed Oct 23 21:16:16 2002
+++ b/drivers/net/e1000/e1000_ethtool.c	Wed Oct 23 21:16:16 2002
@@ -117,7 +117,8 @@
 
 	if(ecmd->autoneg == AUTONEG_ENABLE) {
 		hw->autoneg = 1;
-		hw->autoneg_advertised = (ecmd->advertising & 0x002F);
+		hw->autoneg_advertised = 0x002F;
+		ecmd->advertising = 0x002F;
 	} else {
 		hw->autoneg = 0;
 		switch(ecmd->speed + ecmd->duplex) {
@@ -211,7 +212,7 @@
 	int i, max_len, first_word, last_word;
 
 	if(eeprom->len == 0)
-		return -EOPNOTSUPP;
+		return -EINVAL;
 
 	eeprom->magic = hw->vendor_id | (hw->device_id << 16);
 
@@ -228,6 +229,7 @@
 
 	for(i = 0; i <= (last_word - first_word); i++)
 		e1000_read_eeprom(hw, first_word + i, &eeprom_buff[i]);
+
 	return 0;
 }
 
@@ -290,7 +292,6 @@
 	case E1000_DEV_ID_82543GC_FIBER:
 	case E1000_DEV_ID_82543GC_COPPER:
 	case E1000_DEV_ID_82544EI_FIBER:
-	default:
 		wol->supported = 0;
 		wol->wolopts   = 0;
 		return;
@@ -304,14 +305,7 @@
 		}
 		/* Fall Through */
 
-	case E1000_DEV_ID_82544EI_COPPER:
-	case E1000_DEV_ID_82544GC_COPPER:
-	case E1000_DEV_ID_82544GC_LOM:
-	case E1000_DEV_ID_82540EM:
-	case E1000_DEV_ID_82540EM_LOM:
-	case E1000_DEV_ID_82545EM_COPPER:
-	case E1000_DEV_ID_82545EM_FIBER:
-	case E1000_DEV_ID_82546EB_COPPER:
+	default:
 		wol->supported = WAKE_PHY | WAKE_UCAST | 
 				 WAKE_MCAST | WAKE_BCAST | WAKE_MAGIC;
 		
@@ -340,7 +334,6 @@
 	case E1000_DEV_ID_82543GC_FIBER:
 	case E1000_DEV_ID_82543GC_COPPER:
 	case E1000_DEV_ID_82544EI_FIBER:
-	default:
 		return wol->wolopts ? -EOPNOTSUPP : 0;
 
 	case E1000_DEV_ID_82546EB_FIBER:
@@ -349,14 +342,7 @@
 			return wol->wolopts ? -EOPNOTSUPP : 0;
 		/* Fall Through */
 
-	case E1000_DEV_ID_82544EI_COPPER:
-	case E1000_DEV_ID_82544GC_COPPER:
-	case E1000_DEV_ID_82544GC_LOM:
-	case E1000_DEV_ID_82540EM:
-	case E1000_DEV_ID_82540EM_LOM:
-	case E1000_DEV_ID_82545EM_COPPER:
-	case E1000_DEV_ID_82545EM_FIBER:
-	case E1000_DEV_ID_82546EB_COPPER:
+	default:
 		if(wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))
 			return -EOPNOTSUPP;
 
@@ -518,7 +504,8 @@
 		if(copy_from_user(&eeprom, addr, sizeof(eeprom)))
 			return -EFAULT;
 
-		if((err = e1000_ethtool_geeprom(adapter, &eeprom, eeprom_buff))<0)
+		if((err = e1000_ethtool_geeprom(adapter, 
+			&eeprom, eeprom_buff)))
 			return err;
 
 		if(copy_to_user(addr, &eeprom, sizeof(eeprom)))
