From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLtUR-0002Fz-4Q for qemu-devel@nongnu.org; Thu, 03 Nov 2011 05:21:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLtUP-0005OF-S5 for qemu-devel@nongnu.org; Thu, 03 Nov 2011 05:21:39 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:33824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLtUP-0005O8-A3 for qemu-devel@nongnu.org; Thu, 03 Nov 2011 05:21:37 -0400 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp06.au.ibm.com (8.14.4/8.13.1) with ESMTP id pA39K64a017138 for ; Thu, 3 Nov 2011 20:20:06 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA39IWqg1655018 for ; Thu, 3 Nov 2011 20:18:32 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA39LOYI002041 for ; Thu, 3 Nov 2011 20:21:24 +1100 Message-ID: <4EB25CE0.9060703@linux.vnet.ibm.com> Date: Thu, 03 Nov 2011 17:20:32 +0800 From: hkran MIME-Version: 1.0 References: <1320159390-29797-1-git-send-email-kraxel@redhat.com> <1320159390-29797-2-git-send-email-kraxel@redhat.com> <4EB10FAA.3090304@vnet.linux.ibm.com> <4EB13DF8.2080509@redhat.com> <4EB22E53.7020905@linux.vnet.ibm.com> <4EB253BE.8070300@redhat.com> In-Reply-To: <4EB253BE.8070300@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] usb-hub: wakeup on attach List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: hkran , qemu-devel@nongnu.org On 11/03/2011 04:41 PM, Gerd Hoffmann wrote: > On 11/03/11 07:01, hkran wrote: >> On 11/02/2011 08:56 PM, Gerd Hoffmann wrote: >>> Hi, >>> >>>>> static void usb_hub_detach(USBPort *port1) >>>> pulled, In what cases, the usb hub will be suspended? and how to tell it >>>> happened? thanks. >>> The guest enables the remote-wakeup feature. 'lspci -v' (within the >>> guest) shows it. >>> >>> cheers, >>> Gerd >>> >> I use the param "-usb -usbdevice tablet" to start qemu and then usb_del >> tablet via monitor console after getting qemu up. >> I saw this by entering lsusb -v >> >> Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub >> Device Descriptor: >> bLength 18 >> bDescriptorType 1 >> bcdUSB 1.10 >> bDeviceClass 9 Hub >> bDeviceSubClass 0 Unused >> bDeviceProtocol 0 Full speed (or root) hub >> bMaxPacketSize0 64 >> idVendor 0x1d6b Linux Foundation >> idProduct 0x0001 1.1 root hub >> bcdDevice 2.06 >> iManufacturer 3 Linux 2.6.32-131.0.15.el6.x86_64 uhci_hcd >> iProduct 2 UHCI Host Controller >> iSerial 1 0000:00:01.2 >> .......................... >> Hub Descriptor: >> bLength 9 >> bDescriptorType 41 >> nNbrPorts 2 >> wHubCharacteristic 0x000a >> No power switching (usb 1.0) >> Per-port overcurrent protection >> bPwrOn2PwrGood 1 * 2 milli seconds >> bHubContrCurrent 0 milli Ampere >> DeviceRemovable 0x00 >> PortPwrCtrlMask 0xff >> Hub Port Status: >> Port 1: 0000.0100 power >> Port 2: 0000.0100 power >> Device Status: 0x0003 >> Self Powered >> Remote Wakeup Enabled >> >> (It seems that the Remote-wakeup feature has been enabled) >> There are two ports with the status "power", and I do not know how to >> make it suspended yet. Can you help more ? > That is the root hub created by the linux kernel, not the hub emulated > by qemu. If you hook up just a single device no hob is needed. > > cheers, > Gerd > Yes, it is. After I usb_add a storage a 8-port hub emulated is added : lsusb Bus 001 Device 004: ID 0000:7777 Bus 001 Device 003: ID 0000:0000 Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Device 003 is the hub and Device 004 is my storage lsusb -s 3 -v: Bus 001 Device 003: ID 0000:0000 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 8 idVendor 0x0000 idProduct 0x0000 bcdDevice 1.01 iManufacturer 1 QEMU 0.15.50 iProduct 2 QEMU USB Hub iSerial 3 314159 bNumConfigurations 1 ........................................... iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 255 Hub Descriptor: bLength 10 bDescriptorType 41 nNbrPorts 8 wHubCharacteristic 0x000a No power switching (usb 1.0) Per-port overcurrent protection bPwrOn2PwrGood 1 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 0x00 PortPwrCtrlMask 0xff 0x00 Hub Port Status: Port 1: 0000.0103 power enable connect Port 2: 0000.0100 power Port 3: 0000.0100 power Port 4: 0000.0100 power Port 5: 0000.0100 power Port 6: 0000.0100 power Port 7: 0000.0100 power Port 8: 0000.0100 power Device Status: 0x0001 Self Powered my storage is connected to the port 1. after usb_del, all the hub port status will turn to power. how should i do next to get it to be suspended?thanks.