diff options
| author | 2010-06-20 19:02:53 +0200 | |
|---|---|---|
| committer | 2010-09-07 11:26:58 +0200 | |
| commit | 3fc1f00be39abe13d603f020d3f257c62d9f97ea (patch) | |
| tree | 35205e78d9a8d959bbe19b99c7ab82d94c3b9e95 /src/fw-iso.c | |
| parent | Do not use a random FW_CDEV_VERSION as our implemented ABI version (diff) | |
Rename a few kernel ABI testing helpers
Use more uniform names along the lines of abi_has_some_feature(...).
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'src/fw-iso.c')
| -rw-r--r-- | src/fw-iso.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/fw-iso.c b/src/fw-iso.c index 5193b9a..253ce1d 100644 --- a/src/fw-iso.c +++ b/src/fw-iso.c @@ -156,9 +156,14 @@ int fw_iso_xmit_start(raw1394handle_t handle, int start_on_cycle, return 0; } +static inline int abi_has_iso_rx_timestamps(fw_handle_t handle) +{ + return handle->abi_version >= 2; +} + static inline int recv_header_length(fw_handle_t handle) { - return handle->abi_version >= 2 ? 8 : 4; + return abi_has_iso_rx_timestamps(handle) ? 8 : 4; } static int @@ -179,11 +184,9 @@ flush_recv_packets(raw1394handle_t handle, quadlet_t header, *p, *end; unsigned int len, cycle, dropped; unsigned char channel, tag, sy; - int header_has_timestamp; p = interrupt->header; end = (void *) interrupt->header + interrupt->header_length; - header_has_timestamp = fwhandle->abi_version >= 2; /* * This is bogus, but it's the best we can do without accurate * timestamps. Assume that the first packet was received @@ -192,7 +195,7 @@ flush_recv_packets(raw1394handle_t handle, * later. This also assumes that the interrupt event happened * immediately after the last packet was received. */ - if (!header_has_timestamp) { + if (!abi_has_iso_rx_timestamps(fwhandle)) { cycle = interrupt->cycle; cycle &= 0x1fff; cycle += 8000; @@ -209,7 +212,7 @@ flush_recv_packets(raw1394handle_t handle, channel = (header >> 8) & 0x3f; sy = header & 0x0f; - if (header_has_timestamp) + if (abi_has_iso_rx_timestamps(fwhandle)) cycle = be32_to_cpu(*p++) & 0x1fff; else { cycle++; @@ -293,6 +296,8 @@ static int handle_iso_event(raw1394handle_t handle, int cycle; fwhandle->iso.packet_count -= fwhandle->iso.irq_interval; + + /* Check whether the ABI version provides iso tx timestamps. */ if (interrupt->header_length) { /* * Take the cycle of the last packet transmitted, add |
