hwiattr_get(), hwiattr_get_*()

Get attributes of a bus or device


#include <drvr/hwinfo.h>

/* General-purpose function */
int hwiattr_get( unsigned hwi_off, hwiattr_t *hwiattr );

/* Bus attribute functions */
int hwiattr_get_spi( unsigned hwi_off, hwiattr_spi_t *hwiattr );


The offset into the hwinfo section of the system page for the device, which you can get by calling hwi_find_device().
A pointer to a location where the function can store the requested attribute. The type of the pointer depends on which function you call.



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


These functions retrieve the attributes for the bus or device identified by hwi_off and fill in the hwiattr structure.

The hwiattr_get() function is the generic function, so it must determine the type of the bus or device from hwi_off. It's always faster to call the specific hwiattr_get_*() function directly, as all the generic routine does is try to figure out which specific one to call:

For attributes of: Use:
SPI buses hwiattr_get_spi()


The result from the specific hwiattr_get_*() routine or EINVAL. The specific routines return EOK, or an errno error if an error occurs.


QNX Neutrino

Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

hwi_find(), hwi_find_bus(), hwi_find_device(), hwi_find_devicebus(), hwi_find_num_units(), hwi_find_unit(), hwi_tag_find(), hwitag_find_busattr(), hwitag_find_clkfreq(), hwitag_find_errata(), hwitag_find_ivec(), hwitag_find_nicaddr(), hwitag_find_phyaddr()