STRUCT DWC2_HREGS_BACKUP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct dwc2_hregs_backup(9) β€” a little kernel-API moment πŸŽ€

okay so bestie, welcome to the <pink>Kernel API Manual</pink> ✨ β€” this one's a struct page, and it's honestly serving "save file before you do something risky" energy 🫢

🌸 NAME 🌸

struct dwc2_hregs_backup β€” literally just holds host registers state before entering partial power down πŸ’€πŸ‘‘

no cap, that's the whole vibe: snapshot the host registers before the lights go down.

✨ SYNOPSIS ✨

here's the struct, copied exactly bestie, don't come for me πŸ‘‡

struct dwc2_hregs_backup {
    u32 hcfg;
    u32 hflbaddr;
    u32 haintmsk;
    u32 hcchar[MAX_EPS_CHANNELS];
    u32 hcsplt[MAX_EPS_CHANNELS];
    u32 hcintmsk[MAX_EPS_CHANNELS];
    u32 hctsiz[MAX_EPS_CHANNELS];
    u32 hcidma[MAX_EPS_CHANNELS];
    u32 hcidmab[MAX_EPS_CHANNELS];
    u32 hprt0;
    u32 hfir;
    u32 hptxfsiz;
    bool valid;
 };

like… it's giving PokΓ©mon storage box but for hardware registers πŸ§šπŸ’œ


πŸŽ€ Members πŸŽ€

the way that every single one of these is a backup… obsessed 😭

  • hcfg β€” backup of the HCFG register πŸ’…
  • hflbaddr β€” backup of the HFLBADDR register πŸ’…
  • haintmsk β€” backup of the HAINTMSK register πŸ’…
  • hcchar β€” backup of the HCCHAR register πŸ’…
  • hcsplt β€” backup of the HCSPLT register πŸ’…
  • hcintmsk β€” backup of the HCINTMSK register πŸ’…
  • hctsiz β€” backup of the HCTSIZ register πŸ’…
  • hprt0 β€” backup of the HPTR0 register πŸ’…
  • hfir β€” backup of the HFIR register πŸ’…
  • hptxfsiz β€” backup of the HPTXFSIZ register πŸ’…
  • valid β€” True if registers values backuped 🫢 (yes, the manpage says "backuped", we respect the original text on this blog 🫑)
πŸ™ˆ quick vibe check: hcchar, hcsplt, hcintmsk, hctsiz, hcidma, and hcidmab are all declared as u32 ...[MAX_EPS_CHANNELS] in the struct up top β€” the Members list names the first four of those, and hcidma / hcidmab are in the struct without their own member blurbs. iykyk πŸ’€

🌈 SEE ALSO 🌈

go read these next bestie, they're all in the kernel file ./drivers/usb/dwc2/core.h ✨:

  • struct dwc2_hsotg_ep(9)
  • struct dwc2_hsotg_req(9)
  • struct dwc2_core_params(9)
  • struct dwc2_hw_params(9)
  • struct dwc2_gregs_backup(9)
  • struct dwc2_dregs_backup(9)
  • struct dwc2_hsotg(9)

that's the whole page, main character energy achieved πŸ‘‘ <hotpink>./drivers/usb/dwc2</hotpink> came through with this one in <purple>October 2026</purple>, and yes the page is literally titled struct dwc2_hregs_backup(9) β€” slay, bye bestie πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from