WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [QEMU] Clear TD status field explicitly w

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [QEMU] Clear TD status field explicitly when it's fetched.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Jan 2007 08:55:11 -0800
Delivery-date: Thu, 25 Jan 2007 08:55:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1169635472 0
# Node ID b064775fba7d838c99bcf11ca4fec6127e0e8792
# Parent  c9ac0bace498d1c25f07df95b88d8f8e89168514
[QEMU] Clear TD status field explicitly when it's fetched.

In current Qemu-dm, UHC will set some status bits of TD in status
updating stage, but never process the status bit if relevant condition
does not occur, leaving it as it is. When a TD is fetched with some
status bits are set to 1, it will return to Guest OS with these bits
set to 1 even this TD is executed successfully. Some Windows OS,
e.g. Windows 2000, will check status bits of TD in UHC interrupt
routine, treat it as a unsuccessful one if some status bits are set to
1 and discard the data. Other Windows OS just check USBSTS of UHC,
ignoring status field of TD unless the value of USBSTS indicates
occurrence of error.

With this patch, USB mouse/tablet in Windows 2000 works correctly.

Signed-off-by: Xinmei Huang  <xinmei.huang@xxxxxxxxx>
---
 tools/ioemu/hw/usb-uhci.c |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -r c9ac0bace498 -r b064775fba7d tools/ioemu/hw/usb-uhci.c
--- a/tools/ioemu/hw/usb-uhci.c Wed Jan 24 10:38:17 2007 +0000
+++ b/tools/ioemu/hw/usb-uhci.c Wed Jan 24 10:44:32 2007 +0000
@@ -43,9 +43,15 @@
 #define TD_CTRL_IOC     (1 << 24)
 #define TD_CTRL_ACTIVE  (1 << 23)
 #define TD_CTRL_STALL   (1 << 22)
+#define TD_CTRL_BUFFER  (1 << 21)
 #define TD_CTRL_BABBLE  (1 << 20)
 #define TD_CTRL_NAK     (1 << 19)
 #define TD_CTRL_TIMEOUT (1 << 18)
+#define TD_CTRL_BITSTUFF                                 \
+                        (1 << 17)
+#define TD_CTRL_MASK                                     \
+    (TD_CTRL_BITSTUFF | TD_CTRL_TIMEOUT | TD_CTRL_NAK    \
+     | TD_CTRL_BABBLE | TD_CTRL_BUFFER | TD_CTRL_STALL)
 
 #define UHCI_PORT_RESET (1 << 9)
 #define UHCI_PORT_LSDA  (1 << 8)
@@ -428,6 +434,8 @@ static int uhci_handle_td(UHCIState *s, 
         ret = 1;
         goto out;
     }
+    /* Clear TD's status field explicitly */
+    td->ctrl = td->ctrl & (~TD_CTRL_MASK);
 
     /* TD is active */
     max_len = ((td->token >> 21) + 1) & 0x7ff;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [QEMU] Clear TD status field explicitly when it's fetched., Xen patchbot-unstable <=