aboutsummaryrefslogtreecommitdiff
path: root/hw/usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb.h')
-rw-r--r--hw/usb.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/usb.h b/hw/usb.h
index 966d47e5ee..218788fceb 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -216,12 +216,14 @@ struct USBDeviceInfo {
USBDevice *(*usbdevice_init)(const char *params);
};
-typedef void (*usb_attachfn)(USBPort *port, USBDevice *dev);
+typedef struct USBPortOps {
+ void (*attach)(USBPort *port, USBDevice *dev);
+} USBPortOps;
/* USB port on which a device can be connected */
struct USBPort {
USBDevice *dev;
- usb_attachfn attach;
+ USBPortOps *ops;
void *opaque;
USBDevice *pdev;
int index; /* internal port index, may be used with the opaque */
@@ -333,7 +335,7 @@ USBDevice *usb_create(USBBus *bus, const char *name);
USBDevice *usb_create_simple(USBBus *bus, const char *name);
USBDevice *usbdevice_create(const char *cmdline);
void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
- USBDevice *pdev, usb_attachfn attach);
+ USBDevice *pdev, USBPortOps *ops);
void usb_unregister_port(USBBus *bus, USBPort *port);
int usb_device_attach(USBDevice *dev);
int usb_device_detach(USBDevice *dev);