#include "hw/usb/desc.h"
#include "hw/usb/host.h"
+#ifdef CONFIG_USB_LIBUSB
+# define DEVNAME "usb-host-linux"
+#else
+# define DEVNAME "usb-host"
+#endif
+
/* We redefine it to avoid version problems */
struct usb_ctrltransfer {
uint8_t bRequestType;
trace_usb_host_reset(s->bus_num, s->addr);
- usb_host_do_reset(s);;
+ usb_host_do_reset(s);
usb_host_claim_interfaces(s, 0);
usb_linux_update_endp_table(s);
usb_host_release_port(s);
if (s->fd != -1) {
- usb_host_do_reset(s);;
+ usb_host_do_reset(s);
}
}
}
static const VMStateDescription vmstate_usb_host = {
- .name = "usb-host",
+ .name = DEVNAME,
.version_id = 1,
.minimum_version_id = 1,
.post_load = usb_host_post_load,
uc->handle_destroy = usb_host_handle_destroy;
dc->vmsd = &vmstate_usb_host;
dc->props = usb_host_dev_properties;
+ set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
}
static const TypeInfo usb_host_dev_info = {
- .name = "usb-host",
+ .name = DEVNAME,
.parent = TYPE_USB_DEVICE,
.instance_size = sizeof(USBHostDevice),
.class_init = usb_host_class_initfn,
if (unconnected == 0) {
/* nothing to watch */
if (usb_auto_timer) {
- qemu_del_timer(usb_auto_timer);
+ timer_del(usb_auto_timer);
trace_usb_host_auto_scan_disabled();
}
return;
usb_vmstate = qemu_add_vm_change_state_handler(usb_host_vm_state, NULL);
}
if (!usb_auto_timer) {
- usb_auto_timer = qemu_new_timer_ms(rt_clock, usb_host_auto_check, NULL);
+ usb_auto_timer = timer_new_ms(QEMU_CLOCK_REALTIME, usb_host_auto_check, NULL);
if (!usb_auto_timer) {
return;
}
trace_usb_host_auto_scan_enabled();
}
- qemu_mod_timer(usb_auto_timer, qemu_get_clock_ms(rt_clock) + 2000);
+ timer_mod(usb_auto_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 2000);
}
+#ifndef CONFIG_USB_LIBUSB
+
/**********************/
/* USB host device info */
bus, addr, f->port ? f->port : "*", vid, pid);
}
}
+
+#endif