aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igb/igb_ethtool.c
diff options
context:
space:
mode:
authorMatthew Vick <matthew.vick@intel.com>2012-11-09 00:49:54 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-11-22 05:00:58 -0500
commit63d4a8f963fce8fe5d8ba3d5eba34d7d7ca6f82b (patch)
tree34d71b51d5abcfa21be055245b6e8292b1aedb83 /drivers/net/ethernet/intel/igb/igb_ethtool.c
parent3e961a06a0d509d9f7cddc8240431d25f6dcd51f (diff)
igb: No longer rely on APME to determine WoL settings
Historically, we've been using the APME bit to determine whether a device supports wake on a given port or not. However, this bit specifies the default wake setting, rather than the wake support. Change the behavior so that we use a flag to keep the capabilities separate from the enablement while meeting customer requirements. Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_ethtool.c')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ethtool.c56
1 files changed, 2 insertions, 54 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 0acf590d4a83..e2288b5a9caa 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -1966,54 +1966,6 @@ static void igb_diag_test(struct net_device *netdev,
1966 msleep_interruptible(4 * 1000); 1966 msleep_interruptible(4 * 1000);
1967} 1967}
1968 1968
1969static int igb_wol_exclusion(struct igb_adapter *adapter,
1970 struct ethtool_wolinfo *wol)
1971{
1972 struct e1000_hw *hw = &adapter->hw;
1973 int retval = 1; /* fail by default */
1974
1975 switch (hw->device_id) {
1976 case E1000_DEV_ID_82575GB_QUAD_COPPER:
1977 /* WoL not supported */
1978 wol->supported = 0;
1979 break;
1980 case E1000_DEV_ID_82575EB_FIBER_SERDES:
1981 case E1000_DEV_ID_82576_FIBER:
1982 case E1000_DEV_ID_82576_SERDES:
1983 /* Wake events not supported on port B */
1984 if (rd32(E1000_STATUS) & E1000_STATUS_FUNC_1) {
1985 wol->supported = 0;
1986 break;
1987 }
1988 /* return success for non excluded adapter ports */
1989 retval = 0;
1990 break;
1991 case E1000_DEV_ID_82576_QUAD_COPPER:
1992 case E1000_DEV_ID_82576_QUAD_COPPER_ET2:
1993 /* quad port adapters only support WoL on port A */
1994 if (!(adapter->flags & IGB_FLAG_QUAD_PORT_A)) {
1995 wol->supported = 0;
1996 break;
1997 }
1998 /* return success for non excluded adapter ports */
1999 retval = 0;
2000 break;
2001 default:
2002 /* dual port cards only support WoL on port A from now on
2003 * unless it was enabled in the eeprom for port B
2004 * so exclude FUNC_1 ports from having WoL enabled */
2005 if ((rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) &&
2006 !adapter->eeprom_wol) {
2007 wol->supported = 0;
2008 break;
2009 }
2010
2011 retval = 0;
2012 }
2013
2014 return retval;
2015}
2016
2017static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) 1969static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2018{ 1970{
2019 struct igb_adapter *adapter = netdev_priv(netdev); 1971 struct igb_adapter *adapter = netdev_priv(netdev);
@@ -2023,10 +1975,7 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2023 WAKE_PHY; 1975 WAKE_PHY;
2024 wol->wolopts = 0; 1976 wol->wolopts = 0;
2025 1977
2026 /* this function will set ->supported = 0 and return 1 if wol is not 1978 if (!(adapter->flags & IGB_FLAG_WOL_SUPPORTED))
2027 * supported by this hardware */
2028 if (igb_wol_exclusion(adapter, wol) ||
2029 !device_can_wakeup(&adapter->pdev->dev))
2030 return; 1979 return;
2031 1980
2032 /* apply any specific unsupported masks here */ 1981 /* apply any specific unsupported masks here */
@@ -2054,8 +2003,7 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2054 if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)) 2003 if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))
2055 return -EOPNOTSUPP; 2004 return -EOPNOTSUPP;
2056 2005
2057 if (igb_wol_exclusion(adapter, wol) || 2006 if (!(adapter->flags & IGB_FLAG_WOL_SUPPORTED))
2058 !device_can_wakeup(&adapter->pdev->dev))
2059 return wol->wolopts ? -EOPNOTSUPP : 0; 2007 return wol->wolopts ? -EOPNOTSUPP : 0;
2060 2008
2061 /* these settings will always override what we currently have */ 2009 /* these settings will always override what we currently have */