Lines Matching defs:node

102 	struct fw_node *node;
104 node = kzalloc(struct_size(node, ports, port_count), GFP_ATOMIC);
105 if (node == NULL)
108 node->color = color;
109 node->node_id = LOCAL_BUS | SELF_ID_PHY_ID(sid);
110 node->link_on = SELF_ID_LINK_ON(sid);
111 node->phy_speed = SELF_ID_PHY_SPEED(sid);
112 node->initiated_reset = SELF_ID_PHY_INITIATOR(sid);
113 node->port_count = port_count;
115 refcount_set(&node->ref_count, 1);
116 INIT_LIST_HEAD(&node->link);
118 return node;
122 * Compute the maximum hop count for this node and it's children. The
124 * two nodes in the subtree rooted at this node. We need this for
126 * build_tree() below, this is fairly easy to do: for each node we
129 * two cases: either the path goes through this node, in which case
135 static void update_hop_count(struct fw_node *node)
141 for (i = 0; i < node->port_count; i++) {
142 if (node->ports[i] == NULL)
145 if (node->ports[i]->max_hops > max_child_hops)
146 max_child_hops = node->ports[i]->max_hops;
148 if (node->ports[i]->max_depth > depths[0]) {
150 depths[0] = node->ports[i]->max_depth;
151 } else if (node->ports[i]->max_depth > depths[1])
152 depths[1] = node->ports[i]->max_depth;
155 node->max_depth = depths[0] + 1;
156 node->max_hops = max(max_child_hops, depths[0] + depths[1] + 2);
174 struct fw_node *node, *child, *local_node, *irm_node;
182 node = NULL;
213 * start of the child nodes for this node.
223 node = fw_node_create(q, port_count, card->color);
224 if (node == NULL) {
230 local_node = node;
233 irm_node = node;
242 * parent node at this time, so we
243 * temporarily abuse node->color for
245 * node->ports array where the parent
246 * node should be. Later, when we
247 * handle the parent node, we fix up
251 node->color = i;
255 node->ports[i] = child;
258 * child node.
260 child->ports[child->color] = node;
268 * Check that the node reports exactly one parent
274 fw_err(card, "parent port inconsistency for node %d: "
279 /* Pop the child nodes off the stack and push the new node. */
281 list_add_tail(&node->link, &stack);
284 if (node->phy_speed == SCODE_BETA &&
295 update_hop_count(node);
301 card->root_node = node;
310 struct fw_node * node,
317 struct fw_node *node, *next, *child, *parent;
325 list_for_each_entry(node, &list, link) {
326 node->color = card->color;
328 for (i = 0; i < node->port_count; i++) {
329 child = node->ports[i];
340 callback(card, node, parent);
343 list_for_each_entry_safe(node, next, &list, link)
344 fw_node_put(node);
348 struct fw_node *node, struct fw_node *parent)
350 fw_node_event(card, node, FW_NODE_DESTROYED);
351 fw_node_put(node);
358 struct fw_node *node, struct fw_node *parent)
360 int b_path = (node->phy_speed == SCODE_BETA);
364 node->max_speed = parent->max_speed < node->phy_speed ?
365 parent->max_speed : node->phy_speed;
366 node->b_path = parent->b_path && b_path;
368 node->max_speed = node->phy_speed;
369 node->b_path = b_path;
372 fw_node_event(card, node, FW_NODE_CREATED);
450 * connected node for further
470 * One or more node were connected to