/* Shutdown WAN device. o delete all not opened logical channels for this device o call driver's shutdown() entry point  */
static int wanrouter_device_shutdown(struct wan_device *wandev)
/* Shutdown WAN device. o delete all not opened logical channels for this device o call driver's shutdown() entry point  */
static int wanrouter_device_shutdown(struct wan_device *wandev)
{
	struct net_device *dev;
	int err=0;
	if (wandev->state == WAN_UNCONFIGURED)
		return 0;
	printk(KERN_INFO "\n%s: Shutting Down!\n",wandev->name);
	for (dev = wandev->dev; dev;) {
		err = wanrouter_delete_interface(wandev, dev->name);
		if (err)
			return err;
		dev = wandev->dev;
	}
	if (wandev->ndev)
		return -EBUSY;
	if (wandev->shutdown)
		err=wandev->shutdown(wandev);
	return err;
}