yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
05bba0
From deb3ccfc4df641110546b2af49e885101565143d Mon Sep 17 00:00:00 2001
05bba0
From: Gerd Hoffmann <kraxel@redhat.com>
05bba0
Date: Fri, 17 Jul 2015 11:55:40 +0200
05bba0
Subject: [PATCH 01/13] usb-ccid: add missing wakeup calls
05bba0
05bba0
Message-id: <1437134140-27898-2-git-send-email-kraxel@redhat.com>
05bba0
Patchwork-id: 67056
05bba0
O-Subject: [RHEL-7.2 qemu-kvm PATCH v2 1/1] usb-ccid: add missing wakeup calls
05bba0
Bugzilla: 1243731
05bba0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
05bba0
RH-Acked-by: Juan Quintela <quintela@redhat.com>
05bba0
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
05bba0
05bba0
Properly notify the host adapter that we have
05bba0
data pending, so it doesn't has to poll us.
05bba0
05bba0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
05bba0
(cherry picked from commit 86d7e214c224f939c897cfa3b6d597f7af4b5bba)
05bba0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
05bba0
05bba0
Conflicts:
05bba0
	hw/usb/dev-smartcard-reader.c  [ slightly different context ]
05bba0
---
05bba0
 hw/usb/dev-smartcard-reader.c | 5 +++++
05bba0
 1 file changed, 5 insertions(+)
05bba0
---
05bba0
 hw/usb/dev-smartcard-reader.c | 5 +++++
05bba0
 1 file changed, 5 insertions(+)
05bba0
05bba0
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
05bba0
index c1acf70..0e666e1 100644
05bba0
--- a/hw/usb/dev-smartcard-reader.c
05bba0
+++ b/hw/usb/dev-smartcard-reader.c
05bba0
@@ -284,6 +284,7 @@ typedef struct CCIDBus {
05bba0
 typedef struct USBCCIDState {
05bba0
     USBDevice dev;
05bba0
     USBEndpoint *intr;
05bba0
+    USBEndpoint *bulk;
05bba0
     CCIDBus bus;
05bba0
     CCIDCardState *card;
05bba0
     BulkIn bulk_in_pending[BULK_IN_PENDING_NUM]; /* circular */
05bba0
@@ -769,6 +770,7 @@ static void ccid_write_slot_status(USBCCIDState *s, CCID_Header *recv)
05bba0
     h->b.bError = s->bError;
05bba0
     h->bClockStatus = CLOCK_STATUS_RUNNING;
05bba0
     ccid_reset_error_status(s);
05bba0
+    usb_wakeup(s->bulk, 0);
05bba0
 }
05bba0
 
05bba0
 static void ccid_write_parameters(USBCCIDState *s, CCID_Header *recv)
05bba0
@@ -789,6 +791,7 @@ static void ccid_write_parameters(USBCCIDState *s, CCID_Header *recv)
05bba0
     h->bProtocolNum = s->bProtocolNum;
05bba0
     h->abProtocolDataStructure = s->abProtocolDataStructure;
05bba0
     ccid_reset_error_status(s);
05bba0
+    usb_wakeup(s->bulk, 0);
05bba0
 }
05bba0
 
05bba0
 static void ccid_write_data_block(USBCCIDState *s, uint8_t slot, uint8_t seq,
05bba0
@@ -810,6 +813,7 @@ static void ccid_write_data_block(USBCCIDState *s, uint8_t slot, uint8_t seq,
05bba0
     }
05bba0
     memcpy(p->abData, data, len);
05bba0
     ccid_reset_error_status(s);
05bba0
+    usb_wakeup(s->bulk, 0);
05bba0
 }
05bba0
 
05bba0
 static void ccid_report_error_failed(USBCCIDState *s, uint8_t error)
05bba0
@@ -1311,6 +1315,7 @@ static int ccid_initfn(USBDevice *dev)
05bba0
     usb_desc_init(dev);
05bba0
     qbus_create_inplace(&s->bus.qbus, TYPE_CCID_BUS, &dev->qdev, NULL);
05bba0
     s->intr = usb_ep_get(dev, USB_TOKEN_IN, CCID_INT_IN_EP);
05bba0
+    s->bulk = usb_ep_get(dev, USB_TOKEN_IN, CCID_BULK_IN_EP);
05bba0
     s->bus.qbus.allow_hotplug = 1;
05bba0
     s->card = NULL;
05bba0
     s->migration_state = MIGRATION_NONE;
05bba0
-- 
05bba0
1.8.3.1
05bba0