static int usb_hub_initfn(USBDevice *dev)

{

    USBHubState *s = DO_UPCAST(USBHubState, dev, dev);

    USBHubPort *port;

    int i;



    s->dev.speed = USB_SPEED_FULL;

    for (i = 0; i < NUM_PORTS; i++) {

        port = &s->ports[i];

        usb_register_port(usb_bus_from_device(dev),

                          &port->port, s, i, &s->dev, usb_hub_attach);

        port->wPortStatus = PORT_STAT_POWER;

        port->wPortChange = 0;

    }

    return 0;

}

static int usb_hub_initfn(USBDevice *dev)

{

    USBHubState *s = DO_UPCAST(USBHubState, dev, dev);

    USBHubPort *port;

    int i;



    s->dev.speed = USB_SPEED_FULL;

    for (i = 0; i < NUM_PORTS; i++) {

        port = &s->ports[i];

        usb_register_port(usb_bus_from_device(dev),

                          &port->port, s, i, &s->dev, usb_hub_attach);

        port->wPortStatus = PORT_STAT_POWER;

        port->wPortChange = 0;

    }

    return 0;

}

static int FUNC_0(USBDevice *VAR_0)

{

    USBHubState *s = DO_UPCAST(USBHubState, VAR_0, VAR_0);

    USBHubPort *port;

    int VAR_1;



    s->VAR_0.speed = USB_SPEED_FULL;

    for (VAR_1 = 0; VAR_1 < NUM_PORTS; VAR_1++) {

        port = &s->ports[VAR_1];

        usb_register_port(usb_bus_from_device(VAR_0),

                          &port->port, s, VAR_1, &s->VAR_0, usb_hub_attach);

        port->wPortStatus = PORT_STAT_POWER;

        port->wPortChange = 0;

    }

    return 0;

}

static int FUNC_0(USBDevice *VAR_0)
{ USBHubState *s = DO_UPCAST(USBHubState, VAR_0, VAR_0); USBHubPort *port; int VAR_1; s->VAR_0.speed = USB_SPEED_FULL; for (VAR_1 = 0; VAR_1 < NUM_PORTS; VAR_1++) { port = &s->ports[VAR_1]; usb_register_port(usb_bus_from_device(VAR_0),
&port->port, s, VAR_1, &s->VAR_0, usb_hub_attach); port->wPortStatus = PORT_STAT_POWER; port->wPortChange = 0; } return 0; }