Lines Matching refs:parent
641 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in sas_smp_get_phy_events()
721 static void sas_ex_get_linkrate(struct domain_device *parent, in sas_ex_get_linkrate() argument
725 struct expander_device *parent_ex = &parent->ex_dev; in sas_ex_get_linkrate()
741 child->min_linkrate = min(parent->min_linkrate, in sas_ex_get_linkrate()
743 child->max_linkrate = max(parent->max_linkrate, in sas_ex_get_linkrate()
750 child->pathways = min(child->pathways, parent->pathways); in sas_ex_get_linkrate()
753 static int sas_ex_add_dev(struct domain_device *parent, struct ex_phy *phy, in sas_ex_add_dev() argument
772 list_add_tail(&child->disco_list_node, &parent->port->disco_list); in sas_ex_add_dev()
778 SAS_ADDR(parent->sas_addr), phy_id, res); in sas_ex_add_dev()
788 struct domain_device *parent, int phy_id) in sas_ex_discover_end_dev() argument
790 struct expander_device *parent_ex = &parent->ex_dev; in sas_ex_discover_end_dev()
802 kref_get(&parent->kref); in sas_ex_discover_end_dev()
803 child->parent = parent; in sas_ex_discover_end_dev()
804 child->port = parent->port; in sas_ex_discover_end_dev()
809 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_end_dev()
817 sas_ex_get_linkrate(parent, child, phy); in sas_ex_discover_end_dev()
821 res = sas_ata_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
823 res = sas_ex_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
826 phy->attached_tproto, SAS_ADDR(parent->sas_addr), in sas_ex_discover_end_dev()
846 static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id) in sas_ex_join_wide_port() argument
848 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_join_wide_port()
851 for (i = 0; i < parent->ex_dev.num_phys; i++) { in sas_ex_join_wide_port()
852 struct ex_phy *ephy = &parent->ex_dev.ex_phy[i]; in sas_ex_join_wide_port()
870 struct domain_device *parent, int phy_id) in sas_ex_discover_expander() argument
872 struct sas_expander_device *parent_ex = rphy_to_expander_device(parent->rphy); in sas_ex_discover_expander()
873 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_discover_expander()
882 SAS_ADDR(parent->sas_addr), phy_id, in sas_ex_discover_expander()
891 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_expander()
909 port = parent->port; in sas_ex_discover_expander()
914 kref_get(&parent->kref); in sas_ex_discover_expander()
915 child->parent = parent; in sas_ex_discover_expander()
921 sas_ex_get_linkrate(parent, child, phy); in sas_ex_discover_expander()
923 parent->port->disc.max_level = max(parent->port->disc.max_level, in sas_ex_discover_expander()
929 spin_lock_irq(&parent->port->dev_list_lock); in sas_ex_discover_expander()
930 list_add_tail(&child->dev_list_node, &parent->port->dev_list); in sas_ex_discover_expander()
931 spin_unlock_irq(&parent->port->dev_list_lock); in sas_ex_discover_expander()
936 spin_lock_irq(&parent->port->dev_list_lock); in sas_ex_discover_expander()
938 spin_unlock_irq(&parent->port->dev_list_lock); in sas_ex_discover_expander()
944 list_add_tail(&child->siblings, &parent->ex_dev.children); in sas_ex_discover_expander()
964 if (!dev->parent && sas_phy_match_port_addr(dev->port, ex_phy)) { in sas_ex_discover_dev()
968 if (dev->parent && sas_phy_match_dev_addr(dev->parent, ex_phy)) { in sas_ex_discover_dev()
1185 struct domain_device *parent = child->parent; in sas_print_parent_topology_bug() local
1188 ex_type[parent->dev_type], in sas_print_parent_topology_bug()
1189 SAS_ADDR(parent->sas_addr), in sas_print_parent_topology_bug()
1196 sas_route_char(parent, parent_phy), in sas_print_parent_topology_bug()
1200 static bool sas_eeds_valid(struct domain_device *parent, in sas_eeds_valid() argument
1203 struct sas_discovery *disc = &parent->port->disc; in sas_eeds_valid()
1205 return (SAS_ADDR(disc->eeds_a) == SAS_ADDR(parent->sas_addr) || in sas_eeds_valid()
1207 (SAS_ADDR(disc->eeds_b) == SAS_ADDR(parent->sas_addr) || in sas_eeds_valid()
1216 struct domain_device *parent = child->parent; in sas_check_eeds() local
1217 struct sas_discovery *disc = &parent->port->disc; in sas_check_eeds()
1222 SAS_ADDR(parent->sas_addr), in sas_check_eeds()
1228 memcpy(disc->eeds_a, parent->sas_addr, SAS_ADDR_SIZE); in sas_check_eeds()
1230 } else if (!sas_eeds_valid(parent, child)) { in sas_check_eeds()
1233 SAS_ADDR(parent->sas_addr), in sas_check_eeds()
1246 struct expander_device *parent_ex = &child->parent->ex_dev; in sas_check_edge_expander_topo()
1296 if (!child->parent) in sas_check_parent_topology()
1299 if (!dev_is_expander(child->parent->dev_type)) in sas_check_parent_topology()
1302 parent_ex = &child->parent->ex_dev; in sas_check_parent_topology()
1314 switch (child->parent->dev_type) { in sas_check_parent_topology()
1470 static int sas_configure_parent(struct domain_device *parent, in sas_configure_parent() argument
1474 struct expander_device *ex_parent = &parent->ex_dev; in sas_configure_parent()
1478 if (parent->parent) { in sas_configure_parent()
1479 res = sas_configure_parent(parent->parent, parent, sas_addr, in sas_configure_parent()
1487 SAS_ADDR(parent->sas_addr)); in sas_configure_parent()
1496 res = sas_configure_phy(parent, i, sas_addr, include); in sas_configure_parent()
1512 if (dev->parent) in sas_configure_routing()
1513 return sas_configure_parent(dev->parent, dev, sas_addr, 1); in sas_configure_routing()
1519 if (dev->parent) in sas_disable_routing()
1520 return sas_configure_parent(dev->parent, dev, sas_addr, 0); in sas_disable_routing()
1826 static void sas_unregister_devs_sas_addr(struct domain_device *parent, in sas_unregister_devs_sas_addr() argument
1829 struct expander_device *ex_dev = &parent->ex_dev; in sas_unregister_devs_sas_addr()
1838 sas_unregister_ex_tree(parent->port, child); in sas_unregister_devs_sas_addr()
1840 sas_unregister_dev(parent->port, child); in sas_unregister_devs_sas_addr()
1845 sas_disable_routing(parent, phy->attached_sas_addr); in sas_unregister_devs_sas_addr()
1853 &parent->port->sas_port_del_list); in sas_unregister_devs_sas_addr()