STRUCT XHCI_OP_REGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's struct xhci_op_regs, aka the xHCI Host Controller Operational Registers πŸ’…. yes it's a struct, yes it's in a kernel, yes you're gonna slay it.


🌸 SYNOPSIS 🌸

struct xhci_op_regs {
    __le32 command;
    __le32 status;
    __le32 page_size;
    __le32 reserved1;
    __le32 reserved2;
    __le32 dev_notification;
    __le64 cmd_ring;
    __le32 reserved3[4];
    __le64 dcbaa_ptr;
    __le32 config_reg;
    __le32 reserved4[241];
    struct xhci_port_regs port_regs[];
};

like, look at her. main character struct energy fr fr πŸ‘‘ β€” she's got the little registers up top, a couple of big 64-bit pointers in the middle, and a whole wall of reserved space because sometimes you just need room 🫢


πŸ¦‹ Members πŸ¦‹

  • command β€” this is USBCMD, the xHC command register πŸ’« the "do the thing" button, basically.
  • status β€” this one's USBSTS, the xHC status register πŸ‘€ the "what's the tea, is it working" register.
  • page_size β€” tells you what page size the host controller supports ✨ and here's the deets: if bit n is set, the HC supports a page size of 2^(n+12), all the way up to a 128MB page size 🫧 and the minimum page size is 4K. no cap, that's the floor.
  • cmd_ring β€” CRP, the 64-bit Command Ring Pointer 🌈
  • dcbaa_ptr β€” DCBAAP, the 64-bit Device Context Base Address Array Pointer πŸ’œ (yes that's a lot of words, yes it's one pointer, we move)
  • config_reg β€” CONFIG, the Configure Register ⭐
  • port_regs β€” the Port Register Sets πŸ’… and there's one for each port, from 1 to MaxPorts, where MaxPorts is defined by HCSPARAMS1. iconic array energy.
not me noticing the struct also carries reserved1, reserved2, dev_notification, reserved3[4] and reserved4[241] β€” the page doesn't give them their own little blurbs, so I'm not gonna invent any πŸ™ˆ they're just sitting there being reserved, and we respect their privacy.

⭐ SEE ALSO ⭐

the whole friend group, in the kernel file ./drivers/usb/host/xhci.h πŸ’–:

  • struct xhci_cap_regs(9)
  • struct xhci_intr_reg(9)
  • struct xhci_run_regs(9)
  • struct xhci_container_ctx(9)
  • struct xhci_slot_ctx(9)
  • struct xhci_ep_ctx(9)
  • struct xhci_device_context_array(9)

okay that's the whole page, you ate that πŸ“ mwah πŸ’‹

sign-off time cuties: this one lives in ./drivers/usb/host, dated October 2026, and it's struct xhci_op_regs(9) β€” go be the main character of your own register set πŸ§šπŸ’œ

πŸ“¦ where this page comes from