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 If successful, it returns 0, otherwise a negative error number. The
41 number of actual bytes transferred will be stored in the actual_length
42 paramater.
43
44 Don´t use this function from within an interrupt context, like a bottom
45 half handler. If you need an asynchronous message, or need to send a
46 message from within interrupt context, use usb_submit_urb If a thread
47 in your driver uses this call, make sure your disconnect method can
48 wait for it to complete. Since you don´t have a handle on the URB used,
49 you can´t cancel the request.
50
51 Because there is no usb_interrupt_msg and no USBDEVFS_INTERRUPT ioctl,
52 users are forced to abuse this routine by using it to submit URBs for
53 interrupt endpoints. We will take the liberty of creating an interrupt
54 URB (with the default interval) if the target is an interrupt endpoint.
55
57Kernel Hackers Manual 2.6. June 2019 USB_BULK_MSG(9)