linux/drivers/firewire
Stefan Richter 8e2b2b46ea firewire: cdev: improve FW_CDEV_IOC_ALLOCATE
In both the ieee1394 stack and the firewire stack, the core treats
kernelspace drivers better than userspace drivers when it comes to
CSR address range allocation:  The former may request a register to be
placed automatically at a free spot anywhere inside a specified address
range.  The latter may only request a register at a fixed offset.

Hence, userspace drivers which do not require a fixed offset potentially
need to implement a retry loop with incremented offset in each retry
until the kernel does not fail allocation with EBUSY.  This awkward
procedure is not fundamentally necessary as the core already provides a
superior allocation API to kernelspace drivers.

Therefore change the ioctl() ABI by addition of a region_end member in
the existing struct fw_cdev_allocate.  Userspace and kernelspace APIs
work the same way now.

There is a small cost to pay by clients though:  If client source code
is required to compile with older kernel headers too, then any use of
the new member fw_cdev_allocate.region_end needs to be enclosed by
#ifdef/#endif directives.  However, any client program that seriously
wants to use address range allocations will require a kernel of cdev ABI
version >= 4 at runtime and a linux/firewire-cdev.h header of >= 4
anyway.  This is because v4 brings FW_CDEV_EVENT_REQUEST2.  The only
client program in which build-time compatibility with struct
fw_cdev_allocate as found in older kernel headers makes sense is
libraw1394.

(libraw1394 uses the older broken FW_CDEV_EVENT_REQUEST to implement a
makeshift, incorrect transaction responder that does at least work
somewhat in many simple scenarios, relying on guesswork by libraw1394
and by libraw1394 based applications.  Plus, address range allocation
and transaction responder is only one of many features that libraw1394
needs to provide, and these other features need to work with kernel and
kernel-headers as old as possible.  Any new linux/firewire-cdev.h based
client that implements a transaction responder should never attempt to
do it like libraw1394;  instead it should make a header and kernel of v4
or later a hard requirement.)

While we are at it, update the struct fw_cdev_allocate documentation to
better reflect the recent fw_cdev_event_request2 ABI addition.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2010-07-23 13:36:28 +02:00
..
core-card.c firewire: cdev: add PHY packet reception 2010-07-23 13:36:28 +02:00
core-cdev.c firewire: cdev: improve FW_CDEV_IOC_ALLOCATE 2010-07-23 13:36:28 +02:00
core-device.c firewire: cdev: fix fw_cdev_event_bus_reset emission after local config ROM changes 2010-07-13 09:47:47 +02:00
core-iso.c firewire: core: fix fw_send_request kerneldoc comment 2010-07-13 09:47:47 +02:00
core-topology.c firewire: core: fix fw_send_request kerneldoc comment 2010-07-13 09:47:47 +02:00
core-transaction.c firewire: core: fix upper bound of possible CSR allocations 2010-07-23 13:36:28 +02:00
core.h firewire: cdev: add PHY pinging 2010-07-23 13:36:28 +02:00
Kconfig firewire, ieee1394: update Kconfig help 2009-12-29 19:58:17 +01:00
Makefile firewire: net: add Kconfig item, rename driver 2009-06-14 14:26:29 +02:00
net.c firewire: remove an unused function argument 2010-06-20 23:11:55 +02:00
ohci.c firewire: cdev: add PHY pinging 2010-07-23 13:36:28 +02:00
ohci.h firewire: add CSR cmstr support 2010-06-10 08:36:37 +02:00
sbp2.c firewire: remove an unused function argument 2010-06-20 23:11:55 +02:00