.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "USB_CONTROL_MSG" "" "06 October 2005" "" "" .SH NAME usb_control_msg \- Builds a control urb, sends it off and waits for completion .SH SYNOPSIS "SYNOPSIS" .sp \fB .sp int usb_control_msg (struct usb_device * \fIdev\fB, unsigned int \fIpipe\fB, __u8 \fIrequest\fB, __u8 \fIrequesttype\fB, __u16 \fIvalue\fB, __u16 \fIindex\fB, void * \fIdata\fB, __u16 \fIsize\fB, int \fItimeout\fB); \fR .SH "ARGUMENTS" .TP \fB\fIdev\fB\fR pointer to the usb device to send the message to .TP \fB\fIpipe\fB\fR endpoint ``pipe'' to send the message to .TP \fB\fIrequest\fB\fR USB message request value .TP \fB\fIrequesttype\fB\fR USB message request type value .TP \fB\fIvalue\fB\fR USB message value .TP \fB\fIindex\fB\fR USB message index value .TP \fB\fIdata\fB\fR pointer to the data to send .TP \fB\fIsize\fB\fR length in bytes of the data to send .TP \fB\fItimeout\fB\fR time in jiffies to wait for the message to complete before timing out (if 0 the wait is forever) .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 If successful, it returns the number of bytes transferred, otherwise a negative error number. .PP Don't 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't have a handle on the URB used, you can't cancel the request.