netbsd: check not only addr 0 but also addr 1 to find root hubs#780
Conversation
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
There was a problem hiding this comment.
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.
|
Sanity check on the NetBSD backend using a VirtualBox VM. |
|
More complete installation log. But this does not seem to work. |
|
Okay, I can follow the method in avrdude which I found out last time. |
|
hidapitester -- again the problem with shared library. Need to see how to fix it. |
|
Again CMake works fine for hidapitester. |
|
Testing of the EZ-USB FX2LP High Speed USB Generic HID device with 128 Bytes Report Length. Unfortunately it does not seem to work. |
|
For the original FX2HID example from Jan Axelson, it also does not seems to work.
|
|
Just wondering what kind of generic USB HID device you have which works with the NetBSD uhid backend. Thanks. |
I'm using minichlink https://github.com/cnlohr/ch32fun/tree/master/minichlink (WCH risc-v CH32V003 tool) on NetBSD/i386 11.0_RC3 etc. |
|
Unfortunately even forcing the device to enumerate as a full speed USB device does not work. That was the issues with PR #730 under FreeBSD. Run log with the FX2HID default example with two bytes HID Input/Output report. I will try a physical machine later, and using other generic USB HID device. |
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).