From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRfIH-0004jY-LQ for qemu-devel@nongnu.org; Fri, 26 Oct 2012 04:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRfIB-0006zC-1K for qemu-devel@nongnu.org; Fri, 26 Oct 2012 04:29:29 -0400 Received: from relay2.mail.vrmd.de ([81.28.224.28]:54530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRfIA-0006ym-Qf for qemu-devel@nongnu.org; Fri, 26 Oct 2012 04:29:22 -0400 From: Sebastian Bauer Date: Fri, 26 Oct 2012 10:29:07 +0200 Message-Id: <1351240148-13723-2-git-send-email-mail@sebastianbauer.info> In-Reply-To: <1351240148-13723-1-git-send-email-mail@sebastianbauer.info> References: <1351240148-13723-1-git-send-email-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. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Sebastian Bauer --- 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;iports[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