| 622 |
|
|
| 623 |
if (pci_enabled && usb_enabled) { |
if (pci_enabled && usb_enabled) { |
| 624 |
USBPort *usb_root_ports[2]; |
USBPort *usb_root_ports[2]; |
| 625 |
USBDevice *usb_hub; |
USBDevice *usb_dev; |
| 626 |
usb_uhci_init(pci_bus, usb_root_ports); |
usb_uhci_init(pci_bus, usb_root_ports); |
| 627 |
#if 0 |
#if 0 |
| 628 |
{ |
{ |
| 629 |
USBPort *usb_hub1_ports[4]; |
USBPort *usb_hub1_ports[4]; |
| 630 |
USBPort *usb_hub2_ports[2]; |
USBPort *usb_hub2_ports[2]; |
| 631 |
/* test: we simulate a USB hub */ |
/* test: we simulate a USB hub */ |
| 632 |
usb_hub = usb_hub_init(usb_hub1_ports, 4); |
usb_dev = usb_hub_init(usb_hub1_ports, 4); |
| 633 |
usb_attach(usb_root_ports[0], usb_hub); |
usb_attach(usb_root_ports[0], usb_dev); |
| 634 |
|
|
| 635 |
/* test: we simulate a USB hub */ |
/* test: we simulate a USB hub */ |
| 636 |
usb_hub = usb_hub_init(usb_hub2_ports, 2); |
usb_dev = usb_hub_init(usb_hub2_ports, 2); |
| 637 |
usb_attach(usb_hub1_ports[0], usb_hub); |
usb_attach(usb_hub1_ports[0], usb_dev); |
| 638 |
} |
} |
| 639 |
#endif |
#endif |
| 640 |
|
#if 0 |
| 641 |
|
/* USB mouse */ |
| 642 |
|
usb_dev = usb_mouse_init(); |
| 643 |
|
usb_attach(usb_root_ports[0], usb_dev); |
| 644 |
|
#endif |
| 645 |
|
#if 1 |
| 646 |
/* simulated hub with the host USB devices connected to it */ |
/* simulated hub with the host USB devices connected to it */ |
| 647 |
usb_hub = usb_host_hub_init(); |
usb_dev = usb_host_hub_init(); |
| 648 |
usb_attach(usb_root_ports[0], usb_hub); |
usb_attach(usb_root_ports[0], usb_dev); |
| 649 |
|
#endif |
| 650 |
} |
} |
| 651 |
|
|
| 652 |
/* must be done after all PCI devices are instanciated */ |
/* must be done after all PCI devices are instanciated */ |