Files
RedBear-OS/drivers/usb
Red Bear OS ddb40deac5 xhcid + pcid: P2-A — 51-quirk table ported from Linux 7.1
xhcid:
  - New module xhci/quirks.rs: 51-quirk XhciQuirks bitflags + per-vendor
    lookup table.  Ported from linux-7.1/drivers/usb/host/xhci.h:1587-1649
    (51 quirk flags) + xhci-pci.c (per-vendor lookup).
  - Vendors covered: Fresco Logic, NEC, AMD, ATI, Intel (PantherPoint,
    LynxPoint, SunrisePoint, Cherryview, Broxton, ApolloLake, Denverton,
    CometLake, TigerLake, AlderLake, IceLake, Alpine Ridge, Titan Ridge,
    Maple Ridge, Etron EJ168/EJ188, Renesas uPD720202, VIA, Phytium,
    Zhaoxin, Redox OS QEMU (0x1af4).
  - Tests for Intel/AMD/Etron/Renesas/unknown-vendor coverage.
  - Xhci struct gains a public quirks: XhciQuirks field.
  - main.rs detects vendor/device/class from pcid, applies quirks.

pcid:
  - SubdriverArguments gains device_id: Option<FullDeviceId> field.
  - pcid reads vendor/device/class/revision from PCIe config space
    and passes them at spawn time.  Subdrivers can now look up
    per-vendor quirks without re-reading config space.

Cross-reference: linux-7.1/drivers/usb/host/xhci.h:1587-1649 (51
quirk flags) + xhci-pci.c (per-vendor lookup table, 20+ entries).

Bitflags 2.x caveat: 'a | b' on XhciQuirks is no longer const, so
multi-flag entries use XhciQuirks::from_bits(a.bits() | b.bits()).unwrap()
in const context.

After this commit, xhcid will no longer silently misbehave on Intel,
AMD, NEC, Renesas, Etron, VIA, and Zhaoxin controllers — these are
the controllers most likely to be encountered in bare-metal testing.
2026-07-07 09:19:14 +03:00
..