/* This function moves an active device into down state. A NETDEV_GOING_DOWN is sent to the netdev notifier chain. The device is then deactivated and finally a NETDEV_DOWN is sent to the notifier chain.  */
int dev_close(struct net_device *dev)
/* This function moves an active device into down state. A NETDEV_GOING_DOWN is sent to the netdev notifier chain. The device is then deactivated and finally a NETDEV_DOWN is sent to the notifier chain.  */
int dev_close(struct net_device *dev)
{
	const struct net_device_ops *ops = dev->netdev_ops;
	ASSERT_RTNL();
	might_sleep();
	if (!(dev->flags & IFF_UP))
		return 0;
	call_netdevice_notifiers(NETDEV_GOING_DOWN, dev);
	clear_bit(__LINK_STATE_START, &dev->state);
	smp_mb__after_clear_bit();
	dev_deactivate(dev);
	if (ops->ndo_stop)
		ops->ndo_stop(dev);
	dev->flags &= ~IFF_UP;
	call_netdevice_notifiers(NETDEV_DOWN, dev);
	net_dmaengine_put();
	return 0;
}