Files
RedBear-OS/local
vasilito aa5db5a7fc redox-driver-sys: add QuirkPhase enum and phase-aware lookup
Picks up the Phase A foundation from plan § v4.7 v4.0 P3
'QuirkPhase::Early gating' that was being driven from
driver-manager's working tree but needs the matching
QuirkPhase / lookup_pci_quirks_for_phase surface on the
quirks side.

Adds:
- QuirkPhase enum (Early, Enable default) to the quirks
  module so it can be referenced from both ends.
- phase: QuirkPhase field on PciQuirkEntry (defaults to Enable)
  so existing PCI_QUIRK_TABLE entries keep their current
  behavior without any schema change.
- lookup_pci_quirks_for_phase(info, phase) function that filters
  by phase. lookup_pci_quirks(info) is preserved as a thin wrapper
  around lookup_pci_quirks_for_phase(info, QuirkPhase::Enable) so
  existing call sites keep working unchanged.
- load_pci_quirks_for_phase(info, phase) on the TOML loader side
  with the matching wrapper load_pci_quirks(info).

Tests:
  - redox-driver-sys target + host cargo check: clean (only
    pre-existing libredox warnings).
  - cargo test --lib: 80 passed, 0 failed.

Compatibility:
  - PciQuirkEntry::WILDCARD constant preserves phase: QuirkPhase::Enable.
  - lookup_pci_quirks unchanged for callers.
  - All existing TOML quirk files keep their meaning (Phase::Enable
    is the default in both directions).

This rounds out the v4.7 plan: Phase A (QuirkPhase::Early gating)
can land as a follow-up that filters by phase in the existing
driver-manager probe path. No behavior change for existing entries.
2026-07-25 19:56:34 +09:00
..