/* Network device is taken down. Usually this is done by "ifconfig irda0 down"  */
static int kingsun_net_close(struct net_device *netdev)
/* Network device is taken down. Usually this is done by "ifconfig irda0 down"  */
static int kingsun_net_close(struct net_device *netdev)
{
	struct kingsun_cb *kingsun = netdev_priv(netdev);
	netif_stop_queue(netdev);
	usb_kill_urb(kingsun->tx_urb);
	usb_kill_urb(kingsun->rx_urb);
	usb_free_urb(kingsun->tx_urb);
	usb_free_urb(kingsun->rx_urb);
	kingsun->tx_urb = NULL;
	kingsun->rx_urb = NULL;
	kfree_skb(kingsun->rx_buff.skb);
	kingsun->rx_buff.skb = NULL;
	kingsun->rx_buff.head = NULL;
	kingsun->rx_buff.in_frame = FALSE;
	kingsun->rx_buff.state = OUTSIDE_FRAME;
	kingsun->receiving = 0;
	if (kingsun->irlap)
		irlap_close(kingsun->irlap);
	kingsun->irlap = NULL;
	return 0;
}