2 Power management interface routines.
3 Written by Mariusz Matuszek.
4 This code is currently just a placeholder for later work and
5 does not do anything useful.
7 This is part of rtl8180 OpenSource driver.
8 Copyright (C) Andrea Merello 2004 <andreamrl@tiscali.it>
9 Released under the terms of GPL (General Public Licence)
12 #ifdef CONFIG_RTL8180_PM
19 int rtl8180_save_state (struct pci_dev *dev, u32 state)
21 printk(KERN_NOTICE "r8180 save state call (state %u).\n", state);
25 int rtl8180_suspend (struct pci_dev *pdev, pm_message_t state)
27 struct net_device *dev = pci_get_drvdata(pdev);
28 // struct r8180_priv *priv = ieee80211_priv(dev);
30 if (!netif_running(dev))
35 netif_device_detach(dev);
39 pci_disable_device(pdev);
40 pci_set_power_state(pdev,pci_choose_state(pdev,state));
44 int rtl8180_resume (struct pci_dev *pdev)
46 struct net_device *dev = pci_get_drvdata(pdev);
47 // struct r8180_priv *priv = ieee80211_priv(dev);
51 pci_set_power_state(pdev, PCI_D0);
53 err = pci_enable_device(pdev);
55 printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
60 pci_restore_state(pdev);
62 * Suspend/Resume resets the PCI configuration space, so we have to
63 * re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries
64 * from interfering with C3 CPU state. pci_restore_state won't help
65 * here since it only restores the first 64 bytes pci config header.
67 pci_read_config_dword(pdev, 0x40, &val);
68 if ((val & 0x0000ff00) != 0)
69 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
71 if(!netif_running(dev))
75 netif_device_attach(dev);
81 int rtl8180_enable_wake (struct pci_dev *dev, u32 state, int enable)
83 printk(KERN_NOTICE "r8180 enable wake call (state %u, enable %d).\n",
90 #endif //CONFIG_RTL8180_PM