On 05/25/10 15:40, David S. Ahern wrote:
USB 2.0 leverages companion UHCI or OHCI host controllers for full and low speed devices. I do not see an appropriate means for doing that bus transition and could use some suggestions.
Hmm. Well. That doesn't really fit into the qdev tree model ...
As I understand the code at this point it is a top down setup: device added, bus found, device attached.
Devices are always added to some bus. In the case of usb the devices can also be attached/detached. Emulated devices usually attached right after creating them. Host devices are attached when a matching physical device shows up.
ie., key point is the expectation that the bus to which the device is assigned is known early in the code path.
Yes. You can even specify the bus you want attach the device to.
-------------------- -------------------- | EHCI controller |--->| UHCI / OHCI | -------------------- -------------------- | | -------------------- -------------------- | USB device model | | USB device model | | (or driver ) | | (or driver ) | -------------------- -------------------- high speed full / low speed To know which bus to attach it to the device needs to be queried/probed for basic information - something the current architecture does not have.
USB devices can support both 1.1 and 2.0, right? Who decides which protocol is used then? I think the OS can speak 1.1 to the device even in case a ehci controller is present (but unused by the OS), right?
Suggestions?
Maybe it makes more sense to look at ehci/uhci as *one* (physical) device with multiple interfaces? They share the physical ports after all, at least on real hardware.
The tricky case is assigning host devices, right? For the emulated ones we can probably could get away by simply forcing them into 2.0-only or 1.1-only mode depending on which bus they got attached to.
cheers, Gerd