diff options
author | Patrick Boettcher <devnull@localhost> | 2005-02-14 20:24:53 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-02-14 20:24:53 +0000 |
commit | f03b0fb3a0b8896e1562ba904184581b3f6465a4 (patch) | |
tree | be58e56995d43aede38e0b1acb19a5bb203c6943 /linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c | |
parent | ba289489c2c47a9fc2a69ba05021f0c249b3d72c (diff) | |
download | mediapointer-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/dvb-dibusb-pid.c')
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c | 80 |
1 files changed, 0 insertions, 80 deletions
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; -} - |