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       Don't use this function from within an interrupt context. If you need
51       an asynchronous message, or need to send a message from within
52       interrupt context, use usb_submit_urb. If a thread in your driver uses
53       this call, make sure your disconnect method can wait for it to
54       complete. Since you don't have a handle on the URB used, you can't
55       cancel the request.
56

RETURN

58       If successful, the number of bytes transferred. Otherwise, a negative
59       error number.
60
62Kernel Hackers Manual 3.10         June 2019                USB_CONTROL_MSG(9)
Impressum