@@ -2,7 +2,7 @@
#define QEMU_HW_USB_DESC_H
#include <wchar.h>
-#include "hw/usb.h"
+#include "usb-internal.h"
/* binary representation */
typedef struct USBDescriptor {
@@ -20,7 +20,7 @@
#define HW_USB_DWC2_H
#include "hw/sysbus.h"
-#include "hw/usb.h"
+#include "usb-internal.h"
#define DWC2_MMIO_SIZE 0x11000
@@ -19,10 +19,10 @@
#define HW_USB_HCD_EHCI_H
#include "qemu/timer.h"
-#include "hw/usb.h"
#include "sysemu/dma.h"
#include "hw/pci/pci.h"
#include "hw/sysbus.h"
+#include "usb-internal.h"
#define CAPA_SIZE 0x10
@@ -22,7 +22,7 @@
#define HCD_OHCI_H
#include "sysemu/dma.h"
-#include "hw/usb.h"
+#include "usb-internal.h"
/* Number of Downstream Ports on the root hub: */
#define OHCI_MAX_PORTS 15
@@ -22,7 +22,7 @@
#ifndef HW_USB_HCD_XHCI_H
#define HW_USB_HCD_XHCI_H
-#include "hw/usb.h"
+#include "usb-internal.h"
#define TYPE_XHCI "base-xhci"
#define TYPE_NEC_XHCI "nec-usb-xhci"
similarity index 99%
rename from include/hw/usb.h
rename to hw/usb/usb-internal.h
@@ -1,8 +1,5 @@
-#ifndef QEMU_USB_H
-#define QEMU_USB_H
-
/*
- * QEMU USB API
+ * QEMU USB internal API
*
* Copyright (c) 2005 Fabrice Bellard
*
@@ -24,6 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef QEMU_USB_INTERNAL_H
+#define QEMU_USB_INTERNAL_H
#include "hw/qdev-core.h"
#include "hw/usb/usb.h"
@@ -1,6 +1,5 @@
#include "qemu/osdep.h"
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
@@ -9,6 +8,7 @@
#include "monitor/monitor.h"
#include "trace.h"
#include "qemu/cutils.h"
+#include "usb-internal.h"
#include "desc.h"
static void usb_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent);
@@ -21,9 +21,9 @@
*/
#include "qemu/osdep.h"
#include "qemu/units.h"
-#include "hw/usb.h"
#include "qemu/iov.h"
#include "trace.h"
+#include "usb-internal.h"
static void usb_combined_packet_add(USBCombinedPacket *combined, USBPacket *p)
{
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
-#include "hw/usb.h"
#include "qemu/iov.h"
#include "trace.h"
+#include "usb-internal.h"
void usb_pick_speed(USBPort *port)
{
@@ -1,6 +1,6 @@
#include "qemu/osdep.h"
-#include "hw/usb.h"
#include "desc.h"
+#include "usb-internal.h"
/*
* Microsoft OS Descriptors
@@ -1,8 +1,7 @@
#include "qemu/osdep.h"
-
-#include "hw/usb.h"
#include "desc.h"
#include "trace.h"
+#include "usb-internal.h"
/* ------------------------------------------------------------------ */
@@ -32,10 +32,10 @@
#include "qemu/osdep.h"
#include "qemu/module.h"
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "desc.h"
#include "audio/audio.h"
+#include "usb-internal.h"
static void usb_audio_reinit(USBDevice *dev, unsigned channels);
@@ -25,7 +25,6 @@
#include "qemu/osdep.h"
#include "ui/console.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "desc.h"
#include "qapi/error.h"
@@ -33,6 +32,7 @@
#include "qemu/timer.h"
#include "hw/input/hid.h"
#include "hw/qdev-properties.h"
+#include "usb-internal.h"
/* HID interface requests */
#define GET_REPORT 0xa101
@@ -27,11 +27,11 @@
#include "qemu/timer.h"
#include "trace.h"
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "desc.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "usb-internal.h"
#define MAX_PORTS 8
@@ -24,10 +24,10 @@
#include "qemu/filemonitor.h"
#include "trace.h"
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "desc.h"
#include "qemu/units.h"
+#include "usb-internal.h"
/* ----------------------------------------------------------------------- */
@@ -26,7 +26,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "desc.h"
#include "net/net.h"
@@ -37,6 +36,7 @@
#include "qemu/iov.h"
#include "qemu/module.h"
#include "qemu/cutils.h"
+#include "usb-internal.h"
/*#define TRAFFIC_DEBUG*/
/* Thanks to NetChip Technologies for donating this product ID.
@@ -14,11 +14,11 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "desc.h"
#include "chardev/char-serial.h"
#include "chardev/char-fe.h"
+#include "usb-internal.h"
//#define DEBUG_Serial
@@ -41,9 +41,9 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "desc.h"
+#include "usb-internal.h"
#include "ccid.h"
@@ -13,7 +13,6 @@
#include "qemu/module.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
-#include "hw/usb.h"
#include "desc.h"
#include "hw/qdev-properties.h"
#include "hw/scsi/scsi.h"
@@ -22,6 +21,7 @@
#include "sysemu/block-backend.h"
#include "qapi/visitor.h"
#include "qemu/cutils.h"
+#include "usb-internal.h"
//#define DEBUG_MSD
@@ -17,12 +17,12 @@
#include "qemu/main-loop.h"
#include "qemu/module.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "desc.h"
#include "hw/qdev-properties.h"
#include "hw/scsi/scsi.h"
#include "scsi/constants.h"
+#include "usb-internal.h"
/* --------------------------------------------------------------------- */
@@ -28,10 +28,10 @@
#include "qemu/osdep.h"
#include "ui/console.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "qemu/module.h"
#include "desc.h"
+#include "usb-internal.h"
/* Interface requests */
#define WACOM_GET_REPORT 0x2101
@@ -43,6 +43,7 @@
#include "qemu/log.h"
#include "hw/qdev-properties.h"
#include "dwc2-regs.h"
+#include "usb-internal.h"
#define USB_HZ_FS 12000000
#define USB_HZ_HS 96000000
@@ -22,10 +22,10 @@
*/
#include "qemu/osdep.h"
#include "qemu/timer.h"
-#include "hw/usb.h"
#include "hw/irq.h"
#include "hw/hw.h"
#include "hcd-musb.h"
+#include "usb-internal.h"
/* Common USB registers */
#define MUSB_HDRC_FADDR 0x00 /* 8-bit */
@@ -21,7 +21,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/timer.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "hw/pci/pci.h"
#include "hw/sysbus.h"
@@ -29,6 +28,7 @@
#include "hw/qdev-properties.h"
#include "trace.h"
#include "hcd-ohci.h"
+#include "usb-internal.h"
#define TYPE_PCI_OHCI "pci-ohci"
#define PCI_OHCI(obj) OBJECT_CHECK(OHCIPCIState, (obj), TYPE_PCI_OHCI)
@@ -30,7 +30,6 @@
#include "qapi/error.h"
#include "qemu/module.h"
#include "qemu/timer.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "hw/sysbus.h"
#include "hw/qdev-dma.h"
@@ -27,7 +27,6 @@
*/
#include "qemu/osdep.h"
-#include "hw/usb.h"
#include "hw/usb/uhci-regs.h"
#include "migration/vmstate.h"
#include "hw/pci/pci.h"
@@ -39,6 +38,7 @@
#include "trace.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
+#include "usb-internal.h"
#define FRAME_TIMER_FREQ 1000
@@ -20,11 +20,10 @@
*/
#include "qemu/osdep.h"
-#include "hw/usb.h"
#include "qemu/module.h"
#include "hw/pci/pci.h"
#include "hw/qdev-properties.h"
-
+#include "usb-internal.h"
#include "hcd-xhci.h"
static Property nec_xhci_properties[] = {
@@ -23,7 +23,6 @@
#include "qemu/timer.h"
#include "qemu/module.h"
#include "qemu/queue.h"
-#include "hw/usb.h"
#include "migration/vmstate.h"
#include "hw/pci/pci.h"
#include "hw/qdev-properties.h"
@@ -33,6 +32,7 @@
#include "qapi/error.h"
#include "hcd-xhci.h"
+#include "usb-internal.h"
//#define DEBUG_XHCI
//#define DEBUG_DATA
@@ -50,7 +50,7 @@
#include "trace.h"
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
+#include "usb-internal.h"
/* ------------------------------------------------------------------------ */
@@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
-#include "hw/usb.h"
#include "sysemu/dma.h"
+#include "usb-internal.h"
int usb_packet_map(USBPacket *p, QEMUSGList *sgl)
{
@@ -14,7 +14,7 @@
#include "qemu/osdep.h"
#include "quirks.inc.c"
-#include "hw/usb.h"
+#include "usb-internal.h"
#include "usb-quirks.h"
static bool usb_id_match(const struct usb_device_id *ids,
@@ -42,9 +42,9 @@
#include <usbredirfilter.h>
#include "hw/qdev-properties.h"
-#include "hw/usb.h"
#include "migration/qemu-file-types.h"
#include "migration/vmstate.h"
+#include "usb-internal.h"
#include "usb-quirks.h"
/* ERROR is defined below. Remove any previous definition. */
@@ -22,12 +22,12 @@
#include "qemu/osdep.h"
#include "qemu/module.h"
#include "qemu/timer.h"
-#include "hw/usb.h"
#include "hw/arm/omap.h"
#include "hw/hw.h"
#include "hw/irq.h"
#include "hw/sysbus.h"
#include "hcd-musb.h"
+#include "usb-internal.h"
#define TYPE_TUSB6010 "tusb6010"
#define TUSB(obj) OBJECT_CHECK(TUSBState, (obj), TYPE_TUSB6010)
@@ -27,12 +27,12 @@
#include "qemu/main-loop.h"
#include "qemu/option.h"
#include "hw/sysbus.h"
-#include "hw/usb.h"
#include "hw/xen/xen-legacy-backend.h"
#include "monitor/qdev.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
+#include "usb-internal.h"
#include "hw/xen/interface/io/usbif.h"
@@ -1642,7 +1642,6 @@ F: hw/usb/*
F: tests/qtest/usb-*-test.c
F: docs/usb2.txt
F: docs/usb-storage.txt
-F: include/hw/usb.h
F: include/hw/usb/
F: default-configs/usb.mak
Only the files under hw/usb/ require access to the USB internal API. Move include/hw/usb.h to hw/usb/usb-internal.h to reduce its scope. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- hw/usb/desc.h | 2 +- hw/usb/hcd-dwc2.h | 2 +- hw/usb/hcd-ehci.h | 2 +- hw/usb/hcd-ohci.h | 2 +- hw/usb/hcd-xhci.h | 2 +- include/hw/usb.h => hw/usb/usb-internal.h | 7 +++---- hw/usb/bus.c | 2 +- hw/usb/combined-packet.c | 2 +- hw/usb/core.c | 2 +- hw/usb/desc-msos.c | 2 +- hw/usb/desc.c | 3 +-- hw/usb/dev-audio.c | 2 +- hw/usb/dev-hid.c | 2 +- hw/usb/dev-hub.c | 2 +- hw/usb/dev-mtp.c | 2 +- hw/usb/dev-network.c | 2 +- hw/usb/dev-serial.c | 2 +- hw/usb/dev-smartcard-reader.c | 2 +- hw/usb/dev-storage.c | 2 +- hw/usb/dev-uas.c | 2 +- hw/usb/dev-wacom.c | 2 +- hw/usb/hcd-dwc2.c | 1 + hw/usb/hcd-musb.c | 2 +- hw/usb/hcd-ohci-pci.c | 2 +- hw/usb/hcd-ohci.c | 1 - hw/usb/hcd-uhci.c | 2 +- hw/usb/hcd-xhci-nec.c | 3 +-- hw/usb/hcd-xhci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/libhw.c | 2 +- hw/usb/quirks.c | 2 +- hw/usb/redirect.c | 2 +- hw/usb/tusb6010.c | 2 +- hw/usb/xen-usb.c | 2 +- MAINTAINERS | 1 - 35 files changed, 35 insertions(+), 39 deletions(-) rename include/hw/usb.h => hw/usb/usb-internal.h (99%)