From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39594 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHF5U-0008B4-Cg for qemu-devel@nongnu.org; Wed, 26 May 2010 07:47:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHF5S-0007vW-VF for qemu-devel@nongnu.org; Wed, 26 May 2010 07:47:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64490) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHF5S-0007vM-OM for qemu-devel@nongnu.org; Wed, 26 May 2010 07:47:50 -0400 Message-ID: <4BFD0A60.10408@redhat.com> Date: Wed, 26 May 2010 13:47:44 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] RFC: ehci -> uhci handoff suggestions References: <4BFBD33F.7010403@cisco.com> In-Reply-To: <4BFBD33F.7010403@cisco.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "David S. Ahern" Cc: qemu-devel 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