1USB_CONTROL_MSG(9)               USB Core APIs              USB_CONTROL_MSG(9)
2
3
4

NAME

6       usb_control_msg - Builds a control urb, sends it off and waits for
7       completion
8

SYNOPSIS

10       int usb_control_msg(struct usb_device * dev, unsigned int pipe,
11                           __u8 request, __u8 requesttype, __u16 value,
12                           __u16 index, void * data, __u16 size, int timeout);
13

ARGUMENTS

15       dev
16           pointer to the usb device to send the message to
17
18       pipe
19           endpoint “pipe” to send the message to
20
21       request
22           USB message request value
23
24       requesttype
25           USB message request type value
26
27       value
28           USB message value
29
30       index
31           USB message index value
32
33       data
34           pointer to the data to send
35
36       size
37           length in bytes of the data to send
38
39       timeout
40           time in msecs to wait for the message to complete before timing out
41           (if 0 the wait is forever)
42

CONTEXT

44       !in_interrupt ()
45

DESCRIPTION

47       This function sends a simple control message to a specified endpoint
48       and waits for the message to complete, or timeout.
49
50       If successful, it returns the number of bytes transferred, otherwise a
51       negative error number.
52
53       Don't use this function from within an interrupt context, like a bottom
54       half handler. If you need an asynchronous message, or need to send a
55       message from within interrupt context, use usb_submit_urb. If a thread
56       in your driver uses this call, make sure your disconnect method can
57       wait for it to complete. Since you don't have a handle on the URB used,
58       you can't cancel the request.
59
61Kernel Hackers Manual 2.6.       November 2011              USB_CONTROL_MSG(9)
Impressum