Lines Matching +full:re +full:- +full:attached

1 // SPDX-License-Identifier: GPL-2.0+
4 * either directly or indirectly attached.
20 return -ENOMEM; in netdev_alloc_phy_link_topology()
22 xa_init_flags(&topo->phys, XA_FLAGS_ALLOC1); in netdev_alloc_phy_link_topology()
23 topo->next_phy_index = 1; in netdev_alloc_phy_link_topology()
25 dev->link_topo = topo; in netdev_alloc_phy_link_topology()
34 struct phy_link_topology *topo = dev->link_topo; in phy_link_topo_add_phy()
43 topo = dev->link_topo; in phy_link_topo_add_phy()
48 return -ENOMEM; in phy_link_topo_add_phy()
50 pdn->phy = phy; in phy_link_topo_add_phy()
53 pdn->upstream.netdev = (struct net_device *)upstream; in phy_link_topo_add_phy()
55 pdn->parent_sfp_bus = pdn->upstream.netdev->sfp_bus; in phy_link_topo_add_phy()
58 pdn->upstream.phydev = (struct phy_device *)upstream; in phy_link_topo_add_phy()
60 pdn->parent_sfp_bus = pdn->upstream.phydev->sfp_bus; in phy_link_topo_add_phy()
63 ret = -EINVAL; in phy_link_topo_add_phy()
66 pdn->upstream_type = upt; in phy_link_topo_add_phy()
68 /* Attempt to re-use a previously allocated phy_index */ in phy_link_topo_add_phy()
69 if (phy->phyindex) in phy_link_topo_add_phy()
70 ret = xa_insert(&topo->phys, phy->phyindex, pdn, GFP_KERNEL); in phy_link_topo_add_phy()
72 ret = xa_alloc_cyclic(&topo->phys, &phy->phyindex, pdn, in phy_link_topo_add_phy()
73 xa_limit_32b, &topo->next_phy_index, in phy_link_topo_add_phy()
90 struct phy_link_topology *topo = dev->link_topo; in phy_link_topo_del_phy()
96 pdn = xa_erase(&topo->phys, phy->phyindex); in phy_link_topo_del_phy()
98 /* We delete the PHY from the topology, however we don't re-set the in phy_link_topo_del_phy()
99 * phy->phyindex field. If the PHY isn't gone, we can re-assign it the in phy_link_topo_del_phy()