Lines Matching refs:ndev

74 	struct net_device	*ndev;  member
161 db->phy_dev = of_phy_connect(db->ndev, db->phy_node, in emac_mdio_probe()
165 netdev_err(db->ndev, "could not find the PHY\n"); in emac_mdio_probe()
261 static unsigned int emac_setup(struct net_device *ndev) in emac_setup() argument
263 struct emac_board_info *db = netdev_priv(ndev); in emac_setup()
304 static void emac_set_rx_mode(struct net_device *ndev) in emac_set_rx_mode() argument
306 struct emac_board_info *db = netdev_priv(ndev); in emac_set_rx_mode()
312 if (ndev->flags & IFF_PROMISC) in emac_set_rx_mode()
324 static unsigned int emac_powerup(struct net_device *ndev) in emac_powerup() argument
326 struct emac_board_info *db = netdev_priv(ndev); in emac_powerup()
359 emac_setup(ndev); in emac_powerup()
362 writel(ndev->dev_addr[0] << 16 | ndev->dev_addr[1] << 8 | ndev-> in emac_powerup()
364 writel(ndev->dev_addr[3] << 16 | ndev->dev_addr[4] << 8 | ndev-> in emac_powerup()
774 static int emac_stop(struct net_device *ndev) in emac_stop() argument
776 struct emac_board_info *db = netdev_priv(ndev); in emac_stop()
779 dev_dbg(db->dev, "shutting down %s\n", ndev->name); in emac_stop()
781 netif_stop_queue(ndev); in emac_stop()
782 netif_carrier_off(ndev); in emac_stop()
786 emac_mdio_remove(ndev); in emac_stop()
788 emac_shutdown(ndev); in emac_stop()
790 free_irq(ndev->irq, ndev); in emac_stop()
816 struct net_device *ndev; in emac_probe() local
820 ndev = alloc_etherdev(sizeof(struct emac_board_info)); in emac_probe()
821 if (!ndev) { in emac_probe()
826 SET_NETDEV_DEV(ndev, &pdev->dev); in emac_probe()
828 db = netdev_priv(ndev); in emac_probe()
832 db->ndev = ndev; in emac_probe()
845 ndev->base_addr = (unsigned long)db->membase; in emac_probe()
846 ndev->irq = irq_of_parse_and_map(np, 0); in emac_probe()
847 if (ndev->irq == -ENXIO) { in emac_probe()
848 netdev_err(ndev, "No irq resource\n"); in emac_probe()
849 ret = ndev->irq; in emac_probe()
881 memcpy(ndev->dev_addr, mac_addr, ETH_ALEN); in emac_probe()
884 if (!is_valid_ether_addr(ndev->dev_addr)) { in emac_probe()
885 eth_hw_addr_random(ndev); in emac_probe()
887 ndev->dev_addr); in emac_probe()
891 emac_powerup(ndev); in emac_probe()
894 ndev->netdev_ops = &emac_netdev_ops; in emac_probe()
895 ndev->watchdog_timeo = msecs_to_jiffies(watchdog); in emac_probe()
896 ndev->ethtool_ops = &emac_ethtool_ops; in emac_probe()
898 platform_set_drvdata(pdev, ndev); in emac_probe()
901 netif_carrier_off(ndev); in emac_probe()
903 ret = register_netdev(ndev); in emac_probe()
911 ndev->name, db->membase, ndev->irq, ndev->dev_addr); in emac_probe()
924 free_netdev(ndev); in emac_probe()
931 struct net_device *ndev = platform_get_drvdata(pdev); in emac_remove() local
932 struct emac_board_info *db = netdev_priv(ndev); in emac_remove()
934 unregister_netdev(ndev); in emac_remove()
938 free_netdev(ndev); in emac_remove()
946 struct net_device *ndev = platform_get_drvdata(dev); in emac_suspend() local
948 netif_carrier_off(ndev); in emac_suspend()
949 netif_device_detach(ndev); in emac_suspend()
950 emac_shutdown(ndev); in emac_suspend()
957 struct net_device *ndev = platform_get_drvdata(dev); in emac_resume() local
958 struct emac_board_info *db = netdev_priv(ndev); in emac_resume()
961 emac_init_device(ndev); in emac_resume()
962 netif_device_attach(ndev); in emac_resume()