static void ccid_on_apdu_from_guest(USBCCIDState *s, CCID_XferBlock *recv)

{

    uint32_t len;



    if (ccid_card_status(s) != ICC_STATUS_PRESENT_ACTIVE) {

        DPRINTF(s, 1,

                "usb-ccid: not sending apdu to client, no card connected\n");

        ccid_write_data_block_error(s, recv->hdr.bSlot, recv->hdr.bSeq);

        return;

    }

    len = le32_to_cpu(recv->hdr.dwLength);

    DPRINTF(s, 1, "%s: seq %d, len %d\n", __func__,

                recv->hdr.bSeq, len);

    ccid_add_pending_answer(s, (CCID_Header *)recv);

    if (s->card) {

        ccid_card_apdu_from_guest(s->card, recv->abData, len);

    } else {

        DPRINTF(s, D_WARN, "warning: discarded apdu\n");

    }

}

static void ccid_on_apdu_from_guest(USBCCIDState *s, CCID_XferBlock *recv)

{

    uint32_t len;



    if (ccid_card_status(s) != ICC_STATUS_PRESENT_ACTIVE) {

        DPRINTF(s, 1,

                "usb-ccid: not sending apdu to client, no card connected\n");

        ccid_write_data_block_error(s, recv->hdr.bSlot, recv->hdr.bSeq);

        return;

    }

    len = le32_to_cpu(recv->hdr.dwLength);

    DPRINTF(s, 1, "%s: seq %d, len %d\n", __func__,

                recv->hdr.bSeq, len);

    ccid_add_pending_answer(s, (CCID_Header *)recv);

    if (s->card) {

        ccid_card_apdu_from_guest(s->card, recv->abData, len);

    } else {

        DPRINTF(s, D_WARN, "warning: discarded apdu\n");

    }

}

    if (s->card) {
static void FUNC_0(USBCCIDState *VAR_0, CCID_XferBlock *VAR_1)

{

    uint32_t len;



    if (ccid_card_status(VAR_0) != ICC_STATUS_PRESENT_ACTIVE) {

        DPRINTF(VAR_0, 1,

                "usb-ccid: not sending apdu to client, no card connected\n");

        ccid_write_data_block_error(VAR_0, VAR_1->hdr.bSlot, VAR_1->hdr.bSeq);

        return;

    }

    len = le32_to_cpu(VAR_1->hdr.dwLength);

    DPRINTF(VAR_0, 1, "%VAR_0: seq %d, len %d\n", __func__,

                VAR_1->hdr.bSeq, len);

    ccid_add_pending_answer(VAR_0, (CCID_Header *)VAR_1);

    if (VAR_0->card) {

        ccid_card_apdu_from_guest(VAR_0->card, VAR_1->abData, len);

    } else {

        DPRINTF(VAR_0, D_WARN, "warning: discarded apdu\n");

    }

}

static void FUNC_0(USBCCIDState *VAR_0, CCID_XferBlock *VAR_1)
{ uint32_t len; if (ccid_card_status(VAR_0) != ICC_STATUS_PRESENT_ACTIVE) { DPRINTF(VAR_0, 1,
"usb-ccid: not sending apdu to client, no card connected\n"); ccid_write_data_block_error(VAR_0, VAR_1->hdr.bSlot, VAR_1->hdr.bSeq); return; } len = le32_to_cpu(VAR_1->hdr.dwLength); DPRINTF(VAR_0, 1, "%VAR_0: seq %d, len %d\n", __func__,
VAR_1->hdr.bSeq, len); ccid_add_pending_answer(VAR_0, (CCID_Header *)VAR_1); if (VAR_0->card) { ccid_card_apdu_from_guest(VAR_0->card, VAR_1->abData, len); } else { DPRINTF(VAR_0, D_WARN, "warning: discarded apdu\n"); } }