From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvotM-0006Rj-21 for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvotE-0000LS-Vq for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvotE-0000Kv-Hr for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:44 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1ABhhVB000708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Feb 2012 06:43:43 -0500 From: Gerd Hoffmann Date: Fri, 10 Feb 2012 12:43:23 +0100 Message-Id: <1328874204-20920-28-git-send-email-kraxel@redhat.com> In-Reply-To: <1328874204-20920-1-git-send-email-kraxel@redhat.com> References: <1328874204-20920-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 27/28] xhci: remote wakeup support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/usb-xhci.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c index 65214af..3026edb 100644 --- a/hw/usb-xhci.c +++ b/hw/usb-xhci.c @@ -2698,6 +2698,26 @@ static void xhci_detach(USBPort *usbport) xhci_update_port(xhci, port, 1); } +static void xhci_wakeup(USBPort *usbport) +{ + XHCIState *xhci = usbport->opaque; + XHCIPort *port = &xhci->ports[usbport->index]; + int nr = port->port.index + 1; + XHCIEvent ev = { ER_PORT_STATUS_CHANGE, CC_SUCCESS, nr << 24}; + uint32_t pls; + + pls = (port->portsc >> PORTSC_PLS_SHIFT) & PORTSC_PLS_MASK; + if (pls != 3) { + return; + } + port->portsc |= 0xf << PORTSC_PLS_SHIFT; + if (port->portsc & PORTSC_PLC) { + return; + } + port->portsc |= PORTSC_PLC; + xhci_event(xhci, &ev); +} + static void xhci_complete(USBPort *port, USBPacket *packet) { XHCITransfer *xfer = container_of(packet, XHCITransfer, packet); @@ -2714,6 +2734,7 @@ static void xhci_child_detach(USBPort *port, USBDevice *child) static USBPortOps xhci_port_ops = { .attach = xhci_attach, .detach = xhci_detach, + .wakeup = xhci_wakeup, .complete = xhci_complete, .child_detach = xhci_child_detach, }; -- 1.7.1