/* This is called when a number of packets have been scheduled for transmission and need to be sent to the device.  */
static void ks8851_tx_work(struct work_struct *work)
/* This is called when a number of packets have been scheduled for transmission and need to be sent to the device.  */
static void ks8851_tx_work(struct work_struct *work)
{
	struct ks8851_net *ks = container_of(work, struct ks8851_net, tx_work);
	struct sk_buff *txb;
	bool last = skb_queue_empty(&ks->txq);
	mutex_lock(&ks->lock);
	while (!last) {
		txb = skb_dequeue(&ks->txq);
		last = skb_queue_empty(&ks->txq);
		ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_SDA);
		ks8851_wrpkt(ks, txb, last);
		ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
		ks8851_wrreg16(ks, KS_TXQCR, TXQCR_METFE);
		ks8851_done_tx(ks, txb);
	}
	mutex_unlock(&ks->lock);
}