STRUCT USB_HIDG_REPORT(9)
π struct usb_hidg_report(9) π
ok so this is a page from the Kernel API Manual, and today's main character is struct usb_hidg_report β literally the response to GET_REPORT. bestie, it's giving "small struct, big responsibilities" and i promise it's not scary π
β¨ NAME β¨
struct usb_hidg_report β the response to GET_REPORT, no cap π«Ά
πΈ SYNOPSIS πΈ
ok here's the whole vibe, copy it exactly, do NOT freestyle:
struct usb_hidg_report {
__u8 report_id;
__u8 userspace_req;
__u16 length;
__u8 data[MAX_REPORT_LENGTH];
__u8 padding[4];
};
that's the entire struct, every field accounted for, we love a full roster π
π Members π
report_idβ the report ID that this is a response for. like, which request is this replying to, iykyk π―userspace_reqβ ok this one's a little two-modes situation, pay attention:!0β this report is used for any pendingGET_REPORTrequest, but it waits on userspace to issue a new report on future requests π0β this report is to be used for any futureGET_REPORTrequests π«
lengthβ the length of the report response. the actual size, fr fr πdataβ the report response itself. the payload. the moment. the content πpaddingβ padding for 32/64 bit compatibility. yes it's just sitting there, no it's not useless, it's doing important structural work, respect it π
π Description π
this is the structure used by the GADGET_HID_WRITE_GET_REPORT ioctl on /dev/hidg*. that's it. that's the whole job. iconic honestly π
lowkey reminder: this is a uapi header situation, so the layout is a contract β the padding[4] is there for 32/64 bit compatibility and you do not get to "clean it up" bestie π
π¦ SEE ALSO π¦
- Kernel file
./include/uapi/linux/usb/g_hid.hβ go read it, it's right there π§
ok that's the whole page, you ate that π
and for the credits (because everyone deserves their flowers): this came from ./include/uapi/linux/usb, dated October 2026 πΈ mwah, bye 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