s->fl_base_addr = 0;
s->sof_timing = 64;
- for(i = 0; i < NB_PORTS; i++) {
+ for(i = 0; i < UHCI_PORTS; i++) {
port = &s->ports[i];
port->ctrl = 0x0080;
if (port->port.dev && port->port.dev->attached) {
.fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(dev, UHCIState),
VMSTATE_UINT8_EQUAL(num_ports_vmstate, UHCIState, NULL),
- VMSTATE_STRUCT_ARRAY(ports, UHCIState, NB_PORTS, 1,
+ VMSTATE_STRUCT_ARRAY(ports, UHCIState, UHCI_PORTS, 1,
vmstate_uhci_port, UHCIPort),
VMSTATE_UINT16(cmd, UHCIState),
VMSTATE_UINT16(status, UHCIState),
int i;
/* send reset on the USB bus */
- for(i = 0; i < NB_PORTS; i++) {
+ for(i = 0; i < UHCI_PORTS; i++) {
port = &s->ports[i];
usb_device_reset(port->port.dev);
}
int n;
n = (addr >> 1) & 7;
- if (n >= NB_PORTS) {
+ if (n >= UHCI_PORTS) {
return;
}
port = &s->ports[n];
UHCIPort *port;
int n;
n = (addr >> 1) & 7;
- if (n >= NB_PORTS) {
+ if (n >= UHCI_PORTS) {
goto read_default;
}
port = &s->ports[n];
USBDevice *dev;
int i;
- for (i = 0; i < NB_PORTS; i++) {
+ for (i = 0; i < UHCI_PORTS; i++) {
UHCIPort *port = &s->ports[i];
if (!(port->ctrl & UHCI_PORT_EN)) {
continue;
s->irq = pci_allocate_irq(dev);
if (s->masterbus) {
- USBPort *ports[NB_PORTS];
- for(i = 0; i < NB_PORTS; i++) {
+ USBPort *ports[UHCI_PORTS];
+ for(i = 0; i < UHCI_PORTS; i++) {
ports[i] = &s->ports[i].port;
}
- usb_register_companion(s->masterbus, ports, NB_PORTS,
+ usb_register_companion(s->masterbus, ports, UHCI_PORTS,
s->firstport, s, &uhci_port_ops,
USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL,
&err);
}
} else {
usb_bus_new(&s->bus, sizeof(s->bus), &uhci_bus_ops, DEVICE(dev));
- for (i = 0; i < NB_PORTS; i++) {
+ for (i = 0; i < UHCI_PORTS; i++) {
usb_register_port(&s->bus, &s->ports[i].port, s, i, &uhci_port_ops,
USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL);
}
}
s->bh = qemu_bh_new_guarded(uhci_bh, s, &DEVICE(dev)->mem_reentrancy_guard);
s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, uhci_frame_timer, s);
- s->num_ports_vmstate = NB_PORTS;
+ s->num_ports_vmstate = UHCI_PORTS;
QTAILQ_INIT(&s->queues);
memory_region_init_io(&s->io_bar, OBJECT(s), &uhci_ioport_ops, s,