From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSlsA-0004ZQ-VM for qemu-devel@nongnu.org; Tue, 22 Nov 2011 03:38:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSls6-00076L-J4 for qemu-devel@nongnu.org; Tue, 22 Nov 2011 03:38:34 -0500 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:39353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSls5-0006v3-1j for qemu-devel@nongnu.org; Tue, 22 Nov 2011 03:38:30 -0500 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Nov 2011 14:07:46 +0530 Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAM8bhHB4251722 for ; Tue, 22 Nov 2011 14:07:43 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAM8bhGD013283 for ; Tue, 22 Nov 2011 19:37:43 +1100 Message-ID: <4ECB5F55.3040006@linux.vnet.ibm.com> Date: Tue, 22 Nov 2011 16:37:41 +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