hwi_find_device()

Find the offset in the system page of a device

Synopsis:

#include <drvr/hwinfo.h>

unsigned hwi_find_device( const char *device_name,
                          unsigned unit );

Arguments:

device_name
The name of the device.
unit
The instance of the device.

Library:

libdrvr

Use the -l drvr option to qcc to link against this library.

Description:

If the unit instance of device_name has been added to the hwinfo section of the syspage, hwi_find_device() returns its offset. This function ensures that the device_name found is in fact a device.

If the same device (by name) exists on multiple buses, you can identify the bus on which each device instance resides with hwi_find_devicebus().

The hwi_find_device() function is basically a wrapper hwi_find_item() that allows for a specific item instance to be returned. It differs from hwi_find_item() in that it resolves (all) synonym names (aliases) to a real device.

Returns:

The hwinfo section offset, or HWI_NULL_OFF if the device instance doesn't exist.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes