From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FXL5N-0006qi-27 for qemu-devel@nongnu.org; Sat, 22 Apr 2006 12:35:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FXL5M-0006pZ-5z for qemu-devel@nongnu.org; Sat, 22 Apr 2006 12:35:52 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FXL5M-0006pP-2A for qemu-devel@nongnu.org; Sat, 22 Apr 2006 12:35:52 -0400 Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1FXL7A-0003fi-GE for qemu-devel@nongnu.org; Sat, 22 Apr 2006 12:37:44 -0400 Message-ID: <444A5B65.8010104@gmx.de> Date: Sat, 22 Apr 2006 18:35:49 +0200 From: nix.wie.weg@gmx.de MIME-Version: 1.0 Subject: Re: [Qemu-devel] Large USB patch References: <4447E811.1040403@gmx.de> <4448F1F6.4090609@austin.rr.com> <4448FF3F.3030009@austin.rr.com> <44490614.50406@austin.rr.com> <44490852.2080608@gmx.de> <44491659.30804@austin.rr.com> <44491F0A.2090608@austin.rr.com> <444926AC.3070104@austin.rr.com> <44494596.3070808@austin.rr.com> <4449F860.1060809@gmx.de> <444A3F7E.6070107@austin.rr.com> <444A5336.4040102@gmx.de> <444A578E.6000702@austin.rr.com> In-Reply-To: <444A578E.6000702@austin.rr.com> Content-Type: multipart/mixed; boundary="------------000702070703000502060700" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------000702070703000502060700 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lonnie Mendez wrote: > nix.wie.weg@gmx.de wrote: > > Sorry about that. I was used to the previous syntax: > usb_add host:04b6:0005 > > My guess is that the new syntax is to distinguish it from the > busaddr:addr syntax? It would seem checking for length would > differentiate the two in that case. Yes maybe, but not a real good solution, especially if you know that with the solution we have now, you can omit leading zeros. > > For the linux guest problem which distro is being used? I don't have this problem any more. It was an incomplete merged patch. I have attached a small patch, with which you can really add a device to a hub, if this is then working is another question, but it should only depend on the implementation of usb-hub.c With kind regards, Tino H. Seifert --------------000702070703000502060700 Content-Type: text/plain; name="lusb-upd3.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lusb-upd3.diff" diff -Nur qemu-last-snapshot/hw/usb-hub.c qemu/hw/usb-hub.c --- qemu-last-snapshot/hw/usb-hub.c 2006-04-22 17:53:27.000000000 +0200 +++ qemu/hw/usb-hub.c 2006-04-22 18:24:11.000000000 +0200 @@ -172,18 +172,16 @@ static int usb_hub_attach (USBDevice *hub, USBDevice *dev, int portnum) { - USBHubState *s = (USBHubState *)(dev->father->opaque); + USBHubState *s = (USBHubState *)(hub->opaque); USBHubPort *port; int i; if (dev) { - if( portnum >= MAX_PORTS ) { + if (portnum >= MAX_PORTS || portnum < 0) { #ifdef DEBUG - printf( "Not so many ports available on USB hub \n" ); + printf( "This usb hub port does not exist.\n" ); #endif portnum= 0; - } else if( portnum < 0 ){ - portnum= 0; } if (s->ports[portnum].dev != NULL) { #ifdef DEBUG @@ -201,7 +199,7 @@ } if( portnum < 0 ) { #ifdef DEBUG - printf( "Could not find a Hub Port to connect to!" ); + printf( "Could not find a Hub Port to connect to! \n" ); #endif return 0; } @@ -215,7 +213,8 @@ else port->wPortStatus &= ~PORT_STAT_LOW_SPEED; port->dev = dev; - return 1; + port->dev->handle_msg (port->dev, USB_MSG_ATTACH); + return portnum; } else { port = &s->ports[portnum]; dev = port->dev; @@ -226,11 +225,13 @@ port->wPortStatus &= ~PORT_STAT_ENABLE; port->wPortChange |= PORT_STAT_C_ENABLE; } + port->dev->handle_msg(port->dev, USB_MSG_DETACH); port->dev = NULL; - return 1; + return portnum; + } else { + return -1; } } - return -1; } int usb_hub_handle_reset(USBDevice *dev) diff -Nur qemu-last-snapshot/usb-libusb.c qemu/usb-libusb.c --- qemu-last-snapshot/usb-libusb.c 2006-04-22 17:53:29.000000000 +0200 +++ qemu/usb-libusb.c 2006-04-22 18:03:47.000000000 +0200 @@ -230,8 +230,8 @@ } /* the syntax is : - 'bus.addr' (decimal numbers) or - 'vendor_id:product_id' (hexa numbers) */ + 'bus:addr' (decimal numbers) or + 'vendor_idxproduct_id' (hexa numbers) */ void usb_host_find_device(const char *devname, struct usb_device **device) { *device= NULL; @@ -399,7 +399,7 @@ usbVersion[1]= (bcd >> 8) & 7; usbVersion[2]= (bcd >> 4) & 7; usbVersion[3]= bcd & 7; - term_printf(" VendorID:ProductID %04x:%04x, USB-Standard: %i%i.%i%i\n", + term_printf(" VendorID:ProductID %04xx%04x, USB-Standard: %i%i.%i%i\n", dev->descriptor.idVendor, dev->descriptor.idProduct, usbVersion[0], usbVersion[1], usbVersion[2], usbVersion[3] ); } --------------000702070703000502060700--