'\" t .\" Title: usb_interrupt_msg .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: USB Core APIs .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "USB_INTERRUPT_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_interrupt_msg \- Builds an interrupt urb, sends it off and waits for completion .SH "SYNOPSIS" .HP \w'int\ usb_interrupt_msg('u .BI "int usb_interrupt_msg(struct\ usb_device\ *\ " "usb_dev" ", unsigned\ int\ " "pipe" ", void\ *\ " "data" ", int\ " "len" ", int\ *\ " "actual_length" ", int\ " "timeout" ");" .SH "ARGUMENTS" .PP \fIusb_dev\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 \fIdata\fR .RS 4 pointer to the data to send .RE .PP \fIlen\fR .RS 4 length in bytes of the data to send .RE .PP \fIactual_length\fR .RS 4 pointer to a location to put the actual length transferred in bytes .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 interrupt 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, 0\&. Otherwise a negative error number\&. The number of actual bytes transferred will be stored in the \fIactual_length\fR parameter\&. .SH "COPYRIGHT" .br