summaryrefslogtreecommitdiffstats
path: root/hw/usb
diff options
context:
space:
mode:
authorEduardo Habkost2020-09-03 22:43:22 +0200
committerEduardo Habkost2020-09-09 15:26:43 +0200
commitdb1015e92e04835c9eb50c29625fe566d1202dbd (patch)
tree41fbc0bf3e3f29b7ecb339224a049e3f2a7db8fa /hw/usb
parentDelete duplicate QOM typedefs (diff)
downloadqemu-db1015e92e04835c9eb50c29625fe566d1202dbd.tar.gz
qemu-db1015e92e04835c9eb50c29625fe566d1202dbd.tar.xz
qemu-db1015e92e04835c9eb50c29625fe566d1202dbd.zip
Move QOM typedefs and add missing includes
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE. Patch generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]') which will split "typdef struct { ... } TypedefName" declarations. Followed by: $ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]') which will: - move the typedefs and #defines above the type check macros - add missing #include "qom/object.h" lines if necessary Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-9-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-10-ehabkost@redhat.com> Message-Id: <20200831210740.126168-11-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/ccid-card-emulated.c3
-rw-r--r--hw/usb/ccid-card-passthru.c1
-rw-r--r--hw/usb/ccid.h6
-rw-r--r--hw/usb/dev-audio.c6
-rw-r--r--hw/usb/dev-hid.c6
-rw-r--r--hw/usb/dev-hub.c6
-rw-r--r--hw/usb/dev-mtp.c1
-rw-r--r--hw/usb/dev-network.c6
-rw-r--r--hw/usb/dev-serial.c6
-rw-r--r--hw/usb/dev-smartcard-reader.c11
-rw-r--r--hw/usb/dev-storage.c6
-rw-r--r--hw/usb/dev-uas.c1
-rw-r--r--hw/usb/dev-wacom.c6
-rw-r--r--hw/usb/hcd-dwc2.h1
-rw-r--r--hw/usb/hcd-ehci.h21
-rw-r--r--hw/usb/hcd-ohci-pci.c6
-rw-r--r--hw/usb/hcd-ohci.h6
-rw-r--r--hw/usb/hcd-uhci.c1
-rw-r--r--hw/usb/hcd-xhci.h3
-rw-r--r--hw/usb/host-libusb.c3
-rw-r--r--hw/usb/redirect.c1
-rw-r--r--hw/usb/tusb6010.c6
22 files changed, 76 insertions, 37 deletions
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 0f1afd66be..a84f5783dc 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -35,6 +35,7 @@
#include "ccid.h"
#include "hw/qdev-properties.h"
#include "qapi/error.h"
+#include "qom/object.h"
#define DPRINTF(card, lvl, fmt, ...) \
do {\
@@ -45,6 +46,7 @@ do {\
#define TYPE_EMULATED_CCID "ccid-card-emulated"
+typedef struct EmulatedState EmulatedState;
#define EMULATED_CCID_CARD(obj) \
OBJECT_CHECK(EmulatedState, (obj), TYPE_EMULATED_CCID)
@@ -58,7 +60,6 @@ enum {
#define DEFAULT_BACKEND BACKEND_NSS_EMULATED
-typedef struct EmulatedState EmulatedState;
enum {
EMUL_READER_INSERT = 0,
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index bb325dbc4a..9c9d6857da 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -20,6 +20,7 @@
#include "qemu/sockets.h"
#include "ccid.h"
#include "qapi/error.h"
+#include "qom/object.h"
#define DPRINTF(card, lvl, fmt, ...) \
do { \
diff --git a/hw/usb/ccid.h b/hw/usb/ccid.h
index 531bf28fb0..b992d2ccf8 100644
--- a/hw/usb/ccid.h
+++ b/hw/usb/ccid.h
@@ -11,11 +11,13 @@
#define CCID_H
#include "hw/qdev-core.h"
+#include "qom/object.h"
typedef struct CCIDCardState CCIDCardState;
typedef struct CCIDCardInfo CCIDCardInfo;
#define TYPE_CCID_CARD "ccid-card"
+typedef struct CCIDCardClass CCIDCardClass;
#define CCID_CARD(obj) \
OBJECT_CHECK(CCIDCardState, (obj), TYPE_CCID_CARD)
#define CCID_CARD_CLASS(klass) \
@@ -27,7 +29,7 @@ typedef struct CCIDCardInfo CCIDCardInfo;
* callbacks to be used by the CCID device (hw/usb-ccid.c) to call
* into the smartcard device (hw/ccid-card-*.c)
*/
-typedef struct CCIDCardClass {
+struct CCIDCardClass {
/*< private >*/
DeviceClass parent_class;
/*< public >*/
@@ -37,7 +39,7 @@ typedef struct CCIDCardClass {
uint32_t len);
void (*realize)(CCIDCardState *card, Error **errp);
void (*unrealize)(CCIDCardState *card);
-} CCIDCardClass;
+};
/*
* state of the CCID Card device (i.e. hw/ccid-card-*.c)
diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c
index 1371c44f48..3fc8addae1 100644
--- a/hw/usb/dev-audio.c
+++ b/hw/usb/dev-audio.c
@@ -36,6 +36,7 @@
#include "migration/vmstate.h"
#include "desc.h"
#include "audio/audio.h"
+#include "qom/object.h"
static void usb_audio_reinit(USBDevice *dev, unsigned channels);
@@ -633,7 +634,7 @@ static uint8_t *streambuf_get(struct streambuf *buf, size_t *len)
return data;
}
-typedef struct USBAudioState {
+struct USBAudioState {
/* qemu interfaces */
USBDevice dev;
QEMUSoundCard card;
@@ -652,7 +653,8 @@ typedef struct USBAudioState {
uint32_t debug;
uint32_t buffer_user, buffer;
bool multi;
-} USBAudioState;
+};
+typedef struct USBAudioState USBAudioState;
#define TYPE_USB_AUDIO "usb-audio"
#define USB_AUDIO(obj) OBJECT_CHECK(USBAudioState, (obj), TYPE_USB_AUDIO)
diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c
index c73f7b2fe2..4d1de647bc 100644
--- a/hw/usb/dev-hid.c
+++ b/hw/usb/dev-hid.c
@@ -34,15 +34,17 @@
#include "hw/input/hid.h"
#include "hw/usb/hid.h"
#include "hw/qdev-properties.h"
+#include "qom/object.h"
-typedef struct USBHIDState {
+struct USBHIDState {
USBDevice dev;
USBEndpoint *intr;
HIDState hid;
uint32_t usb_version;
char *display;
uint32_t head;
-} USBHIDState;
+};
+typedef struct USBHIDState USBHIDState;
#define TYPE_USB_HID "usb-hid"
#define USB_HID(obj) OBJECT_CHECK(USBHIDState, (obj), TYPE_USB_HID)
diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c
index 5f19dd9fb5..07e395aa5f 100644
--- a/hw/usb/dev-hub.c
+++ b/hw/usb/dev-hub.c
@@ -32,6 +32,7 @@
#include "desc.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "qom/object.h"
#define MAX_PORTS 8
@@ -41,14 +42,15 @@ typedef struct USBHubPort {
uint16_t wPortChange;
} USBHubPort;
-typedef struct USBHubState {
+struct USBHubState {
USBDevice dev;
USBEndpoint *intr;
uint32_t num_ports;
bool port_power;
QEMUTimer *port_timer;
USBHubPort ports[MAX_PORTS];
-} USBHubState;
+};
+typedef struct USBHubState USBHubState;
#define TYPE_USB_HUB "usb-hub"
#define USB_HUB(obj) OBJECT_CHECK(USBHubState, (obj), TYPE_USB_HUB)
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 15a2243101..6df70a0844 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -28,6 +28,7 @@
#include "migration/vmstate.h"
#include "desc.h"
#include "qemu/units.h"
+#include "qom/object.h"
/* ----------------------------------------------------------------------- */
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index c69756709b..b60f8e52f5 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -37,6 +37,7 @@
#include "qemu/iov.h"
#include "qemu/module.h"
#include "qemu/cutils.h"
+#include "qom/object.h"
/*#define TRAFFIC_DEBUG*/
/* Thanks to NetChip Technologies for donating this product ID.
@@ -629,7 +630,7 @@ struct rndis_response {
uint8_t buf[];
};
-typedef struct USBNetState {
+struct USBNetState {
USBDevice dev;
enum rndis_state rndis_state;
@@ -651,7 +652,8 @@ typedef struct USBNetState {
NICState *nic;
NICConf conf;
QTAILQ_HEAD(, rndis_response) rndis_resp;
-} USBNetState;
+};
+typedef struct USBNetState USBNetState;
#define TYPE_USB_NET "usb-net"
#define USB_NET(obj) OBJECT_CHECK(USBNetState, (obj), TYPE_USB_NET)
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c
index 7e50e3ba47..8f13f2fd31 100644
--- a/hw/usb/dev-serial.c
+++ b/hw/usb/dev-serial.c
@@ -19,6 +19,7 @@
#include "desc.h"
#include "chardev/char-serial.h"
#include "chardev/char-fe.h"
+#include "qom/object.h"
//#define DEBUG_Serial
@@ -96,7 +97,7 @@ do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while (0)
#define FTDI_TEMT (1<<6) // Transmitter Empty
#define FTDI_FIFO (1<<7) // Error in FIFO
-typedef struct {
+struct USBSerialState {
USBDevice dev;
USBEndpoint *intr;
uint8_t recv_buf[RECV_BUF];
@@ -108,7 +109,8 @@ typedef struct {
QEMUSerialSetParams params;
int latency; /* ms */
CharBackend cs;
-} USBSerialState;
+};
+typedef struct USBSerialState USBSerialState;
#define TYPE_USB_SERIAL "usb-serial-dev"
#define USB_SERIAL_DEV(obj) OBJECT_CHECK(USBSerialState, (obj), TYPE_USB_SERIAL)
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index fcfe216594..a9898187b8 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -46,6 +46,7 @@
#include "desc.h"
#include "ccid.h"
+#include "qom/object.h"
#define DPRINTF(s, lvl, fmt, ...) \
do { \
@@ -60,6 +61,7 @@ do { \
#define D_VERBOSE 4
#define CCID_DEV_NAME "usb-ccid"
+typedef struct USBCCIDState USBCCIDState;
#define USB_CCID_DEV(obj) OBJECT_CHECK(USBCCIDState, (obj), CCID_DEV_NAME)
/*
* The two options for variable sized buffers:
@@ -274,14 +276,15 @@ typedef struct BulkIn {
uint32_t pos;
} BulkIn;
-typedef struct CCIDBus {
+struct CCIDBus {
BusState qbus;
-} CCIDBus;
+};
+typedef struct CCIDBus CCIDBus;
/*
* powered - defaults to true, changed by PowerOn/PowerOff messages
*/
-typedef struct USBCCIDState {
+struct USBCCIDState {
USBDevice dev;
USBEndpoint *intr;
USBEndpoint *bulk;
@@ -309,7 +312,7 @@ typedef struct USBCCIDState {
uint8_t powered;
uint8_t notify_slot_change;
uint8_t debug;
-} USBCCIDState;
+};
/*
* CCID Spec chapter 4: CCID uses a standard device descriptor per Chapter 9,
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 405a4ccfe7..55a04293a4 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -22,6 +22,7 @@
#include "sysemu/block-backend.h"
#include "qapi/visitor.h"
#include "qemu/cutils.h"
+#include "qom/object.h"
//#define DEBUG_MSD
@@ -50,7 +51,7 @@ struct usb_msd_csw {
uint8_t status;
};
-typedef struct {
+struct MSDState {
USBDevice dev;
enum USBMSDMode mode;
uint32_t scsi_off;
@@ -65,7 +66,8 @@ typedef struct {
BlockConf conf;
uint32_t removable;
SCSIDevice *scsi_dev;
-} MSDState;
+};
+typedef struct MSDState MSDState;
#define TYPE_USB_STORAGE "usb-storage-dev"
#define USB_STORAGE_DEV(obj) OBJECT_CHECK(MSDState, (obj), TYPE_USB_STORAGE)
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index a3a4d41c07..1d27bb942b 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -23,6 +23,7 @@
#include "hw/qdev-properties.h"
#include "hw/scsi/scsi.h"
#include "scsi/constants.h"
+#include "qom/object.h"
/* --------------------------------------------------------------------- */
diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c
index 76fc5a5dab..e2dae6a86d 100644
--- a/hw/usb/dev-wacom.c
+++ b/hw/usb/dev-wacom.c
@@ -33,12 +33,13 @@
#include "migration/vmstate.h"
#include "qemu/module.h"
#include "desc.h"
+#include "qom/object.h"
/* Interface requests */
#define WACOM_GET_REPORT 0x2101
#define WACOM_SET_REPORT 0x2109
-typedef struct USBWacomState {
+struct USBWacomState {
USBDevice dev;
USBEndpoint *intr;
QEMUPutMouseEntry *eh_entry;
@@ -51,7 +52,8 @@ typedef struct USBWacomState {
} mode;
uint8_t idle;
int changed;
-} USBWacomState;
+};
+typedef struct USBWacomState USBWacomState;
#define TYPE_USB_WACOM "usb-wacom-tablet"
#define USB_WACOM(obj) OBJECT_CHECK(USBWacomState, (obj), TYPE_USB_WACOM)
diff --git a/hw/usb/hcd-dwc2.h b/hw/usb/hcd-dwc2.h
index 54111d835e..71b40f0d8a 100644
--- a/hw/usb/hcd-dwc2.h
+++ b/hw/usb/hcd-dwc2.h
@@ -24,6 +24,7 @@
#include "hw/sysbus.h"
#include "hw/usb.h"
#include "sysemu/dma.h"
+#include "qom/object.h"
#define DWC2_MMIO_SIZE 0x11000
diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h
index 57b38cfc05..c12c9bae46 100644
--- a/hw/usb/hcd-ehci.h
+++ b/hw/usb/hcd-ehci.h
@@ -23,6 +23,7 @@
#include "sysemu/dma.h"
#include "hw/pci/pci.h"
#include "hw/sysbus.h"
+#include "qom/object.h"
#ifndef EHCI_DEBUG
#define EHCI_DEBUG 0
@@ -328,15 +329,16 @@ void usb_ehci_unrealize(EHCIState *s, DeviceState *dev);
void ehci_reset(void *opaque);
#define TYPE_PCI_EHCI "pci-ehci-usb"
+typedef struct EHCIPCIState EHCIPCIState;
#define PCI_EHCI(obj) OBJECT_CHECK(EHCIPCIState, (obj), TYPE_PCI_EHCI)
-typedef struct EHCIPCIState {
+struct EHCIPCIState {
/*< private >*/
PCIDevice pcidev;
/*< public >*/
EHCIState ehci;
-} EHCIPCIState;
+};
#define TYPE_SYS_BUS_EHCI "sysbus-ehci-usb"
@@ -347,6 +349,8 @@ typedef struct EHCIPCIState {
#define TYPE_PPC4xx_EHCI "ppc4xx-ehci-usb"
#define TYPE_FUSBH200_EHCI "fusbh200-ehci-usb"
+typedef struct EHCISysBusState EHCISysBusState;
+typedef struct SysBusEHCIClass SysBusEHCIClass;
#define SYS_BUS_EHCI(obj) \
OBJECT_CHECK(EHCISysBusState, (obj), TYPE_SYS_BUS_EHCI)
#define SYS_BUS_EHCI_CLASS(class) \
@@ -354,15 +358,15 @@ typedef struct EHCIPCIState {
#define SYS_BUS_EHCI_GET_CLASS(obj) \
OBJECT_GET_CLASS(SysBusEHCIClass, (obj), TYPE_SYS_BUS_EHCI)
-typedef struct EHCISysBusState {
+struct EHCISysBusState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
EHCIState ehci;
-} EHCISysBusState;
+};
-typedef struct SysBusEHCIClass {
+struct SysBusEHCIClass {
/*< private >*/
SysBusDeviceClass parent_class;
/*< public >*/
@@ -371,17 +375,18 @@ typedef struct SysBusEHCIClass {
uint16_t opregbase;
uint16_t portscbase;
uint16_t portnr;
-} SysBusEHCIClass;
+};
+typedef struct FUSBH200EHCIState FUSBH200EHCIState;
#define FUSBH200_EHCI(obj) \
OBJECT_CHECK(FUSBH200EHCIState, (obj), TYPE_FUSBH200_EHCI)
-typedef struct FUSBH200EHCIState {
+struct FUSBH200EHCIState {
/*< private >*/
EHCISysBusState parent_obj;
/*< public >*/
MemoryRegion mem_vendor;
-} FUSBH200EHCIState;
+};
#endif
diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c
index a7fb1666af..82fe967196 100644
--- a/hw/usb/hcd-ohci-pci.c
+++ b/hw/usb/hcd-ohci-pci.c
@@ -29,11 +29,13 @@
#include "hw/qdev-properties.h"
#include "trace.h"
#include "hcd-ohci.h"
+#include "qom/object.h"
#define TYPE_PCI_OHCI "pci-ohci"
+typedef struct OHCIPCIState OHCIPCIState;
#define PCI_OHCI(obj) OBJECT_CHECK(OHCIPCIState, (obj), TYPE_PCI_OHCI)
-typedef struct {
+struct OHCIPCIState {
/*< private >*/
PCIDevice parent_obj;
/*< public >*/
@@ -42,7 +44,7 @@ typedef struct {
char *masterbus;
uint32_t num_ports;
uint32_t firstport;
-} OHCIPCIState;
+};
/**
* A typical PCI OHCI will additionally set PERR in its configspace to
diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h
index 5c8819aedf..3e9053fb26 100644
--- a/hw/usb/hcd-ohci.h
+++ b/hw/usb/hcd-ohci.h
@@ -23,6 +23,7 @@
#include "sysemu/dma.h"
#include "hw/usb.h"
+#include "qom/object.h"
/* Number of Downstream Ports on the root hub: */
#define OHCI_MAX_PORTS 15
@@ -92,9 +93,10 @@ typedef struct OHCIState {
} OHCIState;
#define TYPE_SYSBUS_OHCI "sysbus-ohci"
+typedef struct OHCISysBusState OHCISysBusState;
#define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_OHCI)
-typedef struct {
+struct OHCISysBusState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
@@ -104,7 +106,7 @@ typedef struct {
uint32_t num_ports;
uint32_t firstport;
dma_addr_t dma_offset;
-} OHCISysBusState;
+};
extern const VMStateDescription vmstate_ohci_state;
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 37f7beb3fa..31ec5f4702 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -39,6 +39,7 @@
#include "trace.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
+#include "qom/object.h"
#define FRAME_TIMER_FREQ 1000
diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
index 946af51fc2..867388a061 100644
--- a/hw/usb/hcd-xhci.h
+++ b/hw/usb/hcd-xhci.h
@@ -21,11 +21,13 @@
#ifndef HW_USB_HCD_XHCI_H
#define HW_USB_HCD_XHCI_H
+#include "qom/object.h"
#define TYPE_XHCI "base-xhci"
#define TYPE_NEC_XHCI "nec-usb-xhci"
#define TYPE_QEMU_XHCI "qemu-xhci"
+typedef struct XHCIState XHCIState;
#define XHCI(obj) \
OBJECT_CHECK(XHCIState, (obj), TYPE_XHCI)
@@ -39,7 +41,6 @@
/* Very pessimistic, let's hope it's enough for all cases */
#define EV_QUEUE (((3 * 24) + 16) * MAXSLOTS)
-typedef struct XHCIState XHCIState;
typedef struct XHCIStreamContext XHCIStreamContext;
typedef struct XHCIEPContext XHCIEPContext;
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 08604f787f..30779c8ff4 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -34,6 +34,7 @@
*/
#include "qemu/osdep.h"
+#include "qom/object.h"
#ifndef CONFIG_WIN32
#include <poll.h>
#endif
@@ -60,10 +61,10 @@
/* ------------------------------------------------------------------------ */
#define TYPE_USB_HOST_DEVICE "usb-host"
+typedef struct USBHostDevice USBHostDevice;
#define USB_HOST_DEVICE(obj) \
OBJECT_CHECK(USBHostDevice, (obj), TYPE_USB_HOST_DEVICE)
-typedef struct USBHostDevice USBHostDevice;
typedef struct USBHostRequest USBHostRequest;
typedef struct USBHostIsoXfer USBHostIsoXfer;
typedef struct USBHostIsoRing USBHostIsoRing;
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 417a60a2e6..344fdc3d66 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -45,6 +45,7 @@
#include "hw/usb.h"
#include "migration/qemu-file-types.h"
#include "migration/vmstate.h"
+#include "qom/object.h"
/* ERROR is defined below. Remove any previous definition. */
#undef ERROR
diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c
index 27eb28d3e4..a15ee515d7 100644
--- a/hw/usb/tusb6010.c
+++ b/hw/usb/tusb6010.c
@@ -28,11 +28,13 @@
#include "hw/hw.h"
#include "hw/irq.h"
#include "hw/sysbus.h"
+#include "qom/object.h"
#define TYPE_TUSB6010 "tusb6010"
+typedef struct TUSBState TUSBState;
#define TUSB(obj) OBJECT_CHECK(TUSBState, (obj), TYPE_TUSB6010)
-typedef struct TUSBState {
+struct TUSBState {
SysBusDevice parent_obj;
MemoryRegion iomem[2];
@@ -68,7 +70,7 @@ typedef struct TUSBState {
uint32_t pullup[2];
uint32_t control_config;
uint32_t otg_timer_val;
-} TUSBState;
+};
#define TUSB_DEVCLOCK 60000000 /* 60 MHz */