summaryrefslogtreecommitdiffstats
path: root/src/fw-iso.c
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 /src/fw-iso.c
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 'src/fw-iso.c')
-rw-r--r--src/fw-iso.c19
1 files changed, 19 insertions, 0 deletions
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) */
+}