void cpc_net_rx(struct net_device *dev) 
static void cpc_net_rx(struct net_device *dev) 
void cpc_net_rx(struct net_device *dev){	pc300dev_t *d = (pc300dev_t *) dev->priv;	pc300ch_t *chan = (pc300ch_t *) d->chan;	pc300_t *card = (pc300_t *) chan->card;	struct net_device_stats *stats = hdlc_stats(dev);	int ch = chan->channel;#ifdef PC300_DEBUG_RX	int i;#endif	int rxb;	struct sk_buff *skb;	while (1) {		if ((rxb = dma_get_rx_frame_size(card, ch)) == -1)			return;		if (!netif_carrier_ok(dev)) {			/* DCD must be OFF: drop packet */		    printk("%s : DCD is OFF - drop %d rx bytes\n", dev->name, rxb); 			skb = NULL;		} else {			if (rxb > (dev->mtu + 40)) { /* add headers */				printk("%s : MTU exceeded %d\n", dev->name, rxb); 				skb = NULL;			} else {				skb = dev_alloc_skb(rxb);				if (skb == NULL) {					printk("%s: Memory squeeze!!\n", dev->name);					return;				}				skb->dev = dev;			}		}		if (((rxb = dma_buf_read(card, ch, skb)) <= 0) || (skb == NULL)) {#ifdef PC300_DEBUG_RX			printk("%s: rxb = %x\n", dev->name, rxb);#endif			if ((skb == NULL) && (rxb > 0)) {				/* rxb > dev->mtu */				stats->rx_errors++;				stats->rx_length_errors++;				continue;			}			if (rxb < 0) {	/* Invalid frame */				rxb = -rxb;				if (rxb & DST_OVR) {					stats->rx_errors++;					stats->rx_fifo_errors++;				}				if (rxb & DST_CRC) {					stats->rx_errors++;					stats->rx_crc_errors++;				}				if (rxb & (DST_RBIT | DST_SHRT | DST_ABT)) {					stats->rx_errors++;					stats->rx_frame_errors++;				}			}			if (skb) {				dev_kfree_skb_irq(skb);			}			continue;		}		stats->rx_bytes += rxb;#ifdef PC300_DEBUG_RX		printk("%s R:", dev->name);		for (i = 0; i < skb->len; i++)			printk(" %02x", *(skb->data + i));		printk("\n");#endif		if (d->trace_on) {			cpc_trace(dev, skb, 'R');		}		stats->rx_packets++;		skb->protocol = hdlc_type_trans(skb, dev);		netif_rx(skb);	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7665a08928f241247afe8c76865cdbe4ef5489bf/pc300_drv.c/buggy/drivers/net/wan/pc300_drv.c