Lines Matching full:child
745 struct domain_device *child, in sas_ex_get_linkrate() argument
752 child->pathways = 0; in sas_ex_get_linkrate()
764 SAS_ADDR(child->sas_addr)) { in sas_ex_get_linkrate()
766 child->min_linkrate = min(parent->min_linkrate, in sas_ex_get_linkrate()
768 child->max_linkrate = max(parent->max_linkrate, in sas_ex_get_linkrate()
770 child->pathways++; in sas_ex_get_linkrate()
774 child->linkrate = min(parent_phy->linkrate, child->max_linkrate); in sas_ex_get_linkrate()
775 child->pathways = min(child->pathways, parent->pathways); in sas_ex_get_linkrate()
783 struct domain_device *child = NULL; in sas_ex_discover_end_dev() local
790 child = sas_alloc_device(); in sas_ex_discover_end_dev()
791 if (!child) in sas_ex_discover_end_dev()
795 child->parent = parent; in sas_ex_discover_end_dev()
796 child->port = parent->port; in sas_ex_discover_end_dev()
797 child->iproto = phy->attached_iproto; in sas_ex_discover_end_dev()
798 memcpy(child->sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); in sas_ex_discover_end_dev()
799 sas_hash_addr(child->hashed_sas_addr, child->sas_addr); in sas_ex_discover_end_dev()
809 sas_ex_get_linkrate(parent, child, phy); in sas_ex_discover_end_dev()
810 sas_device_set_phy(child, phy->port); in sas_ex_discover_end_dev()
814 if (child->linkrate > parent->min_linkrate) { in sas_ex_discover_end_dev()
815 struct sas_phy *cphy = child->phy; in sas_ex_discover_end_dev()
827 SAS_ADDR(child->sas_addr), phy_id); in sas_ex_discover_end_dev()
832 SAS_ADDR(child->sas_addr), phy_id, ret); in sas_ex_discover_end_dev()
836 SAS_ADDR(child->sas_addr), phy_id); in sas_ex_discover_end_dev()
837 child->linkrate = child->min_linkrate; in sas_ex_discover_end_dev()
839 res = sas_get_ata_info(child, phy); in sas_ex_discover_end_dev()
843 sas_init_dev(child); in sas_ex_discover_end_dev()
844 res = sas_ata_init(child); in sas_ex_discover_end_dev()
852 child->rphy = rphy; in sas_ex_discover_end_dev()
855 list_add_tail(&child->disco_list_node, &parent->port->disco_list); in sas_ex_discover_end_dev()
857 res = sas_discover_sata(child); in sas_ex_discover_end_dev()
860 SAS_ADDR(child->sas_addr), in sas_ex_discover_end_dev()
867 child->dev_type = SAS_END_DEVICE; in sas_ex_discover_end_dev()
872 child->tproto = phy->attached_tproto; in sas_ex_discover_end_dev()
873 sas_init_dev(child); in sas_ex_discover_end_dev()
875 child->rphy = rphy; in sas_ex_discover_end_dev()
878 sas_fill_in_rphy(child, rphy); in sas_ex_discover_end_dev()
880 list_add_tail(&child->disco_list_node, &parent->port->disco_list); in sas_ex_discover_end_dev()
882 res = sas_discover_end_dev(child); in sas_ex_discover_end_dev()
885 SAS_ADDR(child->sas_addr), in sas_ex_discover_end_dev()
896 list_add_tail(&child->siblings, &parent_ex->children); in sas_ex_discover_end_dev()
897 return child; in sas_ex_discover_end_dev()
900 sas_rphy_free(child->rphy); in sas_ex_discover_end_dev()
901 list_del(&child->disco_list_node); in sas_ex_discover_end_dev()
903 list_del(&child->dev_list_node); in sas_ex_discover_end_dev()
909 sas_put_device(child); in sas_ex_discover_end_dev()
942 struct domain_device *child = NULL; in sas_ex_discover_expander() local
955 child = sas_alloc_device(); in sas_ex_discover_expander()
956 if (!child) in sas_ex_discover_expander()
978 child->rphy = rphy; in sas_ex_discover_expander()
981 child->dev_type = phy->attached_dev_type; in sas_ex_discover_expander()
983 child->parent = parent; in sas_ex_discover_expander()
984 child->port = port; in sas_ex_discover_expander()
985 child->iproto = phy->attached_iproto; in sas_ex_discover_expander()
986 child->tproto = phy->attached_tproto; in sas_ex_discover_expander()
987 memcpy(child->sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); in sas_ex_discover_expander()
988 sas_hash_addr(child->hashed_sas_addr, child->sas_addr); in sas_ex_discover_expander()
989 sas_ex_get_linkrate(parent, child, phy); in sas_ex_discover_expander()
993 sas_init_dev(child); in sas_ex_discover_expander()
994 sas_fill_in_rphy(child, rphy); in sas_ex_discover_expander()
998 list_add_tail(&child->dev_list_node, &parent->port->dev_list); in sas_ex_discover_expander()
1001 res = sas_discover_expander(child); in sas_ex_discover_expander()
1005 list_del(&child->dev_list_node); in sas_ex_discover_expander()
1007 sas_put_device(child); in sas_ex_discover_expander()
1012 list_add_tail(&child->siblings, &parent->ex_dev.children); in sas_ex_discover_expander()
1013 return child; in sas_ex_discover_expander()
1020 struct domain_device *child = NULL; in sas_ex_discover_dev() local
1085 child = sas_ex_discover_end_dev(dev, phy_id); in sas_ex_discover_dev()
1101 child = sas_ex_discover_expander(dev, phy_id); in sas_ex_discover_dev()
1107 if (!child) in sas_ex_discover_dev()
1139 struct domain_device *child; in sas_check_level_subtractive_boundary() local
1142 list_for_each_entry(child, &ex->children, siblings) { in sas_check_level_subtractive_boundary()
1143 if (!dev_is_expander(child->dev_type)) in sas_check_level_subtractive_boundary()
1146 sas_find_sub_addr(child, sub_addr); in sas_check_level_subtractive_boundary()
1151 if (sas_find_sub_addr(child, s2) && in sas_check_level_subtractive_boundary()
1156 SAS_ADDR(child->sas_addr), in sas_check_level_subtractive_boundary()
1160 sas_ex_disable_port(child, s2); in sas_check_level_subtractive_boundary()
1247 static void sas_print_parent_topology_bug(struct domain_device *child, in sas_print_parent_topology_bug() argument
1255 struct domain_device *parent = child->parent; in sas_print_parent_topology_bug()
1262 ex_type[child->dev_type], in sas_print_parent_topology_bug()
1263 SAS_ADDR(child->sas_addr), in sas_print_parent_topology_bug()
1267 sas_route_char(child, child_phy)); in sas_print_parent_topology_bug()
1270 static int sas_check_eeds(struct domain_device *child, in sas_check_eeds() argument
1275 struct domain_device *parent = child->parent; in sas_check_eeds()
1282 SAS_ADDR(child->sas_addr), in sas_check_eeds()
1288 memcpy(parent->port->disc.eeds_b, child->sas_addr, in sas_check_eeds()
1293 SAS_ADDR(child->sas_addr))) in sas_check_eeds()
1298 SAS_ADDR(child->sas_addr)))) in sas_check_eeds()
1305 SAS_ADDR(child->sas_addr), in sas_check_eeds()
1314 static int sas_check_parent_topology(struct domain_device *child) in sas_check_parent_topology() argument
1316 struct expander_device *child_ex = &child->ex_dev; in sas_check_parent_topology()
1321 if (!child->parent) in sas_check_parent_topology()
1324 if (!dev_is_expander(child->parent->dev_type)) in sas_check_parent_topology()
1327 parent_ex = &child->parent->ex_dev; in sas_check_parent_topology()
1337 if (SAS_ADDR(parent_phy->attached_sas_addr) != SAS_ADDR(child->sas_addr)) in sas_check_parent_topology()
1342 switch (child->parent->dev_type) { in sas_check_parent_topology()
1344 if (child->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { in sas_check_parent_topology()
1347 sas_print_parent_topology_bug(child, parent_phy, child_phy); in sas_check_parent_topology()
1352 res = sas_check_eeds(child, parent_phy, child_phy); in sas_check_parent_topology()
1354 sas_print_parent_topology_bug(child, parent_phy, child_phy); in sas_check_parent_topology()
1363 sas_print_parent_topology_bug(child, parent_phy, child_phy); in sas_check_parent_topology()
1371 sas_print_parent_topology_bug(child, parent_phy, child_phy); in sas_check_parent_topology()
1517 * @child: child expander
1518 * @sas_addr: SAS port identifier of device directly attached to child
1519 * @include: whether or not to include @child in the expander routing table
1522 struct domain_device *child, in sas_configure_parent() argument
1547 SAS_ADDR(child->sas_addr))) { in sas_configure_parent()
1865 struct domain_device *child, *n; in sas_unregister_ex_tree() local
1867 list_for_each_entry_safe(child, n, &ex->children, siblings) { in sas_unregister_ex_tree()
1868 set_bit(SAS_DEV_GONE, &child->state); in sas_unregister_ex_tree()
1869 if (dev_is_expander(child->dev_type)) in sas_unregister_ex_tree()
1870 sas_unregister_ex_tree(port, child); in sas_unregister_ex_tree()
1872 sas_unregister_dev(port, child); in sas_unregister_ex_tree()
1882 struct domain_device *child, *n, *found = NULL; in sas_unregister_devs_sas_addr() local
1884 list_for_each_entry_safe(child, n, in sas_unregister_devs_sas_addr()
1886 if (SAS_ADDR(child->sas_addr) == in sas_unregister_devs_sas_addr()
1888 set_bit(SAS_DEV_GONE, &child->state); in sas_unregister_devs_sas_addr()
1889 if (dev_is_expander(child->dev_type)) in sas_unregister_devs_sas_addr()
1890 sas_unregister_ex_tree(parent->port, child); in sas_unregister_devs_sas_addr()
1892 sas_unregister_dev(parent->port, child); in sas_unregister_devs_sas_addr()
1893 found = child; in sas_unregister_devs_sas_addr()
1914 struct domain_device *child; in sas_discover_bfs_by_root_level() local
1917 list_for_each_entry(child, &ex_root->children, siblings) { in sas_discover_bfs_by_root_level()
1918 if (dev_is_expander(child->dev_type)) { in sas_discover_bfs_by_root_level()
1920 rphy_to_expander_device(child->rphy); in sas_discover_bfs_by_root_level()
1923 res = sas_discover_bfs_by_root_level(child, in sas_discover_bfs_by_root_level()
1926 res = sas_ex_discover_devices(child, -1); in sas_discover_bfs_by_root_level()
1953 struct domain_device *child; in sas_discover_new() local
1968 list_for_each_entry(child, &dev->ex_dev.children, siblings) { in sas_discover_new()
1969 if (SAS_ADDR(child->sas_addr) == in sas_discover_new()
1971 if (dev_is_expander(child->dev_type)) in sas_discover_new()
1972 res = sas_discover_bfs_by_root(child); in sas_discover_new()