qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Bauer <mail@sebastianbauer.info>
To: qemu-devel@nongnu.org
Cc: Sebastian Bauer <mail@sebastianbauer.info>
Subject: [Qemu-devel] [PATCH 1/2] When the XHCI host controller is switched to the running mode, set the ccs bit for each port, to which a device is already attached.
Date: Fri, 26 Oct 2012 10:29:07 +0200	[thread overview]
Message-ID: <1351240148-13723-2-git-send-email-mail@sebastianbauer.info> (raw)
In-Reply-To: <1351240148-13723-1-git-send-email-mail@sebastianbauer.info>

---
 hw/usb/hcd-xhci.c |   25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 37b3dbb..4c81dcc 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -990,10 +990,29 @@ static void xhci_er_reset(XHCIState *xhci, int v)
             v, intr->er_start, intr->er_size);
 }
 
+static void xhci_set_port_csc(XHCIState* xhci, XHCIPort* port, int set)
+{
+    port->portsc |= PORTSC_CSC;
+    XHCIEvent ev = { ER_PORT_STATUS_CHANGE, CC_SUCCESS, port->portnr << 24 };
+    xhci_event(xhci, &ev, 0);
+    DPRINTF("xhci: port change event for port %d\n", port->portnr);
+}
+
 static void xhci_run(XHCIState *xhci)
 {
+    int i;
+
     trace_usb_xhci_run();
     xhci->usbsts &= ~USBSTS_HCH;
+
+    for (i=0;i<MAXPORTS;i++) {
+        if (xhci->ports[i].uport) {
+            if (xhci->ports[i].portsc & PORTSC_CCS) {
+                xhci_set_port_csc(xhci,&xhci->ports[i],1);
+            }
+        }
+    }
+
     xhci->mfindex_start = qemu_get_clock_ns(vm_clock);
 }
 
@@ -2307,11 +2326,7 @@ static void xhci_update_port(XHCIState *xhci, XHCIPort *port, int is_detach)
     }
 
     if (xhci_running(xhci)) {
-        port->portsc |= PORTSC_CSC;
-        XHCIEvent ev = { ER_PORT_STATUS_CHANGE, CC_SUCCESS,
-                         port->portnr << 24};
-        xhci_event(xhci, &ev, 0);
-        DPRINTF("xhci: port change event for port %d\n", port->portnr);
+    	xhci_set_port_csc(xhci, port, 1);
     }
 }
 
-- 
1.7.10.4

  reply	other threads:[~2012-10-26  8:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26  8:29 [Qemu-devel] [PATCH 0/2] xhci: Better spec conforming behaviour Sebastian Bauer
2012-10-26  8:29 ` Sebastian Bauer [this message]
2012-10-26 12:00   ` [Qemu-devel] [PATCH 1/2] When the XHCI host controller is switched to the running mode, set the ccs bit for each port, to which a device is already attached Gerd Hoffmann
2012-10-26 15:10     ` Sebastian Bauer
2012-11-01 13:20       ` Gerd Hoffmann
2012-10-26  8:29 ` [Qemu-devel] [PATCH 2/2] Respond a set address command with CC_PARAMETER_ERROR, if the speed field of the input context is not valid Sebastian Bauer
2012-10-26 12:05   ` Gerd Hoffmann
2012-10-26 11:53 ` [Qemu-devel] [PATCH 0/2] xhci: Better spec conforming behaviour Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351240148-13723-2-git-send-email-mail@sebastianbauer.info \
    --to=mail@sebastianbauer.info \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).