linux/drivers/firewire
David Moore 0642b6577f firewire: fw-ohci: Fix for dualbuffer three-or-more buffers
This patch fixes the problem where different OHCI 1.1 controllers behave
differently when a received iso packet straddles three or more buffers
when using the dual-buffer receive mode.  Two changes are made in order
to handle this situation:

1. The packet sync DMA descriptor is given a non-zero header length and
non-zero payload length.  This is because zero-payload descriptors are
not discussed in the OHCI 1.1 specs and their behavior is thus
undefined.  Instead we use a header size just large enough for a single
header and a payload length of 4 bytes for this first descriptor.

2. As we process received packets in the context's tasklet, read the
packet length out of the headers.  Keep track of the running total of
the packet length as "excess_bytes", so we can ignore any descriptors
where no packet starts or ends.  These descriptors may not have had
their first_res_count or second_res_count fields updated by the
controller so we cannot rely on those values.

The main drawback of this patch is that the excess_bytes value might get
"out of sync" with the packet descriptors if something strange happens
to the DMA program.  I'm not if such a thing could ever happen, but I
appreciate any suggestions in making it more robust.

Also, the packet-per-buffer support may need a similar fix to deal with
issue 1, but I haven't done any work on that yet.

Stefan, I'm hoping that with this patch, all your OHCI 1.1 controllers
will work properly with an unmodified version of libdc1394.

Signed-off-by: David Moore <dcm@acm.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-01-30 22:22:23 +01:00
..
fw-card.c firewire: fix unloading of fw-ohci while devices are attached 2007-08-25 18:00:27 +02:00
fw-cdev.c firewire: fw-cdev: reorder wakeup vs. spinlock 2007-10-17 00:00:10 +02:00
fw-device.c Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
fw-device.h firewire: fw-sbp2: add support for multiple logical units per target 2007-10-17 00:00:03 +02:00
fw-iso.c firewire: Clean up comment style. 2007-05-10 18:24:13 +02:00
fw-ohci.c firewire: fw-ohci: Fix for dualbuffer three-or-more buffers 2008-01-30 22:22:23 +01:00
fw-ohci.h firewire: fw-ohci: check for misconfigured bus (phyID == 63) 2007-10-17 00:00:08 +02:00
fw-sbp2.c firewire: fw-sbp2: remove unused misleading macro 2008-01-30 22:22:22 +01:00
fw-topology.c firewire: in-code doc updates. 2007-10-17 00:00:09 +02:00
fw-topology.h firewire: a header cleanup 2007-10-17 00:00:09 +02:00
fw-transaction.c fix typo "insted" -> "instead" 2007-10-20 01:55:04 +02:00
fw-transaction.h firewire: fw-sbp2: set correct maximum payload (fixes CardBus adapters) 2007-08-02 20:34:16 +02:00
Kconfig firewire: point to migration document 2007-10-07 13:48:41 +02:00
Makefile firewire: prefix modules with firewire- instead of fw- 2007-05-27 23:21:01 +02:00