Lines Matching defs:instance

33  *	name="foo" parent="/pseudo" instance=0;
45 * name="foo" parent="/pseudo" instance=<n> valid-children="bar","baz";
53 * At some point in the future, it would be desirable to extend the instance
55 * or devfs to online nexus children of pseudo, auto-selecting an instance #,
56 * and the instance number selected would be preserved across reboot in
66 #include <sys/instance.h>
210 int instance;
223 * Save the devi for this instance in the soft_state data.
225 instance = ddi_get_instance(devi);
226 if (ddi_soft_state_zalloc(pseudonex_state, instance) != DDI_SUCCESS)
228 pnx_state = ddi_get_soft_state(pseudonex_state, instance);
231 if (ddi_create_minor_node(devi, "devctl", S_IFCHR, instance,
234 ddi_soft_state_free(pseudonex_state, instance);
245 int instance = ddi_get_instance(devi);
251 ddi_soft_state_free(pseudonex_state, instance);
259 int instance;
264 instance = getminor(*devp);
265 if (ddi_get_soft_state(pseudonex_state, instance) == NULL)
275 int instance;
280 instance = getminor(dev);
281 if (ddi_get_soft_state(pseudonex_state, instance) == NULL)
292 int instance;
295 instance = getminor(dev);
296 if ((pnx_state = ddi_get_soft_state(pseudonex_state, instance)) == NULL)
329 /* is this a duplicate instance? */
341 * major surgery on the instance assignment subsystem, to allow pseudonode
342 * instance assignment to be tracked there.
344 * To auto-assign an instance number, we exhaustively search the instance
345 * list for each possible instance number until we find one which is unused.
392 int instance = -1;
420 * Look up the "instance" property. If it does not exist,
421 * check to see if the "auto-assign-instance" property is set.
422 * If not, default to using instance 0; while not ideal, this
425 instance = ddi_prop_get_int(DDI_DEV_T_ANY, child,
426 DDI_PROP_DONTPASS, "instance", -1);
428 DDI_PROP_DONTPASS, "auto-assign-instance");
430 "pseudonex: DDI_CTLOPS_INITCHILD(instance=%d, "
431 "auto-assign=%d)", instance, auto_assign));
433 if (instance != -1 && auto_assign != 0) {
434 NDI_CONFIG_DEBUG((CE_NOTE, "both instance and "
435 "auto-assign-instance properties specified. "
440 if (instance == -1 && auto_assign == 0) {
441 /* default to instance 0 if not specified */
443 instance = 0;
447 * If an instance has been specified, determine if this
448 * instance is already in use; if we need to pick an instance,
452 if ((instance = pseudonex_auto_assign(child)) == -1) {
454 "auto-select instance for %s", childname));
458 "auto-selected instance for %s: %d",
459 childname, instance));
461 if (pseudonex_check_assignment(child, instance) ==
464 "Duplicate instance %d of node \"%s\" "
465 "ignored.", instance, childname));
469 "using fixed-assignment instance for %s: %d",
470 childname, instance));
474 * Attach the instance number to the node. This allows
476 * device, they will be named 'device@instance'. If this
477 * breaks programs, we may need to special-case instance 0
482 (void) snprintf(name, sizeof (name), "%d", instance);
483 DEVI(child)->devi_instance = instance;
493 "DDI_CTLOPS_UNINITCHILD(%s, instance=%d)",