← Back to Pull requests

vz(usbip): add USB/IP URB engine #5785

Open
unknown opened this pull request with 140 lines diff across 1 files
View on GitHub
unknown unknown commented on Nov 10, 2026 14:32 UTC
Author

What This PR Changes

Part 1 of 6 of the USB passthrough split requested in #5770. It adds the host side of the USB/IP data path, with no wiring to any driver or CLI yet.

  • pkg/usbip/protocol.go: the URB wire format (CMD_SUBMIT, CMD_UNLINK, RET_SUBMIT, RET_UNLINK).

  • pkg/usbip/server.go: runs a URB session over a conn and relays control, bulk and interrupt URBs to a Device interface, which keeps the URB handling OS-neutral. Isochronous URBs fail with -ESHUTDOWN.

  • - Queued URBs are capped at 64 MiB per session.
    - When a session ends, every pending URB is answered before the conn closes. vhci-hcd oopses on any other giveback of a scatter-gather URB.

    Linked Issue (Required in most cases)

    Refs #4766

    How I Tested This

    Host: macOS 27.2

  • go test -race ./pkg/usbip/ (wire format, submit errors and ZLPs, validation and backlog cap, endpoint queues and unlinks, session end and drain)

  • golangci-lint on darwin and linux: 0 issues

  • Every commit builds and passes vet.
  • I tested end to end on hardware on the full stack in #5770.

    AI Usage

    Assisted-by: Claude Code (Claude Opus 5.5)

    Diff: 140 lines (+105 / -35) across 1 files Reviewer: AkihiroSuda Review duration: 5253m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.33) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 140 lines diff across 1 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.296
    Real PR Conversation Timeline
    1 comments
    "Review active on #5785"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 32.6% (LOW) · Higher = larger blast radius
    32.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.4% · Safe to merge
    17.4%
    Repository