From 0d769044d669223fb973c7e8739522fc2bc185fb Mon Sep 17 00:00:00 2001 From: Cao jin Date: Mon, 1 Feb 2016 15:57:35 +0800 Subject: ES1370: QOMify Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- hw/audio/es1370.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'hw') diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 96acbc6e2f..8449b5f436 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -289,6 +289,10 @@ struct chan_bits { uint32_t *old_freq, uint32_t *new_freq); }; +#define TYPE_ES1370 "ES1370" +#define ES1370(obj) \ + OBJECT_CHECK(ES1370State, (obj), TYPE_ES1370) + static void es1370_dac1_calc_freq (ES1370State *s, uint32_t ctl, uint32_t *old_freq, uint32_t *new_freq); static void es1370_dac2_and_adc_calc_freq (ES1370State *s, uint32_t ctl, @@ -1014,7 +1018,7 @@ static void es1370_on_reset (void *opaque) static void es1370_realize(PCIDevice *dev, Error **errp) { - ES1370State *s = DO_UPCAST (ES1370State, dev, dev); + ES1370State *s = ES1370(dev); uint8_t *c = s->dev.config; c[PCI_STATUS + 1] = PCI_STATUS_DEVSEL_SLOW >> 8; @@ -1039,7 +1043,7 @@ static void es1370_realize(PCIDevice *dev, Error **errp) static int es1370_init (PCIBus *bus) { - pci_create_simple (bus, -1, "ES1370"); + pci_create_simple (bus, -1, TYPE_ES1370); return 0; } @@ -1060,7 +1064,7 @@ static void es1370_class_init (ObjectClass *klass, void *data) } static const TypeInfo es1370_info = { - .name = "ES1370", + .name = TYPE_ES1370, .parent = TYPE_PCI_DEVICE, .instance_size = sizeof (ES1370State), .class_init = es1370_class_init, -- cgit 1.4.1 From 35997599aa3b772db9b2f38e3aa137e6f27f25f1 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Wed, 3 Feb 2016 10:36:34 +0800 Subject: Emulated CCID card: QOMify Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- hw/usb/ccid-card-emulated.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'hw') diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 6893028ddf..9ddd5ad75b 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -43,7 +43,10 @@ do {\ } \ } while (0) -#define EMULATED_DEV_NAME "ccid-card-emulated" + +#define TYPE_EMULATED_CCID "ccid-card-emulated" +#define EMULATED_CCID_CARD(obj) \ + OBJECT_CHECK(EmulatedState, (obj), TYPE_EMULATED_CCID) #define BACKEND_NSS_EMULATED_NAME "nss-emulated" #define BACKEND_CERTIFICATES_NAME "certificates" @@ -134,7 +137,7 @@ struct EmulatedState { static void emulated_apdu_from_guest(CCIDCardState *base, const uint8_t *apdu, uint32_t len) { - EmulatedState *card = DO_UPCAST(EmulatedState, base, base); + EmulatedState *card = EMULATED_CCID_CARD(base); EmulEvent *event = (EmulEvent *)g_malloc(sizeof(EmulEvent) + len); assert(event); @@ -151,7 +154,7 @@ static void emulated_apdu_from_guest(CCIDCardState *base, static const uint8_t *emulated_get_atr(CCIDCardState *base, uint32_t *len) { - EmulatedState *card = DO_UPCAST(EmulatedState, base, base); + EmulatedState *card = EMULATED_CCID_CARD(base); *len = card->atr_length; return card->atr; @@ -479,7 +482,7 @@ static uint32_t parse_enumeration(char *str, static int emulated_initfn(CCIDCardState *base) { - EmulatedState *card = DO_UPCAST(EmulatedState, base, base); + EmulatedState *card = EMULATED_CCID_CARD(base); VCardEmulError ret; const EnumTable *ptable; @@ -515,26 +518,26 @@ static int emulated_initfn(CCIDCardState *base) ret = emulated_initialize_vcard_from_certificates(card); } else { printf("%s: you must provide all three certs for" - " certificates backend\n", EMULATED_DEV_NAME); + " certificates backend\n", TYPE_EMULATED_CCID); return -1; } } else { if (card->backend != BACKEND_NSS_EMULATED) { printf("%s: bad backend specified. The options are:\n%s (default)," - " %s.\n", EMULATED_DEV_NAME, BACKEND_NSS_EMULATED_NAME, + " %s.\n", TYPE_EMULATED_CCID, BACKEND_NSS_EMULATED_NAME, BACKEND_CERTIFICATES_NAME); return -1; } if (card->cert1 != NULL || card->cert2 != NULL || card->cert3 != NULL) { printf("%s: unexpected cert parameters to nss emulated backend\n", - EMULATED_DEV_NAME); + TYPE_EMULATED_CCID); return -1; } /* default to mirroring the local hardware readers */ ret = wrap_vcard_emul_init(NULL); } if (ret != VCARD_EMUL_OK) { - printf("%s: failed to initialize vcard\n", EMULATED_DEV_NAME); + printf("%s: failed to initialize vcard\n", TYPE_EMULATED_CCID); return -1; } qemu_thread_create(&card->event_thread_id, "ccid/event", event_thread, @@ -546,7 +549,7 @@ static int emulated_initfn(CCIDCardState *base) static int emulated_exitfn(CCIDCardState *base) { - EmulatedState *card = DO_UPCAST(EmulatedState, base, base); + EmulatedState *card = EMULATED_CCID_CARD(base); VEvent *vevent = vevent_new(VEVENT_LAST, NULL, NULL); vevent_queue_vevent(vevent); /* stop vevent thread */ @@ -589,7 +592,7 @@ static void emulated_class_initfn(ObjectClass *klass, void *data) } static const TypeInfo emulated_card_info = { - .name = EMULATED_DEV_NAME, + .name = TYPE_EMULATED_CCID, .parent = TYPE_CCID_CARD, .instance_size = sizeof(EmulatedState), .class_init = emulated_class_initfn, -- cgit 1.4.1 From 059db2041954766d2f9fd83f51a732a372076937 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Wed, 3 Feb 2016 10:36:35 +0800 Subject: Passthru CCID card: QOMify Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- hw/usb/ccid-card-passthru.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'hw') diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 2e4d95ff75..c0e90e501c 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -39,8 +39,6 @@ static const uint8_t DEFAULT_ATR[] = { 0x13, 0x08 }; - -#define PASSTHRU_DEV_NAME "ccid-card-passthru" #define VSCARD_IN_SIZE 65536 /* maximum size of ATR - from 7816-3 */ @@ -59,6 +57,10 @@ struct PassthruState { uint8_t debug; }; +#define TYPE_CCID_PASSTHRU "ccid-card-passthru" +#define PASSTHRU_CCID_CARD(obj) \ + OBJECT_CHECK(PassthruState, (obj), TYPE_CCID_PASSTHRU) + /* * VSCard protocol over chardev * This code should not depend on the card type. @@ -317,7 +319,7 @@ static void ccid_card_vscard_event(void *opaque, int event) static void passthru_apdu_from_guest( CCIDCardState *base, const uint8_t *apdu, uint32_t len) { - PassthruState *card = DO_UPCAST(PassthruState, base, base); + PassthruState *card = PASSTHRU_CCID_CARD(base); if (!card->cs) { printf("ccid-passthru: no chardev, discarding apdu length %d\n", len); @@ -328,7 +330,7 @@ static void passthru_apdu_from_guest( static const uint8_t *passthru_get_atr(CCIDCardState *base, uint32_t *len) { - PassthruState *card = DO_UPCAST(PassthruState, base, base); + PassthruState *card = PASSTHRU_CCID_CARD(base); *len = card->atr_length; return card->atr; @@ -336,7 +338,7 @@ static const uint8_t *passthru_get_atr(CCIDCardState *base, uint32_t *len) static int passthru_initfn(CCIDCardState *base) { - PassthruState *card = DO_UPCAST(PassthruState, base, base); + PassthruState *card = PASSTHRU_CCID_CARD(base); card->vscard_in_pos = 0; card->vscard_in_hdr = 0; @@ -400,7 +402,7 @@ static void passthru_class_initfn(ObjectClass *klass, void *data) } static const TypeInfo passthru_card_info = { - .name = PASSTHRU_DEV_NAME, + .name = TYPE_CCID_PASSTHRU, .parent = TYPE_CCID_CARD, .instance_size = sizeof(PassthruState), .class_init = passthru_class_initfn, -- cgit 1.4.1 From 6e9965d429f22cf68d47aa6397f7d5b0eff913cc Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Wed, 10 Feb 2016 14:02:44 +0300 Subject: s390x: remove s390-zipl.rom This is an s390 boot rom which was used in s390-virtio machine. but since commit 3538fb6f89dd9bb2e7e59de2bfad52a45321c744 "s390x: remove s390-virtio machine", this file isn't used. The only place it is referenced in the code is an unused define ZIPL_FILENAME. There's also comment in hw/s390/ipl.c which I'm modifying too, to refer to s390-ccw.img instead. Signed-off-by: Michael Tokarev Acked-by: Christian Borntraeger Acked-by: Cornelia Huck --- Makefile | 1 - hw/s390x/ipl.c | 2 +- hw/s390x/s390-virtio.c | 1 - pc-bios/README | 4 ---- pc-bios/s390-zipl.rom | Bin 3304 -> 0 bytes 5 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 pc-bios/s390-zipl.rom (limited to 'hw') diff --git a/Makefile b/Makefile index 30b1b2db4c..f9fae3aa16 100644 --- a/Makefile +++ b/Makefile @@ -400,7 +400,6 @@ efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \ qemu-icon.bmp qemu_logo_no_text.svg \ bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ multiboot.bin linuxboot.bin kvmvapic.bin \ -s390-zipl.rom \ s390-ccw.img \ spapr-rtas.bin slof.bin \ palcode-clipper \ diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 6992add8d3..c9cf7cce64 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -106,7 +106,7 @@ static void s390_ipl_realize(DeviceState *dev, Error **errp) /* Adjust ELF start address to final location */ ipl->bios_start_addr += fwbase; } else { - /* Try to load non-ELF file (e.g. s390-zipl.rom) */ + /* Try to load non-ELF file (e.g. s390-ccw.img) */ bios_size = load_image_targphys(bios_filename, ZIPL_IMAGE_START, 4096); ipl->bios_start_addr = ZIPL_IMAGE_START; diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c index 9efb9c6c48..c320878024 100644 --- a/hw/s390x/s390-virtio.c +++ b/hw/s390x/s390-virtio.c @@ -54,7 +54,6 @@ #endif #define MAX_BLK_DEVS 10 -#define ZIPL_FILENAME "s390-zipl.rom" #define S390_MACHINE "s390-virtio" #define TYPE_S390_MACHINE MACHINE_TYPE_NAME(S390_MACHINE) diff --git a/pc-bios/README b/pc-bios/README index d260c1bbbe..9f65ffa46f 100644 --- a/pc-bios/README +++ b/pc-bios/README @@ -35,10 +35,6 @@ 10ec:8139 -> pxe-rtl8139.rom 1af4:1000 -> pxe-virtio.rom -- The S390 zipl loader is an addition to the official IBM s390-tools - package. That fork is maintained in its own git repository at: - git://repo.or.cz/s390-tools.git - - The sources for the Alpha palcode image is available from: git://github.com/rth7680/qemu-palcode.git diff --git a/pc-bios/s390-zipl.rom b/pc-bios/s390-zipl.rom deleted file mode 100644 index 3115128efe..0000000000 Binary files a/pc-bios/s390-zipl.rom and /dev/null differ -- cgit 1.4.1 From 91dbeeda2d2cf85e733ddd86aa84de12bdf8cd4a Mon Sep 17 00:00:00 2001 From: Daniel Serpell Date: Thu, 4 Feb 2016 16:03:40 -0300 Subject: Adds keycode 86 to the hid_usage_keys translation table. This key is present in international keyboards, between left shift and the 'Z' key, ant is described in the HID usage tables as "Keyboard Non-US \ and |": http://www.usb.org/developers/hidpage/Hut1_12v2.pdf This patch fixes the usb-kbd devices. Signed-off-by: Daniel Serpell Reviewed-by: Gerd Hoffmann Signed-off-by: Michael Tokarev --- hw/input/hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/input/hid.c b/hw/input/hid.c index a11e2bc0f2..b41efbb451 100644 --- a/hw/input/hid.c +++ b/hw/input/hid.c @@ -45,7 +45,7 @@ static const uint8_t hid_usage_keys[0x100] = { 0xe2, 0x2c, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x53, 0x47, 0x5f, 0x60, 0x61, 0x56, 0x5c, 0x5d, 0x5e, 0x57, 0x59, - 0x5a, 0x5b, 0x62, 0x63, 0x00, 0x00, 0x00, 0x44, + 0x5a, 0x5b, 0x62, 0x63, 0x00, 0x00, 0x64, 0x44, 0x45, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0xe8, 0xe9, 0x71, 0x72, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x00, -- cgit 1.4.1