diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e100.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index c1ca2dae7c48..a43b82512b60 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -971,7 +971,8 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) | |||
971 | if(nic->flags & multicast_all) | 971 | if(nic->flags & multicast_all) |
972 | config->multicast_all = 0x1; /* 1=accept, 0=no */ | 972 | config->multicast_all = 0x1; /* 1=accept, 0=no */ |
973 | 973 | ||
974 | if(!(nic->flags & wol_magic)) | 974 | /* disable WoL when up */ |
975 | if(netif_running(nic->netdev) || !(nic->flags & wol_magic)) | ||
975 | config->magic_packet_disable = 0x1; /* 1=off, 0=on */ | 976 | config->magic_packet_disable = 0x1; /* 1=off, 0=on */ |
976 | 977 | ||
977 | if(nic->mac >= mac_82558_D101_A4) { | 978 | if(nic->mac >= mac_82558_D101_A4) { |
@@ -1718,6 +1719,7 @@ static int e100_change_mtu(struct net_device *netdev, int new_mtu) | |||
1718 | return 0; | 1719 | return 0; |
1719 | } | 1720 | } |
1720 | 1721 | ||
1722 | #ifdef CONFIG_PM | ||
1721 | static int e100_asf(struct nic *nic) | 1723 | static int e100_asf(struct nic *nic) |
1722 | { | 1724 | { |
1723 | /* ASF can be enabled from eeprom */ | 1725 | /* ASF can be enabled from eeprom */ |
@@ -1726,6 +1728,7 @@ static int e100_asf(struct nic *nic) | |||
1726 | !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) && | 1728 | !(nic->eeprom[eeprom_config_asf] & eeprom_gcl) && |
1727 | ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE)); | 1729 | ((nic->eeprom[eeprom_smbus_addr] & 0xFF) != 0xFE)); |
1728 | } | 1730 | } |
1731 | #endif | ||
1729 | 1732 | ||
1730 | static int e100_up(struct nic *nic) | 1733 | static int e100_up(struct nic *nic) |
1731 | { | 1734 | { |
@@ -1938,7 +1941,6 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
1938 | else | 1941 | else |
1939 | nic->flags &= ~wol_magic; | 1942 | nic->flags &= ~wol_magic; |
1940 | 1943 | ||
1941 | pci_enable_wake(nic->pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); | ||
1942 | e100_exec_cb(nic, NULL, e100_configure); | 1944 | e100_exec_cb(nic, NULL, e100_configure); |
1943 | 1945 | ||
1944 | return 0; | 1946 | return 0; |
@@ -2336,7 +2338,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2336 | (nic->eeprom[eeprom_id] & eeprom_id_wol)) | 2338 | (nic->eeprom[eeprom_id] & eeprom_id_wol)) |
2337 | nic->flags |= wol_magic; | 2339 | nic->flags |= wol_magic; |
2338 | 2340 | ||
2339 | pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); | 2341 | /* ack any pending wake events, disable PME */ |
2342 | pci_enable_wake(pdev, 0, 0); | ||
2340 | 2343 | ||
2341 | strcpy(netdev->name, "eth%d"); | 2344 | strcpy(netdev->name, "eth%d"); |
2342 | if((err = register_netdev(netdev))) { | 2345 | if((err = register_netdev(netdev))) { |
@@ -2408,6 +2411,8 @@ static int e100_resume(struct pci_dev *pdev) | |||
2408 | 2411 | ||
2409 | pci_set_power_state(pdev, PCI_D0); | 2412 | pci_set_power_state(pdev, PCI_D0); |
2410 | pci_restore_state(pdev); | 2413 | pci_restore_state(pdev); |
2414 | /* ack any pending wake events, disable PME */ | ||
2415 | pci_enable_wake(pdev, 0, 0); | ||
2411 | if(e100_hw_init(nic)) | 2416 | if(e100_hw_init(nic)) |
2412 | DPRINTK(HW, ERR, "e100_hw_init failed\n"); | 2417 | DPRINTK(HW, ERR, "e100_hw_init failed\n"); |
2413 | 2418 | ||
@@ -2419,6 +2424,21 @@ static int e100_resume(struct pci_dev *pdev) | |||
2419 | } | 2424 | } |
2420 | #endif | 2425 | #endif |
2421 | 2426 | ||
2427 | |||
2428 | static void e100_shutdown(struct device *dev) | ||
2429 | { | ||
2430 | struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); | ||
2431 | struct net_device *netdev = pci_get_drvdata(pdev); | ||
2432 | struct nic *nic = netdev_priv(netdev); | ||
2433 | |||
2434 | #ifdef CONFIG_PM | ||
2435 | pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); | ||
2436 | #else | ||
2437 | pci_enable_wake(pdev, 0, nic->flags & (wol_magic)); | ||
2438 | #endif | ||
2439 | } | ||
2440 | |||
2441 | |||
2422 | static struct pci_driver e100_driver = { | 2442 | static struct pci_driver e100_driver = { |
2423 | .name = DRV_NAME, | 2443 | .name = DRV_NAME, |
2424 | .id_table = e100_id_table, | 2444 | .id_table = e100_id_table, |
@@ -2428,6 +2448,11 @@ static struct pci_driver e100_driver = { | |||
2428 | .suspend = e100_suspend, | 2448 | .suspend = e100_suspend, |
2429 | .resume = e100_resume, | 2449 | .resume = e100_resume, |
2430 | #endif | 2450 | #endif |
2451 | |||
2452 | .driver = { | ||
2453 | .shutdown = e100_shutdown, | ||
2454 | } | ||
2455 | |||
2431 | }; | 2456 | }; |
2432 | 2457 | ||
2433 | static int __init e100_init_module(void) | 2458 | static int __init e100_init_module(void) |