/* Called to close down a network device which has been active. Cancell any work, shutdown the RX and TX process and then place the chip into a low power state whilst it is not being used.  */
static int ks_net_stop(struct net_device *netdev)
/* Called to close down a network device which has been active. Cancell any work, shutdown the RX and TX process and then place the chip into a low power state whilst it is not being used.  */
static int ks_net_stop(struct net_device *netdev)
{
	struct ks_net *ks = netdev_priv(netdev);
	if (netif_msg_ifdown(ks))
		ks_info(ks, "%s: shutting down\n", netdev->name);
	netif_stop_queue(netdev);
	mutex_lock(&ks->lock);
	ks_wrreg16(ks, KS_IER, 0x0000);
	ks_wrreg16(ks, KS_ISR, 0xffff);
	ks_disable_qmu(ks);
	ks_set_powermode(ks, PMECR_PM_SOFTDOWN);
	free_irq(ks->irq, netdev);
	mutex_unlock(&ks->lock);
	return 0;
}