aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 13:08:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 13:08:08 -0400
commitfffdedef691a0f6fa7ca1fc0a2a508cbb49def69 (patch)
tree124b128308a4d35bab0ac8001da4b324d40220eb /drivers/net/sky2.c
parent5723ff931a94acf0738df42604ee89f852e151b0 (diff)
parentbf94e17bc8d35fc339945a42990a2f2b5e9b5a40 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: net/mac80211/rx.c: fix build error acpi: Make ACPI_TOSHIBA depend on INPUT. net/bfin_mac.c MDIO namespace fixes jme: remove unused #include <version.h> netfilter: remove unused #include <version.h> net: Fix off-by-one in skb_dma_map smc911x: Add support for LAN921{5,7,8} chips from SMSC qlge: remove duplicated #include wireless: remove duplicated #include net/au1000_eth.c MDIO namespace fixes net/tc35815.c: fix compilation sky2: Fix WOL regression r8169: NULL pointer dereference on r8169 load
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 3805b9318be7..3813d15e2df7 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3034,7 +3034,8 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
3034 struct sky2_port *sky2 = netdev_priv(dev); 3034 struct sky2_port *sky2 = netdev_priv(dev);
3035 struct sky2_hw *hw = sky2->hw; 3035 struct sky2_hw *hw = sky2->hw;
3036 3036
3037 if (wol->wolopts & ~sky2_wol_supported(sky2->hw)) 3037 if ((wol->wolopts & ~sky2_wol_supported(sky2->hw))
3038 || !device_can_wakeup(&hw->pdev->dev))
3038 return -EOPNOTSUPP; 3039 return -EOPNOTSUPP;
3039 3040
3040 sky2->wol = wol->wolopts; 3041 sky2->wol = wol->wolopts;
@@ -3045,6 +3046,8 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
3045 sky2_write32(hw, B0_CTST, sky2->wol 3046 sky2_write32(hw, B0_CTST, sky2->wol
3046 ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF); 3047 ? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
3047 3048
3049 device_set_wakeup_enable(&hw->pdev->dev, sky2->wol);
3050
3048 if (!netif_running(dev)) 3051 if (!netif_running(dev))
3049 sky2_wol_init(sky2); 3052 sky2_wol_init(sky2);
3050 return 0; 3053 return 0;
@@ -4179,18 +4182,6 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
4179 return err; 4182 return err;
4180} 4183}
4181 4184
4182static int __devinit pci_wake_enabled(struct pci_dev *dev)
4183{
4184 int pm = pci_find_capability(dev, PCI_CAP_ID_PM);
4185 u16 value;
4186
4187 if (!pm)
4188 return 0;
4189 if (pci_read_config_word(dev, pm + PCI_PM_CTRL, &value))
4190 return 0;
4191 return value & PCI_PM_CTRL_PME_ENABLE;
4192}
4193
4194/* 4185/*
4195 * Read and parse the first part of Vital Product Data 4186 * Read and parse the first part of Vital Product Data
4196 */ 4187 */
@@ -4314,7 +4305,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
4314 } 4305 }
4315 } 4306 }
4316 4307
4317 wol_default = pci_wake_enabled(pdev) ? WAKE_MAGIC : 0; 4308 wol_default = device_may_wakeup(&pdev->dev) ? WAKE_MAGIC : 0;
4318 4309
4319 err = -ENOMEM; 4310 err = -ENOMEM;
4320 hw = kzalloc(sizeof(*hw), GFP_KERNEL); 4311 hw = kzalloc(sizeof(*hw), GFP_KERNEL);