Пример #1
0
static irqreturn_t irq_handler(int irq, void *device, struct pt_regs *regs)
{
	struct net_device *dev = (struct net_device *) device;
	u16 ival;

	/* in case we're not meant... */
	if (!(inb(dev->base_addr + BCMREG) & BCMREG_IPEND))
		return IRQ_NONE;

	/* loop through the interrupt bits until everything is clear */
	while (1) {
		ival = inw(dev->base_addr + SONIC_ISREG);

		if (ival & ISREG_RBE) {
			irqrbe_handler(dev);
			outw(ISREG_RBE, dev->base_addr + SONIC_ISREG);
		}
		if (ival & ISREG_PKTRX) {
			irqrx_handler(dev);
			outw(ISREG_PKTRX, dev->base_addr + SONIC_ISREG);
		}
		if (ival & ISREG_TXDN) {
			irqtx_handler(dev);
			outw(ISREG_TXDN, dev->base_addr + SONIC_ISREG);
		}
		if (ival & ISREG_TXER) {
			irqtxerr_handler(dev);
			outw(ISREG_TXER, dev->base_addr + SONIC_ISREG);
		}
		break;
	}
	return IRQ_HANDLED;
}
Пример #2
0
static void irq_handler(int irq, void *device, struct pt_regs *regs)
{
	struct IBMLANA_NETDEV *dev = (struct IBMLANA_NETDEV *) device;
	u16 ival;

	/* in case we're not meant... */

	if (!(inb(dev->base_addr + BCMREG) & BCMREG_IPEND))
		return;

#if (LINUX_VERSION_CODE >= 0x02032a)
#if 0
	set_bit(LINK_STATE_RXSEM, &dev->state);
#endif
#else
	dev->interrupt = 1;
#endif

	/* loop through the interrupt bits until everything is clear */

	while (1) {
		ival = inw(dev->base_addr + SONIC_ISREG);

		if (ival & ISREG_RBE) {
			irqrbe_handler(dev);
			outw(ISREG_RBE, dev->base_addr + SONIC_ISREG);
		}

		if (ival & ISREG_PKTRX) {
			irqrx_handler(dev);
			outw(ISREG_PKTRX, dev->base_addr + SONIC_ISREG);
		}

		if (ival & ISREG_TXDN) {
			irqtx_handler(dev);
			outw(ISREG_TXDN, dev->base_addr + SONIC_ISREG);
		}

		if (ival & ISREG_TXER) {
			irqtxerr_handler(dev);
			outw(ISREG_TXER, dev->base_addr + SONIC_ISREG);
		}

		break;
	}

#if (LINUX_VERSION_CODE >= 0x02032a)
#if 0
	clear_bit(LINK_STATE_RXSEM, &dev->state);
#endif
#else
	dev->interrupt = 0;
#endif
}