e1000: remove obsolete custom pci_save_state code

Now that 2.6.19 provides a proper implementation that saves MSI, PCI-E
config space, we can have the e1000 driver use those instead of it's
custom implementation.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Kok, Auke 2007-02-16 14:39:28 -08:00 committed by Jeff Garzik
parent d2ed16356f
commit 1d33e9c606
2 changed files with 2 additions and 57 deletions

View File

@ -337,7 +337,6 @@ struct e1000_adapter {
struct e1000_rx_ring test_rx_ring;
uint32_t *config_space;
int msg_enable;
#ifdef CONFIG_PCI_MSI
boolean_t have_msi;

View File

@ -5071,58 +5071,6 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx)
return 0;
}
#ifdef CONFIG_PM
/* Save/restore 16 or 64 dwords of PCI config space depending on which
* bus we're on (PCI(X) vs. PCI-E)
*/
#define PCIE_CONFIG_SPACE_LEN 256
#define PCI_CONFIG_SPACE_LEN 64
static int
e1000_pci_save_state(struct e1000_adapter *adapter)
{
struct pci_dev *dev = adapter->pdev;
int size;
int i;
if (adapter->hw.mac_type >= e1000_82571)
size = PCIE_CONFIG_SPACE_LEN;
else
size = PCI_CONFIG_SPACE_LEN;
WARN_ON(adapter->config_space != NULL);
adapter->config_space = kmalloc(size, GFP_KERNEL);
if (!adapter->config_space) {
DPRINTK(PROBE, ERR, "unable to allocate %d bytes\n", size);
return -ENOMEM;
}
for (i = 0; i < (size / 4); i++)
pci_read_config_dword(dev, i * 4, &adapter->config_space[i]);
return 0;
}
static void
e1000_pci_restore_state(struct e1000_adapter *adapter)
{
struct pci_dev *dev = adapter->pdev;
int size;
int i;
if (adapter->config_space == NULL)
return;
if (adapter->hw.mac_type >= e1000_82571)
size = PCIE_CONFIG_SPACE_LEN;
else
size = PCI_CONFIG_SPACE_LEN;
for (i = 0; i < (size / 4); i++)
pci_write_config_dword(dev, i * 4, adapter->config_space[i]);
kfree(adapter->config_space);
adapter->config_space = NULL;
return;
}
#endif /* CONFIG_PM */
static int
e1000_suspend(struct pci_dev *pdev, pm_message_t state)
{
@ -5142,9 +5090,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
}
#ifdef CONFIG_PM
/* Implement our own version of pci_save_state(pdev) because pci-
* express adapters have 256-byte config spaces. */
retval = e1000_pci_save_state(adapter);
retval = pci_save_state(pdev);
if (retval)
return retval;
#endif
@ -5231,7 +5177,7 @@ e1000_resume(struct pci_dev *pdev)
uint32_t err;
pci_set_power_state(pdev, PCI_D0);
e1000_pci_restore_state(adapter);
pci_restore_state(pdev);
if ((err = pci_enable_device(pdev))) {
printk(KERN_ERR "e1000: Cannot enable PCI device from suspend\n");
return err;