usb_bulk_msg_killable(9)
π usb_bulk_msg_killable β from the Kernel API Manual, bestie
Okay so picture this: you're in the kernel, you've got a USB device, and you need to send a bulk message and wait for it to finish β but with the option to get interrupted like a normal, killable little task. That's the whole vibe of usb_bulk_msg_killable, and honestly? Iconic. β¨
π¦ NAME
usb_bulk_msg_killable β builds a bulk urb, sends it off, and waits for completion in a killable state. No cap, that's literally what it does. π
πΈ SYNOPSIS
int usb_bulk_msg_killable (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 you're sending the message to π«Άpipeβ the endpoint "pipe" to send the message todataβ 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 β because sometimes you ask for a lot and only part of it goes through, iykyk)timeoutβ time in msecs to wait for the message to complete before timing out (if<= 0, the wait is as long as possible π)
π§ CONTEXT
task context, might sleep. So likeβ¦ don't be weird about it. π΄
π DESCRIPTION
This function is just like usb_blk_msg, except that it waits in a killable state and there is no limit on the timeout length. That's the tea. π« Two whole differences, both of them lowkey huge: killable wait, unlimited timeout. Slay.
π₯ RETURN
If successful, 0. Otherwise a negative error number. The number of actual bytes transferred will be stored in the actual_length parameter. So even when it's giving failure energy, you still get the byte count. Iconic behavior honestly. π
π SEE ALSO
Kernel file ./drivers/usb/core/message.c, plus the whole friend group:
usb_control_msg(9)usb_control_msg_send(9)usb_control_msg_recv(9)usb_interrupt_msg(9)usb_bulk_msg(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)
bestie reminder: it waits in a killable state, so your task can absolutely get yeeted mid-wait. that's a feature, not a bug π
And that's the page, fr fr β brought to you by the fine folks over at ./drivers/usb/core, dated October 2026, filed under usb_bulk_msg_killable(9). Go forth and bulk-msg responsibly, bestie ππ
π¦ 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