aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tulip/dmfe.c52
1 files changed, 49 insertions, 3 deletions
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index b3a64ca98634..e3a077977e4c 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -55,9 +55,6 @@
55 55
56 TODO 56 TODO
57 57
58 Implement pci_driver::suspend() and pci_driver::resume()
59 power management methods.
60
61 Check on 64 bit boxes. 58 Check on 64 bit boxes.
62 Check and fix on big endian boxes. 59 Check and fix on big endian boxes.
63 60
@@ -2050,11 +2047,60 @@ static struct pci_device_id dmfe_pci_tbl[] = {
2050MODULE_DEVICE_TABLE(pci, dmfe_pci_tbl); 2047MODULE_DEVICE_TABLE(pci, dmfe_pci_tbl);
2051 2048
2052 2049
2050#ifdef CONFIG_PM
2051static int dmfe_suspend(struct pci_dev *pci_dev, pm_message_t state)
2052{
2053 struct net_device *dev = pci_get_drvdata(pci_dev);
2054 struct dmfe_board_info *db = netdev_priv(dev);
2055
2056 /* Disable upper layer interface */
2057 netif_device_detach(dev);
2058
2059 /* Disable Tx/Rx */
2060 db->cr6_data &= ~(CR6_RXSC | CR6_TXSC);
2061 update_cr6(db->cr6_data, dev->base_addr);
2062
2063 /* Disable Interrupt */
2064 outl(0, dev->base_addr + DCR7);
2065 outl(inl (dev->base_addr + DCR5), dev->base_addr + DCR5);
2066
2067 /* Fre RX buffers */
2068 dmfe_free_rxbuffer(db);
2069
2070 /* Power down device*/
2071 pci_set_power_state(pci_dev, pci_choose_state (pci_dev,state));
2072 pci_save_state(pci_dev);
2073
2074 return 0;
2075}
2076
2077static int dmfe_resume(struct pci_dev *pci_dev)
2078{
2079 struct net_device *dev = pci_get_drvdata(pci_dev);
2080
2081 pci_restore_state(pci_dev);
2082 pci_set_power_state(pci_dev, PCI_D0);
2083
2084 /* Re-initilize DM910X board */
2085 dmfe_init_dm910x(dev);
2086
2087 /* Restart upper layer interface */
2088 netif_device_attach(dev);
2089
2090 return 0;
2091}
2092#else
2093#define dmfe_suspend NULL
2094#define dmfe_resume NULL
2095#endif
2096
2053static struct pci_driver dmfe_driver = { 2097static struct pci_driver dmfe_driver = {
2054 .name = "dmfe", 2098 .name = "dmfe",
2055 .id_table = dmfe_pci_tbl, 2099 .id_table = dmfe_pci_tbl,
2056 .probe = dmfe_init_one, 2100 .probe = dmfe_init_one,
2057 .remove = __devexit_p(dmfe_remove_one), 2101 .remove = __devexit_p(dmfe_remove_one),
2102 .suspend = dmfe_suspend,
2103 .resume = dmfe_resume
2058}; 2104};
2059 2105
2060MODULE_AUTHOR("Sten Wang, sten_wang@davicom.com.tw"); 2106MODULE_AUTHOR("Sten Wang, sten_wang@davicom.com.tw");