diff options
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index f618e7c8eeb1..794c19b2254f 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -922,6 +922,8 @@ netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev) | |||
922 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | 922 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
923 | netxen_p3_free_mac_list(adapter); | 923 | netxen_p3_free_mac_list(adapter); |
924 | 924 | ||
925 | adapter->set_promisc(adapter, NETXEN_NIU_NON_PROMISC_MODE); | ||
926 | |||
925 | netxen_napi_disable(adapter); | 927 | netxen_napi_disable(adapter); |
926 | 928 | ||
927 | netxen_release_tx_buffers(adapter); | 929 | netxen_release_tx_buffers(adapter); |
@@ -1288,14 +1290,11 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
1288 | 1290 | ||
1289 | free_netdev(netdev); | 1291 | free_netdev(netdev); |
1290 | } | 1292 | } |
1291 | 1293 | static int __netxen_nic_shutdown(struct pci_dev *pdev) | |
1292 | #ifdef CONFIG_PM | ||
1293 | static int | ||
1294 | netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) | ||
1295 | { | 1294 | { |
1296 | |||
1297 | struct netxen_adapter *adapter = pci_get_drvdata(pdev); | 1295 | struct netxen_adapter *adapter = pci_get_drvdata(pdev); |
1298 | struct net_device *netdev = adapter->netdev; | 1296 | struct net_device *netdev = adapter->netdev; |
1297 | int retval; | ||
1299 | 1298 | ||
1300 | netif_device_detach(netdev); | 1299 | netif_device_detach(netdev); |
1301 | 1300 | ||
@@ -1307,7 +1306,12 @@ netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1307 | 1306 | ||
1308 | netxen_nic_detach(adapter); | 1307 | netxen_nic_detach(adapter); |
1309 | 1308 | ||
1310 | pci_save_state(pdev); | 1309 | if (adapter->portnum == 0) |
1310 | netxen_free_dummy_dma(adapter); | ||
1311 | |||
1312 | retval = pci_save_state(pdev); | ||
1313 | if (retval) | ||
1314 | return retval; | ||
1311 | 1315 | ||
1312 | if (netxen_nic_wol_supported(adapter)) { | 1316 | if (netxen_nic_wol_supported(adapter)) { |
1313 | pci_enable_wake(pdev, PCI_D3cold, 1); | 1317 | pci_enable_wake(pdev, PCI_D3cold, 1); |
@@ -1315,10 +1319,27 @@ netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1315 | } | 1319 | } |
1316 | 1320 | ||
1317 | pci_disable_device(pdev); | 1321 | pci_disable_device(pdev); |
1318 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
1319 | 1322 | ||
1320 | return 0; | 1323 | return 0; |
1321 | } | 1324 | } |
1325 | static void netxen_nic_shutdown(struct pci_dev *pdev) | ||
1326 | { | ||
1327 | if (__netxen_nic_shutdown(pdev)) | ||
1328 | return; | ||
1329 | } | ||
1330 | #ifdef CONFIG_PM | ||
1331 | static int | ||
1332 | netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state) | ||
1333 | { | ||
1334 | int retval; | ||
1335 | |||
1336 | retval = __netxen_nic_shutdown(pdev); | ||
1337 | if (retval) | ||
1338 | return retval; | ||
1339 | |||
1340 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
1341 | return 0; | ||
1342 | } | ||
1322 | 1343 | ||
1323 | static int | 1344 | static int |
1324 | netxen_nic_resume(struct pci_dev *pdev) | 1345 | netxen_nic_resume(struct pci_dev *pdev) |
@@ -2068,8 +2089,9 @@ static struct pci_driver netxen_driver = { | |||
2068 | .remove = __devexit_p(netxen_nic_remove), | 2089 | .remove = __devexit_p(netxen_nic_remove), |
2069 | #ifdef CONFIG_PM | 2090 | #ifdef CONFIG_PM |
2070 | .suspend = netxen_nic_suspend, | 2091 | .suspend = netxen_nic_suspend, |
2071 | .resume = netxen_nic_resume | 2092 | .resume = netxen_nic_resume, |
2072 | #endif | 2093 | #endif |
2094 | .shutdown = netxen_nic_shutdown | ||
2073 | }; | 2095 | }; |
2074 | 2096 | ||
2075 | static int __init netxen_init_module(void) | 2097 | static int __init netxen_init_module(void) |