diff options
author | PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com> | 2009-03-18 21:23:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-20 04:17:27 -0400 |
commit | e63d9762929d9b86ac87cfb8047e7f7b1f2ed2dd (patch) | |
tree | ba42359945818218d22fb7e9ce48579d81759f22 /drivers/net | |
parent | 03cfa2054846a9902f0c10bea4680447050f03fa (diff) |
ixgbe: Correctly report Wake On LAN for 82599 KX4 devices
ethtool isn't reporting the support level of WoL for 82599 KX4 devices.
While the device does support WoL, ethtool was never updated to properly
report the level of support, nor will it allow ethtool to modify the type
of packets to listen for.
Signed-off-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.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 3a99781794d1..18ecba7f6ecb 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -909,12 +909,50 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, | |||
909 | static void ixgbe_get_wol(struct net_device *netdev, | 909 | static void ixgbe_get_wol(struct net_device *netdev, |
910 | struct ethtool_wolinfo *wol) | 910 | struct ethtool_wolinfo *wol) |
911 | { | 911 | { |
912 | wol->supported = 0; | 912 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
913 | |||
914 | wol->supported = WAKE_UCAST | WAKE_MCAST | | ||
915 | WAKE_BCAST | WAKE_MAGIC; | ||
913 | wol->wolopts = 0; | 916 | wol->wolopts = 0; |
914 | 917 | ||
918 | if (!device_can_wakeup(&adapter->pdev->dev)) | ||
919 | return; | ||
920 | |||
921 | if (adapter->wol & IXGBE_WUFC_EX) | ||
922 | wol->wolopts |= WAKE_UCAST; | ||
923 | if (adapter->wol & IXGBE_WUFC_MC) | ||
924 | wol->wolopts |= WAKE_MCAST; | ||
925 | if (adapter->wol & IXGBE_WUFC_BC) | ||
926 | wol->wolopts |= WAKE_BCAST; | ||
927 | if (adapter->wol & IXGBE_WUFC_MAG) | ||
928 | wol->wolopts |= WAKE_MAGIC; | ||
929 | |||
915 | return; | 930 | return; |
916 | } | 931 | } |
917 | 932 | ||
933 | static int ixgbe_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | ||
934 | { | ||
935 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
936 | |||
937 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) | ||
938 | return -EOPNOTSUPP; | ||
939 | |||
940 | adapter->wol = 0; | ||
941 | |||
942 | if (wol->wolopts & WAKE_UCAST) | ||
943 | adapter->wol |= IXGBE_WUFC_EX; | ||
944 | if (wol->wolopts & WAKE_MCAST) | ||
945 | adapter->wol |= IXGBE_WUFC_MC; | ||
946 | if (wol->wolopts & WAKE_BCAST) | ||
947 | adapter->wol |= IXGBE_WUFC_BC; | ||
948 | if (wol->wolopts & WAKE_MAGIC) | ||
949 | adapter->wol |= IXGBE_WUFC_MAG; | ||
950 | |||
951 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
952 | |||
953 | return 0; | ||
954 | } | ||
955 | |||
918 | static int ixgbe_nway_reset(struct net_device *netdev) | 956 | static int ixgbe_nway_reset(struct net_device *netdev) |
919 | { | 957 | { |
920 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 958 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
@@ -1031,6 +1069,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops = { | |||
1031 | .get_regs_len = ixgbe_get_regs_len, | 1069 | .get_regs_len = ixgbe_get_regs_len, |
1032 | .get_regs = ixgbe_get_regs, | 1070 | .get_regs = ixgbe_get_regs, |
1033 | .get_wol = ixgbe_get_wol, | 1071 | .get_wol = ixgbe_get_wol, |
1072 | .set_wol = ixgbe_set_wol, | ||
1034 | .nway_reset = ixgbe_nway_reset, | 1073 | .nway_reset = ixgbe_nway_reset, |
1035 | .get_link = ethtool_op_get_link, | 1074 | .get_link = ethtool_op_get_link, |
1036 | .get_eeprom_len = ixgbe_get_eeprom_len, | 1075 | .get_eeprom_len = ixgbe_get_eeprom_len, |