From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSmBp-0004yr-6j for qemu-devel@nongnu.org; Tue, 22 Nov 2011 03:58:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSmBo-0002MQ-AO for qemu-devel@nongnu.org; Tue, 22 Nov 2011 03:58:53 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:59830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSmBn-0002MA-CQ for qemu-devel@nongnu.org; Tue, 22 Nov 2011 03:58:52 -0500 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Nov 2011 14:28:41 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAM8wdQQ2969750 for ; Tue, 22 Nov 2011 14:28:39 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAM8wc1F003433 for ; Tue, 22 Nov 2011 14:28:39 +0530 Message-ID: <4ECB643D.10308@linux.vnet.ibm.com> Date: Tue, 22 Nov 2011 16:58:37 +0800 From: hkran MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Implement the function usb_hub_handle_reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: Stefan Hajnoczi , Gerd Hoffmann Implement the function usb_hub_handle_reset. without it the guest propablly fail to configure the usb device attached to the virtulized hub with a correct address. Typically, attaching more than one usb devices when lauch qemu may lead to the problem. Signed-off-by: hkran --- hw/usb-hub.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/hw/usb-hub.c b/hw/usb-hub.c index 3eb0f1a..6731075 100644 --- a/hw/usb-hub.c +++ b/hw/usb-hub.c @@ -220,7 +220,18 @@ static void usb_hub_complete(USBPort *port, USBPacket *packet) static void usb_hub_handle_reset(USBDevice *dev) { - /* XXX: do it */ + USBHubPort *port = NULL; + USBHubState *s = (USBHubState *)dev; + int i; + + for(i = 0; i < NUM_PORTS; i++) { + port = &(s->ports[i]); + if(port->wPortStatus & PORT_STAT_CONNECTION) { + usb_reset(&port->port); + port->wPortStatus = PORT_STAT_CONNECTION | PORT_STAT_POWER; + port->wPortChange = PORT_STAT_C_CONNECTION; + } + } } static int usb_hub_handle_control(USBDevice *dev, USBPacket *p, -- 1.7.1