Explorar o código

usb-smartcard-reader: Properly NAK interrupt eps when we've no events

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>
Hans de Goede %!s(int64=12) %!d(string=hai) anos
pai
achega
c4020746ff
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      hw/usb/dev-smartcard-reader.c

+ 2 - 0
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, "
                         "handle_data: int_in: notify_slot_change %X, "
                         "requested len %zd\n",
                         "requested len %zd\n",
                         s->bmSlotICCState, p->iov.size);
                         s->bmSlotICCState, p->iov.size);
+            } else {
+                p->status = USB_RET_NAK;
             }
             }
             break;
             break;
         default:
         default: