mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
usb: Move short-not-ok handling to the core
After a short-not-ok packet ending short, we should not advance the queue. Move enforcing this to the core, rather then handling it in the hcd code. This may result in the queue now actually containing multiple input packets (which would not happen before), and this requires special handling in combination with pipelining, so disable pipleining for input endpoints (for now). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
0cae7b1a00
commit
6ba43f1f6b
9 changed files with 33 additions and 22 deletions
|
@ -1270,6 +1270,16 @@ static void usbredir_interface_info(void *priv,
|
|||
}
|
||||
}
|
||||
|
||||
static void usbredir_set_pipeline(USBRedirDevice *dev, struct USBEndpoint *uep)
|
||||
{
|
||||
if (uep->type != USB_ENDPOINT_XFER_BULK) {
|
||||
return;
|
||||
}
|
||||
if (uep->pid == USB_TOKEN_OUT) {
|
||||
uep->pipeline = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void usbredir_ep_info(void *priv,
|
||||
struct usb_redir_ep_info_header *ep_info)
|
||||
{
|
||||
|
@ -1311,9 +1321,7 @@ static void usbredir_ep_info(void *priv,
|
|||
dev->endpoint[i].max_packet_size =
|
||||
usb_ep->max_packet_size = ep_info->max_packet_size[i];
|
||||
}
|
||||
if (ep_info->type[i] == usb_redir_type_bulk) {
|
||||
usb_ep->pipeline = true;
|
||||
}
|
||||
usbredir_set_pipeline(dev, usb_ep);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1574,9 +1582,7 @@ static int usbredir_post_load(void *priv, int version_id)
|
|||
usb_ep->type = dev->endpoint[i].type;
|
||||
usb_ep->ifnum = dev->endpoint[i].interface;
|
||||
usb_ep->max_packet_size = dev->endpoint[i].max_packet_size;
|
||||
if (dev->endpoint[i].type == usb_redir_type_bulk) {
|
||||
usb_ep->pipeline = true;
|
||||
}
|
||||
usbredir_set_pipeline(dev, usb_ep);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue