From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 17/30] usb: add usb_wakeup() + wakeup callback to port ops
Date: Fri, 17 Dec 2010 12:26:33 +0100 [thread overview]
Message-ID: <1292585206-24862-18-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1292585206-24862-1-git-send-email-kraxel@redhat.com>
Add wakeup callback to port ops for remote wakeup handling.
Also add a usb_wakeup() function for devices which want
trigger a remote wakeup.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb.c | 7 +++++++
hw/usb.h | 2 ++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/hw/usb.c b/hw/usb.c
index 2eda86a..ba720b4 100644
--- a/hw/usb.c
+++ b/hw/usb.c
@@ -49,6 +49,13 @@ void usb_attach(USBPort *port, USBDevice *dev)
}
}
+void usb_wakeup(USBDevice *dev)
+{
+ if (dev->remote_wakeup && dev->port && dev->port->ops->wakeup) {
+ dev->port->ops->wakeup(dev);
+ }
+}
+
/**********************/
/* generic USB device helpers (you are not forced to use them when
diff --git a/hw/usb.h b/hw/usb.h
index 6b008cc..9f454e6 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -220,6 +220,7 @@ struct USBDeviceInfo {
typedef struct USBPortOps {
void (*attach)(USBPort *port);
void (*detach)(USBPort *port);
+ void (*wakeup)(USBDevice *dev);
} USBPortOps;
/* USB port on which a device can be connected */
@@ -274,6 +275,7 @@ static inline void usb_cancel_packet(USBPacket * p)
}
void usb_attach(USBPort *port, USBDevice *dev);
+void usb_wakeup(USBDevice *dev);
int usb_generic_handle_packet(USBDevice *s, USBPacket *p);
int set_usb_string(uint8_t *buf, const char *str);
void usb_send_msg(USBDevice *dev, int msg);
--
1.7.1
next prev parent reply other threads:[~2010-12-17 11:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-17 11:26 [Qemu-devel] [PATCH 00/30] usb descriptor overhaul + more Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 01/30] usb: update MAINTAINERS Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 02/30] usb: data structs and helpers for usb descriptors Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 03/30] usb hid: use new descriptor infrastructure Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 04/30] usb serial: " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 05/30] usb storage: " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 06/30] usb wacom: " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 07/30] usb bluetooth: " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 08/30] usb hub: " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 09/30] usb descriptors: add settable strings Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 10/30] usb storage: serial number support Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 11/30] usb network: use new descriptor infrastructure Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 12/30] usb: move USB_REQ_SET_ADDRESS handling to common code Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 13/30] usb: move USB_REQ_{GET, SET}_CONFIGURATION " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 14/30] usb: move remote wakeup " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 15/30] usb: create USBPortOps, move attach there Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 16/30] usb: rework attach/detach workflow Gerd Hoffmann
2010-12-17 11:26 ` Gerd Hoffmann [this message]
2010-12-17 11:26 ` [Qemu-devel] [PATCH 18/30] usb: uhci: remote wakeup support Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 19/30] usb: hub: " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 20/30] usb: hid: " Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 21/30] usb: hid: change serial number to "42" Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 22/30] usb: add speed mask to ports Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 23/30] usb: add attach callback Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 24/30] usb: add usb_desc_attach Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 25/30] usb: add device qualifier support Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 26/30] usb storage: high speed support Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 27/30] usb storage: fix status reporting Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 28/30] usb storage: handle long responses Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 29/30] usb: keep track of physical port address Gerd Hoffmann
2010-12-17 11:26 ` [Qemu-devel] [PATCH 30/30] usb: add port property 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=1292585206-24862-18-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--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).