Andrew Gallatin wrote:
> If I move a device (NIC) around in a Solaris machine, it takes
> on a new name (foo0 becomes foo1 becomes foo2, for example)
> each time I move it.
>
> Can somebody tell me where / how the numbers are assigned?  How do I
> reset them back to zero?
>   

Instance numbers are monotonically increasing and persistent. Once a 
unit is seen, the same driver at the same hardware location will always 
have that number. (Its tied to the device path in /devices, or in the 
kernel tree.)

> It doesn't seem to be a userspace (device alias) thing, as the
> different instances are reflected in my driver via ddi_get_instance(),
> and in the NIC instance as reported by ifconfig, dladm, etc.  I'm
> really curious how the kernel maps devices to instances.
>   

I believe there is logic in the kernel to synchronize this with 
/etc/path_to_inst, which is the initial database that is loaded on boot. 
Likely devfsadm also plays a role in this.

To clear the instance numbers, you may need to boot to alternate media, 
remove the entries from /etc/path_to_inst (after mounting the node), and 
then reboot. I've not tested that, but it *should* work.

But then again, why would you care about instance numbers changing? The 
reason they are persistent is to ensure that device names don't change 
e.g. when booting with slightly different hardware configs, or after 
performing dynamic reconfiguration, etc.

-- Garrett

_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to