Skip to content

Commit

Permalink
natsemi: Consistently use interrupt enable/disable functions
Browse files Browse the repository at this point in the history
The natsemi drivers include functions for enabling and disabling
interrupts from the chip but these are not used in all code paths.  This
patch changes the code paths that touch the interrupt enable register to
use the functions.  In all cases this adds an extra PCI read to post the
operation but since none of these are in fast paths this shouldn't be
too much of a problem.

Signed-Off-By: Mark Brown <broonie@sirena.org.uk>

Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
broonie authored and Jeff Garzik committed Mar 15, 2007
1 parent b58ecad commit 14fdd90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/natsemi.c
Expand Up @@ -1712,7 +1712,7 @@ static void init_registers(struct net_device *dev)

/* Enable interrupts by setting the interrupt mask. */
writel(DEFAULT_INTR, ioaddr + IntrMask);
writel(1, ioaddr + IntrEnable);
natsemi_irq_enable(dev);

writel(RxOn | TxOn, ioaddr + ChipCmd);
writel(StatsClear, ioaddr + StatsCtrl); /* Clear Stats */
Expand Down Expand Up @@ -3071,7 +3071,7 @@ static void enable_wol_mode(struct net_device *dev, int enable_intr)
* Could be used to send a netlink message.
*/
writel(WOLPkt | LinkChange, ioaddr + IntrMask);
writel(1, ioaddr + IntrEnable);
natsemi_irq_enable(dev);
}
}

Expand Down Expand Up @@ -3202,7 +3202,7 @@ static int natsemi_suspend (struct pci_dev *pdev, pm_message_t state)
disable_irq(dev->irq);
spin_lock_irq(&np->lock);

writel(0, ioaddr + IntrEnable);
natsemi_irq_disable(dev);
np->hands_off = 1;
natsemi_stop_rxtx(dev);
netif_stop_queue(dev);
Expand Down

0 comments on commit 14fdd90

Please sign in to comment.