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/
This commit is contained in:
Stefan Richter 2008-06-21 15:38:52 +02:00 committed by Dan Dennedy
parent 477b6eee6d
commit 4ce429a797
4 changed files with 33 additions and 1 deletions

View File

@ -543,3 +543,14 @@ void raw1394_iso_shutdown(raw1394handle_t handle)
else else
ieee1394_iso_shutdown(handle->mode.ieee1394); 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);
}

View File

@ -529,3 +529,22 @@ void fw_iso_shutdown(fw_handle_t handle)
free(handle->iso.packets); free(handle->iso.packets);
handle->iso.packets = NULL; 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) */
}

View File

@ -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); 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_stop(fw_handle_t handle);
void fw_iso_shutdown(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 #endif

View File

@ -329,7 +329,7 @@ void raw1394_iso_stop(raw1394handle_t handle);
void raw1394_iso_shutdown(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 * @handle: libraw1394 handle
* @cycle_timer: buffer for Isochronous Cycle Timer * @cycle_timer: buffer for Isochronous Cycle Timer
* @local_time: buffer for local system time in microseconds since Epoch * @local_time: buffer for local system time in microseconds since Epoch