/* This routine will start the transmit DMA running if it is not already running. This routine ned only be called when queueing a new packet to an empty tx queue. Writes the current tx chain head as start address of the tx descriptor chain and enables the transmission DMA engine.  */
static void spider_net_kick_tx_dma(struct spider_net_card *card)
/* This routine will start the transmit DMA running if it is not already running. This routine ned only be called when queueing a new packet to an empty tx queue. Writes the current tx chain head as start address of the tx descriptor chain and enables the transmission DMA engine.  */
static void spider_net_kick_tx_dma(struct spider_net_card *card)
{
	struct spider_net_descr *descr;
	if (spider_net_read_reg(card, SPIDER_NET_GDTDMACCNTR) &
			SPIDER_NET_TX_DMA_EN)
		goto out;
	descr = card->tx_chain.tail;
	for (;;) {
		if (spider_net_get_descr_status(descr->hwdescr) ==
				SPIDER_NET_DESCR_CARDOWNED) {
			spider_net_write_reg(card, SPIDER_NET_GDTDCHA,
					descr->bus_addr);
			spider_net_write_reg(card, SPIDER_NET_GDTDMACCNTR,
					SPIDER_NET_DMA_TX_VALUE);
			break;
		}
		if (descr == card->tx_chain.head)
			break;
		descr = descr->next;
	}
out:
	mod_timer(&card->tx_timer, jiffies + SPIDER_NET_TX_TIMER);
}