'\" t .\" Title: usb_get_descriptor .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: USB Core APIs .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "USB_GET_DESCRIPTOR" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "USB Core APIs" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" usb_get_descriptor \- issues a generic GET_DESCRIPTOR request .SH "SYNOPSIS" .HP \w'int\ usb_get_descriptor('u .BI "int usb_get_descriptor(struct\ usb_device\ *\ " "dev" ", unsigned\ char\ " "type" ", unsigned\ char\ " "index" ", void\ *\ " "buf" ", int\ " "size" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 the device whose descriptor is being retrieved .RE .PP \fItype\fR .RS 4 the descriptor type (USB_DT_*) .RE .PP \fIindex\fR .RS 4 the number of the descriptor .RE .PP \fIbuf\fR .RS 4 where to put the descriptor .RE .PP \fIsize\fR .RS 4 how big is \(lqbuf\(rq? .RE .SH "CONTEXT" .PP !in_interrupt () .SH "DESCRIPTION" .PP Gets a USB descriptor\&. Convenience functions exist to simplify getting some types of descriptors\&. Use \fBusb_get_string\fR or \fBusb_string\fR for USB_DT_STRING\&. Device (USB_DT_DEVICE) and configuration descriptors (USB_DT_CONFIG) are part of the device structure\&. In addition to a number of USB\-standard descriptors, some devices also use class\-specific or vendor\-specific descriptors\&. .PP This call is synchronous, and may not be used in an interrupt context\&. .SH "RETURN" .PP The number of bytes received on success, or else the status code returned by the underlying \fBusb_control_msg\fR call\&. .SH "COPYRIGHT" .br