aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-08-29 14:13:11 +0200
committerGerd Hoffmann <kraxel@redhat.com>2014-09-23 12:51:08 +0200
commit638ca939d80886545b1b279be240e511da16584f (patch)
treedc868220ce2a1e20c689ee1e732006fcf0291d1d /hw/usb
parent3533c3d2bfcfe151c48ed73fc49590f303cdb72d (diff)
usb: tag standalone uhci as hotpluggable
uhci hostadapters in companion setups can't be hotplugged. So leave hotplug disabled for all ich9 variants (which are already tagged with unplug = true in the info struct). For the other variants we'll enable hotplug and remove the companion setup properties. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/hcd-uhci.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 3b3ebcda8b..5b88f3070f 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1279,13 +1279,18 @@ static void usb_uhci_exit(PCIDevice *dev)
}
}
-static Property uhci_properties[] = {
+static Property uhci_properties_companion[] = {
DEFINE_PROP_STRING("masterbus", UHCIState, masterbus),
DEFINE_PROP_UINT32("firstport", UHCIState, firstport, 0),
DEFINE_PROP_UINT32("bandwidth", UHCIState, frame_bandwidth, 1280),
DEFINE_PROP_UINT32("maxframes", UHCIState, maxframes, 128),
DEFINE_PROP_END_OF_LIST(),
};
+static Property uhci_properties_standalone[] = {
+ DEFINE_PROP_UINT32("bandwidth", UHCIState, frame_bandwidth, 1280),
+ DEFINE_PROP_UINT32("maxframes", UHCIState, maxframes, 128),
+ DEFINE_PROP_END_OF_LIST(),
+};
static void uhci_class_init(ObjectClass *klass, void *data)
{
@@ -1300,9 +1305,14 @@ static void uhci_class_init(ObjectClass *klass, void *data)
k->device_id = info->device_id;
k->revision = info->revision;
k->class_id = PCI_CLASS_SERIAL_USB;
- dc->hotpluggable = false;
dc->vmsd = &vmstate_uhci;
- dc->props = uhci_properties;
+ if (!info->unplug) {
+ /* uhci controllers in companion setups can't be hotplugged */
+ dc->hotpluggable = false;
+ dc->props = uhci_properties_companion;
+ } else {
+ dc->props = uhci_properties_standalone;
+ }
set_bit(DEVICE_CATEGORY_USB, dc->categories);
u->info = *info;
}