'\" t .\" Title: usb_control_msg .\" 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_CONTROL_MSG" "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_control_msg \- Builds a control urb, sends it off and waits for completion .SH "SYNOPSIS" .HP \w'int\ usb_control_msg('u .BI "int usb_control_msg(struct\ usb_device\ *\ " "dev" ", unsigned\ int\ " "pipe" ", __u8\ " "request" ", __u8\ " "requesttype" ", __u16\ " "value" ", __u16\ " "index" ", void\ *\ " "data" ", __u16\ " "size" ", int\ " "timeout" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 pointer to the usb device to send the message to .RE .PP \fIpipe\fR .RS 4 endpoint \(lqpipe\(rq to send the message to .RE .PP \fIrequest\fR .RS 4 USB message request value .RE .PP \fIrequesttype\fR .RS 4 USB message request type value .RE .PP \fIvalue\fR .RS 4 USB message value .RE .PP \fIindex\fR .RS 4 USB message index value .RE .PP \fIdata\fR .RS 4 pointer to the data to send .RE .PP \fIsize\fR .RS 4 length in bytes of the data to send .RE .PP \fItimeout\fR .RS 4 time in msecs to wait for the message to complete before timing out (if 0 the wait is forever) .RE .SH "CONTEXT" .PP !in_interrupt () .SH "DESCRIPTION" .PP This function sends a simple control message to a specified endpoint and waits for the message to complete, or timeout\&. .PP Don\*(Aqt use this function from within an interrupt context, like a bottom half handler\&. If you need an asynchronous message, or need to send a message from within interrupt context, use \fBusb_submit_urb\fR\&. If a thread in your driver uses this call, make sure your \fBdisconnect\fR method can wait for it to complete\&. Since you don\*(Aqt have a handle on the URB used, you can\*(Aqt cancel the request\&. .SH "RETURN" .PP If successful, the number of bytes transferred\&. Otherwise, a negative error number\&. .SH "COPYRIGHT" .br