Kernel Functions for Drivers usbclrfeature(9F)
NAME
usbclrfeature - Clear feature of USB device, interface or
endpoint
SYNOPSIS
#include
int usbclrfeature(devinfot *dip,
uintt requesttype, uintt feature,
uintt which, usbflagst flags,
void (*callback) (usbpipehandlet pipehandle,
usbopaquet callbackarg, int rval, usbcbflagst flags),
usbopaquet callbackarg);
INTERFACE LEVEL
Solaris DI specific (Solaris DI)
PARAMETERS
dip Pointer to the device's devinfo structure.
pipehandle Pipe handle to device, device interface or
endpoint.
requesttype bmRequestType to be used. One of the fol-
lowing:
USBDEVREQRCPTDEV - Clear feature on dev-
ice.
USBDEVREQRCPTIF - Clear feature on
interface.
USBDEVREQRCPTEP - Clear feature on end-
point.
feature Feature to be cleared. Can be any device-
defined device-, interface-, or endpoint-
specific feature, including the following
which are defined in the USB 2.0 specifica-
tion:
USBEPHALT - Clear a HALT on an endpoint.
USBDEVREMOTEWAKEUP - Clear REMOTEWAKEUP
on a device.
SunOS 5.11 Last change: Feb 9 2004 1
Kernel Functions for Drivers usbclrfeature(9F)
USBDEVTESTMODE - Clear TESTMODE on a
device.
which Device, interface or endpoint on which to clear
the feature. One of:
Interface number, for interfaces.
Endpoint number, for endpoints.
0 for devices.
flags USBFLAGSLEP is the only flag recognized.
Wait for completion and do not call call-
back.
callback Callback handler to notify of asynchronous
completion.
callbackarg Second argument passed to callback handler.
DESCRIPTION
The usbclrfeature() function clears a specific feature of
a device, interface or endpoint. This function always blocks
and waits for resources if not available, regardless of the
flags argument.
This call blocks for completion if USBFLAGSLEP is set in
flags. It returns immediately and calls the callback upon
completion if USBFLAGSLEP is not set.
RETURN VALUES
USBSUCES Feature was successfully cleared.
USBINVALIDARGS dip argument is NUL.
USBINVALIDPIPE pipehandle argument is NUL
USBINVALIDCONTEXT Called from interrupt context with
USBFLAGSLEP flag set.
USBFAILURE Clearing of feature was unsuccessful.
SunOS 5.11 Last change: Feb 9 2004 2
Kernel Functions for Drivers usbclrfeature(9F)
CONTEXT
May always be called from user or kernel context. May be
called from interrupt context only if USBFLAGSLEP is not
set in flags.
If the USBCBASYNCREQFAILED bit is clear in
usbcbflagst, the callback, if supplied, can block because
it is executing in kernel context. Otherwise the callback
cannot block. Please see usbcallbackflags(9S) for more
information on callbacks.
EXAMPLES
if (usbclrfeature(dip, pipehandle, USBDEVREQRCPTEP,
USBEPHALT, dataendpointnum, 0) == USBFAILURE) {
cmnerr (CEWARN,
"%s%d: Error clearing halt condition on data endpoint %d.",
ddidrivername(dip), ddigetinstance(dip),
dataendpointnum);
}
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Architecture PCI-based systems
Interface stability Committed
Availability SUNWusb
SEE ALSO
attributes(5), usbgetstatus(9F), usbpipereset(9F),
usbpipegetstate(9F), usbcallbackflags(9S)
SunOS 5.11 Last change: Feb 9 2004 3
|