uint8_t *apdu, uint32_t len)
{
DeviceState *qdev = DEVICE(card);
- USBDevice *dev = USB_DEVICE(qdev);
+ USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
USBCCIDState *s = USB_CCID_DEV(dev);
Answer *answer;
void ccid_card_card_removed(CCIDCardState *card)
{
DeviceState *qdev = DEVICE(card);
- USBDevice *dev = USB_DEVICE(qdev);
+ USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
USBCCIDState *s = USB_CCID_DEV(dev);
ccid_on_slot_change(s, false);
int ccid_card_ccid_attach(CCIDCardState *card)
{
DeviceState *qdev = DEVICE(card);
- USBDevice *dev = USB_DEVICE(qdev);
+ USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
USBCCIDState *s = USB_CCID_DEV(dev);
DPRINTF(s, 1, "CCID Attach\n");
void ccid_card_ccid_detach(CCIDCardState *card)
{
DeviceState *qdev = DEVICE(card);
- USBDevice *dev = USB_DEVICE(qdev);
+ USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
USBCCIDState *s = USB_CCID_DEV(dev);
DPRINTF(s, 1, "CCID Detach\n");
void ccid_card_card_error(CCIDCardState *card, uint64_t error)
{
DeviceState *qdev = DEVICE(card);
- USBDevice *dev = USB_DEVICE(qdev);
+ USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
USBCCIDState *s = USB_CCID_DEV(dev);
s->bmCommandStatus = COMMAND_STATUS_FAILED;
void ccid_card_card_inserted(CCIDCardState *card)
{
DeviceState *qdev = DEVICE(card);
- USBDevice *dev = USB_DEVICE(qdev);
+ USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
USBCCIDState *s = USB_CCID_DEV(dev);
s->bmCommandStatus = COMMAND_STATUS_NO_ERROR;
{
int ret = 0;
CCIDCardState *card = CCID_CARD(qdev);
- USBDevice *dev = USB_DEVICE(qdev);
+ USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
USBCCIDState *s = USB_CCID_DEV(dev);
if (ccid_card_inserted(s)) {
static int ccid_card_init(DeviceState *qdev)
{
CCIDCardState *card = CCID_CARD(qdev);
- USBDevice *dev = USB_DEVICE(qdev);
+ USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent);
USBCCIDState *s = USB_CCID_DEV(dev);
int ret = 0;