qemu/hw/usb
Hans de Goede cae5d3f4b3 ehci: Fix interrupt packet MULT handling
There are several issues with our handling of the MULT epcap field
of interrupt qhs, which this patch fixes.

1) When we don't execute a transaction because of the transaction counter
being 0, p->async stays EHCI_ASYNC_NONE, and the next time we process the
same qtd we hit an assert in ehci_state_fetchqtd because of this. Even though
I believe that this is caused by 3 below, this patch still removes the assert,
as that can still happen without 3, when multiple packets are queued for the
same interrupt ep.

2) We only *check* the transaction counter from ehci_state_execute, any
packets queued up by fill_queue bypass this check. This is fixed by not calling
fill_queue for interrupt packets.

3) Some versions of Windows set the MULT field of the qh to 0, which is a
clear violation of the EHCI spec, but still they do it. This means that we
will never execute a qtd for these, making interrupt ep-s on USB-2 devices
not work, and after recent changes, triggering 1).

So far we've stored the transaction counter in our copy of the mult field,
but with this beginnig at 0 already when dealing with these version of windows
this won't work. So this patch adds a transact_ctr field to our qh struct,
and sets this to the MULT field value on fetchqh. When the MULT field value
is 0, we set it to 4. Assuming that windows gets way with setting it to 0,
by the actual hardware going horizontal on a 1 -> 0 transition, which will
give it 4 transactions (MULT goes from 0 - 3).

Note that we cannot stop on detecting the 1 -> 0 transition, as our decrement
of the transaction counter, and checking for it are done in 2 different places.

Reported-by: Shawn Starr <shawn.starr@rogers.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-09-26 09:24:41 +02:00
..
bus.c
core.c usb-core: Allow the first packet of a pipelined ep to complete immediately 2012-09-11 07:42:59 +02:00
desc.c usb3: bos decriptor 2012-09-11 07:43:01 +02:00
desc.h usb3: bos decriptor 2012-09-11 07:43:01 +02:00
dev-audio.c usb-audio: fix usb version 2012-09-11 07:43:00 +02:00
dev-bluetooth.c
dev-hid.c
dev-hub.c
dev-network.c net: fix usbnet_receive() packet drops 2012-09-14 08:40:32 +01:00
dev-serial.c Better name usb braille device 2012-09-11 07:43:00 +02:00
dev-smartcard-reader.c
dev-storage.c usb-storage: usb3 support 2012-09-11 07:43:01 +02:00
dev-uas.c uas: move transfer kickoff 2012-08-31 15:47:57 +02:00
dev-wacom.c
hcd-ehci.c ehci: Fix interrupt packet MULT handling 2012-09-26 09:24:41 +02:00
hcd-musb.c usb: unique packet ids 2012-08-31 11:57:23 +02:00
hcd-ohci.c usb: unique packet ids 2012-08-31 11:57:23 +02:00
hcd-uhci.c uhci: Don't queue up packets after one with the SPD flag set 2012-09-13 09:50:47 +02:00
hcd-xhci.c xhci: create a memory region for each port 2012-09-26 09:24:41 +02:00
host-bsd.c
host-linux.c usb-host: allow emulated (non-async) control requests without USBPacket 2012-09-12 08:09:48 +02:00
host-stub.c
libhw.c
Makefile.objs
redirect.c usb-redir: Revert usb-redir part of commit 93bfef4c 2012-09-13 09:50:47 +02:00