The USB 2.0 standard supports the disabling of individual hub ports. I am looking for an API to call from user code under Windows 8, specifically to disable hub ports, either in C# or in C++, using existing Windows user-mode drivers.
It looks like the IOCTL to disable a hub port has been deprecated in the WDF.
I've built and used DevCon - it will disable devices through the DDK, but will not disable hub ports.
WinUSB is a powerful interface, which requires specifying WinUSB.sys as your driver stack. However, I don't think its libraries, setupapi.lib and winusb.lib, provide this level of hub control.
I would really appreciate a pointer to the correct user-mode API in Windows 8, especially a C# interface. If no such API exists, that would also be very helpful to know.
-- Added 6/3: Since no information on this has turned up, we're now looking into a software-based bank-switching algorithm that disables and re-enables the devices directly. We hope to be able to build this out at an arbitrary size, but of course the technology is unproven at this point. I'll keep this thread up to date with progress.
Have you considered implementing a bit of hardware to accomplish the same goal?
Since nobody appears to have a software-only solution yet, this may well prove to be the quickest way to get things going. Also, it would be completely OS independent, which might help with future maintainability.
As a very basic example, you could use an off-the-shelf serial relay box (such as this one) to control the power supply going to all the hubs individually. That way you could enable one "end hub" at a time to access the devices that are connected to that hub. Be sure to use self-powered hubs that only work when external power supply is present though - I've seen quite a few powered hubs that still connect when external power is absent.
Since you mentioned that you have experience with embedded software development, you could also consider building a passthrough device that acts as "proxy" between the hubs (with devices) and the host machine. It could send the required USB commands to the hubs downstream to disable/enable the ports. If high data rate isn't a requirement, such a device may be built using an Arduino and a USB Host Shield.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With