Tweak UHCI device settings. Ignore host root hubs.
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 11 Mar 2006 18:03:38 +0000 (18:03 +0000)
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 11 Mar 2006 18:03:38 +0000 (18:03 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1779 c046a42c-6fe2-441c-8c8c-71466251a162

hw/usb-uhci.c
usb-linux.c

index 732b76a..e93db57 100644 (file)
@@ -654,6 +654,7 @@ void usb_uhci_init(PCIBus *bus, USBPort **usb_ports)
     pci_conf[0x0b] = 0x0c;
     pci_conf[0x0e] = 0x00; // header_type
     pci_conf[0x3d] = 4; // interrupt pin 3
+    pci_conf[0x60] = 0x10; // release number
     
     for(i = 0; i < NB_PORTS; i++) {
         port = &s->ports[i];
@@ -666,6 +667,8 @@ void usb_uhci_init(PCIBus *bus, USBPort **usb_ports)
 
     uhci_reset(s);
 
-    pci_register_io_region(&s->dev, 0, 0x20, 
+    /* Use region 4 for consistency with real hardware.  BSD guests seem
+       to rely on this.  */
+    pci_register_io_region(&s->dev, 4, 0x20, 
                            PCI_ADDRESS_SPACE_IO, uhci_map);
 }
index 216ac20..9cd543d 100644 (file)
@@ -278,7 +278,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)
         if (strlen(line) > 0)
             line[strlen(line) - 1] = '\0';
         if (line[0] == 'T' && line[1] == ':') {
-            if (device_count) {
+            if (device_count && (vendor_id || product_id)) {
+                /* New device.  Add the previously discovered device.  */
                 ret = func(opaque, bus_num, addr, class_id, vendor_id, 
                            product_id, product_name, speed);
                 if (ret)
@@ -321,7 +322,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)
         }
     fail: ;
     }
-    if (device_count) {
+    if (device_count && (vendor_id || product_id)) {
+        /* Add the last device.  */
         ret = func(opaque, bus_num, addr, class_id, vendor_id, 
                    product_id, product_name, speed);
     }