s2e/source/s2e-linux-kernel/linux-4.9.3/drivers/net/ethernet/ti/davinci_emac.c
/**
 * emac_dev_stop - EMAC device stop
 * @ndev: The DaVinci EMAC network adapter
 *
 * Called when system wants to stop or down the interface. We stop the network
 * queue, disable interrupts and cleanup TX/RX channels.
 *
 * We return the statistics in net_device_stats structure pulled from emac
 */
EMAC device stop
@ndev: The DaVinci EMAC network adapter

Called when system wants to stop or down the interface. We stop the network
queue, disable interrupts and cleanup TX/RX channels.

We return the statistics in net_device_stats structure pulled from emac
EMAC device stop @ndev : The DaVinci EMAC network adapter Called when system wants to stop or down the interface . We stop the network queue disable interrupts and cleanup TX / RX channels . We return the statistics in net_device_stats structure pulled from emac
static int emac_dev_stop(struct net_device *ndev)
{
	struct resource *res;
	int i = 0;
	int irq_num;
	struct emac_priv *priv = netdev_priv(ndev);
	struct device *emac_dev = &ndev->dev;
	netif_stop_queue(ndev);
	napi_disable(&priv->napi);
	netif_carrier_off(ndev);
	emac_int_disable(priv);
	cpdma_ctlr_stop(priv->dma);
	emac_write(EMAC_SOFTRESET, 1);
	if (ndev->phydev)
		phy_disconnect(ndev->phydev);
	while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, i))) {
		for (irq_num = res->start; irq_num <= res->end; irq_num++)
			free_irq(irq_num, priv->ndev);
		i++;
	}
	if (netif_msg_drv(priv))
		dev_notice(emac_dev, "DaVinci EMAC: %s stopped\n", ndev->name);
	pm_runtime_put(&priv->pdev->dev);
	return 0;
}
static int emac_dev_stop ( struct net_device * ndev ) { struct resource * res ; int i = 0 ; int irq_num ; struct emac_priv * priv = netdev_priv ( ndev ) ; struct device * emac_dev = & ndev -> dev ; netif_stop_queue ( ndev ) ; napi_disable ( & priv -> napi ) ; netif_carrier_off ( ndev ) ; emac_int_disable ( priv ) ; cpdma_ctlr_stop ( priv -> dma ) ; emac_write ( EMAC_SOFTRESET , 1 ) ; if ( ndev -> phydev ) phy_disconnect ( ndev -> phydev ) ; while ( ( res = platform_get_resource ( priv -> pdev , IORESOURCE_IRQ , i ) ) ) { for ( irq_num = res -> start ; irq_num <= res -> end ; irq_num ++ ) free_irq ( irq_num , priv -> ndev ) ; i ++ ; } if ( netif_msg_drv ( priv ) ) dev_notice ( emac_dev , " \n " , ndev -> name ) ; pm_runtime_put ( & priv -> pdev -> dev ) ; return 0 ; }
emac_dev_stop - EMAC device stop
 @ndev: The DaVinci EMAC network adapter
emac_dev_stop - EMAC device stop @ndev : The DaVinci EMAC network adapter
/* inform the upper layers. */ /* Free IRQ */