diff options
Diffstat (limited to 'drivers/net/starfire.c')
-rw-r--r-- | drivers/net/starfire.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index d167deda9a53..35b18057fbdd 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -201,7 +201,7 @@ static int max_interrupt_work = 20; | |||
201 | static int mtu; | 201 | static int mtu; |
202 | /* Maximum number of multicast addresses to filter (vs. rx-all-multicast). | 202 | /* Maximum number of multicast addresses to filter (vs. rx-all-multicast). |
203 | The Starfire has a 512 element hash table based on the Ethernet CRC. */ | 203 | The Starfire has a 512 element hash table based on the Ethernet CRC. */ |
204 | static int multicast_filter_limit = 512; | 204 | static const int multicast_filter_limit = 512; |
205 | /* Whether to do TCP/UDP checksums in hardware */ | 205 | /* Whether to do TCP/UDP checksums in hardware */ |
206 | static int enable_hw_cksum = 1; | 206 | static int enable_hw_cksum = 1; |
207 | 207 | ||
@@ -463,7 +463,7 @@ static struct pci_device_id starfire_pci_tbl[] = { | |||
463 | MODULE_DEVICE_TABLE(pci, starfire_pci_tbl); | 463 | MODULE_DEVICE_TABLE(pci, starfire_pci_tbl); |
464 | 464 | ||
465 | /* A chip capabilities table, matching the CH_xxx entries in xxx_pci_tbl[] above. */ | 465 | /* A chip capabilities table, matching the CH_xxx entries in xxx_pci_tbl[] above. */ |
466 | static struct chip_info { | 466 | static const struct chip_info { |
467 | const char *name; | 467 | const char *name; |
468 | int drv_flags; | 468 | int drv_flags; |
469 | } netdrv_tbl[] __devinitdata = { | 469 | } netdrv_tbl[] __devinitdata = { |
@@ -2084,6 +2084,38 @@ static int netdev_close(struct net_device *dev) | |||
2084 | return 0; | 2084 | return 0; |
2085 | } | 2085 | } |
2086 | 2086 | ||
2087 | #ifdef CONFIG_PM | ||
2088 | static int starfire_suspend(struct pci_dev *pdev, pm_message_t state) | ||
2089 | { | ||
2090 | struct net_device *dev = pci_get_drvdata(pdev); | ||
2091 | |||
2092 | if (netif_running(dev)) { | ||
2093 | netif_device_detach(dev); | ||
2094 | netdev_close(dev); | ||
2095 | } | ||
2096 | |||
2097 | pci_save_state(pdev); | ||
2098 | pci_set_power_state(pdev, pci_choose_state(pdev,state)); | ||
2099 | |||
2100 | return 0; | ||
2101 | } | ||
2102 | |||
2103 | static int starfire_resume(struct pci_dev *pdev) | ||
2104 | { | ||
2105 | struct net_device *dev = pci_get_drvdata(pdev); | ||
2106 | |||
2107 | pci_set_power_state(pdev, PCI_D0); | ||
2108 | pci_restore_state(pdev); | ||
2109 | |||
2110 | if (netif_running(dev)) { | ||
2111 | netdev_open(dev); | ||
2112 | netif_device_attach(dev); | ||
2113 | } | ||
2114 | |||
2115 | return 0; | ||
2116 | } | ||
2117 | #endif /* CONFIG_PM */ | ||
2118 | |||
2087 | 2119 | ||
2088 | static void __devexit starfire_remove_one (struct pci_dev *pdev) | 2120 | static void __devexit starfire_remove_one (struct pci_dev *pdev) |
2089 | { | 2121 | { |
@@ -2115,6 +2147,10 @@ static struct pci_driver starfire_driver = { | |||
2115 | .name = DRV_NAME, | 2147 | .name = DRV_NAME, |
2116 | .probe = starfire_init_one, | 2148 | .probe = starfire_init_one, |
2117 | .remove = __devexit_p(starfire_remove_one), | 2149 | .remove = __devexit_p(starfire_remove_one), |
2150 | #ifdef CONFIG_PM | ||
2151 | .suspend = starfire_suspend, | ||
2152 | .resume = starfire_resume, | ||
2153 | #endif /* CONFIG_PM */ | ||
2118 | .id_table = starfire_pci_tbl, | 2154 | .id_table = starfire_pci_tbl, |
2119 | }; | 2155 | }; |
2120 | 2156 | ||