summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-11-30 10:20:21 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-30 10:20:21 -0600
commit923fd9897b0ffbcc5091181f8b0484aa2e36413b (patch)
treed36784488baf360fff31490f15c6eae7ec5d548e
parent36520faa33abb91b3c8a80e935b82afec78f9bee (diff)
parent2b29f492c844ed03d6d16ebe6bb760d71b6557fe (diff)
downloadqemu-923fd9897b0ffbcc5091181f8b0484aa2e36413b.tar.gz
Merge remote-tracking branch 'kraxel/usb.73' into staging
* kraxel/usb.73: ehci-sysbus: Attach DMA context. usb: fail usbdevice_create() when there is no USB bus usb: tag usb host adapters as not hotpluggable. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/usb/bus.c7
-rw-r--r--hw/usb/hcd-ehci-pci.c1
-rw-r--r--hw/usb/hcd-ehci-sysbus.c1
-rw-r--r--hw/usb/hcd-ohci.c1
-rw-r--r--hw/usb/hcd-uhci.c1
-rw-r--r--hw/usb/hcd-xhci.c1
6 files changed, 12 insertions, 0 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 99aac7a2c0..55d0edd5c3 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -590,6 +590,13 @@ USBDevice *usbdevice_create(const char *cmdline)
return NULL;
}
+ if (!bus) {
+ error_report("Error: no usb bus to attach usbdevice %s, "
+ "please try -machine usb=on and check that "
+ "the machine model supports USB", driver);
+ return NULL;
+ }
+
if (!f->usbdevice_init) {
if (*params) {
error_report("usbdevice %s accepts no params", driver);
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 5887eab197..41dbb539f2 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -123,6 +123,7 @@ static void ehci_class_init(ObjectClass *klass, void *data)
k->revision = i->revision;
k->class_id = PCI_CLASS_SERIAL_USB;
k->config_write = usb_ehci_pci_write_config;
+ k->no_hotplug = 1;
dc->vmsd = &vmstate_ehci_pci;
dc->props = ehci_pci_properties;
}
diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
index 1584079796..803df92f31 100644
--- a/hw/usb/hcd-ehci-sysbus.c
+++ b/hw/usb/hcd-ehci-sysbus.c
@@ -45,6 +45,7 @@ static int usb_ehci_sysbus_initfn(SysBusDevice *dev)
s->capsbase = 0x100;
s->opregbase = 0x140;
+ s->dma = &dma_context_memory;
usb_ehci_initfn(s, DEVICE(dev));
sysbus_init_irq(dev, &s->irq);
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 64de906e41..e16a2ecab4 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1882,6 +1882,7 @@ static void ohci_pci_class_init(ObjectClass *klass, void *data)
k->vendor_id = PCI_VENDOR_ID_APPLE;
k->device_id = PCI_DEVICE_ID_APPLE_IPID_USB;
k->class_id = PCI_CLASS_SERIAL_USB;
+ k->no_hotplug = 1;
dc->desc = "Apple USB Controller";
dc->props = ohci_pci_properties;
}
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 8e478030ad..d053791de0 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1327,6 +1327,7 @@ 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;
+ k->no_hotplug = 1;
dc->vmsd = &vmstate_uhci;
dc->props = uhci_properties;
u->info = *info;
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 8ef4b0730e..efb509e423 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3167,6 +3167,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)
k->class_id = PCI_CLASS_SERIAL_USB;
k->revision = 0x03;
k->is_express = 1;
+ k->no_hotplug = 1;
}
static TypeInfo xhci_info = {