Lines Matching full:child
723 struct domain_device *child, in sas_ex_get_linkrate() argument
730 child->pathways = 0; in sas_ex_get_linkrate()
741 if (sas_phy_match_dev_addr(child, phy)) { in sas_ex_get_linkrate()
742 child->min_linkrate = min(parent->min_linkrate, in sas_ex_get_linkrate()
744 child->max_linkrate = max(parent->max_linkrate, in sas_ex_get_linkrate()
746 child->pathways++; in sas_ex_get_linkrate()
750 child->linkrate = min(parent_phy->linkrate, child->max_linkrate); in sas_ex_get_linkrate()
751 child->pathways = min(child->pathways, parent->pathways); in sas_ex_get_linkrate()
755 struct domain_device *child, int phy_id) in sas_ex_add_dev() argument
760 child->dev_type = SAS_END_DEVICE; in sas_ex_add_dev()
765 child->tproto = phy->attached_tproto; in sas_ex_add_dev()
766 sas_init_dev(child); in sas_ex_add_dev()
768 child->rphy = rphy; in sas_ex_add_dev()
771 sas_fill_in_rphy(child, rphy); in sas_ex_add_dev()
773 list_add_tail(&child->disco_list_node, &parent->port->disco_list); in sas_ex_add_dev()
775 res = sas_notify_lldd_dev_found(child); in sas_ex_add_dev()
778 SAS_ADDR(child->sas_addr), in sas_ex_add_dev()
780 sas_rphy_free(child->rphy); in sas_ex_add_dev()
781 list_del(&child->disco_list_node); in sas_ex_add_dev()
793 struct domain_device *child = NULL; in sas_ex_discover_end_dev() local
799 child = sas_alloc_device(); in sas_ex_discover_end_dev()
800 if (!child) in sas_ex_discover_end_dev()
804 child->parent = parent; in sas_ex_discover_end_dev()
805 child->port = parent->port; in sas_ex_discover_end_dev()
806 child->iproto = phy->attached_iproto; in sas_ex_discover_end_dev()
807 memcpy(child->sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); in sas_ex_discover_end_dev()
808 sas_hash_addr(child->hashed_sas_addr, child->sas_addr); in sas_ex_discover_end_dev()
818 sas_ex_get_linkrate(parent, child, phy); in sas_ex_discover_end_dev()
819 sas_device_set_phy(child, phy->port); in sas_ex_discover_end_dev()
822 res = sas_ata_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
824 res = sas_ex_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
835 list_add_tail(&child->siblings, &parent_ex->children); in sas_ex_discover_end_dev()
836 return child; in sas_ex_discover_end_dev()
842 sas_put_device(child); in sas_ex_discover_end_dev()
875 struct domain_device *child = NULL; in sas_ex_discover_expander() local
888 child = sas_alloc_device(); in sas_ex_discover_expander()
889 if (!child) in sas_ex_discover_expander()
911 child->rphy = rphy; in sas_ex_discover_expander()
914 child->dev_type = phy->attached_dev_type; in sas_ex_discover_expander()
916 child->parent = parent; in sas_ex_discover_expander()
917 child->port = port; in sas_ex_discover_expander()
918 child->iproto = phy->attached_iproto; in sas_ex_discover_expander()
919 child->tproto = phy->attached_tproto; in sas_ex_discover_expander()
920 memcpy(child->sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); in sas_ex_discover_expander()
921 sas_hash_addr(child->hashed_sas_addr, child->sas_addr); in sas_ex_discover_expander()
922 sas_ex_get_linkrate(parent, child, phy); in sas_ex_discover_expander()
926 sas_init_dev(child); in sas_ex_discover_expander()
927 sas_fill_in_rphy(child, rphy); in sas_ex_discover_expander()
931 list_add_tail(&child->dev_list_node, &parent->port->dev_list); in sas_ex_discover_expander()
934 res = sas_discover_expander(child); in sas_ex_discover_expander()
938 list_del(&child->dev_list_node); in sas_ex_discover_expander()
940 sas_put_device(child); in sas_ex_discover_expander()
945 list_add_tail(&child->siblings, &parent->ex_dev.children); in sas_ex_discover_expander()
946 return child; in sas_ex_discover_expander()
953 struct domain_device *child = NULL; in sas_ex_discover_dev() local
1016 child = sas_ex_discover_end_dev(dev, phy_id); in sas_ex_discover_dev()
1032 child = sas_ex_discover_expander(dev, phy_id); in sas_ex_discover_dev()
1038 if (!child) in sas_ex_discover_dev()
1070 struct domain_device *child; in sas_check_level_subtractive_boundary() local
1073 list_for_each_entry(child, &ex->children, siblings) { in sas_check_level_subtractive_boundary()
1074 if (!dev_is_expander(child->dev_type)) in sas_check_level_subtractive_boundary()
1077 sas_find_sub_addr(child, sub_addr); in sas_check_level_subtractive_boundary()
1082 if (sas_find_sub_addr(child, s2) && in sas_check_level_subtractive_boundary()
1087 SAS_ADDR(child->sas_addr), in sas_check_level_subtractive_boundary()
1091 sas_ex_disable_port(child, s2); in sas_check_level_subtractive_boundary()
1178 static void sas_print_parent_topology_bug(struct domain_device *child, in sas_print_parent_topology_bug() argument
1186 struct domain_device *parent = child->parent; in sas_print_parent_topology_bug()
1193 ex_type[child->dev_type], in sas_print_parent_topology_bug()
1194 SAS_ADDR(child->sas_addr), in sas_print_parent_topology_bug()
1198 sas_route_char(child, child_phy)); in sas_print_parent_topology_bug()
1202 struct domain_device *child) in sas_eeds_valid() argument
1207 SAS_ADDR(disc->eeds_a) == SAS_ADDR(child->sas_addr)) && in sas_eeds_valid()
1209 SAS_ADDR(disc->eeds_b) == SAS_ADDR(child->sas_addr)); in sas_eeds_valid()
1212 static int sas_check_eeds(struct domain_device *child, in sas_check_eeds() argument
1217 struct domain_device *parent = child->parent; in sas_check_eeds()
1225 SAS_ADDR(child->sas_addr), in sas_check_eeds()
1230 memcpy(disc->eeds_b, child->sas_addr, SAS_ADDR_SIZE); in sas_check_eeds()
1231 } else if (!sas_eeds_valid(parent, child)) { in sas_check_eeds()
1236 SAS_ADDR(child->sas_addr), in sas_check_eeds()
1243 static int sas_check_edge_expander_topo(struct domain_device *child, in sas_check_edge_expander_topo() argument
1246 struct expander_device *child_ex = &child->ex_dev; in sas_check_edge_expander_topo()
1247 struct expander_device *parent_ex = &child->parent->ex_dev; in sas_check_edge_expander_topo()
1252 if (child->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { in sas_check_edge_expander_topo()
1258 return sas_check_eeds(child, parent_phy, child_phy); in sas_check_edge_expander_topo()
1270 sas_print_parent_topology_bug(child, parent_phy, child_phy); in sas_check_edge_expander_topo()
1274 static int sas_check_fanout_expander_topo(struct domain_device *child, in sas_check_fanout_expander_topo() argument
1277 struct expander_device *child_ex = &child->ex_dev; in sas_check_fanout_expander_topo()
1286 sas_print_parent_topology_bug(child, parent_phy, child_phy); in sas_check_fanout_expander_topo()
1291 static int sas_check_parent_topology(struct domain_device *child) in sas_check_parent_topology() argument
1297 if (!child->parent) in sas_check_parent_topology()
1300 if (!dev_is_expander(child->parent->dev_type)) in sas_check_parent_topology()
1303 parent_ex = &child->parent->ex_dev; in sas_check_parent_topology()
1312 if (!sas_phy_match_dev_addr(child, parent_phy)) in sas_check_parent_topology()
1315 switch (child->parent->dev_type) { in sas_check_parent_topology()
1317 if (sas_check_edge_expander_topo(child, parent_phy)) in sas_check_parent_topology()
1321 if (sas_check_fanout_expander_topo(child, parent_phy)) in sas_check_parent_topology()
1467 * @child: child expander
1468 * @sas_addr: SAS port identifier of device directly attached to child
1469 * @include: whether or not to include @child in the expander routing table
1472 struct domain_device *child, in sas_configure_parent() argument
1496 sas_phy_match_dev_addr(child, phy)) { in sas_configure_parent()
1810 struct domain_device *child, *n; in sas_unregister_ex_tree() local
1812 list_for_each_entry_safe(child, n, &ex->children, siblings) { in sas_unregister_ex_tree()
1813 set_bit(SAS_DEV_GONE, &child->state); in sas_unregister_ex_tree()
1814 if (dev_is_expander(child->dev_type)) in sas_unregister_ex_tree()
1815 sas_unregister_ex_tree(port, child); in sas_unregister_ex_tree()
1817 sas_unregister_dev(port, child); in sas_unregister_ex_tree()
1827 struct domain_device *child, *n, *found = NULL; in sas_unregister_devs_sas_addr() local
1829 list_for_each_entry_safe(child, n, in sas_unregister_devs_sas_addr()
1831 if (sas_phy_match_dev_addr(child, phy)) { in sas_unregister_devs_sas_addr()
1832 set_bit(SAS_DEV_GONE, &child->state); in sas_unregister_devs_sas_addr()
1833 if (dev_is_expander(child->dev_type)) in sas_unregister_devs_sas_addr()
1834 sas_unregister_ex_tree(parent->port, child); in sas_unregister_devs_sas_addr()
1836 sas_unregister_dev(parent->port, child); in sas_unregister_devs_sas_addr()
1837 found = child; in sas_unregister_devs_sas_addr()
1858 struct domain_device *child; in sas_discover_bfs_by_root_level() local
1861 list_for_each_entry(child, &ex_root->children, siblings) { in sas_discover_bfs_by_root_level()
1862 if (dev_is_expander(child->dev_type)) { in sas_discover_bfs_by_root_level()
1864 rphy_to_expander_device(child->rphy); in sas_discover_bfs_by_root_level()
1867 res = sas_discover_bfs_by_root_level(child, in sas_discover_bfs_by_root_level()
1870 res = sas_ex_discover_devices(child, -1); in sas_discover_bfs_by_root_level()
1897 struct domain_device *child; in sas_discover_new() local
1912 list_for_each_entry(child, &dev->ex_dev.children, siblings) { in sas_discover_new()
1913 if (sas_phy_match_dev_addr(child, ex_phy)) { in sas_discover_new()
1914 if (dev_is_expander(child->dev_type)) in sas_discover_new()
1915 res = sas_discover_bfs_by_root(child); in sas_discover_new()