[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/30] usb: hub: remote wakeup support.
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 19/30] usb: hub: remote wakeup support. |
Date: |
Fri, 17 Dec 2010 12:26:35 +0100 |
This patch makes the usb hub handle remote wakeup requests from devices
properly by updating the port status register and forwarding the wakeup
to the upstream port.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb-hub.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 5aa1d0b..9a073f8 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -245,6 +245,17 @@ static void usb_hub_detach(USBPort *port1)
}
}
+static void usb_hub_wakeup(USBDevice *dev)
+{
+ USBHubState *s = dev->port->opaque;
+ USBHubPort *port = &s->ports[dev->port->index];
+
+ if (port->wPortStatus & PORT_STAT_SUSPEND) {
+ port->wPortChange |= PORT_STAT_C_SUSPEND;
+ usb_wakeup(&s->dev);
+ }
+}
+
static void usb_hub_handle_reset(USBDevice *dev)
{
/* XXX: do it */
@@ -502,6 +513,7 @@ static void usb_hub_handle_destroy(USBDevice *dev)
static USBPortOps usb_hub_port_ops = {
.attach = usb_hub_attach,
.detach = usb_hub_detach,
+ .wakeup = usb_hub_wakeup,
};
static int usb_hub_initfn(USBDevice *dev)
--
1.7.1
- [Qemu-devel] [PATCH 10/30] usb storage: serial number support, (continued)
- [Qemu-devel] [PATCH 10/30] usb storage: serial number support, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 06/30] usb wacom: use new descriptor infrastructure., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 09/30] usb descriptors: add settable strings., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 05/30] usb storage: use new descriptor infrastructure., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 08/30] usb hub: use new descriptor infrastructure., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 12/30] usb: move USB_REQ_SET_ADDRESS handling to common code, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 07/30] usb bluetooth: use new descriptor infrastructure., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 17/30] usb: add usb_wakeup() + wakeup callback to port ops, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 14/30] usb: move remote wakeup handling to common code, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 13/30] usb: move USB_REQ_{GET, SET}_CONFIGURATION handling to common code, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 19/30] usb: hub: remote wakeup support.,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 15/30] usb: create USBPortOps, move attach there., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 11/30] usb network: use new descriptor infrastructure., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 20/30] usb: hid: remote wakeup support., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 21/30] usb: hid: change serial number to "42"., Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 27/30] usb storage: fix status reporting, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 28/30] usb storage: handle long responses, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 24/30] usb: add usb_desc_attach, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 16/30] usb: rework attach/detach workflow, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 22/30] usb: add speed mask to ports, Gerd Hoffmann, 2010/12/17
- [Qemu-devel] [PATCH 26/30] usb storage: high speed support, Gerd Hoffmann, 2010/12/17