summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Stefan Richter 2010-06-20 18:03:33 +0200
committerGravatar Stefan Richter 2010-09-07 11:26:56 +0200
commita29d69af5d8fa981722a92a058c24f4af4059702 (patch)
tree4a111bae6fbb5f9f900c333d3a6106166978a904
parenttools/dumpiso: Add write() return code checks, fix harmless format string bug (diff)
Do not use a random FW_CDEV_VERSION as our implemented ABI version
Since linux/firewire-cdev.h header file and libraw1394 sources are distributed separately, it is wrong to fill in a constant from that header into the FW_CDEV_IOC_GET_INFO ioctl as the ABI version which libraw1394 supports. This may not be forward compatible if an old libraw1394 is compiled with a new kernel header and ran on top of a kernel that implements new features that require a compatible userland. OK, the damage is already done in released versions of libraw1394. Hence the FW_CDEV_VERSION of the kernel header file is not going to be updated anymore in future kernel versions. (Only the version internally to firewire-core will be incremented further.) But let's remove the buggy usage of FW_CDEV_VERSION nevertheless. Developers of other firewire-cdev client programs might look at libraw1394 sources. The libraw1394 sources should not teach them how to do it wrong. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to '')
-rw-r--r--src/fw.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/fw.c b/src/fw.c
index 6c851e0..df825c9 100644
--- a/src/fw.c
+++ b/src/fw.c
@@ -25,6 +25,11 @@
#include "fw.h"
#include "raw1394_private.h"
+/*
+ * ABI version history is documented in linux/firewire-cdev.h.
+ */
+#define IMPLEMENTED_CDEV_ABI_VERSION 2
+
int
fw_errcode_to_errno(raw1394_errcode_t errcode)
{
@@ -150,7 +155,7 @@ scan_devices(fw_handle_t handle)
continue;
memset(&get_info, 0, sizeof(get_info));
memset(&reset, 0, sizeof(reset));
- get_info.version = FW_CDEV_VERSION;
+ get_info.version = IMPLEMENTED_CDEV_ABI_VERSION;
get_info.rom = 0;
get_info.rom_length = 0;
get_info.bus_reset = ptr_to_u64(&reset);
@@ -355,7 +360,7 @@ handle_inotify(raw1394handle_t handle, struct epoll_closure *ec,
}
}
- info.version = FW_CDEV_VERSION;
+ info.version = IMPLEMENTED_CDEV_ABI_VERSION;
info.rom = 0;
info.rom_length = 0;
info.bus_reset = ptr_to_u64(&reset);
@@ -607,7 +612,7 @@ int fw_set_port(fw_handle_t handle, int port)
memset(&get_info, 0, sizeof(get_info));
memset(&reset, 0, sizeof(reset));
- get_info.version = FW_CDEV_VERSION;
+ get_info.version = IMPLEMENTED_CDEV_ABI_VERSION;
get_info.rom = 0;
get_info.rom_length = 0;
get_info.bus_reset = ptr_to_u64(&reset);
@@ -1378,7 +1383,7 @@ fw_get_config_rom(fw_handle_t handle, quadlet_t *buffer,
}
memset(&get_info, 0, sizeof(get_info));
- get_info.version = FW_CDEV_VERSION;
+ get_info.version = IMPLEMENTED_CDEV_ABI_VERSION;
get_info.rom = ptr_to_u64(buffer);
get_info.rom_length = buffersize;
get_info.bus_reset = 0;
/td>Gravatar bencollins 1-1/+1 2003-07-13Fixed section for -dev package.Gravatar bencollins 1-1/+1 2003-07-13Re-add the pdf buildGravatar bencollins 1-0/+1 2003-07-13Update Debian files.Gravatar bencollins 4-25/+73 2003-07-13Ok, the Debian package was way out of sync with upstreamGravatar bencollins 1-1/+1 2003-07-13Ooops...libtool works a bit different than I thought, but atleast it worksGravatar bencollins 2-6/+1 2003-07-13Generate and install the pdf in the Debian package.Gravatar bencollins 3-3/+4 2003-07-13Don't run configure at the end of autogen.sh. Also, remove autom4te.cache.Gravatar bencollins 1-1/+1 2003-07-13Update Debian maintainerGravatar bencollins 1-1/+2 2003-07-13Update Debian changelog.Gravatar bencollins 1-0/+8 2003-07-13File doesn't really seem needed. The NEWS file gives a good overview, andGravatar bencollins 1-4/+0 2003-07-13Fix compiler warnings.Gravatar bencollins 4-12/+22 2003-07-13Updates from 0.10.0 release.Gravatar bencollins 4-5/+14 2003-04-23add libtoolize to bootstrapGravatar ddennedy 1-1/+10 2003-04-21added Dan Maas' rawiso docsGravatar ddennedy 1-32/+295 2003-04-07new_handle_on_port() error path fix from Jim RadfordGravatar dmaas 1-1/+3 2003-03-26add raw1394_new_handle_on_port() convenience functionGravatar dmaas 2-1/+41 2003-02-22Updates for new rawiso ioctl interface.Gravatar bencollins 3-37/+125 2003-01-15add iso_xmit_sync() and iso_xmit_write(); clean up iso handling a bitGravatar dmaas 5-39/+161 2003-01-15implement tag matching for rawiso receptionGravatar dmaas 3-4/+12 2003-01-06back out previous commit - don't drop the legacy API just yetGravatar dmaas 6-173/+130 2003-01-05emulate legacy ISO reception API on top of new rawiso APIGravatar dmaas 7-131/+174 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; brought...Gravatar anonymous 3-124/+48 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488