Lines Matching refs:child

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