usb_interrupt_msg(9)
π usb_interrupt_msg β Kernel API Manual, section 9
okay so bestie, welcome to usb_interrupt_msg(9) β the one where you build an interrupt urb, yeet it off into the world, and then just stand there waiting for it to come back. π
β¨ NAME β¨
usb_interrupt_msg β builds an interrupt urb, sends it off and waits for completion π
π¦ SYNOPSIS π¦
int usb_interrupt_msg (struct usb_device *usb_dev , unsigned int pipe ,
void *data , int len , int *actual_length , int timeout );
πΈ ARGUMENTS πΈ
usb_devβ pointer to the usb device to send the message to π«pipeβ the endpoint "pipe" you're sending the message to, iykykdataβ pointer to the data to sendlenβ length in bytes of the data to sendactual_lengthβ pointer to a location to put the actual length transferred in bytes (yes, actual β it's giving receipts)timeoutβ time in msecs to wait for the message to complete before timing out β°
π§ CONTEXT π§
task context, might sleep. π΄ like, it will nap, and that's legal here.
π DESCRIPTION π
This function sends a simple interrupt message to a specified endpoint and waits for the message to complete, or timeout. simple as that, no cap.
π¨ do NOT use this function from within an interrupt context. literally do not.
If you need an asynchronous message, or need to send a message from within interrupt context, use usb_submit_urb β¨. If a thread in your driver uses this call, make sure your disconnect method can wait for it to complete β and here's the shady part: since you don't have a handle on the URB used, you can't cancel the request. π no take-backs, no refunds.
π₯ RETURN π₯
If successful, 0. Otherwise a negative error number. The number of actual bytes transferred will be stored in the actual_length parameter. π¬
π SEE ALSO π
Kernel file ./drivers/usb/core/message.c β and the whole friend group:
usb_control_msg(9)usb_control_msg_send(9)usb_control_msg_recv(9)usb_bulk_msg(9)usb_bulk_msg_killable(9)usb_sg_init(9)usb_sg_wait(9)usb_sg_cancel(9)usb_get_descriptor(9)usb_get_string(9)usb_string(9)usb_cache_string(9)usb_get_status(9)usb_clear_halt(9)usb_disable_endpoint(9)usb_reset_endpoint(9)usb_disable_interface(9)usb_disable_device(9)usb_enable_endpoint(9)usb_enable_interface(9)usb_set_interface(9)usb_reset_configuration(9)usb_set_wireless_status(9)usb_driver_set_configuration(9)cdc_parse_cdc_header(9)
and that's the whole page, bestie π«Ά this lil icon lives in ./drivers/usb/core, dated October 2026, and it's manual usb_interrupt_msg(9). go forth and interrupt (responsibly, in task context only) πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms