Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bank-switch usb devices in Windows8

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.

like image 894
Dana Avatar asked May 20 '13 00:05

Dana


1 Answers

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.

A simple bank switching approach

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.

Serious hacking: a DIY USB proxy device

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.

like image 174
Mels Avatar answered Oct 01 '22 22:10

Mels