From: nix.wie.weg@gmx.de
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Large USB patch
Date: Sat, 22 Apr 2006 18:35:49 +0200 [thread overview]
Message-ID: <444A5B65.8010104@gmx.de> (raw)
In-Reply-To: <444A578E.6000702@austin.rr.com>
[-- Attachment #1: Type: text/plain, Size: 788 bytes --]
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
[-- Attachment #2: lusb-upd3.diff --]
[-- Type: text/plain, Size: 2825 bytes --]
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] );
}
next prev parent reply other threads:[~2006-04-22 16:35 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-20 19:59 [Qemu-devel] Large USB patch nix.wie.weg
2006-04-21 2:23 ` Lonnie Mendez
2006-04-21 5:59 ` nix.wie.weg
2006-04-21 7:04 ` Lonnie Mendez
2006-04-21 14:53 ` Lonnie Mendez
2006-04-21 15:00 ` Lonnie Mendez
2006-04-21 15:50 ` Lonnie Mendez
2006-04-21 16:19 ` Lonnie Mendez
2006-04-21 16:29 ` nix.wie.weg
2006-04-21 17:28 ` Lonnie Mendez
2006-04-21 18:06 ` Lonnie Mendez
2006-04-21 18:38 ` Lonnie Mendez
2006-04-21 20:50 ` Lonnie Mendez
2006-04-22 9:33 ` nix.wie.weg
2006-04-22 14:36 ` Lonnie Mendez
2006-04-22 15:36 ` nix.wie.weg
2006-04-22 15:38 ` nix.wie.weg
2006-04-22 16:00 ` nix.wie.weg
2006-04-22 16:19 ` Lonnie Mendez
2006-04-22 16:35 ` nix.wie.weg [this message]
2006-04-23 3:38 ` Lonnie Mendez
2006-04-23 21:54 ` nix.wie.weg
2006-04-29 1:03 ` Lonnie Mendez
2006-04-29 3:29 ` Lonnie Mendez
2006-04-30 0:46 ` Lonnie Mendez
2006-04-30 20:56 ` Lonnie Mendez
2006-04-21 16:26 ` nix.wie.weg
2006-04-22 14:15 ` nix.wie.weg
2006-04-23 15:02 ` Fabrice Bellard
2006-04-23 16:11 ` nix.wie.weg
2006-04-24 23:50 ` [Qemu-devel] Update for cvs 2006-04-24 nix.wie.weg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=444A5B65.8010104@gmx.de \
--to=nix.wie.weg@gmx.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).