aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-09-23 14:43:47 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-09-23 14:43:47 +0100
commit769188d3bbf95ce8d96a335624234dad083f4db6 (patch)
tree9c6e2944d15f268d308e46cb0041668872d1e94e /include
parentcad684c5386ea01cd725418ff678d54af74068c3 (diff)
parentec56214f6f23c1e2f78de6afa6835acc35fc03ed (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20140923-1' into staging
usb: enable hotplug, switch to realize, ohci tracing, misc fixes. # gpg: Signature made Tue 23 Sep 2014 12:42:29 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-usb-20140923-1: (26 commits) usb: tag standalone ehci as hotpluggable usb: tag standalone uhci as hotpluggable usb: tag xhci as hotpluggable usb-serial: only check speed once at realize time usb-bus: introduce a wrapper function to check speed usb-bus: remove "init" from USBDeviceClass struct usb-mtp: convert init to realize usb-redir: convert init to realize usb-audio: convert init to realize dev-wacom: convert init to realize dev-hid: convert init to realize usb-ccid: convert init to realize dev-serial: convert init to realize dev-bluetooth: convert init to realize dev-uas: using error_report instead of fprintf dev-uas: convert init to realize dev-storage: usring error_report instead of fprintf/printf dev-storage: convert init to realize usb-hub: convert init to realize libusb: using error_report instead of fprintf ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/usb.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/hw/usb.h b/include/hw/usb.h
index 6b32a3bb70..b20b959123 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -267,10 +267,14 @@ struct USBDevice {
#define USB_DEVICE_GET_CLASS(obj) \
OBJECT_GET_CLASS(USBDeviceClass, (obj), TYPE_USB_DEVICE)
+typedef void (*USBDeviceRealize)(USBDevice *dev, Error **errp);
+typedef void (*USBDeviceUnrealize)(USBDevice *dev, Error **errp);
+
typedef struct USBDeviceClass {
DeviceClass parent_class;
- int (*init)(USBDevice *dev);
+ USBDeviceRealize realize;
+ USBDeviceUnrealize unrealize;
/*
* Walk (enabled) downstream ports, check for a matching device.
@@ -544,11 +548,12 @@ int usb_register_companion(const char *masterbus, USBPort *ports[],
void *opaque, USBPortOps *ops, int speedmask);
void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr);
void usb_unregister_port(USBBus *bus, USBPort *port);
-int usb_claim_port(USBDevice *dev);
+void usb_claim_port(USBDevice *dev, Error **errp);
void usb_release_port(USBDevice *dev);
-int usb_device_attach(USBDevice *dev);
+void usb_device_attach(USBDevice *dev, Error **errp);
int usb_device_detach(USBDevice *dev);
int usb_device_delete_addr(int busnr, int addr);
+void usb_check_attach(USBDevice *dev, Error **errp);
static inline USBBus *usb_bus_from_device(USBDevice *d)
{