summaryrefslogtreecommitdiff
path: root/hw/usb/ccid-card-passthru.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/ccid-card-passthru.c')
-rw-r--r--hw/usb/ccid-card-passthru.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index 2eacea72f3..ebe3942ff5 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -48,7 +48,7 @@ typedef struct PassthruState PassthruState;
struct PassthruState {
CCIDCardState base;
- CharDriverState *cs;
+ CharBackend cs;
uint8_t vscard_in_data[VSCARD_IN_SIZE];
uint32_t vscard_in_pos;
uint32_t vscard_in_hdr;
@@ -77,9 +77,9 @@ static void ccid_card_vscard_send_msg(PassthruState *s,
scr_msg_header.length = htonl(length);
/* XXX this blocks entire thread. Rewrite to use
* qemu_chr_fe_write and background I/O callbacks */
- qemu_chr_fe_write_all(s->cs, (uint8_t *)&scr_msg_header,
+ qemu_chr_fe_write_all(s->cs.chr, (uint8_t *)&scr_msg_header,
sizeof(VSCMsgHeader));
- qemu_chr_fe_write_all(s->cs, payload, length);
+ qemu_chr_fe_write_all(s->cs.chr, payload, length);
}
static void ccid_card_vscard_send_apdu(PassthruState *s,
@@ -264,7 +264,7 @@ static void ccid_card_vscard_handle_message(PassthruState *card,
static void ccid_card_vscard_drop_connection(PassthruState *card)
{
- qemu_chr_delete(card->cs);
+ qemu_chr_delete(card->cs.chr);
card->vscard_in_pos = card->vscard_in_hdr = 0;
}
@@ -324,7 +324,7 @@ static void passthru_apdu_from_guest(
{
PassthruState *card = PASSTHRU_CCID_CARD(base);
- if (!card->cs) {
+ if (!card->cs.chr) {
printf("ccid-passthru: no chardev, discarding apdu length %d\n", len);
return;
}
@@ -345,9 +345,9 @@ static int passthru_initfn(CCIDCardState *base)
card->vscard_in_pos = 0;
card->vscard_in_hdr = 0;
- if (card->cs) {
+ if (card->cs.chr) {
DPRINTF(card, D_INFO, "initing chardev\n");
- qemu_chr_add_handlers(card->cs,
+ qemu_chr_add_handlers(card->cs.chr,
ccid_card_vscard_can_read,
ccid_card_vscard_read,
ccid_card_vscard_event, card);