usb: bugfixes for ehci & serial.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABCgAGBQJeZ06JAAoJEEy22O7T6HE4EA8P+gOfdb6sZHrgTyiyiZP0LE3w bfahv0Uy9Wjv8czbKiGocve3IDiIggzvMu5y8lkRDkXULjTm/jlH2dHSIDbfUPbZ d3xcReg30ooQmCJmHv0f6mgmGDTtzu8D/hys3uWyrPRQCK0/n47O24w2h2iOs6zV bHu0+RvdLlT0Zo5W6TTOdtCQR4rEdYx50SL7F6flmWpgG+Wxxhi+0JtY9m4fwx0H qe6JSil0hki1uLHIArwnU/k2ohxWCsBgdiAuvOCtz9rOiYmZe9wDEmZ/Fy81im4j fJ6RN8PxojyA0xIwuDakKhdohY8ZyjI2QIZZVgZBcK2a2M9KnqVSd/s8qa8jHs5q zu0DtGiHak+xuw5pJx3nv8c1UJAjRvibCg9g6AQ7nYD2RP4lEbsxYrH8V5X5AWqO 2gMBhx6A3UqU7Kk5GdPsLS6ZPMhKDoHoEdt1uxpTrCtRZnomn3J4OZpVbYJXBFCB 4GHXeueE7dZp11EcJQYkkA/S+4OzFTkGGlsSt4SYSZ4z/uvPExThxgJqgn+GV5JA UAZSaAMzD3wORuSmLosFoPw5YwLYZThnw9KkbeNt8ZraZ1zsIsFA+FL+pr5CGfy5 0ptSaWSfIDQhUMJ4iwlGoydJ2ZC9QwEyo9t4oBbcw5XkHgshBQ8S0X7/Cvf8dwT7 pp6wc5U2zTZg87ZaiUvK =Ryyr -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/kraxel/tags/usb-20200310-pull-request' into staging usb: bugfixes for ehci & serial. # gpg: Signature made Tue 10 Mar 2020 08:23:37 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/usb-20200310-pull-request: usb/hcd-ehci: Remove redundant statements usb-serial: wakeup device on input Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
7bc4d1980f
@ -98,6 +98,7 @@ do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while (0)
|
||||
|
||||
typedef struct {
|
||||
USBDevice dev;
|
||||
USBEndpoint *intr;
|
||||
uint8_t recv_buf[RECV_BUF];
|
||||
uint16_t recv_ptr;
|
||||
uint16_t recv_used;
|
||||
@ -153,7 +154,7 @@ static const USBDescDevice desc_device = {
|
||||
{
|
||||
.bNumInterfaces = 1,
|
||||
.bConfigurationValue = 1,
|
||||
.bmAttributes = USB_CFG_ATT_ONE,
|
||||
.bmAttributes = USB_CFG_ATT_ONE | USB_CFG_ATT_WAKEUP,
|
||||
.bMaxPower = 50,
|
||||
.nif = 1,
|
||||
.ifs = &desc_iface0,
|
||||
@ -459,6 +460,8 @@ static void usb_serial_read(void *opaque, const uint8_t *buf, int size)
|
||||
memcpy(s->recv_buf + start, buf, size);
|
||||
}
|
||||
s->recv_used += size;
|
||||
|
||||
usb_wakeup(s->intr, 0);
|
||||
}
|
||||
|
||||
static void usb_serial_event(void *opaque, QEMUChrEvent event)
|
||||
@ -513,6 +516,7 @@ static void usb_serial_realize(USBDevice *dev, Error **errp)
|
||||
if (qemu_chr_fe_backend_open(&s->cs) && !dev->attached) {
|
||||
usb_device_attach(dev, &error_abort);
|
||||
}
|
||||
s->intr = usb_ep_get(dev, USB_TOKEN_IN, 1);
|
||||
}
|
||||
|
||||
static USBDevice *usb_braille_init(USBBus *bus, const char *unused)
|
||||
|
@ -1301,7 +1301,6 @@ static void ehci_execute_complete(EHCIQueue *q)
|
||||
/* should not be triggerable */
|
||||
fprintf(stderr, "USB invalid response %d\n", p->packet.status);
|
||||
g_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
/* TODO check 4.12 for splits */
|
||||
@ -2105,9 +2104,7 @@ static void ehci_advance_state(EHCIState *ehci, int async)
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Bad state!\n");
|
||||
again = -1;
|
||||
g_assert_not_reached();
|
||||
break;
|
||||
}
|
||||
|
||||
if (again < 0 || itd_count > 16) {
|
||||
|
Loading…
Reference in New Issue
Block a user