Patchwork [2/2] usb-smartcard-reader: Properly NAK interrupt eps when we've no events

login
register
mail settings
Submitter Hans de Goede
Date Nov. 17, 2012, 11:15 a.m.
Message ID <1353150902-24987-3-git-send-email-hdegoede@redhat.com>
Download mbox | patch
Permalink /patch/199833/
State New
Headers show

Comments

Hans de Goede - Nov. 17, 2012, 11:15 a.m.
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>
---
 hw/usb/dev-smartcard-reader.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index 190fcd6..de955b7 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -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: