/* Called by the network layer to transmit the @skb. spin_lock_irqsave is required because tx and rx should be mutual exclusive. So while tx is in-progress, prevent IRQ interrupt from happenning.  */
static int ks_start_xmit(struct sk_buff *skb, struct net_device *netdev)
/* Called by the network layer to transmit the @skb. spin_lock_irqsave is required because tx and rx should be mutual exclusive. So while tx is in-progress, prevent IRQ interrupt from happenning.  */
static int ks_start_xmit(struct sk_buff *skb, struct net_device *netdev)
{
	int retv = NETDEV_TX_OK;
	struct ks_net *ks = netdev_priv(netdev);
	disable_irq(netdev->irq);
	ks_disable_int(ks);
	spin_lock(&ks->statelock);
	if (likely(ks_tx_fifo_space(ks) >= skb->len + 12)) {
		ks_write_qmu(ks, skb->data, skb->len);
		dev_kfree_skb(skb);
	} else
		retv = NETDEV_TX_BUSY;
	spin_unlock(&ks->statelock);
	ks_enable_int(ks);
	enable_irq(netdev->irq);
	return retv;
}