Search code examples
usb

How to communicate with the devices behind a USB hub?


I need an USB expert. I have a little hardware with a MAX3421 as USB host. I connect my printer that internally is composed of two devices: the printer itself and the scanner. Both are exposed as individual devices via a built-in hub. The devices are Full-Speed.

I have read the huge USB 2.0 manual (http://www.usb.org/developers/docs/usb20_docs) where I searched the way how to communicate through the hub with the devices behind, but the documentation is lacking this important detail.

I can send commands to the hub as decribed in chapter 11.24.2, like for example getting the Hub descriptor, SET_FEATURE(Reset) which resets a device in the printer, GET_STATUS(Port1) which returns correctly the 4 bytes with the state of port 1 in the hub.

But how do I get for example the device descriptor of the scanner?

I have assigned device address 1 to the hub and tried to communicate with the scanner/printer on device address 2 (supposing that it might be there) but the MAX3421 answers with a JERR error when I send a GET_DESCRIPTOR(Device) to device address 2 although both hub ports are powered and enabled after executing a Reset.

I have read a lot about SPLIT tokens, but they seem to be used only in High-Speed hubs. But the hub in my printer is Full-Speed.

The documentation does not say in any place how to do that. Where is this documented ?


Solution

  • No answer? Seems to be a difficult question.

    Meanwhile I found the answer here: http://www.microchip.com/forums/m523103.aspx#523499

    After sending a SET_FEATURE(Reset) to a port on the hub the device that is connected to that port appears with device address 00 on the USB bus. Then you can get the device descriptor the usual way and execute a SET_ADDRESS to this device.

    The USB specification is definitely incomplete.