Kernel Functions for Drivers usblookupepdata(9F)
NAME
usblookupepdata - Lookup endpoint information
SYNOPSIS
#include
usbepdatat *usblookupepdata(devinfot *dip,
usbclientdevdatat *devdatap, uintt interface,
uintt alternate, uintt skip, uintt type, uintt direction);
INTERFACE LEVEL
Solaris DI specific (Solaris DI)
PARAMETERS
dip Pointer to the device's devinfo structure.
devdatap Pointer to a usbclientdevdatat structure
containing tree.
interface Number of interface in which endpoint resides.
alternate Number of interface alternate setting in which
endpoint resides.
skip Number of endpoints which match the requested
type and direction to skip before finding one
to retrieve.
type Type of endpoint. This is one of:
USBEPATRCONTROL, USBEPATRISOCH,
USBEPATRBULK, or USBEPATRINTR. Please
see usbpipeopen(9F) for more information.
direction Direction of endpoint, either USBEPDIROUT or
USBEPDIRIN. This argument is ignored for
bi-directional control endpoints.
DESCRIPTION
The usblookupepdata() function returns endpoint informa-
tion from the tree embedded in client data returned from
usbgetdevdata. It operates on the current configuration
(pointed to by the devcurrcfg field of the
SunOS 5.11 Last change: 5 Jan 2004 1
Kernel Functions for Drivers usblookupepdata(9F)
usbclientdevdatat argument). It skips the first
number of endpoints it finds which match the specifications
of the other arguments, and then retrieves information on
the next matching endpoint it finds. Note that it does not
make a copy of the data, but points to the tree itself.
RETURN VALUES
On success: the tree node corresponding to the desired end-
point.
On failure: returns NUL. Fails if dip or devdatap are
NUL, if the desired endpoint does not exist in the tree, or
no tree is present in devdatap.
CONTEXT
May be called from user, kernel or interrupt context.
EXAMPLES
Retrieve the polling interval for the second interrupt end-
point at interface 0, alt 3:
uint8t interval = 0;
usbepdatat *epnode = usblookupepdata(
dip, devdatap, 0, 3, 1, USBEPATRINTR, USBEPDIRIN);
if (epnode != NUL) {
interval = epnode->epdescr.bInterval;
}
Retrieve the maximum packet size for the first control pipe
at interface 0, alt 4:
uint16t maxPacketSize = 0;
usbepdatat *epnode = usblookupepdata(
dip, devdatap, 0, 4, 0, USBEPATRCONTROL, 0);
if (epnode != NUL) {
maxPacketSize = epnode->epdescr.wMaxPacketSize;
}
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 5 Jan 2004 2
Kernel Functions for Drivers usblookupepdata(9F)
ATRIBUTE TYPE ATRIBUTE VALUE
Architecture PCI-based systems
Interface stability Committed
Availability SUNWusb
SEE ALSO
attributes(5), usbgetdevdata(9F), usbpipeopen(9F),
usbcfgdescr(9S), usbifdescr(9S), usbepdescr(9S)
SunOS 5.11 Last change: 5 Jan 2004 3
|