aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/firewire-cdev.h
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2012-03-18 14:06:39 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2012-03-18 17:15:39 -0400
commitd1bbd20972936b9b178fda3eb1ec417cb27fdc01 (patch)
tree5d2e29adbc6f0e8ad0dd07b7624e2ad07181303e /include/linux/firewire-cdev.h
parent18d627113b830cda80792e96b28341bcd41cf40c (diff)
firewire: allow explicit flushing of iso packet completions
Extend the kernel and userspace APIs to allow reporting all currently completed isochronous packets, even if the next interrupt packet has not yet been reached. This is required to determine the status of the packets at the end of a paused or stopped stream, and useful for more precise synchronization of audio streams. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'include/linux/firewire-cdev.h')
-rw-r--r--include/linux/firewire-cdev.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index b9bd349c6930..d50036953497 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -212,10 +212,11 @@ struct fw_cdev_event_request2 {
212 * @header: Stripped headers, if any 212 * @header: Stripped headers, if any
213 * 213 *
214 * This event is sent when the controller has completed an &fw_cdev_iso_packet 214 * This event is sent when the controller has completed an &fw_cdev_iso_packet
215 * with the %FW_CDEV_ISO_INTERRUPT bit set, or when there have been so many 215 * with the %FW_CDEV_ISO_INTERRUPT bit set, when explicitly requested with
216 * completed packets without the interrupt bit set that the kernel's internal 216 * %FW_CDEV_IOC_FLUSH_ISO, or when there have been so many completed packets
217 * buffer for @header is about to overflow. (In the latter case, kernels with 217 * without the interrupt bit set that the kernel's internal buffer for @header
218 * ABI version < 5 drop header data up to the next interrupt packet.) 218 * is about to overflow. (In the last case, kernels with ABI version < 5 drop
219 * header data up to the next interrupt packet.)
219 * 220 *
220 * Isochronous transmit events (context type %FW_CDEV_ISO_CONTEXT_TRANSMIT): 221 * Isochronous transmit events (context type %FW_CDEV_ISO_CONTEXT_TRANSMIT):
221 * 222 *
@@ -271,7 +272,8 @@ struct fw_cdev_event_iso_interrupt {
271 * This event is sent in multichannel contexts (context type 272 * This event is sent in multichannel contexts (context type
272 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer 273 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer
273 * chunks that have been completely filled and that have the 274 * chunks that have been completely filled and that have the
274 * %FW_CDEV_ISO_INTERRUPT bit set. 275 * %FW_CDEV_ISO_INTERRUPT bit set, or when explicitly requested with
276 * %FW_CDEV_IOC_FLUSH_ISO.
275 * 277 *
276 * The buffer is continuously filled with the following data, per packet: 278 * The buffer is continuously filled with the following data, per packet:
277 * - the 1394 iso packet header as described at &fw_cdev_event_iso_interrupt, 279 * - the 1394 iso packet header as described at &fw_cdev_event_iso_interrupt,
@@ -421,6 +423,9 @@ union fw_cdev_event {
421#define FW_CDEV_IOC_RECEIVE_PHY_PACKETS _IOW('#', 0x16, struct fw_cdev_receive_phy_packets) 423#define FW_CDEV_IOC_RECEIVE_PHY_PACKETS _IOW('#', 0x16, struct fw_cdev_receive_phy_packets)
422#define FW_CDEV_IOC_SET_ISO_CHANNELS _IOW('#', 0x17, struct fw_cdev_set_iso_channels) 424#define FW_CDEV_IOC_SET_ISO_CHANNELS _IOW('#', 0x17, struct fw_cdev_set_iso_channels)
423 425
426/* available since kernel version 3.4 */
427#define FW_CDEV_IOC_FLUSH_ISO _IOW('#', 0x18, struct fw_cdev_flush_iso)
428
424/* 429/*
425 * ABI version history 430 * ABI version history
426 * 1 (2.6.22) - initial version 431 * 1 (2.6.22) - initial version
@@ -445,6 +450,7 @@ union fw_cdev_event {
445 * %FW_CDEV_IOC_SET_ISO_CHANNELS 450 * %FW_CDEV_IOC_SET_ISO_CHANNELS
446 * 5 (3.4) - send %FW_CDEV_EVENT_ISO_INTERRUPT events when needed to 451 * 5 (3.4) - send %FW_CDEV_EVENT_ISO_INTERRUPT events when needed to
447 * avoid dropping data 452 * avoid dropping data
453 * - added %FW_CDEV_IOC_FLUSH_ISO
448 */ 454 */
449 455
450/** 456/**
@@ -855,6 +861,25 @@ struct fw_cdev_stop_iso {
855}; 861};
856 862
857/** 863/**
864 * struct fw_cdev_flush_iso - flush completed iso packets
865 * @handle: handle of isochronous context to flush
866 *
867 * For %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE contexts,
868 * report any completed packets.
869 *
870 * For %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL contexts, report the current
871 * offset in the receive buffer, if it has changed; this is typically in the
872 * middle of some buffer chunk.
873 *
874 * Any %FW_CDEV_EVENT_ISO_INTERRUPT or %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL
875 * events generated by this ioctl are sent synchronously, i.e., are available
876 * for reading from the file descriptor when this ioctl returns.
877 */
878struct fw_cdev_flush_iso {
879 __u32 handle;
880};
881
882/**
858 * struct fw_cdev_get_cycle_timer - read cycle timer register 883 * struct fw_cdev_get_cycle_timer - read cycle timer register
859 * @local_time: system time, in microseconds since the Epoch 884 * @local_time: system time, in microseconds since the Epoch
860 * @cycle_timer: Cycle Time register contents 885 * @cycle_timer: Cycle Time register contents