/* This function closes the network interface and updates the statistics so that most recent statistics will be available after the interface is down.  */
static int amd8111e_close(struct net_device *dev)
/* This function closes the network interface and updates the statistics so that most recent statistics will be available after the interface is down.  */
static int amd8111e_close(struct net_device *dev)
{
	struct amd8111e_priv *lp = netdev_priv(dev);
	netif_stop_queue(dev);
	napi_disable(&lp->napi);
	spin_lock_irq(&lp->lock);
	amd8111e_disable_interrupt(lp);
	amd8111e_stop_chip(lp);
	amd8111e_free_skbs(lp->amd8111e_net_dev);
	netif_carrier_off(lp->amd8111e_net_dev);
	if(lp->options & OPTION_DYN_IPG_ENABLE)
		del_timer_sync(&lp->ipg_data.ipg_timer);
	spin_unlock_irq(&lp->lock);
	free_irq(dev->irq, dev);
	amd8111e_free_ring(lp);
	amd8111e_get_stats(dev);
	lp->opened = 0;
	return 0;
}