diff options
author | Patrick Boettcher <devnull@localhost> | 2005-01-13 13:21:55 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-01-13 13:21:55 +0000 |
commit | abec1400ec7e1b351d714078a12d365f2929f7ab (patch) | |
tree | e8add94f69b624450241073cda49cdf6570664aa | |
parent | 90d3d94d395a445b76de9341168c2f6189e115f6 (diff) | |
download | mediapointer-dvb-s2-abec1400ec7e1b351d714078a12d365f2929f7ab.tar.gz mediapointer-dvb-s2-abec1400ec7e1b351d714078a12d365f2929f7ab.tar.bz2 |
removed the pid_filter_table from frontends
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000-common.c | 63 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000-common.h | 23 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000.h | 8 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000mb.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000mc.c | 23 |
5 files changed, 15 insertions, 118 deletions
diff --git a/linux/drivers/media/dvb/frontends/dib3000-common.c b/linux/drivers/media/dvb/frontends/dib3000-common.c index 7974fa623..247cb85ea 100644 --- a/linux/drivers/media/dvb/frontends/dib3000-common.c +++ b/linux/drivers/media/dvb/frontends/dib3000-common.c @@ -9,7 +9,6 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=i2c,4=srch (|-able))."); #define deb_i2c(args...) dprintk(0x02,args) #define deb_srch(args...) dprintk(0x04,args) - int dib3000_read_reg(struct dib3000_state *state, u16 reg) { u8 wb[] = { ((reg >> 8) | 0x80) & 0xff, reg & 0xff }; @@ -42,65 +41,6 @@ int dib3000_write_reg(struct dib3000_state *state, u16 reg, u16 val) return i2c_transfer(state->i2c,msg, 1) != 1 ? -EREMOTEIO : 0; } -int dib3000_init_pid_list(struct dib3000_state *state, int num) -{ - int i; - if (state != NULL) { - state->pid_list = kmalloc(sizeof(struct dib3000_pid) * num,GFP_KERNEL); - if (state->pid_list == NULL) - return -ENOMEM; - - deb_info("initializing %d pids for the pid_list.\n",num); - state->pid_list_lock = SPIN_LOCK_UNLOCKED; - memset(state->pid_list,0,num*(sizeof(struct dib3000_pid))); - for (i=0; i < num; i++) { - state->pid_list[i].pid = 0; - state->pid_list[i].active = 0; - } - state->feedcount = 0; - } else - return -EINVAL; - - return 0; -} - -void dib3000_dealloc_pid_list(struct dib3000_state *state) -{ - if (state != NULL && state->pid_list != NULL) - kfree(state->pid_list); -} - -/* fetch a pid from pid_list */ -int dib3000_get_pid_index(struct dib3000_pid pid_list[], int num_pids, int pid, - spinlock_t *pid_list_lock,int onoff) -{ - int i,ret = -1; - unsigned long flags; - - spin_lock_irqsave(pid_list_lock,flags); - for (i=0; i < num_pids; i++) - if (onoff) { - if (!pid_list[i].active) { - pid_list[i].pid = pid; - pid_list[i].active = 1; - ret = i; - break; - } - } else { - if (pid_list[i].active && pid_list[i].pid == pid) { - pid_list[i].pid = 0; - pid_list[i].active = 0; - ret = i; - break; - } - } - - deb_info("setting pid: %5d %04x at index %d '%s'\n",pid,pid,ret,onoff ? "on" : "off"); - - spin_unlock_irqrestore(pid_list_lock,flags); - return ret; -} - int dib3000_search_status(u16 irq,u16 lock) { if (irq & 0x02) { @@ -139,7 +79,4 @@ EXPORT_SYMBOL(dib3000_seq); EXPORT_SYMBOL(dib3000_read_reg); EXPORT_SYMBOL(dib3000_write_reg); -EXPORT_SYMBOL(dib3000_init_pid_list); -EXPORT_SYMBOL(dib3000_dealloc_pid_list); -EXPORT_SYMBOL(dib3000_get_pid_index); EXPORT_SYMBOL(dib3000_search_status); diff --git a/linux/drivers/media/dvb/frontends/dib3000-common.h b/linux/drivers/media/dvb/frontends/dib3000-common.h index 1e65c301a..385fcfe4c 100644 --- a/linux/drivers/media/dvb/frontends/dib3000-common.h +++ b/linux/drivers/media/dvb/frontends/dib3000-common.h @@ -29,16 +29,9 @@ #include "dib3000.h" /* info and err, taken from usb.h, if there is anything available like by default. */ -#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg) -#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg) -#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg) - -/* a PID for the pid_filter list, when in use */ -struct dib3000_pid -{ - u16 pid; - int active; -}; +#define err(format, arg...) printk(KERN_ERR "dib3000mX: " format "\n" , ## arg) +#define info(format, arg...) printk(KERN_INFO "dib3000mX: " format "\n" , ## arg) +#define warn(format, arg...) printk(KERN_WARNING "dib3000mX: " format "\n" , ## arg) /* frontend state */ struct dib3000_state { @@ -49,11 +42,6 @@ struct dib3000_state { /* configuration settings */ struct dib3000_config config; - spinlock_t pid_list_lock; - struct dib3000_pid *pid_list; - - int feedcount; - struct dvb_frontend frontend; int timing_offset; int timing_offset_comp_done; @@ -66,11 +54,6 @@ struct dib3000_state { extern int dib3000_read_reg(struct dib3000_state *state, u16 reg); extern int dib3000_write_reg(struct dib3000_state *state, u16 reg, u16 val); -extern int dib3000_init_pid_list(struct dib3000_state *state, int num); -extern void dib3000_dealloc_pid_list(struct dib3000_state *state); -extern int dib3000_get_pid_index(struct dib3000_pid pid_list[], int num_pids, - int pid, spinlock_t *pid_list_lock,int onoff); - extern int dib3000_search_status(u16 irq,u16 lock); /* handy shortcuts */ diff --git a/linux/drivers/media/dvb/frontends/dib3000.h b/linux/drivers/media/dvb/frontends/dib3000.h index 29b4bdd83..6cb45620c 100644 --- a/linux/drivers/media/dvb/frontends/dib3000.h +++ b/linux/drivers/media/dvb/frontends/dib3000.h @@ -37,18 +37,18 @@ struct dib3000_config int (*pll_set)(struct dvb_frontend *fe, struct dvb_frontend_parameters* params, u8 pll_buf[5]); }; -struct dib3000_xfer_ops +struct dib_fe_xfer_ops { /* pid and transfer handling is done in the demodulator */ int (*pid_parse)(struct dvb_frontend *fe, int onoff); int (*fifo_ctrl)(struct dvb_frontend *fe, int onoff); - int (*pid_ctrl)(struct dvb_frontend *fe, int pid, int onoff); + int (*pid_ctrl)(struct dvb_frontend *fe, int index, int pid, int onoff); int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl); }; extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, - struct i2c_adapter* i2c, struct dib3000_xfer_ops *xfer_ops); + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); extern struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, - struct i2c_adapter* i2c, struct dib3000_xfer_ops *xfer_ops); + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); #endif // DIB3000_H diff --git a/linux/drivers/media/dvb/frontends/dib3000mb.c b/linux/drivers/media/dvb/frontends/dib3000mb.c index 5caaed1ee..9178996df 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mb.c +++ b/linux/drivers/media/dvb/frontends/dib3000mb.c @@ -712,18 +712,11 @@ static void dib3000mb_release(struct dvb_frontend* fe) } /* pid filter and transfer stuff */ -static int dib3000mb_pid_control(struct dvb_frontend *fe,int pid,int onoff) +static int dib3000mb_pid_control(struct dvb_frontend *fe,int index, int pid,int onoff) { struct dib3000_state *state = fe->demodulator_priv; - int index = dib3000_get_pid_index(state->pid_list, DIB3000MB_NUM_PIDS, pid, &state->pid_list_lock,onoff); pid = (onoff ? pid | DIB3000_ACTIVATE_PID_FILTERING : 0); - - if (index >= 0) { - wr(index+DIB3000MB_REG_FIRST_PID,pid); - } else { - err("no more pids for filtering."); - return -ENOMEM; - } + wr(index+DIB3000MB_REG_FIRST_PID,pid); return 0; } @@ -761,7 +754,7 @@ static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_ static struct dvb_frontend_ops dib3000mb_ops; struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, - struct i2c_adapter* i2c, struct dib3000_xfer_ops *xfer_ops) + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops) { struct dib3000_state* state = NULL; @@ -782,9 +775,6 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, if (rd(DIB3000_REG_DEVICE_ID) != DIB3000MB_DEVICE_ID) goto error; - if (dib3000_init_pid_list(state,DIB3000MB_NUM_PIDS)) - goto error; - /* create dvb_frontend */ state->frontend.ops = &state->ops; state->frontend.demodulator_priv = state; diff --git a/linux/drivers/media/dvb/frontends/dib3000mc.c b/linux/drivers/media/dvb/frontends/dib3000mc.c index 000f15bfd..f92f8af94 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mc.c +++ b/linux/drivers/media/dvb/frontends/dib3000mc.c @@ -753,27 +753,17 @@ static int dib3000mc_set_frontend_and_tuner(struct dvb_frontend* fe, struct dvb_ } static void dib3000mc_release(struct dvb_frontend* fe) -{ - struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; - dib3000_dealloc_pid_list(state); +{ + struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; kfree(state); } /* pid filter and transfer stuff */ -static int dib3000mc_pid_control(struct dvb_frontend *fe,int pid,int onoff) +static int dib3000mc_pid_control(struct dvb_frontend *fe,int index, int pid,int onoff) { struct dib3000_state *state = fe->demodulator_priv; - int index = dib3000_get_pid_index(state->pid_list, DIB3000MC_NUM_PIDS, pid, &state->pid_list_lock,onoff); - pid = (onoff ? pid | DIB3000_ACTIVATE_PID_FILTERING : 0); - - deb_xfer("write pid %x to index: %x %d\n",pid,index+DIB3000MC_REG_FIRST_PID,index+DIB3000MC_REG_FIRST_PID); - if (index >= 0) { - wr(index+DIB3000MC_REG_FIRST_PID,pid); - } else { - err("no more pids for filtering."); - return -ENOMEM; - } + wr(index+DIB3000MC_REG_FIRST_PID,pid); return 0; } @@ -848,7 +838,7 @@ static int dib3000mc_demod_init(struct dib3000_state *state) static struct dvb_frontend_ops dib3000mc_ops; struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, - struct i2c_adapter* i2c, struct dib3000_xfer_ops *xfer_ops) + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops) { struct dib3000_state* state = NULL; u16 devid; @@ -880,9 +870,6 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, break; } - if (dib3000_init_pid_list(state,DIB3000MC_NUM_PIDS)) - goto error; - /* create dvb_frontend */ state->frontend.ops = &state->ops; state->frontend.demodulator_priv = state; |