From stefanr@s5r6.in-berlin.de Sat Jun 21 09:38:52 2008 Return-Path: Received: from mail.boston.redhat.com ([unix socket]) by mail.boston.redhat.com (Cyrus v2.2.12-Invoca-RPM-2.2.12-8.1.RHEL4) with LMTPA; Sat, 21 Jun 2008 12:23:29 -0400 X-Sieve: CMU Sieve 2.2 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mail.boston.redhat.com (8.13.1/8.13.1) with ESMTP id m5LGNTgY024156 for ; Sat, 21 Jun 2008 12:23:29 -0400 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5LGNSrM016955 for ; Sat, 21 Jun 2008 12:23:28 -0400 Received: from lists-outbound.sourceforge.net (lists-outbound.sourceforge.net [66.35.250.225]) by mx3.redhat.com (8.13.8/8.13.8) with ESMTP id m5LGNER3009229 for ; Sat, 21 Jun 2008 12:23:15 -0400 Received: from sc8-sf-list1-new.sourceforge.net (sc8-sf-list1-new-b.sourceforge.net [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id 61A4C13B5E; Sat, 21 Jun 2008 09:23:09 -0700 (PDT) Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1KA5r3-0001G2-Jl for linux1394-devel@lists.sourceforge.net; Sat, 21 Jun 2008 09:22:22 -0700 Received: from einhorn.in-berlin.de ([192.109.42.8] ident=root) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1KA5ot-0005aS-SV for linux1394-devel@lists.sourceforge.net; Sat, 21 Jun 2008 09:20:10 -0700 X-Envelope-From: stefanr@s5r6.in-berlin.de Received: from stein ([83.221.231.7]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id m5LDcvG8006732; Sat, 21 Jun 2008 15:39:03 +0200 Date: Sat, 21 Jun 2008 15:38:52 +0200 (CEST) From: Stefan Richter Subject: [libraw1394 patch] Fix raw1394_read_cycle_timer after juju integration To: Dan Dennedy Message-ID: MIME-Version: 1.0 Content-Disposition: INLINE X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 Cc: linux1394-devel@lists.sourceforge.net, Pieter Palmers X-BeenThere: linux1394-devel@lists.sourceforge.net X-Mailman-Version: 2.1.8 Precedence: list List-Id: Linux IEEE 1394 development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: linux1394-devel-bounces@lists.sourceforge.net Errors-To: linux1394-devel-bounces@lists.sourceforge.net X-RedHat-Spam-Score: -0.943 X-Length: 6916 X-UID: 4508 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 is only compile-tested. I have no idea if the juju version works at all. But at least the ieee1394 part is quite obvious. src/dispatch.c | 11 +++++++++++ src/fw-iso.c | 19 +++++++++++++++++++ src/fw.h | 2 ++ src/raw1394.h | 2 +- 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 -- 1.5.4.5 -- Stefan Richter -=====-==--- -==- =-=-= http://arcgraph.de/sr/ ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ mailing list linux1394-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux1394-devel