Lines Matching defs:instance

44 #include <sys/instance.h>
65 static int in_inuse(int instance, char *name);
72 static int in_pathin(char *cp, int instance, char *bname, struct bind **args);
84 * This plus devnames defines the entire software state of the instance world.
87 in_node_t *ins_root; /* the root of our instance tree */
96 boolean_t ins_dirty; /* instance info needs flush */
104 * device nodes used to track instance number assignments.
106 * by a linked list of in_drv_t nodes, each with an instance assignment
110 * IN_UNKNOWN: Each node created in this state. The instance number of
112 * IN_PROVISIONAL: When a node is assigned an instance number in
135 * Path to instance file magic string used for first time boot after
153 * Only one thread is allowed to change the state of the instance
168 * Create the root node, instance zallocs to 0.
193 cmn_err(CE_NOTE, "rebuilding device instance data");
196 cmn_err(CE_NOTE, "using backup instance data in %s", file);
202 * parse the file into the instance tree
216 "?Using default device instance data\n");
224 * unknown at this point, we cannot place the instance
225 * number in the instance tree. This will be done at
252 * The preassign instance numbers are not fully
343 /* use preassigned instance if available */
351 * Return 1 if instance block was assigned for the path.
353 * For multi-port NIC cards, sequential instance assignment across all
355 * same as the instance number, and the ppa is used in the NIC's public
361 * support sequential instance assignment accross all ports, without
363 * hack to allocate instance numbers in contiguous blocks based on
374 * used to guarantee sequential instance number assignment.
376 * ddi-instance-blocks ="ib-FJSVe4ca", "ib-FJSVe4ta", "ib-generic";
384 * The value of the 'ddi-instance-blocks' property references a series
386 * defines a single 'instance block'. The 'instance block' describes
388 * called an 'instance path'. The 'instance block' property value is a
389 * series of 'instance paths'. The number of 'instance paths' in an
390 * 'instance block' defines the size of the instance block, and the
391 * ordering of the 'instance paths' defines the instance number
392 * assignment order for paths going through the 'instance block'.
394 * In the instance assignment code below, if a (path, driver) that
395 * currently has no instance number has a path that goes through an
396 * 'instance block', then block instance number allocation occurs. The
397 * block allocation code will find a sequential set of unused instance
398 * numbers, and assign instance numbers for all the paths in the
399 * 'instance block'. Each path is assigned a persistent instance
406 char **ibn; /* instance block names */
407 uint_t nibn; /* number of instance block names */
414 char **ibp; /* instance block paths */
415 uint_t nibp; /* number of paths in instance block */
417 int ibplen; /* length of instance block path */
428 * Check to see if we need to allocate a block of contiguous instance
429 * numbers by looking for the 'ddi-instance-blocks' property.
432 "ddi-instance-blocks", &ibn, &nibn) != DDI_SUCCESS)
433 return (0); /* no instance block needed */
453 /* loop through instance block names */
458 /* lookup instance block */
463 "no devinition for instance block '%s' in %s.conf",
468 /* Does 'path' go through this instance block? */
480 continue; /* no try next instance block */
486 * determine where we splice in instance paths and verify
493 "path %d through instance block '%s' from "
503 /* allocate the instance block - no more failures */
530 /* our path did not go through any of of the instance blocks */
537 * Look up an instance number for a dev_info node, and assign one if it does
557 * If this is a pseudo-device, use the instance number
559 * not needed since the instance tree is not used.
566 * Only one thread is allowed to change the state of the instance
572 * Look for instance node, allocate one if not found
591 ddi_err(DER_MODE, dip, "devinfo and instance node (%p) "
662 * produce the path to the given instance of a major number.
674 /* look for the instance threaded off major */
680 /* produce path from the node that uses the instance */
692 * Allocate a sequential block of instance numbers for the specified driver,
693 * and return the base instance number of the block. The implementation
694 * depends on the list being sorted in ascending instance number sequence.
696 * next available instance number. When dn_instance is IN_SEARCHME, hole(s)
762 /* assign instance block of size 1 */
770 * This call causes us to *forget* the instance number we've generated
790 * If this is a pseudo-device, no instance number
802 * Only one thread is allowed to change the state of the instance
814 "wrong instance node: %p", (void *)np);
834 * This makes our memory of an instance assignment permanent
842 /* Don't make nulldriver instance assignments permanent */
859 * Only one thread is allowed to change the state of the instance
893 * Only one thread is allowed to change the state of the instance
902 * Hash instance list to devnames structure of major.
996 * Create a node specified by cp and assign it the given instance no.
999 in_pathin(char *cp, int instance, char *bname, struct bind **args)
1012 if (cp[0] != '/' || instance == -1 || bname == NULL) {
1014 "invalid instance file entry %s %d",
1015 cp, instance);
1028 "multiple instance number assignments for "
1034 if (in_inuse(instance, bname)) {
1036 "instance already in use: %s %d", cp, instance);
1042 dp->ind_instance = instance;
1289 * Returns true if instance no. is already in use by named driver
1292 in_inuse(int instance, char *name)
1311 if (dp->ind_instance == instance)
1334 * dnp->dn_inlist is sorted by instance number.
1335 * Adding a new instance entry may introduce holes,
1336 * set dn_instance to IN_SEARCHME so the next instance
1514 * Visit a node in the instance tree
1555 * A general interface for walking the instance tree,
1623 * to borrow and instance for them. However since they do
1624 * not expose their instance numbers it is safe to never