int cpc_queue_xmit(struct sk_buff *skb, struct net_device *dev) 
static int cpc_queue_xmit(struct sk_buff *skb, struct net_device *dev) 
int cpc_queue_xmit(struct sk_buff *skb, 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;	unsigned long flags;#ifdef PC300_DEBUG_TX	int i;#endif	if (chan->conf.monitor) {		/* In monitor mode no Tx is done: ignore packet */		dev_kfree_skb(skb);		return 0;	} else if (!netif_carrier_ok(dev)) {		/* DCD must be OFF: drop packet */		dev_kfree_skb(skb);		stats->tx_errors++;		stats->tx_carrier_errors++;		return 0;	} else if (cpc_readb(card->hw.scabase + M_REG(ST3, ch)) & ST3_DCD) {		printk("%s: DCD is OFF. Going administrative down.\n", dev->name);		stats->tx_errors++;		stats->tx_carrier_errors++;		dev_kfree_skb(skb);		netif_carrier_off(dev);		CPC_LOCK(card, flags);		cpc_writeb(card->hw.scabase + M_REG(CMD, ch), CMD_TX_BUF_CLR);		if (card->hw.type == PC300_TE) {			cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,				   cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) & 				   			~(CPLD_REG2_FALC_LED1 << (2 * ch)));		}		CPC_UNLOCK(card, flags);		netif_wake_queue(dev);		return 0;	}	/* Write buffer to DMA buffers */	if (dma_buf_write(card, ch, (ucchar *) skb->data, skb->len) != 0) {//		printk("%s: write error. Dropping TX packet.\n", dev->name);		netif_stop_queue(dev);		dev_kfree_skb(skb);		stats->tx_errors++;		stats->tx_dropped++;		return 0;	}#ifdef PC300_DEBUG_TX	printk("%s T:", 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, 'T');	}	dev->trans_start = jiffies;	/* Start transmission */	CPC_LOCK(card, flags);	/* verify if it has more than one free descriptor */	if (card->chan[ch].nfree_tx_bd <= 1) {		/* don't have so stop the queue */		netif_stop_queue(dev);	}	cpc_writel(card->hw.scabase + DTX_REG(EDAL, ch),		   TX_BD_ADDR(ch, chan->tx_next_bd));	cpc_writeb(card->hw.scabase + M_REG(CMD, ch), CMD_TX_ENA);	cpc_writeb(card->hw.scabase + DSR_TX(ch), DSR_DE);	if (card->hw.type == PC300_TE) {		cpc_writeb(card->hw.falcbase + card->hw.cpld_reg2,			   cpc_readb(card->hw.falcbase + card->hw.cpld_reg2) |			   (CPLD_REG2_FALC_LED1 << (2 * ch)));	}	CPC_UNLOCK(card, flags);	dev_kfree_skb(skb);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7665a08928f241247afe8c76865cdbe4ef5489bf/pc300_drv.c/buggy/drivers/net/wan/pc300_drv.c