for (i = 0; i < TX_RING_SIZE; i++) { 
for (i = 0; i < lp->tx_ring_size; i++) { 
pcnet32_close(struct net_device *dev){    unsigned long ioaddr = dev->base_addr;    struct pcnet32_private *lp = dev->priv;    int i;    unsigned long flags;    del_timer_sync(&lp->watchdog_timer);    netif_stop_queue(dev);    spin_lock_irqsave(&lp->lock, flags);    lp->stats.rx_missed_errors = lp->a.read_csr (ioaddr, 112);    if (netif_msg_ifdown(lp))	printk(KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",	       dev->name, lp->a.read_csr (ioaddr, 0));    /* We stop the PCNET32 here -- it occasionally polls memory if we don't. */    lp->a.write_csr (ioaddr, 0, 0x0004);    /*     * Switch back to 16bit mode to avoid problems with dumb     * DOS packet driver after a warm reboot     */    lp->a.write_bcr (ioaddr, 20, 4);    spin_unlock_irqrestore(&lp->lock, flags);    free_irq(dev->irq, dev);    spin_lock_irqsave(&lp->lock, flags);    /* free all allocated skbuffs */    for (i = 0; i < RX_RING_SIZE; i++) {	lp->rx_ring[i].status = 0;	wmb();		/* Make sure adapter sees owner change */	if (lp->rx_skbuff[i]) {	    pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[i], PKT_BUF_SZ-2,		    PCI_DMA_FROMDEVICE);	    dev_kfree_skb(lp->rx_skbuff[i]);	}	lp->rx_skbuff[i] = NULL;	lp->rx_dma_addr[i] = 0;    }    for (i = 0; i < TX_RING_SIZE; i++) {	lp->tx_ring[i].status = 0;	/* CPU owns buffer */	wmb();		/* Make sure adapter sees owner change */	if (lp->tx_skbuff[i]) {	    pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i],		    lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE);	    dev_kfree_skb(lp->tx_skbuff[i]);	}	lp->tx_skbuff[i] = NULL;	lp->tx_dma_addr[i] = 0;    }    spin_unlock_irqrestore(&lp->lock, flags);    return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/eabf04151682bc7b57c84fea58cf9e4e5a3cf2a9/pcnet32.c/buggy/drivers/net/pcnet32.c