diff options
Diffstat (limited to 'hw/usb')
-rw-r--r-- | hw/usb/bus.c | 4 | ||||
-rw-r--r-- | hw/usb/hcd-xhci.c | 4 | ||||
-rw-r--r-- | hw/usb/host-libusb.c | 7 |
3 files changed, 9 insertions, 6 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 24f1608b4b..5939b273b9 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -762,9 +762,7 @@ static void usb_set_attached(Object *obj, bool value, Error **errp) if (value) { usb_device_attach(dev, &err); - if (err) { - error_propagate(errp, err); - } + error_propagate(errp, err); } else { usb_device_detach(dev); } diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index f0af852709..a2d3143bf4 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2063,7 +2063,7 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid) { XHCIState *xhci = epctx->xhci; - XHCIStreamContext *stctx; + XHCIStreamContext *stctx = NULL; XHCITransfer *xfer; XHCIRing *ring; USBEndpoint *ep = NULL; @@ -2186,6 +2186,8 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid) break; } } + /* update ring dequeue ptr */ + xhci_set_ep_state(xhci, epctx, stctx, epctx->state); epctx->kick_active--; ep = xhci_epid_to_usbep(epctx); diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index c9876a5b0f..f9c8eafe06 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -159,7 +159,10 @@ static void usb_host_attach_kernel(USBHostDevice *s); #define BULK_TIMEOUT 0 /* unlimited */ #define INTR_TIMEOUT 0 /* unlimited */ -#if LIBUSBX_API_VERSION >= 0x01000103 +#ifndef LIBUSB_API_VERSION +# define LIBUSB_API_VERSION LIBUSBX_API_VERSION +#endif +#if LIBUSB_API_VERSION >= 0x01000103 # define HAVE_STREAMS 1 #endif @@ -269,7 +272,7 @@ static int usb_host_get_port(libusb_device *dev, char *port, size_t len) size_t off; int rc, i; -#if LIBUSBX_API_VERSION >= 0x01000102 +#if LIBUSB_API_VERSION >= 0x01000102 rc = libusb_get_port_numbers(dev, path, 7); #else rc = libusb_get_port_path(ctx, dev, path, 7); |