printk(KERN_DEBUG " rhine_rx() status is %8.8x.\n", 
printk(KERN_DEBUG "rhine_rx() status is %8.8x.\n", 
static void rhine_rx(struct net_device *dev){	struct rhine_private *rp = netdev_priv(dev);	int entry = rp->cur_rx % RX_RING_SIZE;	int boguscnt = rp->dirty_rx + RX_RING_SIZE - rp->cur_rx;	if (debug > 4) {		printk(KERN_DEBUG "%s: rhine_rx(), entry %d status %8.8x.\n",		       dev->name, entry,		       le32_to_cpu(rp->rx_head_desc->rx_status));	}	/* If EOP is set on the next entry, it's a new packet. Send it up. */	while (!(rp->rx_head_desc->rx_status & cpu_to_le32(DescOwn))) {		struct rx_desc *desc = rp->rx_head_desc;		u32 desc_status = le32_to_cpu(desc->rx_status);		int data_size = desc_status >> 16;		if (debug > 4)			printk(KERN_DEBUG " rhine_rx() status is %8.8x.\n",			       desc_status);		if (--boguscnt < 0)			break;		if ((desc_status & (RxWholePkt | RxErr)) != RxWholePkt) {			if ((desc_status & RxWholePkt) != RxWholePkt) {				printk(KERN_WARNING "%s: Oversized Ethernet "				       "frame spanned multiple buffers, entry "				       "%#x length %d status %8.8x!\n",				       dev->name, entry, data_size,				       desc_status);				printk(KERN_WARNING "%s: Oversized Ethernet "				       "frame %p vs %p.\n", dev->name,				       rp->rx_head_desc, &rp->rx_ring[entry]);				rp->stats.rx_length_errors++;			} else if (desc_status & RxErr) {				/* There was a error. */				if (debug > 2)					printk(KERN_DEBUG " rhine_rx() Rx "					       "error was %8.8x.\n",					       desc_status);				rp->stats.rx_errors++;				if (desc_status & 0x0030) rp->stats.rx_length_errors++;				if (desc_status & 0x0048) rp->stats.rx_fifo_errors++;				if (desc_status & 0x0004) rp->stats.rx_frame_errors++;				if (desc_status & 0x0002) {					/* this can also be updated outside the interrupt handler */					spin_lock(&rp->lock);					rp->stats.rx_crc_errors++;					spin_unlock(&rp->lock);				}			}		} else {			struct sk_buff *skb;			/* Length should omit the CRC */			int pkt_len = data_size - 4;			/* Check if the packet is long enough to accept without			   copying to a minimally-sized skbuff. */			if (pkt_len < rx_copybreak &&				(skb = dev_alloc_skb(pkt_len + 2)) != NULL) {				skb->dev = dev;				skb_reserve(skb, 2);	/* 16 byte align the IP header */				pci_dma_sync_single_for_cpu(rp->pdev,							    rp->rx_skbuff_dma[entry],							    rp->rx_buf_sz,							    PCI_DMA_FROMDEVICE);				eth_copy_and_sum(skb,						 rp->rx_skbuff[entry]->tail,						 pkt_len, 0);				skb_put(skb, pkt_len);				pci_dma_sync_single_for_device(rp->pdev,							       rp->rx_skbuff_dma[entry],							       rp->rx_buf_sz,							       PCI_DMA_FROMDEVICE);			} else {				skb = rp->rx_skbuff[entry];				if (skb == NULL) {					printk(KERN_ERR "%s: Inconsistent Rx "					       "descriptor chain.\n",					       dev->name);					break;				}				rp->rx_skbuff[entry] = NULL;				skb_put(skb, pkt_len);				pci_unmap_single(rp->pdev,						 rp->rx_skbuff_dma[entry],						 rp->rx_buf_sz,						 PCI_DMA_FROMDEVICE);			}			skb->protocol = eth_type_trans(skb, dev);			netif_rx(skb);			dev->last_rx = jiffies;			rp->stats.rx_bytes += pkt_len;			rp->stats.rx_packets++;		}		entry = (++rp->cur_rx) % RX_RING_SIZE;		rp->rx_head_desc = &rp->rx_ring[entry];	}	/* Refill the Rx ring buffers. */	for (; rp->cur_rx - rp->dirty_rx > 0; rp->dirty_rx++) {		struct sk_buff *skb;		entry = rp->dirty_rx % RX_RING_SIZE;		if (rp->rx_skbuff[entry] == NULL) {			skb = dev_alloc_skb(rp->rx_buf_sz);			rp->rx_skbuff[entry] = skb;			if (skb == NULL)				break;	/* Better luck next round. */			skb->dev = dev;	/* Mark as being used by this device. */			rp->rx_skbuff_dma[entry] =				pci_map_single(rp->pdev, skb->tail,					       rp->rx_buf_sz,					       PCI_DMA_FROMDEVICE);			rp->rx_ring[entry].addr = cpu_to_le32(rp->rx_skbuff_dma[entry]);		}		rp->rx_ring[entry].rx_status = cpu_to_le32(DescOwn);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ed4030d114efff53e2605ea4d07d39835b68b605/via-rhine.c/clean/drivers/net/via-rhine.c