Lines Matching refs:slave_dev

1798 static int dsa_slave_phy_connect(struct net_device *slave_dev, int addr,  in dsa_slave_phy_connect()  argument
1801 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_phy_connect()
1804 slave_dev->phydev = mdiobus_get_phy(ds->slave_mii_bus, addr); in dsa_slave_phy_connect()
1805 if (!slave_dev->phydev) { in dsa_slave_phy_connect()
1806 netdev_err(slave_dev, "no phy at %d\n", addr); in dsa_slave_phy_connect()
1810 slave_dev->phydev->dev_flags |= flags; in dsa_slave_phy_connect()
1812 return phylink_connect_phy(dp->pl, slave_dev->phydev); in dsa_slave_phy_connect()
1815 static int dsa_slave_phy_setup(struct net_device *slave_dev) in dsa_slave_phy_setup() argument
1817 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_phy_setup()
1828 dp->pl_config.dev = &slave_dev->dev; in dsa_slave_phy_setup()
1843 netdev_err(slave_dev, in dsa_slave_phy_setup()
1856 ret = dsa_slave_phy_connect(slave_dev, dp->index, phy_flags); in dsa_slave_phy_setup()
1859 netdev_err(slave_dev, "failed to connect to PHY: %pe\n", in dsa_slave_phy_setup()
1904 int dsa_slave_suspend(struct net_device *slave_dev) in dsa_slave_suspend() argument
1906 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_suspend()
1908 if (!netif_running(slave_dev)) in dsa_slave_suspend()
1911 netif_device_detach(slave_dev); in dsa_slave_suspend()
1920 int dsa_slave_resume(struct net_device *slave_dev) in dsa_slave_resume() argument
1922 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_resume()
1924 if (!netif_running(slave_dev)) in dsa_slave_resume()
1927 netif_device_attach(slave_dev); in dsa_slave_resume()
1942 struct net_device *slave_dev; in dsa_slave_create() local
1949 slave_dev = alloc_netdev_mqs(sizeof(struct dsa_slave_priv), name, in dsa_slave_create()
1952 if (slave_dev == NULL) in dsa_slave_create()
1955 slave_dev->ethtool_ops = &dsa_slave_ethtool_ops; in dsa_slave_create()
1957 ether_addr_copy(slave_dev->dev_addr, port->mac); in dsa_slave_create()
1959 eth_hw_addr_inherit(slave_dev, master); in dsa_slave_create()
1960 slave_dev->priv_flags |= IFF_NO_QUEUE; in dsa_slave_create()
1961 slave_dev->netdev_ops = &dsa_slave_netdev_ops; in dsa_slave_create()
1963 slave_dev->max_mtu = ds->ops->port_max_mtu(ds, port->index); in dsa_slave_create()
1964 SET_NETDEV_DEVTYPE(slave_dev, &dsa_type); in dsa_slave_create()
1966 netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one, in dsa_slave_create()
1969 SET_NETDEV_DEV(slave_dev, port->ds->dev); in dsa_slave_create()
1970 slave_dev->dev.of_node = port->dn; in dsa_slave_create()
1971 slave_dev->vlan_features = master->vlan_features; in dsa_slave_create()
1973 p = netdev_priv(slave_dev); in dsa_slave_create()
1974 slave_dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); in dsa_slave_create()
1975 if (!slave_dev->tstats) { in dsa_slave_create()
1976 free_netdev(slave_dev); in dsa_slave_create()
1980 ret = gro_cells_init(&p->gcells, slave_dev); in dsa_slave_create()
1986 port->slave = slave_dev; in dsa_slave_create()
1987 dsa_slave_setup_tagger(slave_dev); in dsa_slave_create()
1990 ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN); in dsa_slave_create()
1996 netif_carrier_off(slave_dev); in dsa_slave_create()
1998 ret = dsa_slave_phy_setup(slave_dev); in dsa_slave_create()
2000 netdev_err(slave_dev, in dsa_slave_create()
2008 ret = register_netdevice(slave_dev); in dsa_slave_create()
2011 ret, slave_dev->name); in dsa_slave_create()
2016 ret = netdev_upper_dev_link(master, slave_dev, NULL); in dsa_slave_create()
2026 unregister_netdev(slave_dev); in dsa_slave_create()
2035 free_percpu(slave_dev->tstats); in dsa_slave_create()
2036 free_netdev(slave_dev); in dsa_slave_create()
2041 void dsa_slave_destroy(struct net_device *slave_dev) in dsa_slave_destroy() argument
2043 struct net_device *master = dsa_slave_to_master(slave_dev); in dsa_slave_destroy()
2044 struct dsa_port *dp = dsa_slave_to_port(slave_dev); in dsa_slave_destroy()
2045 struct dsa_slave_priv *p = netdev_priv(slave_dev); in dsa_slave_destroy()
2047 netif_carrier_off(slave_dev); in dsa_slave_destroy()
2049 netdev_upper_dev_unlink(master, slave_dev); in dsa_slave_destroy()
2050 unregister_netdevice(slave_dev); in dsa_slave_destroy()
2056 free_percpu(slave_dev->tstats); in dsa_slave_destroy()
2057 free_netdev(slave_dev); in dsa_slave_destroy()