/* counter overruns; all counters are 16bit wide */ if (status & SONIC_INT_FAE) lp->stats.rx_frame_errors += 65536; if (status & SONIC_INT_CRC) lp->stats.rx_crc_errors += 65536; if (status & SONIC_INT_MP) lp->stats.rx_missed_errors += 65536; 
/* bus retry */ if (status & SONIC_INT_BR) { printk(KERN_ERR "%s: Bus retry occurred! Device interrupt disabled.\n", dev->name); /* ... to help debug DMA problems causing endless interrupts. */ /* Bounce the eth interface to turn on the interrupt again. */ SONIC_WRITE(SONIC_IMR, 0); SONIC_WRITE(SONIC_ISR, SONIC_INT_BR); /* clear the interrupt */ } 
static irqreturn_t sonic_interrupt(int irq, void *dev_id, struct pt_regs *regs){	struct net_device *dev = (struct net_device *) dev_id;	unsigned int base_addr = dev->base_addr;	struct sonic_local *lp;	int status;	if (dev == NULL) {		printk("sonic_interrupt: irq %d for unknown device.\n", irq);		return IRQ_NONE;	}	lp = (struct sonic_local *) dev->priv;	status = SONIC_READ(SONIC_ISR);	SONIC_WRITE(SONIC_ISR, 0x7fff);	/* clear all bits */	if (sonic_debug > 2)		printk("sonic_interrupt: ISR=%x\n", status);	if (status & SONIC_INT_PKTRX) {		sonic_rx(dev);	/* got packet(s) */	}	if (status & SONIC_INT_TXDN) {		int dirty_tx = lp->dirty_tx;		while (dirty_tx < lp->cur_tx) {			int entry = dirty_tx & SONIC_TDS_MASK;			int status = lp->tda[entry].tx_status;			if (sonic_debug > 3)				printk				    ("sonic_interrupt: status %d, cur_tx %d, dirty_tx %d\n",				     status, lp->cur_tx, lp->dirty_tx);			if (status == 0) {				/* It still hasn't been Txed, kick the sonic again */				SONIC_WRITE(SONIC_CMD, SONIC_CR_TXP);				break;			}			/* put back EOL and free descriptor */			lp->tda[entry].tx_frag_count = 0;			lp->tda[entry].tx_status = 0;			if (status & 0x0001)				lp->stats.tx_packets++;			else {				lp->stats.tx_errors++;				if (status & 0x0642)					lp->stats.tx_aborted_errors++;				if (status & 0x0180)					lp->stats.tx_carrier_errors++;				if (status & 0x0020)					lp->stats.tx_window_errors++;				if (status & 0x0004)					lp->stats.tx_fifo_errors++;			}			/* We must free the original skb */			if (lp->tx_skb[entry]) {				dev_kfree_skb_irq(lp->tx_skb[entry]);				lp->tx_skb[entry] = 0;			}			/* and the VDMA address */			vdma_free(lp->tx_laddr[entry]);			dirty_tx++;		}		if (lp->tx_full		    && dirty_tx + SONIC_NUM_TDS > lp->cur_tx + 2) {			/* The ring is no longer full, clear tbusy. */			lp->tx_full = 0;			netif_wake_queue(dev);		}		lp->dirty_tx = dirty_tx;	}	/*	 * check error conditions	 */	if (status & SONIC_INT_RFO) {		printk("%s: receive fifo underrun\n", dev->name);		lp->stats.rx_fifo_errors++;	}	if (status & SONIC_INT_RDE) {		printk("%s: receive descriptors exhausted\n", dev->name);		lp->stats.rx_dropped++;	}	if (status & SONIC_INT_RBE) {		printk("%s: receive buffer exhausted\n", dev->name);		lp->stats.rx_dropped++;	}	if (status & SONIC_INT_RBAE) {		printk("%s: receive buffer area exhausted\n", dev->name);		lp->stats.rx_dropped++;	}	/* counter overruns; all counters are 16bit wide */	if (status & SONIC_INT_FAE)		lp->stats.rx_frame_errors += 65536;	if (status & SONIC_INT_CRC)		lp->stats.rx_crc_errors += 65536;	if (status & SONIC_INT_MP)		lp->stats.rx_missed_errors += 65536;	/* transmit error */	if (status & SONIC_INT_TXER)		lp->stats.tx_errors++;	/*	 * clear interrupt bits and return	 */	SONIC_WRITE(SONIC_ISR, status);	return IRQ_HANDLED;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/efcce839360fb3a7b6dedeacaec80f68b0f2d052/sonic.c/clean/drivers/net/sonic.c