Revision a594cfbf hw/pc.c
b/hw/pc.c | ||
---|---|---|
42 | 42 |
static RTCState *rtc_state; |
43 | 43 |
static PITState *pit; |
44 | 44 |
static IOAPICState *ioapic; |
45 |
static USBPort *usb_root_ports[2]; |
|
45 | 46 |
|
46 | 47 |
static void ioport80_write(void *opaque, uint32_t addr, uint32_t data) |
47 | 48 |
{ |
... | ... | |
625 | 626 |
cmos_init(ram_size, boot_device, bs_table); |
626 | 627 |
|
627 | 628 |
if (pci_enabled && usb_enabled) { |
628 |
USBPort *usb_root_ports[2]; |
|
629 |
USBDevice *usb_dev; |
|
630 | 629 |
usb_uhci_init(pci_bus, usb_root_ports); |
631 |
#if 0 |
|
632 |
{ |
|
633 |
USBPort *usb_hub1_ports[4]; |
|
634 |
USBPort *usb_hub2_ports[2]; |
|
635 |
/* test: we simulate a USB hub */ |
|
636 |
usb_dev = usb_hub_init(usb_hub1_ports, 4); |
|
637 |
usb_attach(usb_root_ports[0], usb_dev); |
|
638 |
|
|
639 |
/* test: we simulate a USB hub */ |
|
640 |
usb_dev = usb_hub_init(usb_hub2_ports, 2); |
|
641 |
usb_attach(usb_hub1_ports[0], usb_dev); |
|
642 |
} |
|
643 |
#endif |
|
644 |
#if 0 |
|
645 |
/* USB mouse */ |
|
646 |
usb_dev = usb_mouse_init(); |
|
647 |
usb_attach(usb_root_ports[0], usb_dev); |
|
648 |
#endif |
|
649 |
#if 1 |
|
650 |
/* simulated hub with the host USB devices connected to it */ |
|
651 |
usb_dev = usb_host_hub_init(); |
|
652 |
usb_attach(usb_root_ports[0], usb_dev); |
|
653 |
#endif |
|
630 |
usb_attach(usb_root_ports[0], vm_usb_hub); |
|
654 | 631 |
} |
655 | 632 |
|
656 | 633 |
/* must be done after all PCI devices are instanciated */ |
Also available in: Unified diff