From 8fa3c9874b4d3315229495ae9c8077bf2260807a Mon Sep 17 00:00:00 2001 From: bencollins Date: Thu, 20 Nov 2003 15:47:03 +0000 Subject: [PATCH] Patch from Alexander Neundorf to support differing ISO rx modes. Currently supported only by OHCI. git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@138 53a565d1-3bb7-0310-b661-cf11e63c67ab --- src/iso.c | 10 +++++++--- src/kernel-raw1394.h | 3 +++ src/raw1394.h | 8 ++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/iso.c b/src/iso.c index 9702ea6..f4c6204 100644 --- a/src/iso.c +++ b/src/iso.c @@ -114,6 +114,7 @@ static int do_iso_init(raw1394handle_t handle, unsigned int max_packet_size, int channel, enum raw1394_iso_speed speed, + enum raw1394_iso_dma_recv_mode mode, int irq_interval, int cmd) { @@ -139,6 +140,7 @@ static int do_iso_init(raw1394handle_t handle, handle->iso_status.config.channel = channel; handle->iso_status.config.speed = speed; handle->iso_status.config.irq_interval = irq_interval; + handle->iso_status.config.dma_mode = mode; if(ioctl(handle->fd, cmd, &handle->iso_status)) return -1; @@ -186,7 +188,7 @@ int raw1394_iso_xmit_init(raw1394handle_t handle, enum raw1394_iso_speed speed, int irq_interval) { - if(do_iso_init(handle, buf_packets, max_packet_size, channel, speed, + if (do_iso_init(handle, buf_packets, max_packet_size, channel, speed, RAW1394_DMA_DEFAULT, irq_interval, RAW1394_IOC_ISO_XMIT_INIT)) return -1; @@ -213,10 +215,11 @@ int raw1394_iso_recv_init(raw1394handle_t handle, unsigned int buf_packets, unsigned int max_packet_size, unsigned char channel, + enum raw1394_iso_dma_recv_mode mode, int irq_interval) { /* any speed will work */ - if(do_iso_init(handle, buf_packets, max_packet_size, channel, RAW1394_ISO_SPEED_100, + if (do_iso_init(handle, buf_packets, max_packet_size, channel, RAW1394_ISO_SPEED_100, mode, irq_interval, RAW1394_IOC_ISO_RECV_INIT)) return -1; @@ -242,7 +245,8 @@ int raw1394_iso_multichannel_recv_init(raw1394handle_t handle, int irq_interval) { /* any speed will work */ - if(do_iso_init(handle, buf_packets, max_packet_size, -1, RAW1394_ISO_SPEED_100, + if (do_iso_init(handle, buf_packets, max_packet_size, -1, RAW1394_ISO_SPEED_100, + RAW1394_DMA_BUFFERFILL, irq_interval, RAW1394_IOC_ISO_RECV_INIT)) return -1; diff --git a/src/kernel-raw1394.h b/src/kernel-raw1394.h index 6563c59..cd4fc47 100644 --- a/src/kernel-raw1394.h +++ b/src/kernel-raw1394.h @@ -151,6 +151,9 @@ struct raw1394_iso_config { /* xmit only - iso transmission speed */ __u8 speed; + /* The mode of the dma when receiving iso data. Must be supported by chip */ + __u8 dma_mode; + /* max. latency of buffer, in packets (-1 if you don't care) */ __s32 irq_interval; }; diff --git a/src/raw1394.h b/src/raw1394.h index 997a99a..3cc7bfe 100644 --- a/src/raw1394.h +++ b/src/raw1394.h @@ -55,6 +55,13 @@ enum raw1394_iso_speed { RAW1394_ISO_SPEED_400 = 2, }; +/* The dma mode when receiving iso data. Must be supported by chipset */ +enum raw1394_iso_dma_recv_mode { + RAW1394_DMA_DEFAULT = 0, /* use the default mode, this is BUFFERFILL for ohci */ + RAW1394_DMA_BUFFERFILL = 1, /* BUFFER_FILL mode */ + RAW1394_DMA_PACKET_PER_BUFFER = 2 /* PACKET_PER_BUFFER mode */ +}; + /* return values from isochronous xmit/recv handlers */ enum raw1394_iso_disposition { @@ -110,6 +117,7 @@ int raw1394_iso_recv_init(raw1394handle_t handle, unsigned int buf_packets, unsigned int max_packet_size, unsigned char channel, + enum raw1394_iso_dma_recv_mode mode, int irq_interval); int raw1394_iso_multichannel_recv_init(raw1394handle_t handle,