Data Structures for Drivers usbctrlrequest(9S)
NAME
usbctrlrequest - USB control pipe request structure
SYNOPSIS
#include
INTERFACE LEVEL
Solaris DI specific (Solaris DI)
DESCRIPTION
A control request is used to send device commands (or
requests) and to read status. Please refer to Section 5.5 of
the USB 2.0 specification for information on control pipes.
For information on formatting requests, see Section 9.3 of
the USB 2.0 specification. The USB 2.0 specification is
available at www.usb.org.
STRUCTURE MEMBERS
The fields in the usbctrlreqt are used to format a con-
trol request:
uint8t ctrlbmRequestType; /* characteristics of request */
uint8t ctrlbRequest; /* specific request */
uint16t ctrlwValue; /* varies according to request */
uint16t ctrlwIndex; /* index or offset */
uint16t ctrlwLength; /* number of bytes to xfer */
mblkt *ctrldata; /* data for the data phase */
/* IN or OUT: allocated by client */
uintt ctrltimeout; /* time until USBA framework */
/* retires req, in seconds */
/* If set to zero, defaults to 5 sec */
usbopaquet ctrlclientprivate; /* client private info */
usbreqattrst ctrlattributes; /* attrib. for this req */
/* Normal callback function, called upon completion. */
void (*ctrlcb)(
usbpipehandlet ph, struct usbctrlreq *req);
/* Exception callback function, for error handling. */
void (*ctrlexccb)(
usbpipehandlet ph, struct usbctrlreq *req);
usbcrt ctrlcompletionreason; /* overall success status */
/* See usbcompletionreason(9S) */
usbcbflagst ctrlcbflags; /* recovery done by callback hndlr */
/* See usbcallbackflags(9S) */
Request attributes define special handling for transfers.
The following attributes are valid for control requests:
SunOS 5.11 Last change: 5 Jan 2004 1
Data Structures for Drivers usbctrlrequest(9S)
USBATRSHORTXFEROK Accept transfers where less data
is received than expected.
USBATRSAUTOCLEARING Have USB framework reset pipe and
clear functional stalls automati-
cally on exception.
USBATRSPIPERESET Have USB framework reset pipe
automatically on exception.
Please see usbrequestattributes(9S) for more information.
The following definitions directly pertain to fields in the
USB control request structure. (See Section 9.3 of the USB
2.0 specification.)
Direction bitmasks of a control request's ctrlbmRequestType field
(USB 2.0 spec, section 9.3.1)
USBDEVREQHOSTODEV Host to device direction
USBDEVREQDEVTOHOST Device to host direction
USBDEVREQDIRMASK Bitmask of direction bits
Request type bitmasks of a control request's ctrlbmRequestType field
(USB 2.0 spec, section 9.3.1)
USBDEVREQTYPESTANDARD USB 2.0 defined command
for all USB devices
USBDEVREQTYPECLAS USB 2.0 defined
class-specific command
USBDEVREQTYPEVENDOR Vendor-specific command
USBDEVREQTYPEMASK Bitmask of request type bits
Recipient bitmasks of a control request's ctrlbmRequestType field
(USB 2.0 spec, section 9.3.1)
USBDEVREQRCPTDEV Request is for device
USBDEVREQRCPTIF Request is for interface
USBDEVREQRCPTEP Request is for endpoint
USBDEVREQRCPTOTHER Req is for other than above
USBDEVREQRCPTMASK Bitmask of request recipient bits
Standard requests (USB 2.0 spec, section 9.4)
USBREQGETSTATUS Get status of device, endpoint
or interface (9.4.5)
USBREQCLEARFEATURE Clear feature specified by
wValue field (9.4.1)
SunOS 5.11 Last change: 5 Jan 2004 2
Data Structures for Drivers usbctrlrequest(9S)
USBREQSETFEATURE Set feature specified by
wValue field (9.4.9)
USBREQSETADRES Set address specified by
wValue field (9.4.6)
USBREQGETDESCR Get descr for item/idx in
wValue field (9.4.3)
USBREQSETDESCR Set descr for item/idx in
wValue field (9.4.8)
USBREQGETCFG Get current device
configuration (9.4.2)
USBREQSETCFG Set current device
configuration (9.4.7)
USBREQGETIF Get alternate interface
setting (9.4.4)
USBREQSETIF Set alternate interface
setting (9.4.10)
USBREQSYNCFRAME Set and report an endpoint's
sync frame (9.4.11)
Unicode language ID, used as wIndex for USBREQSET/GETDESCRIPTOR
USBLANGID Unicode English Lang ID for
parsing str descr
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Architecture PCI-based systems
Interface stability Committed
Availability SUNWusbu
SEE ALSO
usballocrequest(9F), usbpipebulkxfer(9F),
usbpipectrlxfer(9F), usbpipeintrxfer(9F),
usbpipeisocxfer(9F), usbbulkrequest(9S),
usbcallbackflags(9S), usbcompletionreason(9S),
usbintrrequest(9S), usbisocrequest(9S),
usbrequestattributes(9S)
SunOS 5.11 Last change: 5 Jan 2004 3
|