Blame qemu-2.7.0-usb-redirect-wakeup.patch
|
Hans de Goede |
a2729a |
diff -up qemu-2.7.0/hw/usb/redirect.c~ qemu-2.7.0/hw/usb/redirect.c
|
|
Hans de Goede |
a2729a |
--- qemu-2.7.0/hw/usb/redirect.c~ 2016-09-02 17:34:20.000000000 +0200
|
|
Hans de Goede |
a2729a |
+++ qemu-2.7.0/hw/usb/redirect.c 2016-10-10 09:18:35.319562664 +0200
|
|
Hans de Goede |
a2729a |
@@ -2036,18 +2036,22 @@ static void usbredir_interrupt_packet(vo
|
|
Hans de Goede |
a2729a |
}
|
|
Hans de Goede |
a2729a |
|
|
Hans de Goede |
a2729a |
if (ep & USB_DIR_IN) {
|
|
Hans de Goede |
a2729a |
+ bool q_was_empty;
|
|
Hans de Goede |
a2729a |
+
|
|
Hans de Goede |
a2729a |
if (dev->endpoint[EP2I(ep)].interrupt_started == 0) {
|
|
Hans de Goede |
a2729a |
DPRINTF("received int packet while not started ep %02X\n", ep);
|
|
Hans de Goede |
a2729a |
free(data);
|
|
Hans de Goede |
a2729a |
return;
|
|
Hans de Goede |
a2729a |
}
|
|
Hans de Goede |
a2729a |
|
|
Hans de Goede |
a2729a |
- if (QTAILQ_EMPTY(&dev->endpoint[EP2I(ep)].bufpq)) {
|
|
Hans de Goede |
a2729a |
- usb_wakeup(usb_ep_get(&dev->dev, USB_TOKEN_IN, ep & 0x0f), 0);
|
|
Hans de Goede |
a2729a |
- }
|
|
Hans de Goede |
a2729a |
+ q_was_empty = QTAILQ_EMPTY(&dev->endpoint[EP2I(ep)].bufpq);
|
|
Hans de Goede |
a2729a |
|
|
Hans de Goede |
a2729a |
/* bufp_alloc also adds the packet to the ep queue */
|
|
Hans de Goede |
a2729a |
bufp_alloc(dev, data, data_len, interrupt_packet->status, ep, data);
|
|
Hans de Goede |
a2729a |
+
|
|
Hans de Goede |
a2729a |
+ if (q_was_empty) {
|
|
Hans de Goede |
a2729a |
+ usb_wakeup(usb_ep_get(&dev->dev, USB_TOKEN_IN, ep & 0x0f), 0);
|
|
Hans de Goede |
a2729a |
+ }
|
|
Hans de Goede |
a2729a |
} else {
|
|
Hans de Goede |
a2729a |
/*
|
|
Hans de Goede |
a2729a |
* We report output interrupt packets as completed directly upon
|