Find a bus attribute tag associated with a bus
Synopsis:
#include <drvr/hwinfo.h>
int hwitag_find_busattr( unsigned hwi_off,
unsigned *busattr_idx,
struct hwi_busattr *busattr );
Arguments:
- hwi_off
- The offset into the hwinfo section of the system page for the device,
which you can get by calling
hwi_find_device().
- busattr_idx
- The index of the bus attribute; see below.
- busattr
- A pointer to a struct hwi_busattr where the function can store the attribute.
Library:
libdrvr
Use the -l drvr option to
qcc
to link against this library.
Description:
You can use hwitag_find_busattr() to find one or more bus attribute tags associated
with the bus at hwi_off in the hwinfo section of the system page.
If the specified bus attribute tag exists and busattr isn't NULL, the
retrieved bus attributes are placed in *busattr.
Some buses contain multiple sets of attributes.
You can retrieve all of them by using the busattr_idx parameter as follows:
- On the first call, set *busattr_idx to 0.
The first bus attribute (if one exists) is returned in *busattr.
- You can then continue to call hwitag_find_busattr() with the same arguments until
NULL is returned.
- If you know that there's more than one set of bus attributes for the
specified bus, you can set *busattr_idx to the entry number of the desired attribute tag.
If that entry exists, it's returned.
For example, to obtain the third bus attribute for hwi_off, set
*busattr_idx to 2 (base-0 indexing applies).
- If you're interested only in the first attribute, you can pass NULL for
busattr_idx (which is the same as setting *busattr_idx to 0).
Returns:
0 on success (independent of whether busattr is NULL), or -1 on error.
Classification:
QNX Neutrino
Safety: |
|
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |