Skip to content

Commit

Permalink
usb: controllers do not need to check for babble themselves
Browse files Browse the repository at this point in the history
If an (emulated) usb-device tries to write more data to a packet then
its iov len, this will trigger an assert in usb_packet_copy(), and if
a driver somehow circumvents that check and writes more data to the
iov then there is space, we have a much bigger problem then not correctly
reporting babble to the guest.

In practice babble will only happen with (real) redirected devices, and there
both the usb-host os and the qemu usb-device code already check for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
jwrdegoede authored and kraxel committed Sep 11, 2012
1 parent 4b1c11f commit 45b339b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions hw/usb/hcd-ehci.c
Expand Up @@ -1481,10 +1481,6 @@ static void ehci_execute_complete(EHCIQueue *q)
assert(0);
break;
}
} else if ((p->usb_status > p->tbytes) && (p->pid == USB_TOKEN_IN)) {
p->usb_status = USB_RET_BABBLE;
q->qh.token |= (QTD_TOKEN_HALT | QTD_TOKEN_BABBLE);
ehci_raise_irq(q->ehci, USBSTS_ERRINT);
} else {
// TODO check 4.12 for splits

Expand Down
5 changes: 0 additions & 5 deletions hw/usb/hcd-uhci.c
Expand Up @@ -729,11 +729,6 @@ static int uhci_complete_td(UHCIState *s, UHCI_TD *td, UHCIAsync *async, uint32_
*int_mask |= 0x01;

if (pid == USB_TOKEN_IN) {
if (len > max_len) {
ret = USB_RET_BABBLE;
goto out;
}

if ((td->ctrl & TD_CTRL_SPD) && len < max_len) {
*int_mask |= 0x02;
/* short packet: do not update QH */
Expand Down

0 comments on commit 45b339b

Please sign in to comment.