STRUCT HIDSPI_DEV_DESCRIPTOR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct hidspi_dev_descriptor(9) 🌸

okay so we're in the Kernel API Manual bestie, and this is literally the whole vibe of HID-over-SPI device descriptors. strap in πŸ’–


✨ NAME ✨

struct hidspi_dev_descriptor β€” the actual definition of a HIDSPI device descriptor. that's it, that's the whole thing, and yes she is important πŸ‘‘


🌈 SYNOPSIS 🌈

struct hidspi_dev_descriptor {
    __le16 dev_desc_len;
    __le16 bcd_ver;
    __le16 rep_desc_len;
    __le16 max_input_len;
    __le16 max_output_len;
    __le16 max_frag_len;
    __le16 vendor_id;
    __le16 product_id;
    __le16 version_id;
    __le16 flags;
    __le32 reserved;
 };

look at her. all those __le16s lined up like a little choir πŸŽ€ (and one lone __le32 at the end serving main character energy, we love to see it)


πŸ’… Members πŸ’…

okay so here's the member-by-member breakdown, no cap, nothing skipped:

  • dev_desc_len β€” the length of the complete device descriptor. and it is fixed to 0x18 (that's 24 in human numbers). do not freestyle this one, she's not negotiable πŸ™…β€β™€οΈ
  • bcd_ver β€” the version number of the HIDSPI protocol supported, in binary coded decimal (BCD) format. Must be fixed to 0x0300. again: fixed. not a suggestion. periodt πŸ’€
  • rep_desc_len β€” the length of the report descriptor πŸ“‹
  • max_input_len β€” the length of the largest possible HID input (or feature) report
  • max_output_len β€” the length of the largest output (or feature) report πŸ“€
  • max_frag_len β€” the length of the largest fragment, where a fragment represents the body of an input report. fancy!! 🧚
  • vendor_id β€” device manufacturer's vendor ID 🏭
  • product_id β€” the device's unique model/product ID
  • version_id β€” the device's unique version
  • flags β€” specify flags for the device's operation 🚩
  • reserved β€” reserved, and should be 0. she's just sitting there. leave her at 0 🫢
⚠️ friendly reminder bestie: dev_desc_len is fixed at 0x18 (24) and bcd_ver must be 0x0300, and reserved should be 0. those aren't vibes, those are rules 😭

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./include/linux/hid-over-spi.h struct input_report_body_header(9), struct input_report_body(9), struct output_report_header(9), struct output_report(9)

like, go read the whole friend group, they're all connected, iykyk πŸ’œ


and that's the page!! this lil icon lives in ./include/linux, dated October 2026, and she's filed under struct hidspi_dev_descriptor(9). slay, go forth and set your reserved to 0 πŸ¦‹βœ¨

πŸ“¦ where this page comes from