Lines Matching refs:ndev
73 struct net_device *ndev; member
160 db->phy_dev = of_phy_connect(db->ndev, db->phy_node, in emac_mdio_probe()
164 netdev_err(db->ndev, "could not find the PHY\n"); in emac_mdio_probe()
260 static unsigned int emac_setup(struct net_device *ndev) in emac_setup() argument
262 struct emac_board_info *db = netdev_priv(ndev); in emac_setup()
303 static void emac_set_rx_mode(struct net_device *ndev) in emac_set_rx_mode() argument
305 struct emac_board_info *db = netdev_priv(ndev); in emac_set_rx_mode()
311 if (ndev->flags & IFF_PROMISC) in emac_set_rx_mode()
323 static unsigned int emac_powerup(struct net_device *ndev) in emac_powerup() argument
325 struct emac_board_info *db = netdev_priv(ndev); in emac_powerup()
358 emac_setup(ndev); in emac_powerup()
361 writel(ndev->dev_addr[0] << 16 | ndev->dev_addr[1] << 8 | ndev-> in emac_powerup()
363 writel(ndev->dev_addr[3] << 16 | ndev->dev_addr[4] << 8 | ndev-> in emac_powerup()
773 static int emac_stop(struct net_device *ndev) in emac_stop() argument
775 struct emac_board_info *db = netdev_priv(ndev); in emac_stop()
778 dev_dbg(db->dev, "shutting down %s\n", ndev->name); in emac_stop()
780 netif_stop_queue(ndev); in emac_stop()
781 netif_carrier_off(ndev); in emac_stop()
785 emac_mdio_remove(ndev); in emac_stop()
787 emac_shutdown(ndev); in emac_stop()
789 free_irq(ndev->irq, ndev); in emac_stop()
815 struct net_device *ndev; in emac_probe() local
819 ndev = alloc_etherdev(sizeof(struct emac_board_info)); in emac_probe()
820 if (!ndev) { in emac_probe()
825 SET_NETDEV_DEV(ndev, &pdev->dev); in emac_probe()
827 db = netdev_priv(ndev); in emac_probe()
831 db->ndev = ndev; in emac_probe()
844 ndev->base_addr = (unsigned long)db->membase; in emac_probe()
845 ndev->irq = irq_of_parse_and_map(np, 0); in emac_probe()
846 if (ndev->irq == -ENXIO) { in emac_probe()
847 netdev_err(ndev, "No irq resource\n"); in emac_probe()
848 ret = ndev->irq; in emac_probe()
870 memcpy(ndev->dev_addr, mac_addr, ETH_ALEN); in emac_probe()
873 if (!is_valid_ether_addr(ndev->dev_addr)) { in emac_probe()
874 eth_hw_addr_random(ndev); in emac_probe()
876 ndev->dev_addr); in emac_probe()
880 emac_powerup(ndev); in emac_probe()
883 ndev->netdev_ops = &emac_netdev_ops; in emac_probe()
884 ndev->watchdog_timeo = msecs_to_jiffies(watchdog); in emac_probe()
885 ndev->ethtool_ops = &emac_ethtool_ops; in emac_probe()
887 platform_set_drvdata(pdev, ndev); in emac_probe()
890 netif_carrier_off(ndev); in emac_probe()
892 ret = register_netdev(ndev); in emac_probe()
900 ndev->name, db->membase, ndev->irq, ndev->dev_addr); in emac_probe()
907 free_netdev(ndev); in emac_probe()
914 struct net_device *ndev = platform_get_drvdata(pdev); in emac_remove() local
916 unregister_netdev(ndev); in emac_remove()
917 free_netdev(ndev); in emac_remove()
925 struct net_device *ndev = platform_get_drvdata(dev); in emac_suspend() local
927 netif_carrier_off(ndev); in emac_suspend()
928 netif_device_detach(ndev); in emac_suspend()
929 emac_shutdown(ndev); in emac_suspend()
936 struct net_device *ndev = platform_get_drvdata(dev); in emac_resume() local
937 struct emac_board_info *db = netdev_priv(ndev); in emac_resume()
940 emac_init_device(ndev); in emac_resume()
941 netif_device_attach(ndev); in emac_resume()