Lines Matching refs:node

113 	struct fw_node *node;  in fw_node_create()  local
115 node = kzalloc(sizeof(*node) + port_count * sizeof(node->ports[0]), in fw_node_create()
117 if (node == NULL) in fw_node_create()
120 node->color = color; in fw_node_create()
121 node->node_id = LOCAL_BUS | SELF_ID_PHY_ID(sid); in fw_node_create()
122 node->link_on = SELF_ID_LINK_ON(sid); in fw_node_create()
123 node->phy_speed = SELF_ID_PHY_SPEED(sid); in fw_node_create()
124 node->initiated_reset = SELF_ID_PHY_INITIATOR(sid); in fw_node_create()
125 node->port_count = port_count; in fw_node_create()
127 atomic_set(&node->ref_count, 1); in fw_node_create()
128 INIT_LIST_HEAD(&node->link); in fw_node_create()
130 return node; in fw_node_create()
147 static void update_hop_count(struct fw_node *node) in update_hop_count() argument
153 for (i = 0; i < node->port_count; i++) { in update_hop_count()
154 if (node->ports[i] == NULL) in update_hop_count()
157 if (node->ports[i]->max_hops > max_child_hops) in update_hop_count()
158 max_child_hops = node->ports[i]->max_hops; in update_hop_count()
160 if (node->ports[i]->max_depth > depths[0]) { in update_hop_count()
162 depths[0] = node->ports[i]->max_depth; in update_hop_count()
163 } else if (node->ports[i]->max_depth > depths[1]) in update_hop_count()
164 depths[1] = node->ports[i]->max_depth; in update_hop_count()
167 node->max_depth = depths[0] + 1; in update_hop_count()
168 node->max_hops = max(max_child_hops, depths[0] + depths[1] + 2); in update_hop_count()
186 struct fw_node *node, *child, *local_node, *irm_node; in build_tree() local
194 node = NULL; in build_tree()
235 node = fw_node_create(q, port_count, card->color); in build_tree()
236 if (node == NULL) { in build_tree()
242 local_node = node; in build_tree()
245 irm_node = node; in build_tree()
263 node->color = i; in build_tree()
267 node->ports[i] = child; in build_tree()
272 child->ports[child->color] = node; in build_tree()
293 list_add_tail(&node->link, &stack); in build_tree()
296 if (node->phy_speed == SCODE_BETA && in build_tree()
307 update_hop_count(node); in build_tree()
313 card->root_node = node; in build_tree()
322 struct fw_node * node,
329 struct fw_node *node, *next, *child, *parent; in for_each_fw_node() local
337 list_for_each_entry(node, &list, link) { in for_each_fw_node()
338 node->color = card->color; in for_each_fw_node()
340 for (i = 0; i < node->port_count; i++) { in for_each_fw_node()
341 child = node->ports[i]; in for_each_fw_node()
352 callback(card, node, parent); in for_each_fw_node()
355 list_for_each_entry_safe(node, next, &list, link) in for_each_fw_node()
356 fw_node_put(node); in for_each_fw_node()
360 struct fw_node *node, struct fw_node *parent) in report_lost_node() argument
362 fw_node_event(card, node, FW_NODE_DESTROYED); in report_lost_node()
363 fw_node_put(node); in report_lost_node()
370 struct fw_node *node, struct fw_node *parent) in report_found_node() argument
372 int b_path = (node->phy_speed == SCODE_BETA); in report_found_node()
376 node->max_speed = parent->max_speed < node->phy_speed ? in report_found_node()
377 parent->max_speed : node->phy_speed; in report_found_node()
378 node->b_path = parent->b_path && b_path; in report_found_node()
380 node->max_speed = node->phy_speed; in report_found_node()
381 node->b_path = b_path; in report_found_node()
384 fw_node_event(card, node, FW_NODE_CREATED); in report_found_node()