Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300549
b: refs/heads/master
c: c0bd55e
h: refs/heads/master
i:
  300547: 1c2c4bb
v: v3
  • Loading branch information
Francois Romieu committed Apr 7, 2012
1 parent ec4239a commit 820b37f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0357e975afdbbedab5c662d19bef865f02adc17
refs/heads/master: c0bd55efd7b7ea8346ec3b5ce8414f978fede1f5
17 changes: 8 additions & 9 deletions trunk/drivers/net/ethernet/dec/tulip/winbond-840.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,6 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
No hold time required! */
iowrite32(0x00000001, ioaddr + PCIBusCfg);

dev->base_addr = (unsigned long)ioaddr;
dev->irq = irq;

np = netdev_priv(dev);
np->pci_dev = pdev;
np->chip_id = chip_idx;
Expand Down Expand Up @@ -635,17 +632,18 @@ static int netdev_open(struct net_device *dev)
{
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = np->base_addr;
const int irq = np->pci_dev->irq;
int i;

iowrite32(0x00000001, ioaddr + PCIBusCfg); /* Reset */

netif_device_detach(dev);
i = request_irq(dev->irq, intr_handler, IRQF_SHARED, dev->name, dev);
i = request_irq(irq, intr_handler, IRQF_SHARED, dev->name, dev);
if (i)
goto out_err;

if (debug > 1)
netdev_dbg(dev, "w89c840_open() irq %d\n", dev->irq);
netdev_dbg(dev, "w89c840_open() irq %d\n", irq);

if((i=alloc_ringdesc(dev)))
goto out_err;
Expand Down Expand Up @@ -932,6 +930,7 @@ static void tx_timeout(struct net_device *dev)
{
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = np->base_addr;
const int irq = np->pci_dev->irq;

dev_warn(&dev->dev, "Transmit timed out, status %08x, resetting...\n",
ioread32(ioaddr + IntrStatus));
Expand All @@ -951,7 +950,7 @@ static void tx_timeout(struct net_device *dev)
np->cur_tx, np->dirty_tx, np->tx_full, np->tx_q_bytes);
printk(KERN_DEBUG "Tx Descriptor addr %xh\n", ioread32(ioaddr+0x4C));

disable_irq(dev->irq);
disable_irq(irq);
spin_lock_irq(&np->lock);
/*
* Under high load dirty_tx and the internal tx descriptor pointer
Expand All @@ -966,7 +965,7 @@ static void tx_timeout(struct net_device *dev)
init_rxtx_rings(dev);
init_registers(dev);
spin_unlock_irq(&np->lock);
enable_irq(dev->irq);
enable_irq(irq);

netif_wake_queue(dev);
dev->trans_start = jiffies; /* prevent tx timeout */
Expand Down Expand Up @@ -1500,7 +1499,7 @@ static int netdev_close(struct net_device *dev)
iowrite32(0x0000, ioaddr + IntrEnable);
spin_unlock_irq(&np->lock);

free_irq(dev->irq, dev);
free_irq(np->pci_dev->irq, dev);
wmb();
netif_device_attach(dev);

Expand Down Expand Up @@ -1589,7 +1588,7 @@ static int w840_suspend (struct pci_dev *pdev, pm_message_t state)
iowrite32(0, ioaddr + IntrEnable);
spin_unlock_irq(&np->lock);

synchronize_irq(dev->irq);
synchronize_irq(np->pci_dev->irq);
netif_tx_disable(dev);

np->stats.rx_missed_errors += ioread32(ioaddr + RxMissed) & 0xffff;
Expand Down

0 comments on commit 820b37f

Please sign in to comment.