new file mode 100644
@@ -0,0 +1,27 @@
+/*
+ * USB quirk handling
+ *
+ * Copyright (c) 2012 Red Hat, Inc.
+ *
+ * Red Hat Authors:
+ * Hans de Goede <hdegoede@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef HW_USB_QUIRKS_H
+#define HW_USB_QUIRKS_H
+
+/* In bulk endpoints are streaming data sources (iow behave like isoc eps) */
+#define USB_QUIRK_BUFFER_BULK_IN 0x01
+/* Bulk pkts in FTDI format, need special handling when combining packets */
+#define USB_QUIRK_IS_FTDI 0x02
+
+int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
+ uint8_t interface_class, uint8_t interface_subclass,
+ uint8_t interface_protocol);
+
+#endif
@@ -549,15 +549,4 @@ int usb_device_alloc_streams(USBDevice *dev, USBEndpoint **eps, int nr_eps,
int streams);
void usb_device_free_streams(USBDevice *dev, USBEndpoint **eps, int nr_eps);
-/* quirks.c */
-
-/* In bulk endpoints are streaming data sources (iow behave like isoc eps) */
-#define USB_QUIRK_BUFFER_BULK_IN 0x01
-/* Bulk pkts in FTDI format, need special handling when combining packets */
-#define USB_QUIRK_IS_FTDI 0x02
-
-int usb_get_quirks(uint16_t vendor_id, uint16_t product_id,
- uint8_t interface_class, uint8_t interface_subclass,
- uint8_t interface_protocol);
-
#endif
@@ -15,6 +15,7 @@
#include "qemu/osdep.h"
#include "quirks.inc.c"
#include "hw/usb.h"
+#include "usb-quirks.h"
static bool usb_id_match(const struct usb_device_id *ids,
uint16_t vendor_id, uint16_t product_id,
@@ -45,6 +45,7 @@
#include "hw/usb.h"
#include "migration/qemu-file-types.h"
#include "migration/vmstate.h"
+#include "usb-quirks.h"
/* ERROR is defined below. Remove any previous definition. */
#undef ERROR
Only redirect.c consumes the quirks API. Reduce the big "hw/usb.h" header by moving the quirks related declaration into their own header. As nothing out of hw/usb/ requires it, keep it local. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- hw/usb/usb-quirks.h | 27 +++++++++++++++++++++++++++ include/hw/usb.h | 11 ----------- hw/usb/quirks.c | 1 + hw/usb/redirect.c | 1 + 4 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 hw/usb/usb-quirks.h