]> git.proxmox.com Git - qemu.git/commitdiff
usb-smartcard-reader: Properly NAK interrupt eps when we've no events
authorHans de Goede <hdegoede@redhat.com>
Sat, 17 Nov 2012 11:15:02 +0000 (12:15 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 21 Nov 2012 13:55:54 +0000 (14:55 +0100)
When we've no data to return from the interrupt endpoint, return NAK rather
then a 0 length packet.

CC: Alon Levy <alevy@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-smartcard-reader.c

index 190fcd62d4ed3b38bd5e02d8d249e09b0438fae0..de955b709f73442f275d6089b490b4951fdbd7ef 100644 (file)
@@ -1002,6 +1002,8 @@ static void ccid_handle_data(USBDevice *dev, USBPacket *p)
                         "handle_data: int_in: notify_slot_change %X, "
                         "requested len %zd\n",
                         s->bmSlotICCState, p->iov.size);
+            } else {
+                p->status = USB_RET_NAK;
             }
             break;
         default: