Patch from Dan Maas to add raw1394_iso_recv_flush() call to API, using the

RAW1394_IOC_ISO_RECV_FLUSH ioctl. Updated the ieee1394-ioctl.h file
aswell.


git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@127 53a565d1-3bb7-0310-b661-cf11e63c67ab
This commit is contained in:
bencollins 2003-07-17 17:33:39 +00:00
parent 531c6b405c
commit ce14ef3b9e
2 changed files with 25 additions and 3 deletions

View File

@ -100,6 +100,8 @@
_IOW ('#', 0x27, struct raw1394_iso_packets)
#define RAW1394_IOC_ISO_XMIT_SYNC \
_IO ('#', 0x28)
#define RAW1394_IOC_ISO_RECV_FLUSH \
_IO ('#', 0x29)
#endif /* __IEEE1394_IOCTL_H */

View File

@ -256,7 +256,7 @@ int raw1394_iso_multichannel_recv_init(raw1394handle_t handle,
**/
int raw1394_iso_recv_listen_channel(raw1394handle_t handle, unsigned char channel)
{
if(handle->iso_mode != ISO_RECV) {
if (handle->iso_mode != ISO_RECV) {
errno = EINVAL;
return -1;
}
@ -269,7 +269,7 @@ int raw1394_iso_recv_listen_channel(raw1394handle_t handle, unsigned char channe
**/
int raw1394_iso_recv_unlisten_channel(raw1394handle_t handle, unsigned char channel)
{
if(handle->iso_mode != ISO_RECV) {
if (handle->iso_mode != ISO_RECV) {
errno = EINVAL;
return -1;
}
@ -277,6 +277,26 @@ int raw1394_iso_recv_unlisten_channel(raw1394handle_t handle, unsigned char chan
return ioctl(handle->fd, RAW1394_IOC_ISO_RECV_UNLISTEN_CHANNEL, channel);
}
/**
* raw1394_iso_recv_flush - if you specified an irq_interval > 1 in
* iso_recv_init, you won't be notified for every single iso packet, but
* for groups of them. Now e.g. if irq_interval is 100, and you were just
* notified about iso packets and after them only 20 more packets arrived,
* no notification will be generated (20 < 100). In the case that you know
* that there should be more packets at this moment, you can call this
* function and all iso packets which are already received by the kernel
* will be flushed out to user space.
*/
int raw1394_iso_recv_flush(raw1394handle_t handle)
{
if (handle->iso_mode != ISO_RECV) {
errno = EINVAL;
return -1;
}
return ioctl(handle->fd, RAW1394_IOC_ISO_RECV_FLUSH, 0);
}
/**
* raw1394_iso_recv_set_channel_mask - listen or unlisten to a whole bunch of channels at once
* @mask: 64-bit mask of channels, 1 means listen, 0 means unlisten,
@ -286,7 +306,7 @@ int raw1394_iso_recv_unlisten_channel(raw1394handle_t handle, unsigned char chan
**/
int raw1394_iso_recv_set_channel_mask(raw1394handle_t handle, u_int64_t mask)
{
if(handle->iso_mode != ISO_RECV) {
if (handle->iso_mode != ISO_RECV) {
errno = EINVAL;
return -1;
}