.\" 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" "9" "17 July 2003" "" ""
.SH NAME
usb_control_msg \- Builds a control urb, sends it off and waits for completion
.SH 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.
.SH "ABOUT THIS DOCUMENT"
.PP
This documentation is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
.PP
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
.PP
For more details see the file COPYING in the source
distribution of Linux.
.PP
If you have comments on the formatting of this manpage, then please contact
Michael Still (mikal@stillhq.com).
.PP
This documentation was generated with kernel version 2.5.71.