summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Stefan Richter 2008-06-21 15:38:52 +0200
committerGravatar Dan Dennedy 2008-07-05 13:16:30 -0700
commit4ce429a797a7790d5c42cb4398b54b549a01d625 (patch)
treebc9637cdfcd51c1af5433874e79acb860e5895d0
parentPlug dir leak and initialize data structs (diff)
Fix raw1394_read_cycle_timer after juju integration
The ieee1394 version of raw1394_read_cycle_timer() fell over the cliff in "First cut at integrating juju". This brings it back and adds a juju version of it. Also correct a typo in the inline documentation: s/get/read/
Diffstat (limited to '')
-rw-r--r--src/dispatch.c11
-rw-r--r--src/fw-iso.c19
-rw-r--r--src/fw.h2
-rw-r--r--src/raw1394.h2
4 files changed, 33 insertions, 1 deletions
diff --git a/src/dispatch.c b/src/dispatch.c
index 4fe805e..aa40071 100644
--- a/src/dispatch.c
+++ b/src/dispatch.c
@@ -543,3 +543,14 @@ void raw1394_iso_shutdown(raw1394handle_t handle)
else
ieee1394_iso_shutdown(handle->mode.ieee1394);
}
+
+int raw1394_read_cycle_timer(raw1394handle_t handle,
+ u_int32_t *cycle_timer, u_int64_t *local_time)
+{
+ if (handle && handle->is_fw)
+ return fw_read_cycle_timer(handle->mode.fw,
+ cycle_timer, local_time);
+ else
+ return ieee1394_read_cycle_timer(handle->mode.ieee1394,
+ cycle_timer, local_time);
+}
diff --git a/src/fw-iso.c b/src/fw-iso.c
index a1794c3..f493444 100644
--- a/src/fw-iso.c
+++ b/src/fw-iso.c
@@ -529,3 +529,22 @@ void fw_iso_shutdown(fw_handle_t handle)
free(handle->iso.packets);
handle->iso.packets = NULL;
}
+
+int fw_read_cycle_timer(fw_handle_t handle,
+ u_int32_t *cycle_timer, u_int64_t *local_time)
+{
+#ifdef FW_CDEV_IOC_GET_CYCLE_TIMER /* added in kernel 2.6.24 */
+ int err;
+ struct fw_cdev_get_cycle_timer ctr = { 0 };
+
+ err = ioctl(handle->iso.fd, FW_CDEV_IOC_GET_CYCLE_TIMER, &ctr);
+ if (!err) {
+ *cycle_timer = ctr.cycle_timer;
+ *local_time = ctr.local_time;
+ }
+ return err;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif /* defined(FW_CDEV_IOC_GET_CYCLE_TIMER) */
+}
diff --git a/src/fw.h b/src/fw.h
index e3196de..4ee9017 100644
--- a/src/fw.h
+++ b/src/fw.h
@@ -253,5 +253,7 @@ int fw_iso_recv_unlisten_channel(fw_handle_t handle,
int fw_iso_recv_set_channel_mask(fw_handle_t handle, u_int64_t mask);
void fw_iso_stop(fw_handle_t handle);
void fw_iso_shutdown(fw_handle_t handle);
+int fw_read_cycle_timer(fw_handle_t handle,
+ u_int32_t *cycle_timer, u_int64_t *local_time);
#endif
diff --git a/src/raw1394.h b/src/raw1394.h
index 1bcdf19..7cc07e6 100644
--- a/src/raw1394.h
+++ b/src/raw1394.h
@@ -329,7 +329,7 @@ void raw1394_iso_stop(raw1394handle_t handle);
void raw1394_iso_shutdown(raw1394handle_t handle);
/**
- * raw1394_get_cycle_timer - get the current value of the cycle timer
+ * raw1394_read_cycle_timer - get the current value of the cycle timer
* @handle: libraw1394 handle
* @cycle_timer: buffer for Isochronous Cycle Timer
* @local_time: buffer for local system time in microseconds since Epoch
ht='13' alt='Gravatar' /> 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