void usb_device_attach(USBDevice *dev, Error **errp)

{

    USBBus *bus = usb_bus_from_device(dev);

    USBPort *port = dev->port;

    char devspeed[32], portspeed[32];



    assert(port != NULL);

    assert(!dev->attached);

    usb_mask_to_str(devspeed, sizeof(devspeed), dev->speedmask);

    usb_mask_to_str(portspeed, sizeof(portspeed), port->speedmask);

    trace_usb_port_attach(bus->busnr, port->path,

                          devspeed, portspeed);



    if (!(port->speedmask & dev->speedmask)) {

        error_setg(errp, "Warning: speed mismatch trying to attach"

                   " usb device \"%s\" (%s speed)"

                   " to bus \"%s\", port \"%s\" (%s speed)",

                   dev->product_desc, devspeed,

                   bus->qbus.name, port->path, portspeed);

        return;

    }



    dev->attached++;

    usb_attach(port);

}

void usb_device_attach(USBDevice *dev, Error **errp)

{

    USBBus *bus = usb_bus_from_device(dev);

    USBPort *port = dev->port;

    char devspeed[32], portspeed[32];



    assert(port != NULL);

    assert(!dev->attached);

    usb_mask_to_str(devspeed, sizeof(devspeed), dev->speedmask);

    usb_mask_to_str(portspeed, sizeof(portspeed), port->speedmask);

    trace_usb_port_attach(bus->busnr, port->path,

                          devspeed, portspeed);



    if (!(port->speedmask & dev->speedmask)) {

        error_setg(errp, "Warning: speed mismatch trying to attach"

                   " usb device \"%s\" (%s speed)"

                   " to bus \"%s\", port \"%s\" (%s speed)",

                   dev->product_desc, devspeed,

                   bus->qbus.name, port->path, portspeed);

        return;

    }



    dev->attached++;

    usb_attach(port);

}

void FUNC_0(USBDevice *VAR_0, Error **VAR_1)

{

    USBBus *bus = usb_bus_from_device(VAR_0);

    USBPort *port = VAR_0->port;

    char VAR_2[32], VAR_3[32];



    assert(port != NULL);

    assert(!VAR_0->attached);

    usb_mask_to_str(VAR_2, sizeof(VAR_2), VAR_0->speedmask);

    usb_mask_to_str(VAR_3, sizeof(VAR_3), port->speedmask);

    trace_usb_port_attach(bus->busnr, port->path,

                          VAR_2, VAR_3);



    if (!(port->speedmask & VAR_0->speedmask)) {

        error_setg(VAR_1, "Warning: speed mismatch trying to attach"

                   " usb device \"%s\" (%s speed)"

                   " to bus \"%s\", port \"%s\" (%s speed)",

                   VAR_0->product_desc, VAR_2,

                   bus->qbus.name, port->path, VAR_3);

        return;

    }



    VAR_0->attached++;

    usb_attach(port);

}

void FUNC_0(USBDevice *VAR_0, Error **VAR_1)
{ USBBus *bus = usb_bus_from_device(VAR_0); USBPort *port = VAR_0->port; char VAR_2[32], VAR_3[32]; assert(port != NULL); assert(!VAR_0->attached); usb_mask_to_str(VAR_2, sizeof(VAR_2), VAR_0->speedmask); usb_mask_to_str(VAR_3, sizeof(VAR_3), port->speedmask); trace_usb_port_attach(bus->busnr, port->path,
VAR_2, VAR_3); if (!(port->speedmask & VAR_0->speedmask)) { error_setg(VAR_1, "Warning: speed mismatch trying to attach"
" usb device \"%s\" (%s speed)"
" to bus \"%s\", port \"%s\" (%s speed)",
VAR_0->product_desc, VAR_2,
bus->qbus.name, port->path, VAR_3); return; } VAR_0->attached++; usb_attach(port); }