From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZlJV-0005Yj-NJ for qemu-devel@nongnu.org; Thu, 23 Jun 2011 10:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZlJT-0001Gm-Rj for qemu-devel@nongnu.org; Thu, 23 Jun 2011 10:55:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZlJT-0001GX-AY for qemu-devel@nongnu.org; Thu, 23 Jun 2011 10:55:23 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5NEtLSW027732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Jun 2011 10:55:21 -0400 Message-ID: <4E0353D4.50401@redhat.com> Date: Thu, 23 Jun 2011 16:55:16 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <4E033946.5040902@redhat.com> In-Reply-To: <4E033946.5040902@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] qdev and compound devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hans de Goede Cc: "qemu-devel@nongnu.org" On 06/23/11 15:01, Hans de Goede wrote: > Hi all, > > I've been working on adding support to the usb-ehci code > to have an uhci companion controller. This is actually > working quite well, and the code is pretty nice too, > see: > http://cgit.freedesktop.org/~jwrdegoede/qemu/log/?h=usbredir > > Note the last commit likely needs to be split into 2, and > that tree contains some other stuff too. > > Anyways to add support for a companion controller the > logical thing to do would be to do: > s->companion = pci_create_simple(bus, companion_devfn, > "usb-ehci-uhci-companion"); > > From the qdev initfn for usb-ehci, this works if > I create the usb-ehci instance from pc_init1() from > hw/pc_piix.c . But for some reason it does not work > if I simple add: "-device usb-ehci, multifunction=on" to > the qemu cmdline. The device gets created, but no ioports > / interrupts get assigned, and it does not show up in > lspci in the guest. Basically we'll want be able to create a multifunction device like this: [root@rincewind ~]# lspci -s1d 00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03) Ideally via "-device ich9-ehci-uhci,addr=1d" or simliar. Asking the user to create the four subdevices manually, with properties set correctly to wind up the usb port relations is kida insane ... Ideas how to do that best? cheers, Gerd