summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-mpeg.c
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-09-06 10:40:21 +0000
committerGerd Knorr <devnull@localhost>2004-09-06 10:40:21 +0000
commit86e6c8cbd39e3f5ff9f121ff23f1c0b1741781b3 (patch)
tree196abc919eae7feaed3147732e8aaba88965984c /linux/drivers/media/video/cx88/cx88-mpeg.c
parent05f9a06beff29d379571d105e161d99ffff72b03 (diff)
downloadmediapointer-dvb-s2-86e6c8cbd39e3f5ff9f121ff23f1c0b1741781b3.tar.gz
mediapointer-dvb-s2-86e6c8cbd39e3f5ff9f121ff23f1c0b1741781b3.tar.bz2
- cx88: misc dvb tweaks.
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-mpeg.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-mpeg.c48
1 files changed, 32 insertions, 16 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c
index a02423473..a878a5fa4 100644
--- a/linux/drivers/media/video/cx88/cx88-mpeg.c
+++ b/linux/drivers/media/video/cx88/cx88-mpeg.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-mpeg.c,v 1.7 2004/08/31 14:08:45 kraxel Exp $
+ * $Id: cx88-mpeg.c,v 1.8 2004/09/06 10:40:21 kraxel Exp $
*
* Support for the mpeg transport stream transfers
* PCI function #2 of the cx2388x.
@@ -201,36 +201,51 @@ void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf)
/* ----------------------------------------------------------- */
-static void cx8802_timeout(unsigned long data)
+static void do_cancel_buffers(struct cx8802_dev *dev, char *reason, int restart)
{
- struct cx8802_dev *dev = (struct cx8802_dev*)data;
struct cx88_dmaqueue *q = &dev->mpegq;
struct cx88_buffer *buf;
unsigned long flags;
- dprintk(0, "cx8802_mpegport_timeout\n");
-
-#if 0 /* FIXME */
- mpegport_api_cmd(dev, IVTV_API_END_CAPTURE, 3, 0, 1, 0, 0x13);
-#endif
-
- cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]);
- cx8802_shutdown(dev);
- dev->timeout_count++;
-
spin_lock_irqsave(&dev->slock,flags);
while (!list_empty(&q->active)) {
buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
list_del(&buf->vb.queue);
buf->vb.state = STATE_ERROR;
wake_up(&buf->vb.done);
- printk("%s: [%p/%d] timeout - dma=0x%08lx\n", dev->core->name,
- buf, buf->vb.i, (unsigned long)buf->risc.dma);
+ dprintk(1,"[%p/%d] %s - dma=0x%08lx\n",
+ buf, buf->vb.i, reason, (unsigned long)buf->risc.dma);
}
- cx8802_restart_queue(dev,q);
+ if (restart)
+ cx8802_restart_queue(dev,q);
spin_unlock_irqrestore(&dev->slock,flags);
}
+void cx8802_cancel_buffers(struct cx8802_dev *dev)
+{
+ struct cx88_dmaqueue *q = &dev->mpegq;
+
+ del_timer_sync(&q->timeout);
+ cx8802_shutdown(dev);
+ do_cancel_buffers(dev,"cancel",0);
+}
+
+static void cx8802_timeout(unsigned long data)
+{
+ struct cx8802_dev *dev = (struct cx8802_dev*)data;
+
+ dprintk(0, "%s\n",__FUNCTION__);
+
+#if 0 /* FIXME */
+ mpegport_api_cmd(dev, IVTV_API_END_CAPTURE, 3, 0, 1, 0, 0x13);
+#endif
+
+ cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]);
+ cx8802_shutdown(dev);
+ dev->timeout_count++;
+ do_cancel_buffers(dev,"timeout",1);
+}
+
static void cx8802_mpeg_irq(struct cx8802_dev *dev)
{
struct cx88_core *core = dev->core;
@@ -385,6 +400,7 @@ void cx8802_fini_common(struct cx8802_dev *dev)
EXPORT_SYMBOL(cx8802_buf_prepare);
EXPORT_SYMBOL(cx8802_buf_queue);
+EXPORT_SYMBOL(cx8802_cancel_buffers);
EXPORT_SYMBOL(cx8802_init_common);
EXPORT_SYMBOL(cx8802_fini_common);