* If THROTTLE_TX_PKTS is set, we look at the TX_EMPTY flag * before queueing this packet for TX, and if it's clear then * we stop the queue here.  This will have the effect of * having at most 2 packets queued for TX in the chip's memory * at all time. If THROTTLE_TX_PKTS is not set then the queue * is stopped only when memory allocation (MC_ALLOC) does not * succeed right away. 
* If THROTTLE_TX_PKTS is set, we stop the queue here. This will * have the effect of having at most one packet queued for TX * in the chip's memory at all time. * * If THROTTLE_TX_PKTS is not set then the queue is stopped only * when memory allocation (MC_ALLOC) does not succeed right away. 
static void smc_hardware_send_pkt(unsigned long data){	struct net_device *dev = (struct net_device *)data;	struct smc_local *lp = netdev_priv(dev);	void __iomem *ioaddr = lp->base;	struct sk_buff *skb;	unsigned int packet_no, len;	unsigned char *buf;	DBG(3, "%s: %s\n", dev->name, __FUNCTION__);	if (!smc_special_trylock(&lp->lock)) {		netif_stop_queue(dev);		tasklet_schedule(&lp->tx_task);		return;	}	skb = lp->pending_tx_skb;	lp->pending_tx_skb = NULL;	packet_no = SMC_GET_AR();	if (unlikely(packet_no & AR_FAILED)) {		printk("%s: Memory allocation failed.\n", dev->name);		lp->stats.tx_errors++;		lp->stats.tx_fifo_errors++;		smc_special_unlock(&lp->lock);		goto done;	}	/* point to the beginning of the packet */	SMC_SET_PN(packet_no);	SMC_SET_PTR(PTR_AUTOINC);	buf = skb->data;	len = skb->len;	DBG(2, "%s: TX PNR 0x%x LENGTH 0x%04x (%d) BUF 0x%p\n",		dev->name, packet_no, len, len, buf);	PRINT_PKT(buf, len);	/*	 * Send the packet length (+6 for status words, length, and ctl.	 * The card will pad to 64 bytes with zeroes if packet is too small.	 */	SMC_PUT_PKT_HDR(0, len + 6);	/* send the actual data */	SMC_PUSH_DATA(buf, len & ~1);	/* Send final ctl word with the last byte if there is one */	SMC_outw(((len & 1) ? (0x2000 | buf[len-1]) : 0), ioaddr, DATA_REG);	/*	 * If THROTTLE_TX_PKTS is set, we look at the TX_EMPTY flag	 * before queueing this packet for TX, and if it's clear then	 * we stop the queue here.  This will have the effect of	 * having at most 2 packets queued for TX in the chip's memory	 * at all time. If THROTTLE_TX_PKTS is not set then the queue	 * is stopped only when memory allocation (MC_ALLOC) does not	 * succeed right away.	 */	if (THROTTLE_TX_PKTS && !(SMC_GET_INT() & IM_TX_EMPTY_INT))		netif_stop_queue(dev);	/* queue the packet for TX */	SMC_SET_MMU_CMD(MC_ENQUEUE);	SMC_ACK_INT(IM_TX_EMPTY_INT);	smc_special_unlock(&lp->lock);	dev->trans_start = jiffies;	lp->stats.tx_packets++;	lp->stats.tx_bytes += len;	SMC_ENABLE_INT(IM_TX_INT | IM_TX_EMPTY_INT);done:	if (!THROTTLE_TX_PKTS)		netif_wake_queue(dev);	dev_kfree_skb(skb);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ea9375607f8b312cf4389d68909330ed32a622ef/smc91x.c/clean/drivers/net/smc91x.c