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;
067d5052887&follow=1'>Ok, the Debian package was way out of sync with upstreamGravatar bencollins 1-1/+1 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@119 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-07-13Ooops...libtool works a bit different than I thought, but atleast it worksGravatar bencollins 2-6/+1 like it is supposed to. git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@117 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-07-13Generate and install the pdf in the Debian package.Gravatar bencollins 3-3/+4 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@114 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-07-13Don't run configure at the end of autogen.sh. Also, remove autom4te.cache.Gravatar bencollins 1-1/+1 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@113 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-07-13Update Debian maintainerGravatar bencollins 1-1/+2 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@112 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-07-13Update Debian changelog.Gravatar bencollins 1-0/+8 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@111 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-07-13File doesn't really seem needed. The NEWS file gives a good overview, andGravatar bencollins 1-4/+0 the svn log is more than verbose enough for info seekers. git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@110 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-07-13Fix compiler warnings.Gravatar bencollins 4-12/+22 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@109 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-07-13Updates from 0.10.0 release.Gravatar bencollins 4-5/+14 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@108 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-04-23add libtoolize to bootstrapGravatar ddennedy 1-1/+10 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@107 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-04-21added Dan Maas' rawiso docsGravatar ddennedy 1-32/+295 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@106 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-04-07new_handle_on_port() error path fix from Jim RadfordGravatar dmaas 1-1/+3 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@105 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-03-26add raw1394_new_handle_on_port() convenience functionGravatar dmaas 2-1/+41 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@104 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-02-22Updates for new rawiso ioctl interface.Gravatar bencollins 3-37/+125 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@103 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-15add iso_xmit_sync() and iso_xmit_write(); clean up iso handling a bitGravatar dmaas 5-39/+161 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@102 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-15implement tag matching for rawiso receptionGravatar dmaas 3-4/+12 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@101 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-06back out previous commit - don't drop the legacy API just yetGravatar dmaas 6-173/+130 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@100 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-05emulate legacy ISO reception API on top of new rawiso APIGravatar dmaas 7-131/+174 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@99 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@98 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@97 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; ↵Gravatar anonymous 3-124/+48 brought kernel-raw1394.h back in sync with the kernel version git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@96 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 - changed return type of rawiso xmit/recv handlers from int to enum raw1394_iso_disposition - added an ioctl (RAW1394_ISO_QUEUE_ACTIVITY) to force an ISO_ACTIVITY event into the queue. This is needed for handling RAW1394_ISO_DEFER, to kick us out of the next read() instead of sleeping forever. - removed references to "8-byte" isochronous header - this is an OHCI-specific implementation detail git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@95 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@94 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@93 53a565d1-3bb7-0310-b661-cf11e63c67ab