diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2013-04-08 10:34:21 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2013-04-08 10:34:21 +0000 |
commit | ddec2027d9edb59dff664ea02c5ecabd791c2981 (patch) | |
tree | 84034339ca710df9359bf58209f3dd920f811e73 /share/man/man4 | |
parent | 5285fafd3b88f9e11cb286d9449e37ec35fee719 (diff) |
Add new ioctl's USB_DEVICE_GET_CDESC and USB_DEVICE_GET_FDESC to usb(4).
Those are the equivalents for ugen(4)'s USB_GET_CONFIG_DESC and
USB_GET_FULL_DESC.
Help and OK mpi@, jmc@
Diffstat (limited to 'share/man/man4')
-rw-r--r-- | share/man/man4/usb.4 | 71 |
1 files changed, 69 insertions, 2 deletions
diff --git a/share/man/man4/usb.4 b/share/man/man4/usb.4 index c1c26f475c7..19c0e24517f 100644 --- a/share/man/man4/usb.4 +++ b/share/man/man4/usb.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: usb.4,v 1.136 2012/12/31 04:24:34 miod Exp $ +.\" $OpenBSD: usb.4,v 1.137 2013/04/08 10:34:20 mglocker Exp $ .\" $NetBSD: usb.4,v 1.15 1999/07/29 14:20:32 augustss Exp $ .\" .\" Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 31 2012 $ +.Dd $Mdocdate: April 8 2013 $ .Dt USB 4 .Os .Sh NAME @@ -508,6 +508,73 @@ field is indexed by the transfer kind, i.e.\& .Dv UE_* , and indicates how many transfers of each kind have been completed by the controller. +.It Dv USB_DEVICE_GET_CDESC (struct usb_device_cdesc) +This command can be used to retrieve the configuration descriptor for the +given configuration of a device on the bus. +The +.Va udi_addr +field needs to be filled with the bus device address. +The +.Va udc_config_index +field needs to be filled with the configuration index for the +relevant configuration descriptor. +For convenience the current configuration can be specified by +.Dv USB_CURRENT_CONFIG_INDEX : +.Bd -literal +struct usb_device_cdesc { + u_int8_t udc_bus; + u_int8_t udc_addr; /* device address */ + int udc_config_index; + usb_config_descriptor_t udc_desc; +}; +.Ed +.Pp +The +.Va udc_bus +field contains the device unit number. +.Pp +The +.Va udc_desc +field contains the configuration descriptor structure. +.It Dv USB_DEVICE_GET_FDESC (struct usb_device_fdesc) +This command can be used to retrieve all descriptors for the +given configuration of a device on the bus. +The +.Va udf_addr +field needs to be filled with the bus device address. +The +.Va udf_config_index +field needs to be filled with the configuration index for the +relevant configuration descriptor. +For convenience the current configuration can be specified by +.Dv USB_CURRENT_CONFIG_INDEX . +The +.Va udf_data +field needs to point to a memory area of the size given in the +.Va udf_size +field. +The proper size can be determined by first issuing a +.Dv USB_DEVICE_GET_CDESC +command and inspecting the +.Va wTotalLength +field: +.Bd -literal +struct usb_device_fdesc { + u_int8_t udf_bus; + u_int8_t udf_addr; /* device address */ + int udf_config_index; + u_int udf_size; + u_char *udf_data; +}; +.Ed +.Pp +The +.Va udf_bus +field contains the device unit number. +.Pp +The +.Va udf_data +field contains all descriptors. .It Dv USB_REQUEST Fa "struct usb_ctl_request *" This command can be used to execute arbitrary requests on the control pipe. This is |