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.
This commit is contained in:
Christian Helmuth 2022-03-28 09:35:28 +02:00
parent 00479aea29
commit d1f9434fd5

View File

@ -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<Completion *>(packet.completion);
c->p = p;
c->dev = udev;