summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dibusb
diff options
context:
space:
mode:
authorPatrick Boettcher <devnull@localhost>2005-02-14 20:24:53 +0000
committerPatrick Boettcher <devnull@localhost>2005-02-14 20:24:53 +0000
commitf03b0fb3a0b8896e1562ba904184581b3f6465a4 (patch)
treebe58e56995d43aede38e0b1acb19a5bb203c6943 /linux/drivers/media/dvb/dibusb
parentba289489c2c47a9fc2a69ba05021f0c249b3d72c (diff)
downloadmediapointer-dvb-s2-f03b0fb3a0b8896e1562ba904184581b3f6465a4.tar.gz
mediapointer-dvb-s2-f03b0fb3a0b8896e1562ba904184581b3f6465a4.tar.bz2
- adding the index to struct dvb_demux_feed makes dibusb-pid-filtering redundant
Diffstat (limited to 'linux/drivers/media/dvb/dibusb')
-rw-r--r--linux/drivers/media/dvb/dibusb/Makefile3
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c2
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c24
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c80
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb.h10
5 files changed, 6 insertions, 113 deletions
diff --git a/linux/drivers/media/dvb/dibusb/Makefile b/linux/drivers/media/dvb/dibusb/Makefile
index a0319f8cb..aeb896fe2 100644
--- a/linux/drivers/media/dvb/dibusb/Makefile
+++ b/linux/drivers/media/dvb/dibusb/Makefile
@@ -3,8 +3,7 @@ dvb-dibusb-objs = dvb-dibusb-core.o \
dvb-dibusb-fe-i2c.o \
dvb-dibusb-firmware.o \
dvb-dibusb-remote.o \
- dvb-dibusb-usb.o \
- dvb-dibusb-pid.o
+ dvb-dibusb-usb.o
obj-$(CONFIG_DVB_DIBUSB) += dvb-dibusb.o
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c
index be85b0e7f..d53270003 100644
--- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c
+++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c
@@ -348,7 +348,6 @@ static int dibusb_exit(struct usb_dibusb *dib)
dibusb_remote_exit(dib);
dibusb_fe_exit(dib);
dibusb_i2c_exit(dib);
- dibusb_pid_list_exit(dib);
dibusb_dvb_exit(dib);
dibusb_urb_exit(dib);
deb_info("init_state should be zero now: %x\n",dib->init_state);
@@ -367,7 +366,6 @@ static int dibusb_init(struct usb_dibusb *dib)
if ((ret = dibusb_urb_init(dib)) ||
(ret = dibusb_dvb_init(dib)) ||
- (ret = dibusb_pid_list_init(dib)) ||
(ret = dibusb_i2c_init(dib))) {
dibusb_exit(dib);
return ret;
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c
index 4cc8f5f8c..17b2a2f6e 100644
--- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c
+++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c
@@ -22,7 +22,6 @@ static u32 urb_compl_count;
void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs)
{
struct usb_dibusb *dib = urb->context;
- int ret;
deb_ts("urb complete feedcount: %d, status: %d, length: %d\n",dib->feedcount,urb->status,
urb->actual_length);
@@ -45,24 +44,12 @@ void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs)
}
if (dib->feedcount > 0) {
- deb_ts("URB return len: %d\n",urb->actual_length);
- if (urb->actual_length % 188)
- deb_ts("TS Packets: %d, %d\n", urb->actual_length/188,urb->actual_length % 188);
-
- /* Francois recommends to drop not full-filled packets, even if they may
- * contain valid TS packets, at least for USB1.1
- *
- * if (urb->actual_length == dib->dibdev->parm->default_size && dib->dvb_is_ready) */
if (dib->init_state & DIBUSB_STATE_DVB)
dvb_dmx_swfilter(&dib->demux, (u8*) urb->transfer_buffer,urb->actual_length);
- else
- deb_ts("URB dropped because of the "
- "actual_length or !dvb_is_ready (%d).\n",dib->init_state & DIBUSB_STATE_DVB);
} else
deb_ts("URB dropped because of feedcount.\n");
- ret = usb_submit_urb(urb,GFP_ATOMIC);
- deb_ts("urb resubmitted, (%d)\n",ret);
+ usb_submit_urb(urb,GFP_ATOMIC);
}
static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
@@ -90,11 +77,10 @@ static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
dib->feedcount = newfeedcount;
- /* get a free pid from the list and activate it on the device
- * specific pid_filter
- */
- if (dib->pid_parse)
- dibusb_ctrl_pid(dib,dvbdmxfeed,onoff);
+ /* activate the pid on the device specific pid_filter */
+ deb_ts("setting pid: %5d %04x at index %d '%s'\n",dvbdmxfeed->pid,dvbdmxfeed->pid,dvbdmxfeed->index,onoff ? "on" : "off");
+ if (dib->pid_parse && dib->xfer_ops.pid_ctrl != NULL)
+ dib->xfer_ops.pid_ctrl(dib->fe,dvbdmxfeed->index,dvbdmxfeed->pid,onoff);
/*
* start the feed if this was the first pid to set and there is still a pid
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c
deleted file mode 100644
index 5308be7da..000000000
--- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * dvb-dibusb-pid.c is part of the driver for mobile USB Budget DVB-T devices
- * based on reference design made by DiBcom (http://www.dibcom.fr/)
- *
- * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
- *
- * see dvb-dibusb-core.c for more copyright details.
- *
- * This file contains functions for initializing and handling the internal
- * pid-list. This pid-list mirrors the information currently stored in the
- * devices pid-list.
- */
-#include "dvb-dibusb.h"
-
-int dibusb_pid_list_init(struct usb_dibusb *dib)
-{
- int i;
- dib->pid_list = kmalloc(sizeof(struct dibusb_pid) * dib->dibdev->dev_cl->demod->pid_filter_count,GFP_KERNEL);
- if (dib->pid_list == NULL)
- return -ENOMEM;
-
- deb_xfer("initializing %d pids for the pid_list.\n",dib->dibdev->dev_cl->demod->pid_filter_count);
-
- dib->pid_list_lock = SPIN_LOCK_UNLOCKED;
- memset(dib->pid_list,0,dib->dibdev->dev_cl->demod->pid_filter_count*(sizeof(struct dibusb_pid)));
- for (i=0; i < dib->dibdev->dev_cl->demod->pid_filter_count; i++) {
- dib->pid_list[i].index = i;
- dib->pid_list[i].pid = 0;
- dib->pid_list[i].active = 0;
- }
-
- dib->init_state |= DIBUSB_STATE_PIDLIST;
- return 0;
-}
-
-void dibusb_pid_list_exit(struct usb_dibusb *dib)
-{
- if (dib->init_state & DIBUSB_STATE_PIDLIST)
- kfree(dib->pid_list);
- dib->init_state &= ~DIBUSB_STATE_PIDLIST;
-}
-
-/* fetch a pid from pid_list and set it on or off */
-int dibusb_ctrl_pid(struct usb_dibusb *dib, struct dvb_demux_feed *dvbdmxfeed , int onoff)
-{
- int i,ret = -1;
- unsigned long flags;
- u16 pid = dvbdmxfeed->pid;
-
- if (onoff) {
- spin_lock_irqsave(&dib->pid_list_lock,flags);
- for (i=0; i < dib->dibdev->dev_cl->demod->pid_filter_count; i++)
- if (!dib->pid_list[i].active) {
- dib->pid_list[i].pid = pid;
- dib->pid_list[i].active = 1;
- ret = i;
- break;
- }
- dvbdmxfeed->priv = &dib->pid_list[ret];
- spin_unlock_irqrestore(&dib->pid_list_lock,flags);
-
- if (dib->xfer_ops.pid_ctrl != NULL)
- dib->xfer_ops.pid_ctrl(dib->fe,dib->pid_list[ret].index,dib->pid_list[ret].pid,1);
- } else {
- struct dibusb_pid *dpid = dvbdmxfeed->priv;
-
- if (dib->xfer_ops.pid_ctrl != NULL)
- dib->xfer_ops.pid_ctrl(dib->fe,dpid->index,0,0);
-
- ret = dpid->index;
- dpid->pid = 0;
- dpid->active = 0;
- }
-
- /* a free pid from the list */
- deb_xfer("setting pid: %5d %04x at index %d '%s'\n",pid,pid,ret,onoff ? "on" : "off");
-
- return ret;
-}
-
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h
index 4a38b72a8..102d5a5b4 100644
--- a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h
+++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h
@@ -157,7 +157,6 @@ struct usb_dibusb {
#define DIBUSB_STATE_DVB 0x008
#define DIBUSB_STATE_I2C 0x010
#define DIBUSB_STATE_REMOTE 0x020
-#define DIBUSB_STATE_PIDLIST 0x040
int init_state;
int feedcount;
@@ -176,10 +175,6 @@ struct usb_dibusb {
struct semaphore usb_sem;
struct semaphore i2c_sem;
- /* pid filtering */
- spinlock_t pid_list_lock;
- struct dibusb_pid *pid_list;
-
/* dvb */
struct dvb_adapter *adapter;
struct dmxdev dmxdev;
@@ -232,11 +227,6 @@ int dibusb_streaming(struct usb_dibusb *,int);
int dibusb_urb_init(struct usb_dibusb *);
int dibusb_urb_exit(struct usb_dibusb *);
-/* dvb-dibusb-pid.c */
-int dibusb_pid_list_init(struct usb_dibusb *dib);
-void dibusb_pid_list_exit(struct usb_dibusb *dib);
-int dibusb_ctrl_pid(struct usb_dibusb *dib, struct dvb_demux_feed *dvbdmxfeed , int onoff);
-
/* i2c and transfer stuff */
#define DIBUSB_I2C_TIMEOUT HZ*5