aboutsummaryrefslogtreecommitdiff
path: root/hw/usb.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-06-24 12:31:11 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-07-05 15:09:02 +0200
commit4706ab6cc0af86d3f38806664420cc3eb8999bd9 (patch)
tree53ca1a3df6c81e2eb309b431f01825496ea4692a /hw/usb.h
parentd47e59b8b8adc96a2052f7e004cb12b6ff62edd9 (diff)
downloadqemu-4706ab6cc0af86d3f38806664420cc3eb8999bd9.zip
qemu-4706ab6cc0af86d3f38806664420cc3eb8999bd9.tar.gz
qemu-4706ab6cc0af86d3f38806664420cc3eb8999bd9.tar.bz2
usb: Replace device_destroy bus op with a child_detach port op
Note this fixes 2 things in one go, first of all the device_destroy bus op should be a device_detach bus op, as pending async packets from the device should be cancelled on detach not on destroy. Secondly having this as a bus op won't work with companion controllers, since then there will be 1 bus driven by the ehci controller and thus 1 set of bus ops, but the device being detached may be downstream of a handed over port. Making the detach of a downstream device a port op allows the ehci controller to forward this to the companion controller port for handed over ports. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/usb.h b/hw/usb.h
index 65f45a0..ded2de2 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -252,6 +252,11 @@ struct USBDeviceInfo {
typedef struct USBPortOps {
void (*attach)(USBPort *port);
void (*detach)(USBPort *port);
+ /*
+ * This gets called when a device downstream from the device attached to
+ * the port (iow attached through a hub) gets detached.
+ */
+ void (*child_detach)(USBPort *port, USBDevice *child);
void (*wakeup)(USBPort *port);
/*
* Note that port->dev will be different then the device from which
@@ -351,7 +356,6 @@ struct USBBus {
struct USBBusOps {
int (*register_companion)(USBBus *bus, USBPort *ports[],
uint32_t portcount, uint32_t firstport);
- void (*device_destroy)(USBBus *bus, USBDevice *dev);
};
void usb_bus_new(USBBus *bus, USBBusOps *ops, DeviceState *host);