usb: xhci assert fix, add usbredir streams property

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJXj2E5AAoJEEy22O7T6HE4V4YQANVSnCGcDAkgPyfKc1idzKrz
 tUakv/G3NRkFUXLInw/LCgvHz/Hz1ffFPXerW7VCJXjhXKwcJK0Yv9jAEchqt+Ux
 ZiCTW+/WoKqSHZRuxnsQUmVTHhGHqQ0lEhI/N8l/+kKt3/kVOJwof1HttIPtNvPB
 w7yU3evSx0YY2vFiPbQGrvk40pfjtB9rP3G4HuAJeT3C3dY0q2iqgZVZLO1M44OM
 wYE3YdNXOA8seN7lQhY9W+8bYsi9YpWF3yOlYKJ19qUNQbEjTVvy0g8lx04bXe9G
 +de7mos8/xXES7mcDc3ynMZI3pMjzcAl9x7X1rNuHMKpwzNl7MWZvZVVKIHHaF2Y
 34Glely1Cje4DYdH9hsWCf13eKzbNlrM2cxBVV9ZBp6ngM8+PMGkITPwPmcbaDyW
 ZgnFXGfJZvn8OUIrPS6WPj43OOuK/WWHUCdVw7OUR98pPqlSawoog1N5V+mL3YYi
 PjVC7wV1SmdBiptSSZI6InlY3b4WXU+uJNOV4pH+5nxLtirHtSMt0lLGS6b/RDKb
 IJvyf8IMT2sKfEntQjui330O8O/A08Y7QtN/1dbTSyFjRf9d+G8M2g7UNqFiXT7R
 HelDXzXRAnM5c/igdwFPnIxl+TTDZqe2FUYbzbkF1W/A/129/r6auBZFDubsr0z3
 6eASgbytwQlv/0NnAkuo
 =6gF5
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Peter Maydell 2016-07-20 20:31:31 +01:00
commit 6a426eb27e
2 changed files with 8 additions and 2 deletions

View file

@ -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;

View file

@ -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(),
};