The system assigns an instance number to each device. The driver may not reliably predict the value of the instance number assigned to a particular device. The driver should retrieve the particular instance number that has been assigned by calling ddi_get_instance(9F), as shown in Example 5-4.
Instance numbers are derived in an implementation-specific manner from different properties for the different device types. The following properties are used to derive instance numbers:
The reg property is used for SBus, PCI, VMEbus, ISA, EISA, and MCA devices. Non-self-identifying device drivers provide this property in the hardware configuration file. See sbus(4), pci(4), isa(4), and vme(4).
The target and lun properties are used for SCSI target devices. These are provided in the hardware configuration file. See scsi(4).
The instance property is used for pseudo-devices. This is provided in the hardware configuration file. See pseudo(4).
Once an instance number has been assigned to a particular physical device by the system, it stays the same even across reconfiguration and reboot. Because of this, instance numbers seen by a driver may not appear to be in consecutive order.