/* This function is called by the router when device is being unregistered or when it handles ROUTER_DOWN IOCTL.  */
static int cycx_wan_shutdown(struct wan_device *wandev)
/* This function is called by the router when device is being unregistered or when it handles ROUTER_DOWN IOCTL.  */
static int cycx_wan_shutdown(struct wan_device *wandev)
{
	int ret = -EFAULT;
	struct cycx_device *card;
	if (!wandev || !wandev->private)
		goto out;
	ret = 0;
	if (wandev->state == WAN_UNCONFIGURED)
		goto out;
	card = wandev->private;
	wandev->state = WAN_UNCONFIGURED;
	cycx_down(&card->hw);
	printk(KERN_INFO "%s: irq %d being freed!\n", wandev->name,
			wandev->irq);
	free_irq(wandev->irq, card);
out:	return ret;
}