From d1f9434fd5495d8f0e61a4bac7a477904ff46715 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Mon, 28 Mar 2022 09:35:28 +0200 Subject: [PATCH] qemu-usb: send usb ctrl transfers with timeout Send usb ctrl transfers with one second timeout as some devices (e.g., smartcard readers) do not response to certain control transfers. Thanks to Peter for the investigation. --- repos/libports/src/lib/qemu-usb/host.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/repos/libports/src/lib/qemu-usb/host.cc b/repos/libports/src/lib/qemu-usb/host.cc index 305b909530..7ac1634e35 100644 --- a/repos/libports/src/lib/qemu-usb/host.cc +++ b/repos/libports/src/lib/qemu-usb/host.cc @@ -871,6 +871,12 @@ static void usb_host_handle_control(USBDevice *udev, USBPacket *p, packet.control.index = index; packet.control.value = value; + /* + * Send usb ctrl transfers with one second timeout as some devices (e.g., + * smartcard readers) do not response to certain control transfers. + */ + packet.control.timeout = 1000; /* ms */ + Completion *c = dynamic_cast(packet.completion); c->p = p; c->dev = udev;