aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-04-08 09:20:50 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-11 04:43:14 -0400
commitd6c519e12984d26d96b91e4482280acbba0e0a22 (patch)
tree2a2aa35b91803502c55d105021c6dc9f397cb25b /drivers/net
parent87c1201708381c2791caa78a2caf217778633277 (diff)
ixgbe: only allow WOL for 82599 KX4 NIC
All NICs were reporting WOL support when only the KX4 NIC is capable of supporting WOL. This patch adds a function to check for and exclude all non-WOL capable nics from enabling WOL in ethtool. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index aafc120f164e..f0a20facc650 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -943,6 +943,24 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset,
943} 943}
944 944
945 945
946static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter,
947 struct ethtool_wolinfo *wol)
948{
949 struct ixgbe_hw *hw = &adapter->hw;
950 int retval = 1;
951
952 switch(hw->device_id) {
953 case IXGBE_DEV_ID_82599_KX4:
954 retval = 0;
955 break;
956 default:
957 wol->supported = 0;
958 retval = 0;
959 }
960
961 return retval;
962}
963
946static void ixgbe_get_wol(struct net_device *netdev, 964static void ixgbe_get_wol(struct net_device *netdev,
947 struct ethtool_wolinfo *wol) 965 struct ethtool_wolinfo *wol)
948{ 966{
@@ -952,7 +970,8 @@ static void ixgbe_get_wol(struct net_device *netdev,
952 WAKE_BCAST | WAKE_MAGIC; 970 WAKE_BCAST | WAKE_MAGIC;
953 wol->wolopts = 0; 971 wol->wolopts = 0;
954 972
955 if (!device_can_wakeup(&adapter->pdev->dev)) 973 if (ixgbe_wol_exclusion(adapter, wol) ||
974 !device_can_wakeup(&adapter->pdev->dev))
956 return; 975 return;
957 976
958 if (adapter->wol & IXGBE_WUFC_EX) 977 if (adapter->wol & IXGBE_WUFC_EX)
@@ -974,6 +993,9 @@ static int ixgbe_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
974 if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) 993 if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
975 return -EOPNOTSUPP; 994 return -EOPNOTSUPP;
976 995
996 if (ixgbe_wol_exclusion(adapter, wol))
997 return wol->wolopts ? -EOPNOTSUPP : 0;
998
977 adapter->wol = 0; 999 adapter->wol = 0;
978 1000
979 if (wol->wolopts & WAKE_UCAST) 1001 if (wol->wolopts & WAKE_UCAST)