qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Fix remainder field for TR_SETUP completion event


From: Hans Petter Selasky
Subject: [Qemu-devel] [PATCH] Fix remainder field for TR_SETUP completion event
Date: Tue, 23 Aug 2016 13:46:55 +0200
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0

Hi,

Patch is also attached.

--HPS

 Fix remainder field for TR_SETUP completion event. Previously
 the code would incorrectly report the remainder as 8 bytes. A remainder of 0
 bytes should be reported when the SETUP packet is successfully transferred.
 Found using FreeBSD's XHCI driver.

Signed-off-by: Hans Petter Selasky <address@hidden>
---
 hw/usb/hcd-xhci.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 188f954..d996d7e 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1753,6 +1753,11 @@ static void xhci_xfer_report(XHCITransfer *xfer)
         unsigned int chunk = 0;

         switch (TRB_TYPE(*trb)) {
+        case TR_SETUP:
+            chunk = trb->status & 0x1ffff;
+            if (chunk > 8)
+                chunk = 8;
+            break;
         case TR_DATA:
         case TR_NORMAL:
         case TR_ISOCH:
--
2.8.1

Attachment: 0001-Fix-remainder-field-for-TR_SETUP-completion-event.-P.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]