diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-07-20 20:31:31 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-07-20 20:31:31 +0100 |
commit | 6a426eb27ec17684808ab87374f51d6ed3a47835 (patch) | |
tree | 1e9db65c886b829f406df6ab14359b5043e132b6 | |
parent | 518cb31fa7d2dd648bc400d68c25e0df8394683f (diff) | |
parent | 87ae924b73cbbe13ad800ab2016d011b42456f25 (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160720-1' into staging
usb: xhci assert fix, add usbredir streams property
# gpg: Signature made Wed 20 Jul 2016 12:32:09 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/pull-usb-20160720-1:
usbredir: add streams property
xhci: Fix possible side effect from assert()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/usb/hcd-xhci.c | 4 | ||||
-rw-r--r-- | hw/usb/redirect.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 976bfb0659..188f95416a 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2201,7 +2201,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, xfer->trb_count = length; for (i = 0; i < length; i++) { - assert(xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL)); + TRBType type; + type = xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL); + assert(type); } xfer->streamid = streamid; diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 8ec8484349..444672a000 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -109,6 +109,7 @@ struct USBRedirDevice { uint8_t debug; char *filter_str; int32_t bootindex; + bool enable_streams; /* Data passed from chardev the fd_read cb to the usbredirparser read cb */ const uint8_t *read_buf; int read_buf_size; @@ -1229,7 +1230,9 @@ static void usbredir_create_parser(USBRedirDevice *dev) usbredirparser_caps_set_cap(caps, usb_redir_cap_32bits_bulk_length); usbredirparser_caps_set_cap(caps, usb_redir_cap_bulk_receiving); #if USBREDIR_VERSION >= 0x000700 - usbredirparser_caps_set_cap(caps, usb_redir_cap_bulk_streams); + if (dev->enable_streams) { + usbredirparser_caps_set_cap(caps, usb_redir_cap_bulk_streams); + } #endif if (runstate_check(RUN_STATE_INMIGRATE)) { @@ -2476,6 +2479,7 @@ static Property usbredir_properties[] = { DEFINE_PROP_CHR("chardev", USBRedirDevice, cs), DEFINE_PROP_UINT8("debug", USBRedirDevice, debug, usbredirparser_warning), DEFINE_PROP_STRING("filter", USBRedirDevice, filter_str), + DEFINE_PROP_BOOL("streams", USBRedirDevice, enable_streams, true), DEFINE_PROP_END_OF_LIST(), }; |