Commit 8a813c98 authored by Stefan Hajnoczi's avatar Stefan Hajnoczi
Browse files

Merge remote-tracking branch 'kraxel/tags/pull-usb-20170512-1' into staging



usb: bugfixes, doc update

# gpg: Signature made Fri 12 May 2017 01:20:29 PM 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

* kraxel/tags/pull-usb-20170512-1:
  hw/usb/dev-serial: Do not try to set vendorid or productid properties
  xhci: relax link check
  usb-hub: clear PORT_STAT_SUSPEND on wakeup
  xhci: fix logging
  usb-redir: fix stack overflow in usbredir_log_data
  qemu-doc: Update to use the new way of attaching USB devices

Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parents 384d9d55 aa612b36
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -182,15 +182,13 @@ The appropriate DEVNAME depends on the machine type. For type "pc":

  This lets you control I/O ports and IRQs.

* -usbdevice serial:vendorid=VID,productid=PRID becomes
  -device usb-serial,vendorid=VID,productid=PRID
* -usbdevice serial::chardev becomes -device usb-serial,chardev=dev.

* -usbdevice braille doesn't support LEGACY-CHARDEV syntax.  It always
  uses "braille".  With -device, this useful default is gone, so you
  have to use something like

  -device usb-braille,chardev=braille,vendorid=VID,productid=PRID
  -chardev braille,id=braille
  -device usb-braille,chardev=braille -chardev braille,id=braille

* -virtioconsole becomes
  -device virtio-serial-pci,class=C,vectors=V,ioeventfd=IOEVENTFD,max_ports=N
+1 −0
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ static void usb_hub_wakeup(USBPort *port1)
    USBHubPort *port = &s->ports[port1->index];

    if (port->wPortStatus & PORT_STAT_SUSPEND) {
        port->wPortStatus &= ~PORT_STAT_SUSPEND;
        port->wPortChange |= PORT_STAT_C_SUSPEND;
        usb_wakeup(s->intr, 0);
    }
+6 −18
Original line number Diff line number Diff line
@@ -513,27 +513,18 @@ static USBDevice *usb_serial_init(USBBus *bus, const char *filename)
{
    USBDevice *dev;
    Chardev *cdrv;
    uint32_t vendorid = 0, productid = 0;
    char label[32];
    static int index;

    while (*filename && *filename != ':') {
        const char *p;
        char *e;

        if (strstart(filename, "vendorid=", &p)) {
            vendorid = strtol(p, &e, 16);
            if (e == p || (*e && *e != ',' && *e != ':')) {
                error_report("bogus vendor ID %s", p);
            error_report("vendorid is not supported anymore");
            return NULL;
            }
            filename = e;
        } else if (strstart(filename, "productid=", &p)) {
            productid = strtol(p, &e, 16);
            if (e == p || (*e && *e != ',' && *e != ':')) {
                error_report("bogus product ID %s", p);
            error_report("productid is not supported anymore");
            return NULL;
            }
            filename = e;
        } else {
            error_report("unrecognized serial USB option %s", filename);
            return NULL;
@@ -554,10 +545,7 @@ static USBDevice *usb_serial_init(USBBus *bus, const char *filename)

    dev = usb_create(bus, "usb-serial");
    qdev_prop_set_chr(&dev->qdev, "chardev", cdrv);
    if (vendorid)
        qdev_prop_set_uint16(&dev->qdev, "vendorid", vendorid);
    if (productid)
        qdev_prop_set_uint16(&dev->qdev, "productid", productid);

    return dev;
}

+3 −6
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
/* Very pessimistic, let's hope it's enough for all cases */
#define EV_QUEUE (((3 * 24) + 16) * MAXSLOTS)

#define TRB_LINK_LIMIT  4
#define TRB_LINK_LIMIT  32
#define COMMAND_LIMIT   256
#define TRANSFER_LIMIT  256

@@ -1790,9 +1790,6 @@ static void xhci_stall_ep(XHCITransfer *xfer)
    }
}

static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer,
                       XHCIEPContext *epctx);

static int xhci_setup_packet(XHCITransfer *xfer)
{
    USBEndpoint *ep;
@@ -1806,7 +1803,7 @@ static int xhci_setup_packet(XHCITransfer *xfer)
        ep = xhci_epid_to_usbep(xfer->epctx);
        if (!ep) {
            DPRINTF("xhci: slot %d has no device\n",
                    xfer->slotid);
                    xfer->epctx->slotid);
            return -1;
        }
    }
@@ -1980,7 +1977,7 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer, XHCIEPContext *epctx
{
    uint64_t mfindex;

    DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", xfer->slotid, xfer->epid);
    DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", epctx->slotid, epctx->epid);

    xfer->in_xfer = epctx->type>>2;

+1 −12
Original line number Diff line number Diff line
@@ -229,21 +229,10 @@ static void usbredir_log(void *priv, int level, const char *msg)
static void usbredir_log_data(USBRedirDevice *dev, const char *desc,
    const uint8_t *data, int len)
{
    int i, j, n;

    if (dev->debug < usbredirparser_debug_data) {
        return;
    }

    for (i = 0; i < len; i += j) {
        char buf[128];

        n = sprintf(buf, "%s", desc);
        for (j = 0; j < 8 && i + j < len; j++) {
            n += sprintf(buf + n, " %02X", data[i + j]);
        }
        error_report("%s", buf);
    }
    qemu_hexdump((char *)data, stderr, desc, len);
}

/*
Loading