long ioaddr = dev->base_addr; 
void __iomem *ioaddr = vp->ioaddr; 
boomerang_rx(struct net_device *dev){	struct vortex_private *vp = netdev_priv(dev);	int entry = vp->cur_rx % RX_RING_SIZE;	long ioaddr = dev->base_addr;	int rx_status;	int rx_work_limit = vp->dirty_rx + RX_RING_SIZE - vp->cur_rx;	if (vortex_debug > 5)		printk(KERN_DEBUG "boomerang_rx(): status %4.4x\n", inw(ioaddr+EL3_STATUS));	while ((rx_status = le32_to_cpu(vp->rx_ring[entry].status)) & RxDComplete){		if (--rx_work_limit < 0)			break;		if (rx_status & RxDError) { /* Error, update stats. */			unsigned char rx_error = rx_status >> 16;			if (vortex_debug > 2)				printk(KERN_DEBUG " Rx error: status %2.2x.\n", rx_error);			vp->stats.rx_errors++;			if (rx_error & 0x01)  vp->stats.rx_over_errors++;			if (rx_error & 0x02)  vp->stats.rx_length_errors++;			if (rx_error & 0x04)  vp->stats.rx_frame_errors++;			if (rx_error & 0x08)  vp->stats.rx_crc_errors++;			if (rx_error & 0x10)  vp->stats.rx_length_errors++;		} else {			/* The packet length: up to 4.5K!. */			int pkt_len = rx_status & 0x1fff;			struct sk_buff *skb;			dma_addr_t dma = le32_to_cpu(vp->rx_ring[entry].addr);			if (vortex_debug > 4)				printk(KERN_DEBUG "Receiving packet size %d status %4.4x.\n",					   pkt_len, rx_status);			/* Check if the packet is long enough to just accept without			   copying to a properly sized skbuff. */			if (pkt_len < rx_copybreak && (skb = dev_alloc_skb(pkt_len + 2)) != 0) {				skb->dev = dev;				skb_reserve(skb, 2);	/* Align IP on 16 byte boundaries */				pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);				/* 'skb_put()' points to the start of sk_buff data area. */				memcpy(skb_put(skb, pkt_len),					   vp->rx_skbuff[entry]->data,					   pkt_len);				pci_dma_sync_single_for_device(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);				vp->rx_copy++;			} else {				/* Pass up the skbuff already on the Rx ring. */				skb = vp->rx_skbuff[entry];				vp->rx_skbuff[entry] = NULL;				skb_put(skb, pkt_len);				pci_unmap_single(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);				vp->rx_nocopy++;			}			skb->protocol = eth_type_trans(skb, dev);			{					/* Use hardware checksum info. */				int csum_bits = rx_status & 0xee000000;				if (csum_bits &&					(csum_bits == (IPChksumValid | TCPChksumValid) ||					 csum_bits == (IPChksumValid | UDPChksumValid))) {					skb->ip_summed = CHECKSUM_UNNECESSARY;					vp->rx_csumhits++;				}			}			netif_rx(skb);			dev->last_rx = jiffies;			vp->stats.rx_packets++;		}		entry = (++vp->cur_rx) % RX_RING_SIZE;	}	/* Refill the Rx ring buffers. */	for (; vp->cur_rx - vp->dirty_rx > 0; vp->dirty_rx++) {		struct sk_buff *skb;		entry = vp->dirty_rx % RX_RING_SIZE;		if (vp->rx_skbuff[entry] == NULL) {			skb = dev_alloc_skb(PKT_BUF_SZ);			if (skb == NULL) {				static unsigned long last_jif;				if ((jiffies - last_jif) > 10 * HZ) {					printk(KERN_WARNING "%s: memory shortage\n", dev->name);					last_jif = jiffies;				}				if ((vp->cur_rx - vp->dirty_rx) == RX_RING_SIZE)					mod_timer(&vp->rx_oom_timer, RUN_AT(HZ * 1));				break;			/* Bad news!  */			}			skb->dev = dev;			/* Mark as being used by this device. */			skb_reserve(skb, 2);	/* Align IP on 16 byte boundaries */			vp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, PKT_BUF_SZ, PCI_DMA_FROMDEVICE));			vp->rx_skbuff[entry] = skb;		}		vp->rx_ring[entry].status = 0;	/* Clear complete bit. */		outw(UpUnstall, ioaddr + EL3_CMD);	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/62afe595de7aaac6c140103a34dc8c208afa34e7/3c59x.c/buggy/drivers/net/3c59x.c