qemu-e2k/hw/usb
Hans de Goede 58ea88d87a usb-ehci: frindex always is a 14 bits counter
frindex always is a 14 bits counter, and not a 13 bits one as we were
emulating. There are some subtle hints to this in the spec, first of all
"Table 2-12. FRINDEX - Frame Index Register" says:
"Bit 13:0 Frame Index. The value in this register increments at the end of
each time frame (e.g. micro-frame). Bits [N:3] are used for the Frame List
current index. This means that each location of the frame list is accessed
8 times (frames or micro-frames) before moving to the next index. The
following illustrates values of N based on the value of the Frame List
Size field in the USBCMD register.

USBCMD[Frame List Size]	Number Elements		 N
00b				1024		12
01b				 512		11
10b				 256		10
11b			    Reserved"

Notice how the text talks about "Bits [N:3]" are used ..., it does
NOT say that when N == 12 (our case) the counter will wrap from 8191 to 0,
or in otherwords that it is a 13 bits counter (bits 0 - 12).

The other hint is in "Table 2-10. USBSTS USB Status Register Bit Definitions":

"Bit 3 Frame List Rollover - R/WC. The Host Controller sets this bit to a one
when the Frame List Index (see Section 2.3.4) rolls over from its maximum value
to zero. The exact value at which the rollover occurs depends on the frame
list size. For example, if the frame list size (as programmed in the Frame
List Size field of the USBCMD register) is 1024, the Frame Index Register
rolls over every time FRINDEX[13] toggles. Similarly, if the size is 512,
the Host Controller sets this bit to a one every time FRINDEX[12] toggles."

Notice how this text talks about setting bit 3 when bit 13 of frindex toggles
(when there are 1024 entries, so our case), so this indicates that frindex
has a bit 13 making it a 14 bit counter.

Besides these clear hints the real proof is in the pudding. Before this
patch I could not stream data from a USB2 webcam under Windows XP, after
this cam using a USB2 webcam under Windows XP works fine, and no regressions
with other operating systems were seen.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17 10:23:28 +02:00
..
bus.c usb/vmstate: add parent dev path 2012-04-17 10:23:21 +02:00
core.c usb_packet_set_state: handle p->ep == NULL 2012-04-17 10:23:27 +02:00
desc.c usb: the big rename 2012-03-13 10:15:32 +01:00
desc.h usb: the big rename 2012-03-13 10:15:32 +01:00
dev-audio.c usb: the big rename 2012-03-13 10:15:32 +01:00
dev-bluetooth.c usb: the big rename 2012-03-13 10:15:32 +01:00
dev-hid.c usb: the big rename 2012-03-13 10:15:32 +01:00
dev-hub.c usb-hub: add tracepoints 2012-04-17 10:23:27 +02:00
dev-network.c usb: the big rename 2012-03-13 10:15:32 +01:00
dev-serial.c usb: the big rename 2012-03-13 10:15:32 +01:00
dev-smartcard-reader.c usb: the big rename 2012-03-13 10:15:32 +01:00
dev-storage.c qdev: qdev_unplug(): use error_set() 2012-04-09 14:35:25 -03:00
dev-wacom.c usb: the big rename 2012-03-13 10:15:32 +01:00
hcd-ehci.c usb-ehci: frindex always is a 14 bits counter 2012-04-17 10:23:28 +02:00
hcd-musb.c usb: the big rename 2012-03-13 10:15:32 +01:00
hcd-ohci.c usb-ohci: DMA writeback bug fixes 2012-03-13 10:15:32 +01:00
hcd-uhci.c usb-uhci: queuing fix 2012-04-17 10:23:27 +02:00
hcd-xhci.c usb: the big rename 2012-03-13 10:15:32 +01:00
host-bsd.c usb: the big rename 2012-03-13 10:15:32 +01:00
host-linux.c usb-host: add property to turn off pipelining 2012-04-17 10:23:27 +02:00
host-stub.c usb: the big rename 2012-03-13 10:15:32 +01:00
libhw.c usb: the big rename 2012-03-13 10:15:32 +01:00
redirect.c Add bootindex support to usb-host and usb-redir 2012-04-17 10:23:27 +02:00