Lines Matching defs:node

112 static int s1394_alloc_cfgrom(s1394_hal_t *hal, s1394_node_t *node,
158 static int s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node,
524 * Allocates config rom for the node. Sets CFGROM_NEW_ALLOC bit in the
525 * node cfgrom state. Drops topology_tree_mutex around the calls to
530 s1394_alloc_cfgrom(s1394_hal_t *hal, s1394_node_t *node, s1394_status_t *status)
545 ASSERT(node->cfgrom == NULL || (node->cfgrom != NULL &&
546 CFGROM_GEN_CHANGED(node) == B_TRUE));
549 * if node matched, either cfgrom has to be NULL or link should be
550 * off in the last matched node or config rom generations changed.
552 ASSERT(NODE_MATCHED(node) == B_FALSE || (NODE_MATCHED(node) == B_TRUE &&
553 (node->cfgrom == NULL || LINK_ACTIVE(node->old_node) == B_FALSE) ||
554 CFGROM_GEN_CHANGED(node) == B_TRUE));
567 node->cfgrom = cfgrom;
568 node->cfgrom_size = IEEE1394_CONFIG_ROM_QUAD_SZ;
569 SET_CFGROM_NEW_ALLOC(node);
573 node_num, node->node_num, tnf_opaque, cfgrom, cfgrom);
582 s1394_free_cfgrom(s1394_hal_t *hal, s1394_node_t *node,
586 ASSERT(node->cfgrom != NULL);
594 * new node.
596 s1394_node_t *onode = node->old_node;
598 if (NODE_MATCHED(node) == B_TRUE && onode->cfgrom != NULL)
599 ASSERT(onode->cfgrom == node->cfgrom);
604 node->node_num, tnf_opaque, old_cfgrom, onode->cfgrom,
605 tnf_opaque, cfgrom, node->cfgrom);
608 node->cfgrom)
611 kmem_free(node->cfgrom, IEEE1394_CONFIG_ROM_SZ);
613 node->cfgrom = NULL;
616 CLEAR_CFGROM_STATE(node);
622 tnf_int, node_num, node->node_num,
623 tnf_opaque, cfgrom, node->cfgrom);
625 ASSERT(CFGROM_NEW_ALLOC(node) == B_TRUE);
626 kmem_free(node->cfgrom, IEEE1394_CONFIG_ROM_SZ);
627 CLEAR_CFGROM_NEW_ALLOC(node);
628 node->cfgrom = NULL;
629 CLEAR_CFGROM_STATE(node);
636 tnf_int, node_num, node->node_num,
637 tnf_opaque, cfgrom, node->cfgrom);
638 kmem_free(node->cfgrom, IEEE1394_CONFIG_ROM_SZ);
639 node->cfgrom = NULL;
640 CLEAR_CFGROM_STATE(node);
649 * Copies config rom info from "from" node to "to" node. Clears
651 * acts as a reference count. If set, only the node in the current tree
652 * has a pointer to it; if clear, both the node in the current tree as
653 * well as the corresponding node in the old tree point to the same memory).
710 s1394_read_bus_info_blk(s1394_hal_t *hal, s1394_node_t *node,
718 ASSERT(LINK_ACTIVE(node) == B_TRUE);
720 node_num = node->node_num;
753 if (node->cfgrom == NULL && s1394_alloc_cfgrom(hal, node, status) !=
766 * if this is a matched node, read quad 2 (node capabilities) to
769 quadlet = CFGROM_BIB_READ(node) ? IEEE1212_NODE_CAP_QUAD : 0;
793 node_num, node_num, tnf_int, parsed, CFGROM_PARSED(node), tnf_int,
794 matched, NODE_MATCHED(node), tnf_int, visited,
795 NODE_VISITED(node), tnf_int, generation_changed,
796 CFGROM_GEN_CHANGED(node));
798 SETUP_QUAD_READ(node, 1, quadlet, 1);
826 * Attempts to start reading node->cfgrom_quad_to_read quadlet. Increments
831 s1394_read_rest_of_cfgrom(s1394_hal_t *hal, s1394_node_t *node,
835 uchar_t node_num = node->node_num;
838 ASSERT(LINK_ACTIVE(node) == B_TRUE);
880 node->node_num);
883 node->cfgrom_quad_to_read, cmd->cmd_addr);
884 SETUP_QUAD_READ(node, 1, node->cfgrom_quad_to_read, 1);
923 int node;
951 /* Send requests for all new node config ROM 0 */
952 for (node = 0; node < number_of_nodes; node++) {
961 nnode = &hal->topology_tree[node];
963 /* if node matched, onode should be non NULL */
968 * Read bus info block if it is a brand new node (MATCHED is 0)
974 if ((node != hal_node_num) &&
1003 * node going away.
1012 "link lost power", tnf_int, node,
1013 node, tnf_int, onode,
1018 if (node == hal_node_num) {
1061 * did not change, move targets hanging off the old node to the current
1062 * node. If config rom generations change, alloc new config rom and start
1064 * required), mark the node as CFGROM_BIB_READ. If config rom read fails
1069 * indicate not done with the node yet).
1080 s1394_node_t *node, *onode;
1106 node = &hal->topology_tree[node_num];
1115 CFGROM_BIB_READ(node)) {
1121 * node->old_node can be NULL if this is a new node &
1124 onode = node->old_node;
1125 if (CONFIG_ROM_GEN(node->cfgrom) == cur_gen) {
1127 if (CFGROM_PARSED(node) == B_TRUE) {
1133 node->target_list = t;
1135 t->on_node = node;
1141 SET_NODE_MATCHED(node);
1144 node->cfgrom_quad_to_read =
1154 CONFIG_ROM_GEN(node->cfgrom));
1156 SET_CFGROM_GEN_CHANGED(node);
1163 CLEAR_CFGROM_BIB_READ(node);
1171 if (s1394_alloc_cfgrom(hal, node, &status) !=
1186 * node or if config rom generation changed.
1193 * We identify a remote Rio by the node vendor id part of
1198 node->cfgrom_size = IEEE1394_BIB_QUAD_SZ;
1199 node->cfgrom_valid_size = IEEE1394_BIB_QUAD_SZ;
1208 node->cfgrom[quadlet++] = data;
1213 CFGROM_GET_READ_DELAY(node, readdelay);
1214 SETUP_QUAD_READ(node, 1, quadlet, 1);
1249 if (CFGROM_NEW_ALLOC(node) ==
1252 node,
1256 node);
1265 SET_CFGROM_BIB_READ(node);
1266 if (node->cfgrom_size == IEEE1394_BIB_QUAD_SZ)
1267 SET_CFGROM_ALL_READ(node);
1268 node->cfgrom_quad_to_read = quadlet;
1274 tnf_int, node_num, node->node_num,
1275 tnf_opaque, cfgrom, node->cfgrom);
1280 node->cfgrom_read_fails++;
1281 BUMP_CFGROM_READ_DELAY(node);
1284 if (node->cfgrom_read_fails < s1394_cfgrom_read_retry_cnt) {
1285 CFGROM_GET_READ_DELAY(node, readdelay);
1286 SETUP_QUAD_READ(node, 0, quadlet, 1);
1318 if (CFGROM_NEW_ALLOC(node) == B_TRUE) {
1319 s1394_free_cfgrom(hal, node,
1322 CLEAR_CFGROM_STATE(node);
1334 node->cfgrom);
1335 if (CFGROM_NEW_ALLOC(node) == B_TRUE) {
1336 s1394_free_cfgrom(hal, node,
1339 CLEAR_CFGROM_STATE(node);
1352 "done with node", tnf_int, node_num, node_num);
1370 * and new topology trees to identify which node moved where. Processes
1527 * done with the node (with or withoug crc errors), returns
1529 * indicate not done with the node yet).
1534 s1394_node_t *node;
1545 * we end up here if this is a brand new node or if it is a known node
1566 node = &hal->topology_tree[node_num];
1570 ASSERT(CFGROM_BIB_READ(node) == B_TRUE);
1572 node->cfgrom[quadlet] = data;
1574 if (s1394_calc_next_quad(hal, node, quadlet, &quadlet) != 0) {
1576 * Done with this node. Mark config rom valid and
1577 * update the devinfo tree for this node.
1581 "all read", tnf_int, node_num, node->node_num,
1582 tnf_opaque, cfgrom, node->cfgrom, tnf_int, quadlet,
1585 node->cfgrom_valid_size = quadlet + 1;
1586 if (s1394_valid_cfgrom(hal, node) == B_TRUE) {
1587 SET_CFGROM_ALL_READ(node);
1590 s1394_free_cfgrom(hal, node,
1594 CFGROM_GET_READ_DELAY(node, readdelay);
1595 SETUP_QUAD_READ(node, 1, quadlet, 1);
1603 tnf_int, node_num, node->node_num,
1620 node->cfgrom_valid_size = quadlet;
1621 if (s1394_valid_cfgrom(hal, node) ==
1623 SET_CFGROM_ALL_READ(node);
1626 s1394_free_cfgrom(hal, node,
1637 node->cfgrom_read_fails++;
1638 BUMP_CFGROM_READ_DELAY(node);
1641 if (node->cfgrom_read_fails < s1394_cfgrom_read_retry_cnt) {
1642 CFGROM_GET_READ_DELAY(node, readdelay);
1644 SETUP_QUAD_READ(node, 0, quadlet, 1);
1651 tnf_int, node_num, node->node_num,
1666 tnf_int, node_num, node->node_num,
1668 tnf_opaque, cfgrom, node->cfgrom);
1669 node->cfgrom_valid_size = quadlet + 1;
1670 if (s1394_valid_cfgrom(hal, node) ==
1672 SET_CFGROM_ALL_READ(node);
1675 s1394_free_cfgrom(hal, node,
1690 node->cfgrom);
1692 node->cfgrom_valid_size = quadlet + 1;
1693 if (s1394_valid_cfgrom(hal, node) == B_TRUE) {
1694 SET_CFGROM_ALL_READ(node);
1697 s1394_free_cfgrom(hal, node,
1711 "done with a node", tnf_int, node_num, node_num);
1722 if (s1394_update_devinfo_tree(hal, node) != DDI_SUCCESS) {
1754 s1394_node_t *node;
1759 node = &hal->topology_tree[node_num];
1760 quadlet = node->cfgrom_quad_to_read;
1933 * a node in the old topology tree by comparing GUIDs. If a match is found
1934 * the old_node field of the current node and cur_node field of the old
1979 /* offline the new node that last matched */
1981 /* and make the current new node invalid */
2017 * hanging off the old node, prior to freeing up old
2020 * the old node (this helps in picking up further
2096 * attempt to match each node in the current topology tree with the a
2097 * node in the old topology tree. If unable to relock the tree, returns
2103 int node;
2112 for (node = 0; node < hal->number_of_nodes; node++) {
2113 nnode = &hal->topology_tree[node];
2119 * Skip if node matched. If config rom generations
2152 s1394_valid_cfgrom(s1394_hal_t *hal, s1394_node_t *node)
2160 ASSERT(node->cfgrom);
2169 quad0 = node->cfgrom[0];
2174 if (node->cfgrom_valid_size < crc_len + 1) {
2177 tnf_uint, node_guid_hi, node->node_guid_hi,
2178 tnf_uint, node_guid_lo, node->node_guid_lo,
2180 tnf_uint, valid_size, node->cfgrom_valid_size);
2186 CRC = s1394_CRC16(&node->cfgrom[1], crc_len);
2189 CRC_old = s1394_CRC16_old(&node->cfgrom[1], crc_len);
2193 tnf_uint, node_guid_hi, node->node_guid_hi,
2194 tnf_uint, node_guid_lo, node->node_guid_lo,
2195 tnf_uint, node_num, node->node_num,
2203 "!Bad CRC in config rom (node's GUID %08x%08x)",
2204 node->node_guid_hi, node->node_guid_lo);
2208 tnf_uint, node_guid_hi, node->node_guid_hi,
2209 tnf_uint, node_guid_lo, node->node_guid_lo,
2218 "", tnf_uint, node_num, node->node_num, tnf_uint, crc_len, crc_len,
2231 s1394_valid_dir(s1394_hal_t *hal, s1394_node_t *node,
2267 tnf_uint, node_guid_hi, node->node_guid_hi,
2268 tnf_uint, node_guid_lo, node->node_guid_lo,
2269 tnf_uint, node_num, node->node_num,
2278 tnf_uint, node_guid_hi, node->node_guid_hi,
2279 tnf_uint, node_guid_lo, node->node_guid_lo,
2280 tnf_uint, node_num, node->node_num,
2290 tnf_uint, node_guid_hi, node->node_guid_hi,
2291 tnf_uint, node_guid_lo, node->node_guid_lo,
2292 tnf_uint, node_num, node->node_num, tnf_uint, key, key);
2536 * Its purpose is to determine whether the local node is capable of
2582 * chosen yet). Then, if there is more than one node on the 1394 bus,
2644 /* Make sure the root node is cycle master capable */
2646 /* Make the local node root */
2838 /* Is this target on a node? */
2878 * is used to determine whether or not the current root node on the
2880 * is not capable of being cycle master and a new root node must be
2897 /* Get a pointer to the root node */
2980 /* Root node needs to be changed */
3190 * directories in the node. When the first quad of a directory (the
3201 s1394_calc_next_quad(s1394_hal_t *hal, s1394_node_t *node, uint32_t quadlet,
3209 S1394_TNF_SL_HOTPLUG_STACK, "", tnf_uint, node_num, node->node_num,
3210 tnf_uint, quadlet, quadlet, tnf_int, cfgrom_size, node->cfgrom_size,
3213 if (((quadlet + 1) >= node->cfgrom_size) ||
3214 (CFGROM_SIZE_IS_CRCSIZE(node) == B_TRUE && (quadlet + 1) >=
3215 node->cfgrom_valid_size)) {
3221 if (s1394_turn_off_dir_stack != 0 || CFGROM_DIR_STACK_OFF(node) ==
3228 tnf_opaque, cfgrom, node->cfgrom);
3232 data = node->cfgrom[quadlet];
3235 node->dir_stack_top = -1;
3236 node->expected_dir_quad = quadlet;
3237 node->expected_type = IEEE1212_IMMEDIATE_TYPE;
3246 if (node->expected_dir_quad == quadlet) {
3252 SET_CFGROM_DIR_STACK_OFF(node);
3255 node->cur_dir_start = quadlet;
3256 node->cur_dir_size = IEEE1212_DIR_LEN(data);
3257 node->expected_dir_quad = 0;
3272 if (quadlet == node->cur_dir_start + node->cur_dir_size) {
3277 if (node->expected_type == IEEE1212_LEAF_TYPE) {
3278 node->expected_type = IEEE1212_IMMEDIATE_TYPE;
3287 ptr = &node->cfgrom[node->cur_dir_start];
3299 if (s1394_valid_dir(hal, node, key, ptr) == B_FALSE) {
3300 SET_CFGROM_DIR_STACK_OFF(node);
3302 SET_CFGROM_SIZE_IS_CRCSIZE(node);
3303 node->cfgrom_valid_size =
3304 ((node->cfgrom[0] >>
3311 node->cfgrom_valid_size);
3320 i = node->cur_dir_start + 1;
3323 node->cur_dir_start + node->cur_dir_size; i++) {
3324 data = node->cfgrom[i];
3340 top = ++node->dir_stack_top;
3349 SET_CFGROM_DIR_STACK_OFF(node);
3362 node->dir_stack[top].dir_start =
3363 node->cur_dir_start;
3364 node->dir_stack[top].dir_size =
3365 node->cur_dir_size;
3366 node->dir_stack[top].dir_next_quad =
3370 node->expected_dir_quad = quadlet;
3371 node->expected_type = type;
3378 if ((i > node->cur_dir_start + node->cur_dir_size) ||
3384 if (node->dir_stack_top >= 0) {
3390 tnf_int, top, node->dir_stack_top);
3391 top = node->dir_stack_top--;
3392 node->cur_dir_start =
3393 node->dir_stack[top].dir_start;
3394 node->cur_dir_size =
3395 node->dir_stack[top].dir_size;
3396 i = node->dir_stack[top].dir_next_quad;