Lines Matching refs:child
744 struct domain_device *child, in sas_ex_get_linkrate() argument
751 child->pathways = 0; in sas_ex_get_linkrate()
762 if (sas_phy_match_dev_addr(child, phy)) { in sas_ex_get_linkrate()
763 child->min_linkrate = min(parent->min_linkrate, in sas_ex_get_linkrate()
765 child->max_linkrate = max(parent->max_linkrate, in sas_ex_get_linkrate()
767 child->pathways++; in sas_ex_get_linkrate()
771 child->linkrate = min(parent_phy->linkrate, child->max_linkrate); in sas_ex_get_linkrate()
772 child->pathways = min(child->pathways, parent->pathways); in sas_ex_get_linkrate()
776 struct domain_device *child, int phy_id) in sas_ex_add_dev() argument
781 child->dev_type = SAS_END_DEVICE; in sas_ex_add_dev()
786 child->tproto = phy->attached_tproto; in sas_ex_add_dev()
787 sas_init_dev(child); in sas_ex_add_dev()
789 child->rphy = rphy; in sas_ex_add_dev()
792 sas_fill_in_rphy(child, rphy); in sas_ex_add_dev()
794 list_add_tail(&child->disco_list_node, &parent->port->disco_list); in sas_ex_add_dev()
796 res = sas_notify_lldd_dev_found(child); in sas_ex_add_dev()
799 SAS_ADDR(child->sas_addr), in sas_ex_add_dev()
801 sas_rphy_free(child->rphy); in sas_ex_add_dev()
802 list_del(&child->disco_list_node); in sas_ex_add_dev()
814 struct domain_device *child = NULL; in sas_ex_discover_end_dev() local
820 child = sas_alloc_device(); in sas_ex_discover_end_dev()
821 if (!child) in sas_ex_discover_end_dev()
825 child->parent = parent; in sas_ex_discover_end_dev()
826 child->port = parent->port; in sas_ex_discover_end_dev()
827 child->iproto = phy->attached_iproto; in sas_ex_discover_end_dev()
828 memcpy(child->sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); in sas_ex_discover_end_dev()
829 sas_hash_addr(child->hashed_sas_addr, child->sas_addr); in sas_ex_discover_end_dev()
839 sas_ex_get_linkrate(parent, child, phy); in sas_ex_discover_end_dev()
840 sas_device_set_phy(child, phy->port); in sas_ex_discover_end_dev()
843 res = sas_ata_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
845 res = sas_ex_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
856 list_add_tail(&child->siblings, &parent_ex->children); in sas_ex_discover_end_dev()
857 return child; in sas_ex_discover_end_dev()
863 sas_put_device(child); in sas_ex_discover_end_dev()
894 struct domain_device *child = NULL; in sas_ex_discover_expander() local
907 child = sas_alloc_device(); in sas_ex_discover_expander()
908 if (!child) in sas_ex_discover_expander()
930 child->rphy = rphy; in sas_ex_discover_expander()
933 child->dev_type = phy->attached_dev_type; in sas_ex_discover_expander()
935 child->parent = parent; in sas_ex_discover_expander()
936 child->port = port; in sas_ex_discover_expander()
937 child->iproto = phy->attached_iproto; in sas_ex_discover_expander()
938 child->tproto = phy->attached_tproto; in sas_ex_discover_expander()
939 memcpy(child->sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); in sas_ex_discover_expander()
940 sas_hash_addr(child->hashed_sas_addr, child->sas_addr); in sas_ex_discover_expander()
941 sas_ex_get_linkrate(parent, child, phy); in sas_ex_discover_expander()
945 sas_init_dev(child); in sas_ex_discover_expander()
946 sas_fill_in_rphy(child, rphy); in sas_ex_discover_expander()
950 list_add_tail(&child->dev_list_node, &parent->port->dev_list); in sas_ex_discover_expander()
953 res = sas_discover_expander(child); in sas_ex_discover_expander()
957 list_del(&child->dev_list_node); in sas_ex_discover_expander()
959 sas_put_device(child); in sas_ex_discover_expander()
964 list_add_tail(&child->siblings, &parent->ex_dev.children); in sas_ex_discover_expander()
965 return child; in sas_ex_discover_expander()
972 struct domain_device *child = NULL; in sas_ex_discover_dev() local
1035 child = sas_ex_discover_end_dev(dev, phy_id); in sas_ex_discover_dev()
1051 child = sas_ex_discover_expander(dev, phy_id); in sas_ex_discover_dev()
1057 if (!child) in sas_ex_discover_dev()
1089 struct domain_device *child; in sas_check_level_subtractive_boundary() local
1092 list_for_each_entry(child, &ex->children, siblings) { in sas_check_level_subtractive_boundary()
1093 if (!dev_is_expander(child->dev_type)) in sas_check_level_subtractive_boundary()
1096 sas_find_sub_addr(child, sub_addr); in sas_check_level_subtractive_boundary()
1101 if (sas_find_sub_addr(child, s2) && in sas_check_level_subtractive_boundary()
1106 SAS_ADDR(child->sas_addr), in sas_check_level_subtractive_boundary()
1110 sas_ex_disable_port(child, s2); in sas_check_level_subtractive_boundary()
1197 static void sas_print_parent_topology_bug(struct domain_device *child, in sas_print_parent_topology_bug() argument
1205 struct domain_device *parent = child->parent; in sas_print_parent_topology_bug()
1212 ex_type[child->dev_type], in sas_print_parent_topology_bug()
1213 SAS_ADDR(child->sas_addr), in sas_print_parent_topology_bug()
1217 sas_route_char(child, child_phy)); in sas_print_parent_topology_bug()
1221 struct domain_device *child) in sas_eeds_valid() argument
1226 SAS_ADDR(disc->eeds_a) == SAS_ADDR(child->sas_addr)) && in sas_eeds_valid()
1228 SAS_ADDR(disc->eeds_b) == SAS_ADDR(child->sas_addr)); in sas_eeds_valid()
1231 static int sas_check_eeds(struct domain_device *child, in sas_check_eeds() argument
1236 struct domain_device *parent = child->parent; in sas_check_eeds()
1244 SAS_ADDR(child->sas_addr), in sas_check_eeds()
1249 memcpy(disc->eeds_b, child->sas_addr, SAS_ADDR_SIZE); in sas_check_eeds()
1250 } else if (!sas_eeds_valid(parent, child)) { in sas_check_eeds()
1255 SAS_ADDR(child->sas_addr), in sas_check_eeds()
1262 static int sas_check_edge_expander_topo(struct domain_device *child, in sas_check_edge_expander_topo() argument
1265 struct expander_device *child_ex = &child->ex_dev; in sas_check_edge_expander_topo()
1266 struct expander_device *parent_ex = &child->parent->ex_dev; in sas_check_edge_expander_topo()
1271 if (child->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { in sas_check_edge_expander_topo()
1277 return sas_check_eeds(child, parent_phy, child_phy); in sas_check_edge_expander_topo()
1289 sas_print_parent_topology_bug(child, parent_phy, child_phy); in sas_check_edge_expander_topo()
1293 static int sas_check_fanout_expander_topo(struct domain_device *child, in sas_check_fanout_expander_topo() argument
1296 struct expander_device *child_ex = &child->ex_dev; in sas_check_fanout_expander_topo()
1305 sas_print_parent_topology_bug(child, parent_phy, child_phy); in sas_check_fanout_expander_topo()
1310 static int sas_check_parent_topology(struct domain_device *child) in sas_check_parent_topology() argument
1316 if (!child->parent) in sas_check_parent_topology()
1319 if (!dev_is_expander(child->parent->dev_type)) in sas_check_parent_topology()
1322 parent_ex = &child->parent->ex_dev; in sas_check_parent_topology()
1331 if (!sas_phy_match_dev_addr(child, parent_phy)) in sas_check_parent_topology()
1334 switch (child->parent->dev_type) { in sas_check_parent_topology()
1336 if (sas_check_edge_expander_topo(child, parent_phy)) in sas_check_parent_topology()
1340 if (sas_check_fanout_expander_topo(child, parent_phy)) in sas_check_parent_topology()
1491 struct domain_device *child, in sas_configure_parent() argument
1515 sas_phy_match_dev_addr(child, phy)) { in sas_configure_parent()
1834 struct domain_device *child, *n; in sas_unregister_ex_tree() local
1836 list_for_each_entry_safe(child, n, &ex->children, siblings) { in sas_unregister_ex_tree()
1837 set_bit(SAS_DEV_GONE, &child->state); in sas_unregister_ex_tree()
1838 if (dev_is_expander(child->dev_type)) in sas_unregister_ex_tree()
1839 sas_unregister_ex_tree(port, child); in sas_unregister_ex_tree()
1841 sas_unregister_dev(port, child); in sas_unregister_ex_tree()
1851 struct domain_device *child, *n, *found = NULL; in sas_unregister_devs_sas_addr() local
1853 list_for_each_entry_safe(child, n, in sas_unregister_devs_sas_addr()
1855 if (sas_phy_match_dev_addr(child, phy)) { in sas_unregister_devs_sas_addr()
1856 set_bit(SAS_DEV_GONE, &child->state); in sas_unregister_devs_sas_addr()
1857 if (dev_is_expander(child->dev_type)) in sas_unregister_devs_sas_addr()
1858 sas_unregister_ex_tree(parent->port, child); in sas_unregister_devs_sas_addr()
1860 sas_unregister_dev(parent->port, child); in sas_unregister_devs_sas_addr()
1861 found = child; in sas_unregister_devs_sas_addr()
1885 struct domain_device *child; in sas_discover_bfs_by_root_level() local
1888 list_for_each_entry(child, &ex_root->children, siblings) { in sas_discover_bfs_by_root_level()
1889 if (dev_is_expander(child->dev_type)) { in sas_discover_bfs_by_root_level()
1891 rphy_to_expander_device(child->rphy); in sas_discover_bfs_by_root_level()
1894 res = sas_discover_bfs_by_root_level(child, in sas_discover_bfs_by_root_level()
1897 res = sas_ex_discover_devices(child, -1); in sas_discover_bfs_by_root_level()
1924 struct domain_device *child; in sas_discover_new() local
1939 list_for_each_entry(child, &dev->ex_dev.children, siblings) { in sas_discover_new()
1940 if (sas_phy_match_dev_addr(child, ex_phy)) { in sas_discover_new()
1941 if (dev_is_expander(child->dev_type)) in sas_discover_new()
1942 res = sas_discover_bfs_by_root(child); in sas_discover_new()