summaryrefslogtreecommitdiff
path: root/hw/ccid-card-passthru.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 12:34:10 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:47 -0600
commitba7c05205c4ba2fd08096b0083fc1e5decf3c342 (patch)
tree4f51677a29c97582ae914b94d6884e8857284aba /hw/ccid-card-passthru.c
parent62aed76583fe8bf8e6ba5955b2ecfa3619ea3540 (diff)
downloadqemu-ba7c05205c4ba2fd08096b0083fc1e5decf3c342.tar.gz
qemu-ba7c05205c4ba2fd08096b0083fc1e5decf3c342.tar.bz2
qemu-ba7c05205c4ba2fd08096b0083fc1e5decf3c342.zip
ccid: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ccid-card-passthru.c')
-rw-r--r--hw/ccid-card-passthru.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/hw/ccid-card-passthru.c b/hw/ccid-card-passthru.c
index 9f51c6cb05..f563d97cb4 100644
--- a/hw/ccid-card-passthru.c
+++ b/hw/ccid-card-passthru.c
@@ -316,16 +316,23 @@ static VMStateDescription passthru_vmstate = {
}
};
-static CCIDCardInfo passthru_card_info = {
- .qdev.name = PASSTHRU_DEV_NAME,
- .qdev.desc = "passthrough smartcard",
- .qdev.size = sizeof(PassthruState),
- .qdev.vmsd = &passthru_vmstate,
- .initfn = passthru_initfn,
- .exitfn = passthru_exitfn,
- .get_atr = passthru_get_atr,
- .apdu_from_guest = passthru_apdu_from_guest,
- .qdev.props = (Property[]) {
+static void passthru_class_initfn(ObjectClass *klass, void *data)
+{
+ CCIDCardClass *cc = CCID_CARD_CLASS(klass);
+
+ cc->initfn = passthru_initfn;
+ cc->exitfn = passthru_exitfn;
+ cc->get_atr = passthru_get_atr;
+ cc->apdu_from_guest = passthru_apdu_from_guest;
+}
+
+static DeviceInfo passthru_card_info = {
+ .name = PASSTHRU_DEV_NAME,
+ .desc = "passthrough smartcard",
+ .size = sizeof(PassthruState),
+ .vmsd = &passthru_vmstate,
+ .class_init = passthru_class_initfn,
+ .props = (Property[]) {
DEFINE_PROP_CHR("chardev", PassthruState, cs),
DEFINE_PROP_UINT8("debug", PassthruState, debug, 0),
DEFINE_PROP_END_OF_LIST(),