diff options
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 24 |
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 | ||
946 | static 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 | |||
946 | static void ixgbe_get_wol(struct net_device *netdev, | 964 | static 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) |