Lines Matching refs:node

258 	link_cache_t *node;  in vnic_unregister()  local
264 node = cache_head.vc_next; in vnic_unregister()
265 while (node != &cache_tail) { in vnic_unregister()
266 if (rcm_unregister_interest(hd, node->vc_resource, 0) in vnic_unregister()
270 node->vc_resource); in vnic_unregister()
274 cache_remove(node); in vnic_unregister()
275 node_free(node); in vnic_unregister()
276 node = cache_head.vc_next; in vnic_unregister()
307 link_cache_t *node; in vnic_offline() local
313 node = cache_lookup(hd, rsrc, CACHE_REFRESH); in vnic_offline()
314 if (node == NULL) { in vnic_offline()
325 if (vnic_consumer_offline(hd, node, errorp, flags, info) == in vnic_offline()
330 vnic_log_err(node->vc_linkid, errorp, in vnic_offline()
344 if (vnic_offline_vnic(node, VNIC_OFFLINED, CACHE_NODE_OFFLINED) != in vnic_offline()
346 vnic_online_vnic(node); in vnic_offline()
347 vnic_log_err(node->vc_linkid, errorp, "offline failed"); in vnic_offline()
365 link_cache_t *node; in vnic_undo_offline() local
370 node = cache_lookup(hd, rsrc, CACHE_NO_REFRESH); in vnic_undo_offline()
371 if (node == NULL) { in vnic_undo_offline()
379 if (!(node->vc_state & CACHE_NODE_OFFLINED)) { in vnic_undo_offline()
380 vnic_log_err(node->vc_linkid, errorp, "link not offlined"); in vnic_undo_offline()
386 vnic_online_vnic(node); in vnic_undo_offline()
391 vnic_consumer_online(hd, node, errorp, flags, info); in vnic_undo_offline()
393 node->vc_state &= ~CACHE_NODE_OFFLINED; in vnic_undo_offline()
400 vnic_online_vnic(link_cache_t *node) in vnic_online_vnic() argument
409 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) { in vnic_online_vnic()
430 vnic_offline_vnic(link_cache_t *node, uint32_t flags, cache_node_state_t state) in vnic_offline_vnic() argument
437 node->vc_resource, flags, state); in vnic_offline_vnic()
442 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) { in vnic_offline_vnic()
459 node->vc_state |= state; in vnic_offline_vnic()
471 link_cache_t *node; in vnic_get_info() local
476 node = cache_lookup(hd, rsrc, CACHE_REFRESH); in vnic_get_info()
477 if (node == NULL) { in vnic_get_info()
485 *usagep = vnic_usage(node); in vnic_get_info()
534 vnic_consumer_remove(rcm_handle_t *hd, link_cache_t *node, uint_t flags, in vnic_consumer_remove() argument
542 node->vc_resource); in vnic_consumer_remove()
544 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) { in vnic_consumer_remove()
576 link_cache_t *node; in vnic_remove() local
582 node = cache_lookup(hd, rsrc, CACHE_NO_REFRESH); in vnic_remove()
583 if (node == NULL) { in vnic_remove()
592 cache_remove(node); in vnic_remove()
595 rv = vnic_consumer_remove(hd, node, flags, info); in vnic_remove()
596 node_free(node); in vnic_remove()
674 vnic_usage(link_cache_t *node) in vnic_usage() argument
686 rcm_log_message(RCM_TRACE2, "VNIC: usage(%s)\n", node->vc_resource); in vnic_usage()
689 if ((status = dladm_datalink_id2info(dld_handle, node->vc_linkid, NULL, in vnic_usage()
693 node->vc_resource, dladm_status2str(status, errmsg)); in vnic_usage()
697 if (node->vc_state & CACHE_NODE_OFFLINED) in vnic_usage()
706 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) in vnic_usage()
715 node->vc_resource, strerror(errno)); in vnic_usage()
720 if (node->vc_state & CACHE_NODE_OFFLINED) { in vnic_usage()
723 node->vc_resource, buf); in vnic_usage()
727 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) { in vnic_usage()
735 node->vc_resource, vnic->dlv_vnic_id, in vnic_usage()
747 node->vc_resource, buf); in vnic_usage()
767 link_cache_t *node; in cache_lookup() local
779 node = cache_head.vc_next; in cache_lookup()
780 for (; node != &cache_tail; node = node->vc_next) { in cache_lookup()
781 if (strcmp(rsrc, node->vc_resource) == 0) { in cache_lookup()
784 return (node); in cache_lookup()
794 node_free(link_cache_t *node) in node_free() argument
798 if (node != NULL) { in node_free()
799 free(node->vc_resource); in node_free()
802 for (vnic = node->vc_vnic; vnic != NULL; vnic = next) { in node_free()
806 free(node); in node_free()
814 cache_insert(link_cache_t *node) in cache_insert() argument
819 node->vc_next = cache_head.vc_next; in cache_insert()
820 node->vc_prev = &cache_head; in cache_insert()
822 node->vc_next->vc_prev = node; in cache_insert()
823 node->vc_prev->vc_next = node; in cache_insert()
830 cache_remove(link_cache_t *node) in cache_remove() argument
833 node->vc_next->vc_prev = node->vc_prev; in cache_remove()
834 node->vc_prev->vc_next = node->vc_next; in cache_remove()
835 node->vc_next = NULL; in cache_remove()
836 node->vc_prev = NULL; in cache_remove()
852 link_cache_t *node; in vnic_update() local
891 node = cache_lookup(hd, rsrc, CACHE_NO_REFRESH); in vnic_update()
892 if (node != NULL) { in vnic_update()
901 if ((node = calloc(1, sizeof (link_cache_t))) == NULL) { in vnic_update()
908 node->vc_resource = rsrc; in vnic_update()
909 node->vc_vnic = NULL; in vnic_update()
910 node->vc_linkid = vnic_attr.va_link_id; in vnic_update()
911 node->vc_state |= CACHE_NODE_NEW; in vnic_update()
915 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) { in vnic_update()
928 free(node); in vnic_update()
933 vnic->dlv_next = node->vc_vnic; in vnic_update()
935 if (node->vc_vnic != NULL) in vnic_update()
936 node->vc_vnic->dlv_prev = vnic; in vnic_update()
937 node->vc_vnic = vnic; in vnic_update()
940 node->vc_state &= ~CACHE_NODE_STALE; in vnic_update()
943 cache_insert(node); in vnic_update()
976 link_cache_t *node, *nnode; in cache_update() local
985 node = cache_head.vc_next; in cache_update()
986 for (; node != &cache_tail; node = node->vc_next) { in cache_update()
987 node->vc_state |= CACHE_NODE_STALE; in cache_update()
988 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) in cache_update()
999 for (node = cache_head.vc_next; node != &cache_tail; node = nnode) { in cache_update()
1002 for (vnic = node->vc_vnic; vnic != NULL; vnic = next) { in cache_update()
1010 node->vc_vnic = next; in cache_update()
1018 nnode = node->vc_next; in cache_update()
1019 if (node->vc_state & CACHE_NODE_STALE) { in cache_update()
1020 (void) rcm_unregister_interest(hd, node->vc_resource, in cache_update()
1023 node->vc_resource); in cache_update()
1024 assert(node->vc_vnic == NULL); in cache_update()
1025 cache_remove(node); in cache_update()
1026 node_free(node); in cache_update()
1030 if (!(node->vc_state & CACHE_NODE_NEW)) in cache_update()
1033 if (rcm_register_interest(hd, node->vc_resource, 0, NULL) != in cache_update()
1037 node->vc_resource); in cache_update()
1041 node->vc_resource); in cache_update()
1042 node->vc_state &= ~CACHE_NODE_NEW; in cache_update()
1056 link_cache_t *node; in cache_free() local
1061 node = cache_head.vc_next; in cache_free()
1062 while (node != &cache_tail) { in cache_free()
1063 cache_remove(node); in cache_free()
1064 node_free(node); in cache_free()
1065 node = cache_head.vc_next; in cache_free()
1121 vnic_consumer_online(rcm_handle_t *hd, link_cache_t *node, char **errorp, in vnic_consumer_online() argument
1128 node->vc_resource); in vnic_consumer_online()
1130 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) { in vnic_consumer_online()
1150 vnic_consumer_offline(rcm_handle_t *hd, link_cache_t *node, char **errorp, in vnic_consumer_offline() argument
1158 node->vc_resource); in vnic_consumer_offline()
1160 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) { in vnic_consumer_offline()
1172 vnic_consumer_online(hd, node, errorp, flags, info); in vnic_consumer_offline()
1185 link_cache_t *node; in vnic_notify_new_vnic() local
1194 if ((node = cache_lookup(hd, rsrc, CACHE_REFRESH)) == NULL) { in vnic_notify_new_vnic()
1206 for (vnic = node->vc_vnic; vnic != NULL; vnic = vnic->dlv_next) { in vnic_notify_new_vnic()
1224 RCM_RESOURCE_LINK_NEW, node->vc_resource); in vnic_notify_new_vnic()
1242 link_cache_t *node; in vnic_consumer_notify() local
1255 if ((node = cache_lookup(hd, rsrc, CACHE_NO_REFRESH)) != NULL) { in vnic_consumer_notify()
1256 (void) vnic_offline_vnic(node, VNIC_STALE, in vnic_consumer_notify()
1315 link_cache_t *node; in vnic_configure() local
1325 if (((node = cache_lookup(hd, rsrc, CACHE_REFRESH)) != NULL) && in vnic_configure()
1326 (!(node->vc_state & CACHE_NODE_OFFLINED))) { in vnic_configure()