Skip to content

netbsd: check not only addr 0 but also addr 1 to find root hubs#780

Merged
Youw merged 1 commit intolibusb:masterfrom
tsutsui:check-addr-1-as-roothub-on-netbsd
Mar 20, 2026
Merged

netbsd: check not only addr 0 but also addr 1 to find root hubs#780
Youw merged 1 commit intolibusb:masterfrom
tsutsui:check-addr-1-as-roothub-on-netbsd

Conversation

@tsutsui
Copy link
Contributor

@tsutsui tsutsui commented Mar 17, 2026

On NetBSD xhci(4) uses 'addr 0' for the root hub but all drivers for other host controllers use 'addr 1' for the root hub.
https://gnats.netbsd.org/60073


Tested with ch32fun on NetBSD/i386 10.1 both with xhci(4) and ohci(4).

On NetBSD xhci(4) uses 'addr 0' for the root hub but all drivers for
other host controllers use 'addr 1' for the root hub.
 https://gnats.netbsd.org/60073
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts NetBSD HID device enumeration to find USB root hubs regardless of whether the controller presents the root hub at address 0 (xhci) or address 1 (most other host controllers), improving device discovery on NetBSD (per GNATS 60073).

Changes:

  • Adds a two-step enumeration attempt: probe USB address 0 first, then fall back to address 1 if nothing was found.
  • Introduces state tracking (prev_end) to decide whether to attempt the fallback enumeration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mcuee mcuee added the bsd FreeBSD, NetBSD, OpenBSD, etc label Mar 20, 2026
@Youw Youw merged commit 7e994d8 into libusb:master Mar 20, 2026
18 checks passed
@tsutsui tsutsui deleted the check-addr-1-as-roothub-on-netbsd branch March 20, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bsd FreeBSD, NetBSD, OpenBSD, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants