summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ddennedy 2005-07-04 03:00:50 +0000
committerGravatar ddennedy 2005-07-04 03:00:50 +0000
commit19065515152718407db849b0be71a8eeee80deaa (patch)
tree53aaf9dba643e8967d02a5b5509f2b4a1d4ca416
parentAdd a comment that libraw does not allocate channels and bandwidth. This (diff)
add sanity check to queuing of packets in rawiso xmit
git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@159 53a565d1-3bb7-0310-b661-cf11e63c67ab
-rw-r--r--src/iso.c5
-rw-r--r--src/raw1394.h16
2 files changed, 15 insertions, 6 deletions
diff --git a/src/iso.c b/src/iso.c
index 9e19e49..914b3ec 100644
--- a/src/iso.c
+++ b/src/iso.c
@@ -269,7 +269,6 @@ int raw1394_iso_recv_start(raw1394handle_t handle, int start_on_cycle, int tag_m
return 0;
}
-
static int _raw1394_iso_xmit_queue_packets(raw1394handle_t handle)
{
struct raw1394_iso_status *stat = &handle->iso_status;
@@ -282,6 +281,10 @@ static int _raw1394_iso_xmit_queue_packets(raw1394handle_t handle)
goto out;
}
+ /* ensure stat->n_packets is sane */
+ if (stat->n_packets > stat->config.buf_packets)
+ stat->n_packets = stat->config.buf_packets;
+
/* we could potentially send up to stat->n_packets packets */
packets.n_packets = 0;
packets.infos = malloc(stat->n_packets * sizeof(struct raw1394_iso_packet_info));
diff --git a/src/raw1394.h b/src/raw1394.h
index bd482da..833915f 100644
--- a/src/raw1394.h
+++ b/src/raw1394.h
@@ -1207,7 +1207,9 @@ typedef int (*iso_handler_t)(raw1394handle_t, int channel, size_t length,
**/
iso_handler_t raw1394_set_iso_handler(raw1394handle_t handle,
unsigned int channel,
- iso_handler_t new_h);
+ iso_handler_t new_h)
+__attribute__ ((deprecated));
+
/**
* raw1394_start_iso_rcv - enable isochronous receiving (DEPRECATED)
* @handle: libraw1394 handle
@@ -1219,7 +1221,8 @@ iso_handler_t raw1394_set_iso_handler(raw1394handle_t handle,
* Isochronous packets are then passed to the callback specified with
* raw1394_set_iso_handler().
**/
-int raw1394_start_iso_rcv(raw1394handle_t handle, unsigned int channel);
+int raw1394_start_iso_rcv(raw1394handle_t handle, unsigned int channel)
+__attribute__ ((deprecated));
/**
* raw1394_stop_iso_rcv - stop isochronous receiving (DEPRECATED)
@@ -1230,7 +1233,8 @@ int raw1394_start_iso_rcv(raw1394handle_t handle, unsigned int channel);
*
* Stops the reception of isochronous packets in @channel on @handle.
**/
-int raw1394_stop_iso_rcv(raw1394handle_t handle, unsigned int channel);
+int raw1394_stop_iso_rcv(raw1394handle_t handle, unsigned int channel)
+__attribute__ ((deprecated));
/**
* raw1394_start_iso_write - initiate an isochronous packet write (DEPRECATED)
@@ -1259,7 +1263,8 @@ int raw1394_stop_iso_rcv(raw1394handle_t handle, unsigned int channel);
int raw1394_start_iso_write(raw1394handle_t handle, unsigned int channel,
unsigned int tag, unsigned int sy,
unsigned int speed, size_t length, quadlet_t *data,
- unsigned long rawtag);
+ unsigned long rawtag)
+__attribute__ ((deprecated));
/**
* raw1394_iso_write - DEPRECATED
@@ -1269,7 +1274,8 @@ int raw1394_start_iso_write(raw1394handle_t handle, unsigned int channel,
**/
int raw1394_iso_write(raw1394handle_t handle, unsigned int channel,
unsigned int tag, unsigned int sy, unsigned int speed,
- size_t length, quadlet_t *data);
+ size_t length, quadlet_t *data)
+__attribute__ ((deprecated));
#ifdef __cplusplus
}
w.gravatar.com/avatar/4fdeb2365dc75bd544972b8cdb7992fd?s=13&d=retro' width='13' height='13' alt='Gravatar' /> aeb 2-3/+11 2000-11-24Added libraw1394.postinst.in to list of distributed files.Gravatar aeb 3-3/+35 2000-11-23Add ldconfig in deb postinst for Debian policy conformance.Gravatar aeb 2-2/+17 2000-11-23Removed acconfig.h, which wasn't needed for some time.Gravatar aeb 1-13/+0 2000-11-22Added ieee1394.h header.Gravatar aeb 3-1/+38 2000-09-13Fix raw1394_start_iso_write() which uses wrong variable.Gravatar aeb 1-1/+1 2000-09-10Work around compiler warnings for int/ptr casts.Gravatar aeb 6-10/+20 2000-09-10Added control files for Debian packages.Gravatar aeb 6-8/+106 2000-09-01Added missing prototypes for iso send functions.Gravatar aeb 1-0/+7 2000-08-08Added raw1394_get_irm_id().Gravatar aeb 7-7/+39 2000-08-06Added support for isochronous sending.Gravatar aeb 3-0/+35 2000-07-05Added raw1394_reset_bus() call.Gravatar aeb 4-0/+23 2000-06-22- Set library version info in configure.in, use in src/Makefile.am.Gravatar aeb 4-2/+16 2000-06-15Update libtool version number.Gravatar aeb 2-2/+2 2000-06-14Added copyright headers.Gravatar aeb 6-0/+54 2000-06-11Added explicit AC_PROG_INSTALL call.Gravatar aeb 1-0/+1 2000-06-09Fix size of error field.Gravatar aeb 1-2/+2 2000-06-02Modified support for 32/64 bit environments, control struct fields have fixed...Gravatar aeb 7-43/+28 2000-05-28Added support for environments with 64 bit kernel and 32 bit userland.Gravatar aeb 8-7/+45 2000-04-27Fixed missing setting of ext code in raw1394_start_lock()Gravatar aeb 1-0/+1 2000-04-15Fixed lock transaction to actually return response value.Gravatar aeb 3-5/+11 2000-04-12Add userdata functions as news.Gravatar aeb 1-0/+4 2000-04-05Add userdata functions.Gravatar aeb 3-0/+18 2000-03-18Bump version number to 0.6.Gravatar aeb 3-5/+6 2000-03-18Mention byte order change.Gravatar aeb 1-0/+2 2000-03-18Mention SourceForge home.Gravatar aeb 1-1/+5