dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0101-usb-redir-Clear-iso-irq-error-when-stopping-the-stre.patch

Justin M. Forbes d4cdad
From 01936dfd5b9fa8117fc1d63ce92198dd28422773 Mon Sep 17 00:00:00 2001
Justin M. Forbes d4cdad
From: Hans de Goede <hdegoede@redhat.com>
Justin M. Forbes d4cdad
Date: Mon, 19 Dec 2011 14:59:45 +0100
Justin M. Forbes d4cdad
Subject: [PATCH 101/118] usb-redir: Clear iso / irq error when stopping the
Justin M. Forbes d4cdad
 stream
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
And ignore status messages from the client which arrive after stream
Justin M. Forbes d4cdad
stop (the stream stop send to the client and an error status reported by
Justin M. Forbes d4cdad
the client my cross each other due to network latency).
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Justin M. Forbes d4cdad
---
Justin M. Forbes d4cdad
 usb-redir.c |    6 ++++--
Justin M. Forbes d4cdad
 1 files changed, 4 insertions(+), 2 deletions(-)
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
diff --git a/usb-redir.c b/usb-redir.c
Justin M. Forbes d4cdad
index fb91c92..7678f1a 100644
Justin M. Forbes d4cdad
--- a/usb-redir.c
Justin M. Forbes d4cdad
+++ b/usb-redir.c
Justin M. Forbes d4cdad
@@ -410,6 +410,7 @@ static void usbredir_stop_iso_stream(USBRedirDevice *dev, uint8_t ep)
Justin M. Forbes d4cdad
         DPRINTF("iso stream stopped ep %02X\n", ep);
Justin M. Forbes d4cdad
         dev->endpoint[EP2I(ep)].iso_started = 0;
Justin M. Forbes d4cdad
     }
Justin M. Forbes d4cdad
+    dev->endpoint[EP2I(ep)].iso_error = 0;
Justin M. Forbes d4cdad
     usbredir_free_bufpq(dev, ep);
Justin M. Forbes d4cdad
 }
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
@@ -522,6 +523,7 @@ static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
Justin M. Forbes d4cdad
         DPRINTF("interrupt recv stopped ep %02X\n", ep);
Justin M. Forbes d4cdad
         dev->endpoint[EP2I(ep)].interrupt_started = 0;
Justin M. Forbes d4cdad
     }
Justin M. Forbes d4cdad
+    dev->endpoint[EP2I(ep)].interrupt_error = 0;
Justin M. Forbes d4cdad
     usbredir_free_bufpq(dev, ep);
Justin M. Forbes d4cdad
 }
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
@@ -1029,7 +1031,7 @@ static void usbredir_iso_stream_status(void *priv, uint32_t id,
Justin M. Forbes d4cdad
     DPRINTF("iso status %d ep %02X id %u\n", iso_stream_status->status,
Justin M. Forbes d4cdad
             ep, id);
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
-    if (!dev->dev.attached) {
Justin M. Forbes d4cdad
+    if (!dev->dev.attached || !dev->endpoint[EP2I(ep)].iso_started) {
Justin M. Forbes d4cdad
         return;
Justin M. Forbes d4cdad
     }
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
@@ -1050,7 +1052,7 @@ static void usbredir_interrupt_receiving_status(void *priv, uint32_t id,
Justin M. Forbes d4cdad
     DPRINTF("interrupt recv status %d ep %02X id %u\n",
Justin M. Forbes d4cdad
             interrupt_receiving_status->status, ep, id);
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
-    if (!dev->dev.attached) {
Justin M. Forbes d4cdad
+    if (!dev->dev.attached || !dev->endpoint[EP2I(ep)].interrupt_started) {
Justin M. Forbes d4cdad
         return;
Justin M. Forbes d4cdad
     }
Justin M. Forbes d4cdad
Justin M. Forbes d4cdad
-- 
Justin M. Forbes d4cdad
1.7.7.5
Justin M. Forbes d4cdad