Lines Matching refs:node

28 	struct fw_node *node;  in fw_node_create()  local
30 node = kzalloc(struct_size(node, ports, port_count), GFP_ATOMIC); in fw_node_create()
31 if (node == NULL) in fw_node_create()
34 node->color = color; in fw_node_create()
35 node->node_id = LOCAL_BUS | phy_packet_self_id_get_phy_id(sid); in fw_node_create()
36 node->link_on = phy_packet_self_id_zero_get_link_active(sid); in fw_node_create()
38 node->phy_speed = phy_packet_self_id_zero_get_scode(sid); in fw_node_create()
39 node->initiated_reset = phy_packet_self_id_zero_get_initiated_reset(sid); in fw_node_create()
40 node->port_count = port_count; in fw_node_create()
42 kref_init(&node->kref); in fw_node_create()
43 INIT_LIST_HEAD(&node->link); in fw_node_create()
45 return node; in fw_node_create()
62 static void update_hop_count(struct fw_node *node) in update_hop_count() argument
68 for (i = 0; i < node->port_count; i++) { in update_hop_count()
69 if (node->ports[i] == NULL) in update_hop_count()
72 if (node->ports[i]->max_hops > max_child_hops) in update_hop_count()
73 max_child_hops = node->ports[i]->max_hops; in update_hop_count()
75 if (node->ports[i]->max_depth > depths[0]) { in update_hop_count()
77 depths[0] = node->ports[i]->max_depth; in update_hop_count()
78 } else if (node->ports[i]->max_depth > depths[1]) in update_hop_count()
79 depths[1] = node->ports[i]->max_depth; in update_hop_count()
82 node->max_depth = depths[0] + 1; in update_hop_count()
83 node->max_hops = max(max_child_hops, depths[0] + depths[1] + 2); in update_hop_count()
105 struct fw_node *node, *child, *local_node, *irm_node; in build_tree() local
112 node = NULL; in build_tree()
185 node = fw_node_create(self_id_sequence[0], total_port_count, card->color); in build_tree()
186 if (node == NULL) { in build_tree()
192 local_node = node; in build_tree()
195 irm_node = node; in build_tree()
207 node->color = port_index; in build_tree()
211 node->ports[port_index] = child; in build_tree()
213 child->ports[child->color] = node; in build_tree()
235 list_add_tail(&node->link, &stack); in build_tree()
238 if (node->phy_speed == SCODE_BETA && parent_count + child_port_count > 1) in build_tree()
246 update_hop_count(node); in build_tree()
251 card->root_node = node; in build_tree()
260 struct fw_node * node,
267 struct fw_node *node, *next, *child, *parent; in for_each_fw_node() local
275 list_for_each_entry(node, &list, link) { in for_each_fw_node()
276 node->color = card->color; in for_each_fw_node()
278 for (i = 0; i < node->port_count; i++) { in for_each_fw_node()
279 child = node->ports[i]; in for_each_fw_node()
290 callback(card, node, parent); in for_each_fw_node()
293 list_for_each_entry_safe(node, next, &list, link) in for_each_fw_node()
294 fw_node_put(node); in for_each_fw_node()
298 struct fw_node *node, struct fw_node *parent) in report_lost_node() argument
300 fw_node_event(card, node, FW_NODE_DESTROYED); in report_lost_node()
301 fw_node_put(node); in report_lost_node()
308 struct fw_node *node, struct fw_node *parent) in report_found_node() argument
310 int b_path = (node->phy_speed == SCODE_BETA); in report_found_node()
314 node->max_speed = parent->max_speed < node->phy_speed ? in report_found_node()
315 parent->max_speed : node->phy_speed; in report_found_node()
316 node->b_path = parent->b_path && b_path; in report_found_node()
318 node->max_speed = node->phy_speed; in report_found_node()
319 node->b_path = b_path; in report_found_node()
322 fw_node_event(card, node, FW_NODE_CREATED); in report_found_node()