qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb: change VID/PID for usb-hub and usb-msd to prevent conflict
@ 2011-09-15  3:25 Roy Tam
  2011-09-15 16:06 ` Gerd Hoffmann
  0 siblings, 1 reply; 4+ messages in thread
From: Roy Tam @ 2011-09-15  3:25 UTC (permalink / raw)
  To: qemu-devel

Some USB drivers, for example USBASPI.SYS, will skip different type of
device which has same VID/PID. The following patch helps preventing
usb-msd being skipped by the driver.

Sign-off-by: Roy Tam <roytam@gmail.com>
--
diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 286e3ad..449dd4d 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -127,8 +127,8 @@ static const USBDescDevice desc_device_hub = {

 static const USBDesc desc_hub = {
     .id = {
-        .idVendor          = 0,
-        .idProduct         = 0,
+        .idVendor          = 0x0409,
+        .idProduct         = 0x55aa,
         .bcdDevice         = 0x0101,
         .iManufacturer     = STR_MANUFACTURER,
         .iProduct          = STR_PRODUCT,
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index e92434c..4826045 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -162,8 +162,8 @@ static const USBDescDevice desc_device_high = {

 static const USBDesc desc = {
     .id = {
-        .idVendor          = 0,
-        .idProduct         = 0,
+        .idVendor          = 0x46f4,
+        .idProduct         = 0x0001,
         .bcdDevice         = 0,
         .iManufacturer     = STR_MANUFACTURER,
         .iProduct          = STR_PRODUCT,

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] usb: change VID/PID for usb-hub and usb-msd to prevent conflict
  2011-09-15  3:25 [Qemu-devel] [PATCH] usb: change VID/PID for usb-hub and usb-msd to prevent conflict Roy Tam
@ 2011-09-15 16:06 ` Gerd Hoffmann
  2011-09-16  0:14   ` Roy Tam
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2011-09-15 16:06 UTC (permalink / raw)
  To: Roy Tam; +Cc: qemu-devel

On 09/15/11 05:25, Roy Tam wrote:
> Some USB drivers, for example USBASPI.SYS, will skip different type of
> device which has same VID/PID. The following patch helps preventing
> usb-msd being skipped by the driver.

How and why did you pick those IDs?

>   static const USBDesc desc_hub = {
>       .id = {
> -        .idVendor          = 0,
> -        .idProduct         = 0,
> +        .idVendor          = 0x0409,
> +        .idProduct         = 0x55aa,

lsusb says: Bus 004 Device 002: ID 0409:55aa NEC Corp. Hub

Looks sensible.  Is that actually a USB 1.1 Hub?

>   static const USBDesc desc = {
>       .id = {
> -        .idVendor          = 0,
> -        .idProduct         = 0,
> +        .idVendor          = 0x46f4,
> +        .idProduct         = 0x0001,

lsusb doesn't find those IDs in the database.

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] usb: change VID/PID for usb-hub and usb-msd to prevent conflict
  2011-09-15 16:06 ` Gerd Hoffmann
@ 2011-09-16  0:14   ` Roy Tam
  2011-09-16  9:46     ` Gerd Hoffmann
  0 siblings, 1 reply; 4+ messages in thread
From: Roy Tam @ 2011-09-16  0:14 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

2011/9/16 Gerd Hoffmann <kraxel@redhat.com>:
> On 09/15/11 05:25, Roy Tam wrote:
>>
>> Some USB drivers, for example USBASPI.SYS, will skip different type of
>> device which has same VID/PID. The following patch helps preventing
>> usb-msd being skipped by the driver.
>
> How and why did you pick those IDs?
>
>>  static const USBDesc desc_hub = {
>>      .id = {
>> -        .idVendor          = 0,
>> -        .idProduct         = 0,
>> +        .idVendor          = 0x0409,
>> +        .idProduct         = 0x55aa,
>
> lsusb says: Bus 004 Device 002: ID 0409:55aa NEC Corp. Hub
>
> Looks sensible.  Is that actually a USB 1.1 Hub?
>

Yes. If you want a USB 2.0 ID, use 0x03f0:0x2002 (HP Hub) instead.
Using USB 1.1 ID to prevent "High Speed" information cloud in XP.
BTW I can't add "usb-ehci" in my MinGW build, it just not available in
"-device ?".

>>  static const USBDesc desc = {
>>      .id = {
>> -        .idVendor          = 0,
>> -        .idProduct         = 0,
>> +        .idVendor          = 0x46f4,
>> +        .idProduct         = 0x0001,
>
> lsusb doesn't find those IDs in the database.
>

This is expected. Just like my ATA-to-USB adapter which has
0x152D:0x2338 and not in usb.ids.
0x46f4 is CRC16() of "QEMU".

> cheers,
>  Gerd
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] usb: change VID/PID for usb-hub and usb-msd to prevent conflict
  2011-09-16  0:14   ` Roy Tam
@ 2011-09-16  9:46     ` Gerd Hoffmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2011-09-16  9:46 UTC (permalink / raw)
  To: Roy Tam; +Cc: qemu-devel

   Hi,

>> lsusb says: Bus 004 Device 002: ID 0409:55aa NEC Corp. Hub
>>
>> Looks sensible.  Is that actually a USB 1.1 Hub?
>>
>
> Yes. If you want a USB 2.0 ID, use 0x03f0:0x2002 (HP Hub) instead.
> Using USB 1.1 ID to prevent "High Speed" information cloud in XP.

No, a USB 1.1 Hub ID is perfectly fine as we are actually emulating a 
1.1 Hub.  Just asking because it wasn't obvious whenever this is a 1.1 
or 2.0 hub id.

> 0x46f4 is CRC16() of "QEMU".

Ok.  I'll add that as comment to the patch.

thanks,
   Gerd

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-16  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-15  3:25 [Qemu-devel] [PATCH] usb: change VID/PID for usb-hub and usb-msd to prevent conflict Roy Tam
2011-09-15 16:06 ` Gerd Hoffmann
2011-09-16  0:14   ` Roy Tam
2011-09-16  9:46     ` Gerd Hoffmann

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).