hwitag_find_phyaddr()
QNX SDP8.0C Library ReferenceAPIDeveloper
Find the PHY address associated with a device
Synopsis:
#include <drvr/hwinfo.h>
int hwitag_find_phyaddr( unsigned hwi_off,
unsigned *phy_idx );
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().
- phy_idx
- NULL, or a pointer to a location that holds the index of the PHY address that you want to find; see below.
Library:
libdrvr
Use the -l drvr option to qcc to link against this library.
Description:
You can use hwitag_find_phyaddr() to find one or more PHY addresses associated with the device at hwi_off in the hwinfo section of the system page.
Some devices contain multiple PHY addresses. You can retrieve all of them by using the phy_idx parameter as follows:
- On the first call, set *phy_idx to 0. The function returns the first address (if one exists).
- You can then continue to call hwitag_find_phyaddr() with the same arguments until it returns -1.
- If you know that there's more than 1 PHY address for the specified device, you can set *phy_idx to the entry number of the desired address. If that entry exists, the address is returned. For example, to obtain the third address for hwi_off, set *phy_idx to 2 (base-0 indexing applies).
- If you're interested only in the first address, you can pass NULL for phy_idx (which is the same as setting *phy_idx to 0).
Returns:
the PHY address on success or -1 on error.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | No |
Thread | Yes |
Page updated: