1USB_BULK_MSG(9) USB Core APIs USB_BULK_MSG(9)
2
3
4
6 usb_bulk_msg - Builds a bulk urb, sends it off and waits for completion
7
9 int usb_bulk_msg(struct usb_device * usb_dev, unsigned int pipe,
10 void * data, int len, int * actual_length,
11 int timeout);
12
14 usb_dev
15 pointer to the usb device to send the message to
16
17 pipe
18 endpoint “pipe” to send the message to
19
20 data
21 pointer to the data to send
22
23 len
24 length in bytes of the data to send
25
26 actual_length
27 pointer to a location to put the actual length transferred in bytes
28
29 timeout
30 time in msecs to wait for the message to complete before timing out
31 (if 0 the wait is forever)
32
34 !in_interrupt ()
35
37 This function sends a simple bulk message to a specified endpoint and
38 waits for the message to complete, or timeout.
39
40 Don't use this function from within an interrupt context. If you need
41 an asynchronous message, or need to send a message from within
42 interrupt context, use usb_submit_urb If a thread in your driver uses
43 this call, make sure your disconnect method can wait for it to
44 complete. Since you don't have a handle on the URB used, you can't
45 cancel the request.
46
47 Because there is no usb_interrupt_msg and no USBDEVFS_INTERRUPT ioctl,
48 users are forced to abuse this routine by using it to submit URBs for
49 interrupt endpoints. We will take the liberty of creating an interrupt
50 URB (with the default interval) if the target is an interrupt endpoint.
51
53 If successful, 0. Otherwise a negative error number. The number of
54 actual bytes transferred will be stored in the actual_length parameter.
55
57Kernel Hackers Manual 3.10 June 2019 USB_BULK_MSG(9)