Lines Matching refs:usage
40 * Define structures for a path-to-usage lookup table.
44 char *usage;
93 * RCM usage information and merge it into the snapshot.
112 /* Get RCM usage information */
122 /* If there is RCM usage information, merge it in */
284 * Lookup usage information for a set of resources from RCM.
303 /* Get usage information from RCM */
323 * First a lookup table is built to map lists of RCM usage to
336 /* Build a lookup table, mapping paths to usage information */
344 log_err("Unable to gather RCM usage.\n");
451 hp_node_t usage;
457 /* Only process device nodes (other nodes cannot have usage) */
468 /* Check the lookup table for associated usage */
477 /* Allocate a new usage node */
478 usage = (hp_node_t)calloc(1, sizeof (struct hp_node));
479 if (usage == NULL) {
480 log_err("Cannot allocate hotplug usage node.\n");
485 /* Initialize the usage node's contents */
486 usage->hp_type = HP_NODE_USAGE;
487 if ((usage->hp_name = strdup(entry->rsrc)) == NULL) {
488 log_err("Cannot allocate hotplug usage node name.\n");
489 free(usage);
493 if ((usage->hp_usage = strdup(entry->usage)) == NULL) {
494 log_err("Cannot allocate hotplug usage node info.\n");
495 free(usage->hp_name);
496 free(usage);
501 /* Link the usage node as a child of the device node */
502 usage->hp_parent = node;
503 usage->hp_sibling = node->hp_child;
504 node->hp_child = usage;
525 const char *usage;
557 * Extract RCM resource name and usage description.
562 ((usage = rcm_info_info(tuple)) == NULL)) {
563 log_err("RCM returned invalid resource or usage.\n");
584 /* Append current usage to entry list in the current slot */
601 ((entry->usage = strdup(usage)) == NULL)) {
644 if (entry->usage != NULL)
645 free(entry->usage);
692 * Compare two slots in the lookup table that maps paths to usage.