Determine which instance of a device an offset corresponds to
#include <drvr/hwinfo.h> int hwi_find_unit (unsigned hwi_off );
libdrvr
Use the -l drvr option to qcc to link against this library.
Multiple instances of a device or bus may exist in the hwinfo section of the system page. The hwi_find_unit() function determines which instance of the item hwi_off is.
Note that this routine resolves all synonyms and returns the instance of a real device or bus, not the instance of a synonym name. For example, if the second instance of synonym name “foo” resolves to the fourth instance of the real device “bar”, hwi_find_unit() returns 3 (base 0 instance numbering).
The device or bus instance (or unit #, base 0) or -1 on error.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
hwi_find(), hwi_find_bus(), hwi_find_device(), hwi_find_devicebus(), hwi_find_num_units(), hwi_tag_find(), hwiattr_get(), hwiattr_get_*(), hwitag_find_busattr(), hwitag_find_clkfreq(), hwitag_find_errata(), hwitag_find_ivec(), hwitag_find_nicaddr(), hwitag_find_phyaddr()