STRUCT USB_SG_REQUEST(9)
β¨ struct usb_sg_request(9) β¨
Okay bestie, welcome to the Kernel API Manual π
this one's about struct usb_sg_request and it's genuinely giving "scatter/gather I/O support" β like, that's the whole gig, no cap.
π NAME π
struct usb_sg_request β literally support for scatter/gather I/O πΈ
π¦ SYNOPSIS π¦
struct usb_sg_request {
int status;
size_t bytes;
};
That's the whole struct, bestie. Two members. Tiny. Iconic. π
π Members π
statusβ zero means slay (success π), anything else is a negativeerrno, so likeβ¦ not slay πbytesβ counts the bytes that actually got transferred, fr fr π
π Description π
So here's the vibe: these requests get initialized using usb_sg_init, and after that they're used as request handles passed to usb_sg_wait or usb_sg_cancel. That's their whole main character arc β¨
Most members of the request object aren't for driver access β like, they're not yours to touch, bestie, hands off π
The status and bytecount values are valid only after usb_sg_wait returns. Read that again. Only after. Don't be out here reading them early, that's not the vibe π
If the status is zero, then the bytecount matches the total from the request π―
Heads up π«Ά after an error completion, drivers may need to clear a halt condition on the endpoint. Not optional energy, just so you know.
π SEE ALSO π
Kernel file ./include/linux/usb.h β plus the whole friend group:
struct usb_host_endpoint(9)struct usb_interface(9)usb_set_intfdata(9)struct usb_interface_cache(9)struct usb_host_config(9)struct usb_device(9)usb_hub_for_each_child(9)usb_interface_claimed(9)usb_make_path(9)USB_DEVICE(9)USB_DEVICE_VER(9)USB_DEVICE_INTERFACE_CLASS(9)USB_DEVICE_INTERFACE_PROTOCOL(9)USB_DEVICE_INTERFACE_NUMBER(9)USB_DEVICE_INFO(9)USB_INTERFACE_INFO(9)USB_DEVICE_AND_INTERFACE_INFO(9)USB_VENDOR_AND_INTERFACE_INFO(9)struct usb_driver(9)struct usb_device_driver(9)struct usb_class_driver(9)module_usb_driver(9)struct urb(9)usb_fill_control_urb(9)usb_fill_bulk_urb(9)usb_fill_int_urb(9)usb_urb_dir_in(9)usb_urb_dir_out(9)
That's the whole page, bestie, you ate it up π
π«Ά this one lives in ./include/linux and it's dated October 2026 β mwah, go read your USB headers, ily, bye! πΈπβ¨
π¦ 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