qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Large USB patch


From: Lonnie Mendez
Subject: Re: [Qemu-devel] Large USB patch
Date: Fri, 21 Apr 2006 12:28:57 -0500
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

address@hidden wrote:

you are too fast for me :)

Had to rediff it. Fabrice already put the necessary bits in uhci_update_irq. Right in front of my eyes too.

There is some funkiness going on with removing the device in the linux guest once attached. Not sure what it is yet.
--- a/qemu/hw/usb-uhci.c        2006-04-21 11:15:40.000000000 -0500
+++ b/qemu/hw/usb-uhci.c        2006-04-21 11:17:08.000000000 -0500
@@ -32,6 +32,8 @@
 // #define DEBUG
 // #define DEBUG_PACKET
 
+#define UHCI_CMD_FGR      (1 << 4)
+#define UHCI_CMD_EGSM     (1 << 3)
 #define UHCI_CMD_GRESET   (1 << 2)
 #define UHCI_CMD_HCRESET  (1 << 1)
 #define UHCI_CMD_RS       (1 << 0)
@@ -188,7 +191,7 @@
             /* start frame processing */
             qemu_mod_timer(s->frame_timer, qemu_get_clock(vm_clock));
             s->status &= ~UHCI_STS_HCHALTED;
-        } else if (!(val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) {
+        } else if (!(val & UHCI_CMD_RS)) {
             s->status |= UHCI_STS_HCHALTED;
         }
         if (val & UHCI_CMD_GRESET) {
@@ -335,6 +338,14 @@
     UHCIState *s = hub->opaque;
     UHCIPort  *port;
     int i;
+
+    // wakeup the controller if suspended
+    if (s->cmd & UHCI_CMD_EGSM) {
+        s->cmd |= UHCI_CMD_FGR;
+        s->status |= UHCI_STS_RD;
+        uhci_update_irq(s);
+    }
+
     if (dev) {
         if( portnum >= NB_PORTS ) {
 #ifdef DEBUG        
@@ -575,8 +586,6 @@
 
     if (!(s->cmd & UHCI_CMD_RS)) {
         qemu_del_timer(s->frame_timer);
-        /* set hchalted bit in status - UHCI11D 2.1.2 */
-        s->status |= UHCI_STS_HCHALTED;
         return;
     }
     frame_addr = s->fl_base_addr + ((s->frnum & 0x3ff) << 2);

reply via email to

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