Commit b735a725 authored by Stefan Rompf's avatar Stefan Rompf Committed by Jeff Garzik

[PATCH] Re: Patch: netif_carrier_on()/off() for xircom_tulip_cb

--Boundary-00=_EQjNA7alc3Y2zQJ
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

> Please resend patches that may be applied with "patch -p1",
> not "patch -p0".

ok., here's the first, suspend/resume

--Boundary-00=_EQjNA7alc3Y2zQJ
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="xircom_tulip_cb_pm.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="xircom_tulip_cb_pm.diff"
parent b72b407a
...@@ -329,6 +329,9 @@ struct xircom_private { ...@@ -329,6 +329,9 @@ struct xircom_private {
int saved_if_port; int saved_if_port;
struct pci_dev *pdev; struct pci_dev *pdev;
spinlock_t lock; spinlock_t lock;
#ifdef CONFIG_PM
u32 pci_state[16];
#endif
}; };
static int mdio_read(struct net_device *dev, int phy_id, int location); static int mdio_read(struct net_device *dev, int phy_id, int location);
...@@ -749,6 +752,7 @@ xircom_up(struct net_device *dev) ...@@ -749,6 +752,7 @@ xircom_up(struct net_device *dev)
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int i; int i;
xircom_init_ring(dev);
/* Clear the tx ring */ /* Clear the tx ring */
for (i = 0; i < TX_RING_SIZE; i++) { for (i = 0; i < TX_RING_SIZE; i++) {
tp->tx_skbuff[i] = 0; tp->tx_skbuff[i] = 0;
...@@ -801,8 +805,6 @@ xircom_open(struct net_device *dev) ...@@ -801,8 +805,6 @@ xircom_open(struct net_device *dev)
if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev)) if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev))
return -EAGAIN; return -EAGAIN;
xircom_init_ring(dev);
xircom_up(dev); xircom_up(dev);
tp->open = 1; tp->open = 1;
...@@ -1668,6 +1670,11 @@ static int xircom_suspend(struct pci_dev *pdev, u32 state) ...@@ -1668,6 +1670,11 @@ static int xircom_suspend(struct pci_dev *pdev, u32 state)
printk(KERN_INFO "xircom_suspend(%s)\n", dev->name); printk(KERN_INFO "xircom_suspend(%s)\n", dev->name);
if (tp->open) if (tp->open)
xircom_down(dev); xircom_down(dev);
pci_save_state(pdev, tp->pci_state);
pci_disable_device(pdev);
pci_set_power_state(pdev, 3);
return 0; return 0;
} }
...@@ -1678,6 +1685,10 @@ static int xircom_resume(struct pci_dev *pdev) ...@@ -1678,6 +1685,10 @@ static int xircom_resume(struct pci_dev *pdev)
struct xircom_private *tp = dev->priv; struct xircom_private *tp = dev->priv;
printk(KERN_INFO "xircom_resume(%s)\n", dev->name); printk(KERN_INFO "xircom_resume(%s)\n", dev->name);
pci_set_power_state(pdev,0);
pci_enable_device(pdev);
pci_restore_state(pdev, tp->pci_state);
/* Bring the chip out of sleep mode. /* Bring the chip out of sleep mode.
Caution: Snooze mode does not work with some boards! */ Caution: Snooze mode does not work with some boards! */
if (xircom_tbl[tp->chip_id].flags & HAS_ACPI) if (xircom_tbl[tp->chip_id].flags & HAS_ACPI)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment