if (tx_status & 0x1e)	/* Restart the Tx. */ iowrite16 (TxEnable, ioaddr + MACCtrl1); 
/* Restart the Tx. */ iowrite16 (TxEnable, ioaddr + MACCtrl1); 
static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs){	struct net_device *dev = (struct net_device *)dev_instance;	struct netdev_private *np = netdev_priv(dev);	void __iomem *ioaddr = np->base;	int hw_frame_id;	int tx_cnt;	int tx_status;	int handled = 0;	do {		int intr_status = ioread16(ioaddr + IntrStatus);		iowrite16(intr_status, ioaddr + IntrStatus);		if (netif_msg_intr(np))			printk(KERN_DEBUG "%s: Interrupt, status %4.4x.\n",				   dev->name, intr_status);		if (!(intr_status & DEFAULT_INTR))			break;		handled = 1;		if (intr_status & (IntrRxDMADone)) {			iowrite16(DEFAULT_INTR & ~(IntrRxDone|IntrRxDMADone),					ioaddr + IntrEnable);			if (np->budget < 0)				np->budget = RX_BUDGET;			tasklet_schedule(&np->rx_tasklet);		}		if (intr_status & (IntrTxDone | IntrDrvRqst)) {			tx_status = ioread16 (ioaddr + TxStatus);			for (tx_cnt=32; tx_status & 0x80; --tx_cnt) {				if (netif_msg_tx_done(np))					printk					    ("%s: Transmit status is %2.2x.\n",				     	dev->name, tx_status);				if (tx_status & 0x1e) {					np->stats.tx_errors++;					if (tx_status & 0x10)						np->stats.tx_fifo_errors++;					if (tx_status & 0x08)						np->stats.collisions++;					if (tx_status & 0x02)						np->stats.tx_window_errors++;					/* This reset has not been verified!. */					if (tx_status & 0x10) {	/* Reset the Tx. */						np->stats.tx_fifo_errors++;						spin_lock(&np->lock);						reset_tx(dev);						spin_unlock(&np->lock);					}					if (tx_status & 0x1e)	/* Restart the Tx. */						iowrite16 (TxEnable,							ioaddr + MACCtrl1);				}				/* Yup, this is a documentation bug.  It cost me *hours*. */				iowrite16 (0, ioaddr + TxStatus);				if (tx_cnt < 0) {					iowrite32(5000, ioaddr + DownCounter);					break;				}				tx_status = ioread16 (ioaddr + TxStatus);			}			hw_frame_id = (tx_status >> 8) & 0xff;		} else 	{			hw_frame_id = ioread8(ioaddr + TxFrameId);		}					if (np->pci_rev_id >= 0x14) {				spin_lock(&np->lock);			for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) {				int entry = np->dirty_tx % TX_RING_SIZE;				struct sk_buff *skb;				int sw_frame_id;				sw_frame_id = (le32_to_cpu(					np->tx_ring[entry].status) >> 2) & 0xff;				if (sw_frame_id == hw_frame_id &&					!(le32_to_cpu(np->tx_ring[entry].status)					& 0x00010000))						break;				if (sw_frame_id == (hw_frame_id + 1) % 					TX_RING_SIZE)						break;				skb = np->tx_skbuff[entry];				/* Free the original skb. */				pci_unmap_single(np->pci_dev,					np->tx_ring[entry].frag[0].addr,					skb->len, PCI_DMA_TODEVICE);				dev_kfree_skb_irq (np->tx_skbuff[entry]);				np->tx_skbuff[entry] = NULL;				np->tx_ring[entry].frag[0].addr = 0;				np->tx_ring[entry].frag[0].length = 0;			}			spin_unlock(&np->lock);		} else {			spin_lock(&np->lock);			for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) {				int entry = np->dirty_tx % TX_RING_SIZE;				struct sk_buff *skb;				if (!(le32_to_cpu(np->tx_ring[entry].status) 							& 0x00010000))					break;				skb = np->tx_skbuff[entry];				/* Free the original skb. */				pci_unmap_single(np->pci_dev,					np->tx_ring[entry].frag[0].addr,					skb->len, PCI_DMA_TODEVICE);				dev_kfree_skb_irq (np->tx_skbuff[entry]);				np->tx_skbuff[entry] = NULL;				np->tx_ring[entry].frag[0].addr = 0;				np->tx_ring[entry].frag[0].length = 0;			}			spin_unlock(&np->lock);		}				if (netif_queue_stopped(dev) &&			np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) {			/* The ring is no longer full, clear busy flag. */			netif_wake_queue (dev);		}		/* Abnormal error summary/uncommon events handlers. */		if (intr_status & (IntrPCIErr | LinkChange | StatsMax))			netdev_error(dev, intr_status);	} while (0);	if (netif_msg_intr(np))		printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n",			   dev->name, ioread16(ioaddr + IntrStatus));	return IRQ_RETVAL(handled);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b71b95efa5abca33e1bfb85d55162c7f99f54c23/sundance.c/clean/drivers/net/sundance.c