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
This commit is contained in:
bencollins 2003-11-20 15:47:03 +00:00
parent ff891d604b
commit 8fa3c9874b
3 changed files with 18 additions and 3 deletions

View File

@ -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;

View File

@ -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;
};

View File

@ -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,