aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-09-14 15:49:30 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-09-14 15:49:30 +0100
commitdae288d7d820e12073e55ded64b226843d352c1f (patch)
tree351f42934e5fc38bdb4163424bbb5b1bf4909f1a
parent9d81b2d2000f41be55a0624a26873f993fb6e928 (diff)
parent2041649f0b04f61869589571ddf5ecd4f0695ea2 (diff)
downloadqemu-dae288d7d820e12073e55ded64b226843d352c1f.zip
qemu-dae288d7d820e12073e55ded64b226843d352c1f.tar.gz
qemu-dae288d7d820e12073e55ded64b226843d352c1f.tar.bz2
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20170913-pull-request' into staging
usb: misc small fixes. # gpg: Signature made Wed 13 Sep 2017 10:28:25 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # 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>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/usb-20170913-pull-request: usb: only build usb-host with CONFIG_USB=y usb: drop HOST_USB MAINTAINERS: add missing USB entry xhci: Avoid DMA when ERSTBA is set to zero Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--MAINTAINERS1
-rwxr-xr-xconfigure7
-rw-r--r--hw/usb/Makefile.objs6
-rw-r--r--hw/usb/hcd-xhci.c4
4 files changed, 8 insertions, 10 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 36eeb42..2c333ab 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -999,6 +999,7 @@ F: docs/usb2.txt
F: docs/usb-storage.txt
F: include/hw/usb.h
F: include/hw/usb/
+F: default-configs/usb.mak
USB (serial adapter)
M: Gerd Hoffmann <kraxel@redhat.com>
diff --git a/configure b/configure
index 7ea9cb3..9ee4559 100755
--- a/configure
+++ b/configure
@@ -5935,13 +5935,6 @@ if test "$live_block_migration" = "yes" ; then
echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
fi
-# USB host support
-if test "$libusb" = "yes"; then
- echo "HOST_USB=libusb legacy" >> $config_host_mak
-else
- echo "HOST_USB=stub" >> $config_host_mak
-fi
-
# TPM passthrough support?
if test "$tpm" = "yes"; then
echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index 97f1c456..757e365 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -38,7 +38,11 @@ endif
common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o
# usb pass-through
-common-obj-y += $(patsubst %,host-%.o,$(HOST_USB))
+ifeq ($(CONFIG_LIBUSB)$(CONFIG_USB),yy)
+common-obj-y += host-libusb.o host-legacy.o
+else
+common-obj-y += host-stub.o
+endif
ifeq ($(CONFIG_USB_LIBUSB),y)
common-obj-$(CONFIG_XEN) += xen-usb.o
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 204ea69..d75c085 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -811,8 +811,9 @@ static void xhci_er_reset(XHCIState *xhci, int v)
{
XHCIInterrupter *intr = &xhci->intr[v];
XHCIEvRingSeg seg;
+ dma_addr_t erstba = xhci_addr64(intr->erstba_low, intr->erstba_high);
- if (intr->erstsz == 0) {
+ if (intr->erstsz == 0 || erstba == 0) {
/* disabled */
intr->er_start = 0;
intr->er_size = 0;
@@ -824,7 +825,6 @@ static void xhci_er_reset(XHCIState *xhci, int v)
xhci_die(xhci);
return;
}
- dma_addr_t erstba = xhci_addr64(intr->erstba_low, intr->erstba_high);
pci_dma_read(PCI_DEVICE(xhci), erstba, &seg, sizeof(seg));
le32_to_cpus(&seg.addr_low);
le32_to_cpus(&seg.addr_high);