Commit 38ca0f6deebe286a521d6dfaf6583e9216b441ee
1 parent
09c56b84
Tweak UHCI device settings. Ignore host root hubs.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1779 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
8 additions
and
3 deletions
hw/usb-uhci.c
@@ -654,6 +654,7 @@ void usb_uhci_init(PCIBus *bus, USBPort **usb_ports) | @@ -654,6 +654,7 @@ void usb_uhci_init(PCIBus *bus, USBPort **usb_ports) | ||
654 | pci_conf[0x0b] = 0x0c; | 654 | pci_conf[0x0b] = 0x0c; |
655 | pci_conf[0x0e] = 0x00; // header_type | 655 | pci_conf[0x0e] = 0x00; // header_type |
656 | pci_conf[0x3d] = 4; // interrupt pin 3 | 656 | pci_conf[0x3d] = 4; // interrupt pin 3 |
657 | + pci_conf[0x60] = 0x10; // release number | ||
657 | 658 | ||
658 | for(i = 0; i < NB_PORTS; i++) { | 659 | for(i = 0; i < NB_PORTS; i++) { |
659 | port = &s->ports[i]; | 660 | port = &s->ports[i]; |
@@ -666,6 +667,8 @@ void usb_uhci_init(PCIBus *bus, USBPort **usb_ports) | @@ -666,6 +667,8 @@ void usb_uhci_init(PCIBus *bus, USBPort **usb_ports) | ||
666 | 667 | ||
667 | uhci_reset(s); | 668 | uhci_reset(s); |
668 | 669 | ||
669 | - pci_register_io_region(&s->dev, 0, 0x20, | 670 | + /* Use region 4 for consistency with real hardware. BSD guests seem |
671 | + to rely on this. */ | ||
672 | + pci_register_io_region(&s->dev, 4, 0x20, | ||
670 | PCI_ADDRESS_SPACE_IO, uhci_map); | 673 | PCI_ADDRESS_SPACE_IO, uhci_map); |
671 | } | 674 | } |
usb-linux.c
@@ -278,7 +278,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) | @@ -278,7 +278,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) | ||
278 | if (strlen(line) > 0) | 278 | if (strlen(line) > 0) |
279 | line[strlen(line) - 1] = '\0'; | 279 | line[strlen(line) - 1] = '\0'; |
280 | if (line[0] == 'T' && line[1] == ':') { | 280 | if (line[0] == 'T' && line[1] == ':') { |
281 | - if (device_count) { | 281 | + if (device_count && (vendor_id || product_id)) { |
282 | + /* New device. Add the previously discovered device. */ | ||
282 | ret = func(opaque, bus_num, addr, class_id, vendor_id, | 283 | ret = func(opaque, bus_num, addr, class_id, vendor_id, |
283 | product_id, product_name, speed); | 284 | product_id, product_name, speed); |
284 | if (ret) | 285 | if (ret) |
@@ -321,7 +322,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) | @@ -321,7 +322,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) | ||
321 | } | 322 | } |
322 | fail: ; | 323 | fail: ; |
323 | } | 324 | } |
324 | - if (device_count) { | 325 | + if (device_count && (vendor_id || product_id)) { |
326 | + /* Add the last device. */ | ||
325 | ret = func(opaque, bus_num, addr, class_id, vendor_id, | 327 | ret = func(opaque, bus_num, addr, class_id, vendor_id, |
326 | product_id, product_name, speed); | 328 | product_id, product_name, speed); |
327 | } | 329 | } |