mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
QOM boilerplate cleanup
Documentation build fix: * memory: Remove kernel-doc comment marker (Eduardo Habkost) QOM cleanups: * Rename QOM macros for consistency between TYPE_* and type checking constants (Eduardo Habkost) QOM new macros: * OBJECT_DECLARE_* and OBJECT_DEFINE_* macros (Daniel P. Berrangé) * DECLARE_*_CHECKER macros (Eduardo Habkost) Automated QOM boilerplate changes: * Automated changes to use DECLARE_*_CHECKER (Eduardo Habkost * Automated changes to use OBJECT_DECLARE* (Eduardo Habkost) -----BEGIN PGP SIGNATURE----- iQJIBAABCAAyFiEEWjIv1avE09usz9GqKAeTb5hNxaYFAl9abc0UHGVoYWJrb3N0 QHJlZGhhdC5jb20ACgkQKAeTb5hNxaYU9Q/8CyK1w2SlItxBhos7zojqnZ9TP1Jt b1YCApQJ+bKSPAUDyefajQA0D9HeR9bFlreiOprQnmZWOqeOvnRIxNGvelJRqRRu KcIA5DIfVMJRkKJQEXairrGdnPmFLWSLEb7AmwxyAhp5G51PCP/3kbudi3T/vrNr OaccUejs5UgImPfO8Fm+0zqZPmblq/xmtU0p77FvDxGNFPPG8ddpu7eKksGD7FYd 5bTJTtUhONYG9EJMUD2TBxnJoy1pi6AYUu4+2T211RpBcxeiyNSSitI8fZTk6BGl 33VwQib9SXjGaE8VsSvHDHhLLec7sqqr2JH3rfvyKF6BOptKWzmSzFdbo2mrRkSy 8jfCImQgTBBMAHBWP+MFTeKuzfhikZx2DbBLzpppHMMvCca6Zc+oYgR2FbVwuPsw H2YL+8Wx4Ws6RXe147toNDRbv75vnS7F3fU800Pcur5VHJWTgSpT/tggzmVPWsdU GeUgceYlXyVk5/fC89ZhhtD9eurfBSzQR4eN7/nie2wD6PFMpZkOjHwLn40uWsyq xRO0F4uYghNU1N8z6NBhEYLTBtEcS1HFEisSLQrnTQH9W0I7mBx3MaZib/uK7NLC b2gT0hossTT8Z46Z8ynoZarwO5EquAMWEQtc9hfZGWacrQEpjVm2DMYMfu83krWb xhgl+mpKqVasAPk= =RjXc -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging QOM boilerplate cleanup Documentation build fix: * memory: Remove kernel-doc comment marker (Eduardo Habkost) QOM cleanups: * Rename QOM macros for consistency between TYPE_* and type checking constants (Eduardo Habkost) QOM new macros: * OBJECT_DECLARE_* and OBJECT_DEFINE_* macros (Daniel P. Berrangé) * DECLARE_*_CHECKER macros (Eduardo Habkost) Automated QOM boilerplate changes: * Automated changes to use DECLARE_*_CHECKER (Eduardo Habkost * Automated changes to use OBJECT_DECLARE* (Eduardo Habkost) # gpg: Signature made Thu 10 Sep 2020 19:17:49 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: (33 commits) virtio-vga: Use typedef name for instance_size vhost-user-vga: Use typedef name for instance_size xilinx_axienet: Use typedef name for instance_size lpc_ich9: Use typedef name for instance_size omap_intc: Use typedef name for instance_size xilinx_axidma: Use typedef name for instance_size tusb6010: Rename TUSB to TUSB6010 pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312 vfio: Rename PCI_VFIO to VFIO_PCI usb: Rename USB_SERIAL_DEV to USB_SERIAL sabre: Rename SABRE_DEVICE to SABRE rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER esp: Rename ESP_STATE to ESP ahci: Rename ICH_AHCI to ICH9_AHCI vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE gpex: Fix type checking function name ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
f4ef8c9cc1
827 changed files with 7851 additions and 4406 deletions
|
@ -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,8 +46,9 @@ do {\
|
|||
|
||||
|
||||
#define TYPE_EMULATED_CCID "ccid-card-emulated"
|
||||
#define EMULATED_CCID_CARD(obj) \
|
||||
OBJECT_CHECK(EmulatedState, (obj), TYPE_EMULATED_CCID)
|
||||
typedef struct EmulatedState EmulatedState;
|
||||
DECLARE_INSTANCE_CHECKER(EmulatedState, EMULATED_CCID_CARD,
|
||||
TYPE_EMULATED_CCID)
|
||||
|
||||
#define BACKEND_NSS_EMULATED_NAME "nss-emulated"
|
||||
#define BACKEND_CERTIFICATES_NAME "certificates"
|
||||
|
@ -58,7 +60,6 @@ enum {
|
|||
|
||||
#define DEFAULT_BACKEND BACKEND_NSS_EMULATED
|
||||
|
||||
typedef struct EmulatedState EmulatedState;
|
||||
|
||||
enum {
|
||||
EMUL_READER_INSERT = 0,
|
||||
|
|
|
@ -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 { \
|
||||
|
@ -64,8 +65,8 @@ struct PassthruState {
|
|||
};
|
||||
|
||||
#define TYPE_CCID_PASSTHRU "ccid-card-passthru"
|
||||
#define PASSTHRU_CCID_CARD(obj) \
|
||||
OBJECT_CHECK(PassthruState, (obj), TYPE_CCID_PASSTHRU)
|
||||
DECLARE_INSTANCE_CHECKER(PassthruState, PASSTHRU_CCID_CARD,
|
||||
TYPE_CCID_PASSTHRU)
|
||||
|
||||
/*
|
||||
* VSCard protocol over chardev
|
||||
|
|
|
@ -11,23 +11,21 @@
|
|||
#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"
|
||||
#define CCID_CARD(obj) \
|
||||
OBJECT_CHECK(CCIDCardState, (obj), TYPE_CCID_CARD)
|
||||
#define CCID_CARD_CLASS(klass) \
|
||||
OBJECT_CLASS_CHECK(CCIDCardClass, (klass), TYPE_CCID_CARD)
|
||||
#define CCID_CARD_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(CCIDCardClass, (obj), TYPE_CCID_CARD)
|
||||
typedef struct CCIDCardClass CCIDCardClass;
|
||||
DECLARE_OBJ_CHECKERS(CCIDCardState, CCIDCardClass,
|
||||
CCID_CARD, TYPE_CCID_CARD)
|
||||
|
||||
/*
|
||||
* 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 +35,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)
|
||||
|
|
|
@ -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,10 +653,12 @@ 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)
|
||||
DECLARE_INSTANCE_CHECKER(USBAudioState, USB_AUDIO,
|
||||
TYPE_USB_AUDIO)
|
||||
|
||||
static void output_callback(void *opaque, int avail)
|
||||
{
|
||||
|
|
|
@ -34,18 +34,21 @@
|
|||
#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)
|
||||
DECLARE_INSTANCE_CHECKER(USBHIDState, USB_HID,
|
||||
TYPE_USB_HID)
|
||||
|
||||
enum {
|
||||
STR_MANUFACTURER = 1,
|
||||
|
|
|
@ -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,17 +42,19 @@ 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)
|
||||
DECLARE_INSTANCE_CHECKER(USBHubState, USB_HUB,
|
||||
TYPE_USB_HUB)
|
||||
|
||||
#define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE)
|
||||
#define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE)
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "migration/vmstate.h"
|
||||
#include "desc.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
|
@ -237,7 +238,8 @@ typedef struct {
|
|||
} QEMU_PACKED ObjectInfo;
|
||||
|
||||
#define TYPE_USB_MTP "usb-mtp"
|
||||
#define USB_MTP(obj) OBJECT_CHECK(MTPState, (obj), TYPE_USB_MTP)
|
||||
DECLARE_INSTANCE_CHECKER(MTPState, USB_MTP,
|
||||
TYPE_USB_MTP)
|
||||
|
||||
#define QEMU_STORAGE_ID 0x00010001
|
||||
|
||||
|
|
|
@ -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,10 +652,12 @@ 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)
|
||||
DECLARE_INSTANCE_CHECKER(USBNetState, USB_NET,
|
||||
TYPE_USB_NET)
|
||||
|
||||
static int is_rndis(USBNetState *s)
|
||||
{
|
||||
|
|
|
@ -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,10 +109,12 @@ 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)
|
||||
DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL,
|
||||
TYPE_USB_SERIAL)
|
||||
|
||||
enum {
|
||||
STR_MANUFACTURER = 1,
|
||||
|
@ -514,7 +517,7 @@ static void usb_serial_event(void *opaque, QEMUChrEvent event)
|
|||
|
||||
static void usb_serial_realize(USBDevice *dev, Error **errp)
|
||||
{
|
||||
USBSerialState *s = USB_SERIAL_DEV(dev);
|
||||
USBSerialState *s = USB_SERIAL(dev);
|
||||
Error *local_err = NULL;
|
||||
|
||||
usb_desc_create_serial(dev);
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "desc.h"
|
||||
|
||||
#include "ccid.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define DPRINTF(s, lvl, fmt, ...) \
|
||||
do { \
|
||||
|
@ -59,8 +60,10 @@ do { \
|
|||
#define D_MORE_INFO 3
|
||||
#define D_VERBOSE 4
|
||||
|
||||
#define CCID_DEV_NAME "usb-ccid"
|
||||
#define USB_CCID_DEV(obj) OBJECT_CHECK(USBCCIDState, (obj), CCID_DEV_NAME)
|
||||
#define TYPE_USB_CCID_DEV "usb-ccid"
|
||||
typedef struct USBCCIDState USBCCIDState;
|
||||
DECLARE_INSTANCE_CHECKER(USBCCIDState, USB_CCID_DEV,
|
||||
TYPE_USB_CCID_DEV)
|
||||
/*
|
||||
* The two options for variable sized buffers:
|
||||
* make them constant size, for large enough constant,
|
||||
|
@ -274,14 +277,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 +313,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,
|
||||
|
@ -1173,7 +1177,8 @@ static Property ccid_props[] = {
|
|||
};
|
||||
|
||||
#define TYPE_CCID_BUS "ccid-bus"
|
||||
#define CCID_BUS(obj) OBJECT_CHECK(CCIDBus, (obj), TYPE_CCID_BUS)
|
||||
DECLARE_INSTANCE_CHECKER(CCIDBus, CCID_BUS,
|
||||
TYPE_CCID_BUS)
|
||||
|
||||
static const TypeInfo ccid_bus_info = {
|
||||
.name = TYPE_CCID_BUS,
|
||||
|
@ -1457,7 +1462,7 @@ static void ccid_class_initfn(ObjectClass *klass, void *data)
|
|||
}
|
||||
|
||||
static const TypeInfo ccid_info = {
|
||||
.name = CCID_DEV_NAME,
|
||||
.name = TYPE_USB_CCID_DEV,
|
||||
.parent = TYPE_USB_DEVICE,
|
||||
.instance_size = sizeof(USBCCIDState),
|
||||
.class_init = ccid_class_initfn,
|
||||
|
@ -1490,7 +1495,7 @@ static void ccid_register_types(void)
|
|||
type_register_static(&ccid_bus_info);
|
||||
type_register_static(&ccid_card_type_info);
|
||||
type_register_static(&ccid_info);
|
||||
usb_legacy_register(CCID_DEV_NAME, "ccid", NULL);
|
||||
usb_legacy_register(TYPE_USB_CCID_DEV, "ccid", NULL);
|
||||
}
|
||||
|
||||
type_init(ccid_register_types)
|
||||
|
|
|
@ -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,10 +66,12 @@ 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)
|
||||
DECLARE_INSTANCE_CHECKER(MSDState, USB_STORAGE_DEV,
|
||||
TYPE_USB_STORAGE)
|
||||
|
||||
struct usb_msd_cbw {
|
||||
uint32_t sig;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "hw/qdev-properties.h"
|
||||
#include "hw/scsi/scsi.h"
|
||||
#include "scsi/constants.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
|
@ -132,7 +133,8 @@ struct UASDevice {
|
|||
};
|
||||
|
||||
#define TYPE_USB_UAS "usb-uas"
|
||||
#define USB_UAS(obj) OBJECT_CHECK(UASDevice, (obj), TYPE_USB_UAS)
|
||||
DECLARE_INSTANCE_CHECKER(UASDevice, USB_UAS,
|
||||
TYPE_USB_UAS)
|
||||
|
||||
struct UASRequest {
|
||||
uint16_t tag;
|
||||
|
|
|
@ -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,10 +52,12 @@ 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)
|
||||
DECLARE_INSTANCE_CHECKER(USBWacomState, USB_WACOM,
|
||||
TYPE_USB_WACOM)
|
||||
|
||||
enum {
|
||||
STR_MANUFACTURER = 1,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -180,11 +181,7 @@ struct DWC2Class {
|
|||
};
|
||||
|
||||
#define TYPE_DWC2_USB "dwc2-usb"
|
||||
#define DWC2_USB(obj) \
|
||||
OBJECT_CHECK(DWC2State, (obj), TYPE_DWC2_USB)
|
||||
#define DWC2_USB_CLASS(klass) \
|
||||
OBJECT_CLASS_CHECK(DWC2Class, (klass), TYPE_DWC2_USB)
|
||||
#define DWC2_USB_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(DWC2Class, (obj), TYPE_DWC2_USB)
|
||||
DECLARE_OBJ_CHECKERS(DWC2State, DWC2Class,
|
||||
DWC2_USB, TYPE_DWC2_USB)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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,17 @@ void usb_ehci_unrealize(EHCIState *s, DeviceState *dev);
|
|||
void ehci_reset(void *opaque);
|
||||
|
||||
#define TYPE_PCI_EHCI "pci-ehci-usb"
|
||||
#define PCI_EHCI(obj) OBJECT_CHECK(EHCIPCIState, (obj), TYPE_PCI_EHCI)
|
||||
typedef struct EHCIPCIState EHCIPCIState;
|
||||
DECLARE_INSTANCE_CHECKER(EHCIPCIState, PCI_EHCI,
|
||||
TYPE_PCI_EHCI)
|
||||
|
||||
typedef struct EHCIPCIState {
|
||||
struct EHCIPCIState {
|
||||
/*< private >*/
|
||||
PCIDevice pcidev;
|
||||
/*< public >*/
|
||||
|
||||
EHCIState ehci;
|
||||
} EHCIPCIState;
|
||||
};
|
||||
|
||||
|
||||
#define TYPE_SYS_BUS_EHCI "sysbus-ehci-usb"
|
||||
|
@ -347,22 +350,20 @@ typedef struct EHCIPCIState {
|
|||
#define TYPE_PPC4xx_EHCI "ppc4xx-ehci-usb"
|
||||
#define TYPE_FUSBH200_EHCI "fusbh200-ehci-usb"
|
||||
|
||||
#define SYS_BUS_EHCI(obj) \
|
||||
OBJECT_CHECK(EHCISysBusState, (obj), TYPE_SYS_BUS_EHCI)
|
||||
#define SYS_BUS_EHCI_CLASS(class) \
|
||||
OBJECT_CLASS_CHECK(SysBusEHCIClass, (class), TYPE_SYS_BUS_EHCI)
|
||||
#define SYS_BUS_EHCI_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(SysBusEHCIClass, (obj), TYPE_SYS_BUS_EHCI)
|
||||
typedef struct EHCISysBusState EHCISysBusState;
|
||||
typedef struct SysBusEHCIClass SysBusEHCIClass;
|
||||
DECLARE_OBJ_CHECKERS(EHCISysBusState, SysBusEHCIClass,
|
||||
SYS_BUS_EHCI, 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 +372,18 @@ typedef struct SysBusEHCIClass {
|
|||
uint16_t opregbase;
|
||||
uint16_t portscbase;
|
||||
uint16_t portnr;
|
||||
} SysBusEHCIClass;
|
||||
};
|
||||
|
||||
#define FUSBH200_EHCI(obj) \
|
||||
OBJECT_CHECK(FUSBH200EHCIState, (obj), TYPE_FUSBH200_EHCI)
|
||||
typedef struct FUSBH200EHCIState FUSBH200EHCIState;
|
||||
DECLARE_INSTANCE_CHECKER(FUSBH200EHCIState, FUSBH200_EHCI,
|
||||
TYPE_FUSBH200_EHCI)
|
||||
|
||||
typedef struct FUSBH200EHCIState {
|
||||
struct FUSBH200EHCIState {
|
||||
/*< private >*/
|
||||
EHCISysBusState parent_obj;
|
||||
/*< public >*/
|
||||
|
||||
MemoryRegion mem_vendor;
|
||||
} FUSBH200EHCIState;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,11 +29,14 @@
|
|||
#include "hw/qdev-properties.h"
|
||||
#include "trace.h"
|
||||
#include "hcd-ohci.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_PCI_OHCI "pci-ohci"
|
||||
#define PCI_OHCI(obj) OBJECT_CHECK(OHCIPCIState, (obj), TYPE_PCI_OHCI)
|
||||
typedef struct OHCIPCIState OHCIPCIState;
|
||||
DECLARE_INSTANCE_CHECKER(OHCIPCIState, PCI_OHCI,
|
||||
TYPE_PCI_OHCI)
|
||||
|
||||
typedef struct {
|
||||
struct OHCIPCIState {
|
||||
/*< private >*/
|
||||
PCIDevice parent_obj;
|
||||
/*< public >*/
|
||||
|
@ -42,7 +45,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
|
||||
|
|
|
@ -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,11 @@ typedef struct OHCIState {
|
|||
} OHCIState;
|
||||
|
||||
#define TYPE_SYSBUS_OHCI "sysbus-ohci"
|
||||
#define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_OHCI)
|
||||
typedef struct OHCISysBusState OHCISysBusState;
|
||||
DECLARE_INSTANCE_CHECKER(OHCISysBusState, SYSBUS_OHCI,
|
||||
TYPE_SYSBUS_OHCI)
|
||||
|
||||
typedef struct {
|
||||
struct OHCISysBusState {
|
||||
/*< private >*/
|
||||
SysBusDevice parent_obj;
|
||||
/*< public >*/
|
||||
|
@ -104,7 +107,7 @@ typedef struct {
|
|||
uint32_t num_ports;
|
||||
uint32_t firstport;
|
||||
dma_addr_t dma_offset;
|
||||
} OHCISysBusState;
|
||||
};
|
||||
|
||||
extern const VMStateDescription vmstate_ohci_state;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -160,7 +161,8 @@ static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td);
|
|||
static void uhci_resume(void *opaque);
|
||||
|
||||
#define TYPE_UHCI "pci-uhci-usb"
|
||||
#define UHCI(obj) OBJECT_CHECK(UHCIState, (obj), TYPE_UHCI)
|
||||
DECLARE_INSTANCE_CHECKER(UHCIState, UHCI,
|
||||
TYPE_UHCI)
|
||||
|
||||
static inline int32_t uhci_queue_token(UHCI_TD *td)
|
||||
{
|
||||
|
|
|
@ -21,13 +21,15 @@
|
|||
|
||||
#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"
|
||||
|
||||
#define XHCI(obj) \
|
||||
OBJECT_CHECK(XHCIState, (obj), TYPE_XHCI)
|
||||
typedef struct XHCIState XHCIState;
|
||||
DECLARE_INSTANCE_CHECKER(XHCIState, XHCI,
|
||||
TYPE_XHCI)
|
||||
|
||||
#define MAXPORTS_2 15
|
||||
#define MAXPORTS_3 15
|
||||
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"
|
||||
#define USB_HOST_DEVICE(obj) \
|
||||
OBJECT_CHECK(USBHostDevice, (obj), TYPE_USB_HOST_DEVICE)
|
||||
|
||||
typedef struct USBHostDevice USBHostDevice;
|
||||
DECLARE_INSTANCE_CHECKER(USBHostDevice, USB_HOST_DEVICE,
|
||||
TYPE_USB_HOST_DEVICE)
|
||||
|
||||
typedef struct USBHostRequest USBHostRequest;
|
||||
typedef struct USBHostIsoXfer USBHostIsoXfer;
|
||||
typedef struct USBHostIsoRing USBHostIsoRing;
|
||||
|
|
|
@ -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
|
||||
|
@ -144,7 +145,8 @@ struct USBRedirDevice {
|
|||
};
|
||||
|
||||
#define TYPE_USB_REDIR "usb-redir"
|
||||
#define USB_REDIRECT(obj) OBJECT_CHECK(USBRedirDevice, (obj), TYPE_USB_REDIR)
|
||||
DECLARE_INSTANCE_CHECKER(USBRedirDevice, USB_REDIRECT,
|
||||
TYPE_USB_REDIR)
|
||||
|
||||
static void usbredir_hello(void *priv, struct usb_redir_hello_header *h);
|
||||
static void usbredir_device_connect(void *priv,
|
||||
|
|
|
@ -28,11 +28,14 @@
|
|||
#include "hw/hw.h"
|
||||
#include "hw/irq.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_TUSB6010 "tusb6010"
|
||||
#define TUSB(obj) OBJECT_CHECK(TUSBState, (obj), TYPE_TUSB6010)
|
||||
typedef struct TUSBState TUSBState;
|
||||
DECLARE_INSTANCE_CHECKER(TUSBState, TUSB6010,
|
||||
TYPE_TUSB6010)
|
||||
|
||||
typedef struct TUSBState {
|
||||
struct TUSBState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion iomem[2];
|
||||
|
@ -68,7 +71,7 @@ typedef struct TUSBState {
|
|||
uint32_t pullup[2];
|
||||
uint32_t control_config;
|
||||
uint32_t otg_timer_val;
|
||||
} TUSBState;
|
||||
};
|
||||
|
||||
#define TUSB_DEVCLOCK 60000000 /* 60 MHz */
|
||||
|
||||
|
@ -776,7 +779,7 @@ static void tusb6010_irq(void *opaque, int source, int level)
|
|||
|
||||
static void tusb6010_reset(DeviceState *dev)
|
||||
{
|
||||
TUSBState *s = TUSB(dev);
|
||||
TUSBState *s = TUSB6010(dev);
|
||||
int i;
|
||||
|
||||
s->test_reset = TUSB_PROD_TEST_RESET_VAL;
|
||||
|
@ -812,7 +815,7 @@ static void tusb6010_reset(DeviceState *dev)
|
|||
|
||||
static void tusb6010_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
TUSBState *s = TUSB(dev);
|
||||
TUSBState *s = TUSB6010(dev);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||
|
||||
s->otg_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_otg_tick, s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue