hcd-ohci.c (0c28d0d07fbcd7aa44d231241d444d00882256e2) | hcd-ohci.c (f4bbaaf584ed8d0a430b467bace15f338cba4c57) |
---|---|
1/* 2 * QEMU USB OHCI Emulation 3 * Copyright (c) 2004 Gianni Tedesco 4 * Copyright (c) 2006 CodeSourcery 5 * Copyright (c) 2006 Openedhand Ltd. 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public --- 1818 unchanged lines hidden (view full) --- 1827static USBBusOps ohci_bus_ops = { 1828}; 1829 1830static int usb_ohci_init(OHCIState *ohci, DeviceState *dev, 1831 int num_ports, dma_addr_t localmem_base, 1832 char *masterbus, uint32_t firstport, 1833 AddressSpace *as) 1834{ | 1/* 2 * QEMU USB OHCI Emulation 3 * Copyright (c) 2004 Gianni Tedesco 4 * Copyright (c) 2006 CodeSourcery 5 * Copyright (c) 2006 Openedhand Ltd. 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public --- 1818 unchanged lines hidden (view full) --- 1827static USBBusOps ohci_bus_ops = { 1828}; 1829 1830static int usb_ohci_init(OHCIState *ohci, DeviceState *dev, 1831 int num_ports, dma_addr_t localmem_base, 1832 char *masterbus, uint32_t firstport, 1833 AddressSpace *as) 1834{ |
1835 Error *err = NULL; |
|
1835 int i; 1836 1837 ohci->as = as; 1838 1839 if (usb_frame_time == 0) { 1840#ifdef OHCI_TIME_WARP 1841 usb_frame_time = get_ticks_per_sec(); 1842 usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ/1000); --- 9 unchanged lines hidden (view full) --- 1852 } 1853 1854 ohci->num_ports = num_ports; 1855 if (masterbus) { 1856 USBPort *ports[OHCI_MAX_PORTS]; 1857 for(i = 0; i < num_ports; i++) { 1858 ports[i] = &ohci->rhport[i].port; 1859 } | 1836 int i; 1837 1838 ohci->as = as; 1839 1840 if (usb_frame_time == 0) { 1841#ifdef OHCI_TIME_WARP 1842 usb_frame_time = get_ticks_per_sec(); 1843 usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ/1000); --- 9 unchanged lines hidden (view full) --- 1853 } 1854 1855 ohci->num_ports = num_ports; 1856 if (masterbus) { 1857 USBPort *ports[OHCI_MAX_PORTS]; 1858 for(i = 0; i < num_ports; i++) { 1859 ports[i] = &ohci->rhport[i].port; 1860 } |
1860 if (usb_register_companion(masterbus, ports, num_ports, 1861 firstport, ohci, &ohci_port_ops, 1862 USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL) != 0) { | 1861 usb_register_companion(masterbus, ports, num_ports, 1862 firstport, ohci, &ohci_port_ops, 1863 USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL, 1864 &err); 1865 if (err) { 1866 error_report_err(err); |
1863 return -1; 1864 } 1865 } else { 1866 usb_bus_new(&ohci->bus, sizeof(ohci->bus), &ohci_bus_ops, dev); 1867 for (i = 0; i < num_ports; i++) { 1868 usb_register_port(&ohci->bus, &ohci->rhport[i].port, 1869 ohci, i, &ohci_port_ops, 1870 USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL); --- 268 unchanged lines hidden --- | 1867 return -1; 1868 } 1869 } else { 1870 usb_bus_new(&ohci->bus, sizeof(ohci->bus), &ohci_bus_ops, dev); 1871 for (i = 0; i < num_ports; i++) { 1872 usb_register_port(&ohci->bus, &ohci->rhport[i].port, 1873 ohci, i, &ohci_port_ops, 1874 USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL); --- 268 unchanged lines hidden --- |