Device Information Library Functions dibindingname(3DEVINFO)
NAME
dibindingname, dibusaddr, dicompatiblenames, didevid,
didrivername, didriverops, didrivermajor, diinstance,
dinodeid, dinodename - return libdevinfo node information
SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ]
#include
char *dibindingname(dinodet node);
char *dibusaddr(dinodet node);
int dicompatiblenames(dinodet node, char **names);
ddidevidt didevid(dinodet node);
char *didrivername(dinodet node);
uintt didriverops(dinodet node);
int didrivermajor(dinodet node);
int diinstance(dinodet node);
int dinodeid(dinodet node);
char *dinodename(dinodet node);
PARAMETERS
names The address of a pointer.
node A handle to a device node.
DESCRIPTION
These functions extract information associated with a device
node.
RETURN VALUES
SunOS 5.11 Last change: 22 Mar 2004 1
Device Information Library Functions dibindingname(3DEVINFO)
The dibindingname() function returns a pointer to the
binding name. The binding name is the name used by the sys-
tem to select a driver for the device.
The dibusaddr() function returns a pointer to a null-
terminated string containing the assigned bus address for
the device. NUL is returned if a bus address has not been
assigned to the device. A zero-length string may be returned
and is considered a valid bus address.
The return value of dicompatiblenames() is the number of
compatible names. names is updated to point to a buffer con-
tained within the snapshot. The buffer contains a concatena-
tion of null-terminated strings, for example:
/0/0.../0
See the discussion of generic names in Writing Device
Drivers for a description of how compatible names are used
by Solaris to achieve driver binding for the node.
The didevid() function returns the device ID for node, if
it is registered. Otherwise, a null pointer is returned.
Interfaces in the libdevid(3LIB) library may be used to
manipulate the handle to the device id. This function is
obsolete and might be removed from a future Solaris release.
Applications should use the "devid" property instead.
The didrivername() function returns the name of the driver
bound to the node. A null pointer is returned if node is
not bound to any driver.
The didriverops() function returns a bit array of device
driver entry points that are supported by the driver bound
to this node. Possible bit fields supported by the driver
are DICBOPS, DIBUSOPS, DISTREAMOPS.
The didrivermajor() function returns the major number
associated with the driver bound to node. If there is no
driver bound to the node, this function returns -1.
The diinstance() function returns the instance number of
the device. A value of -1 indicates an instance number has
SunOS 5.11 Last change: 22 Mar 2004 2
Device Information Library Functions dibindingname(3DEVINFO)
not been assigned to the device by the system.
The dinodeid() function returns the type of device, which
may be one of the following possible values:
DIPSEUDONODEID, DIPROMNODEID, and DISIDNODEID. Dev-
ices of type DIPROMNODEID may have additional properties
that are defined by the PROM. See
diprompropdata(3DEVINFO) and
dipromproplookupbytes(3DEVINFO).
The dinodename() function returns a pointer to a null-
terminated string containing the node name.
EXAMPLES
See diinit(3DEVINFO) for an example demonstrating typical
use of these functions.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving (didevid() is obsolete)
MT-Level Safe
SEE ALSO
diinit(3DEVINFO), diprominit(3DEVINFO),
diprompropdata(3DEVINFO),
dipromproplookupbytes(3DEVINFO), libdevid(3LIB),
libdevinfo(3LIB), attributes(5)
Writing Device Drivers
SunOS 5.11 Last change: 22 Mar 2004 3
|