Re: idea on how to break the static dependencies on demodulator modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 12 May 2006, Johannes Stezenbach wrote:
> > > - add dvb_attach() and dvb_detach() functions
> > > - leave frontend drivers unmodified
> > > - so nothing changes for out-of-tree STB like users like tuxbox
> >
> > How can dvb_detach() work, satisfy your three requirements here, AND still
> > work with chained front-ends?
> >
> > Without chained frontends, it's easy enough (*):
> >
> > int dvb_detach(struct dvb_frontend* fe)
> > {
> > 	void *addr = (void*)fe->ops->release;
> > 	dvb_unregister_frontend(fe);
> > 	symbol_put_addr(addr);
> > }
> >
> > But this doesn't work at all with chained frontends.
>
> Looks like I didn't get something...
>
> What is a "chained frontend"? How is this handled currently

First, let me say that chained frontends *isn't* something new that is
mixed in with this attach/detach stuff.  It's already there.  See the
lnbp21 driver for an example.

Here is where Andrew first mentions the problem with chaining:
http://article.gmane.org/gmane.linux.drivers.dvb/25599

Here is a bit more info:
http://article.gmane.org/gmane.linux.drivers.dvb/25662
http://article.gmane.org/gmane.linux.drivers.dvb/25701

See that last message for an example for how chaining can be made to work
with or without dvb_attach() for same frontend.

> without dvb_attach()? Why does it need to be handled
> differently with dvb_attach()?

See those messages I linked to for a better discussion, but in a nutshell,
the function pointers in fe->ops can be changed to point to a module other
than the original dvb_attach()ed frontend.  symbol_put_addr() would put
this new module that has chained itself in front of the original FE
module, and not the orignal FE module.

> > (*) This assumes, currently correctly, that foo_attach() and foo_release() are
> > in the same module
>
> why? dvb_attach() incs the frontend module ref count, dvb_detach()
> decs it -- no matter where they are called from

I mean that the frontend_attach() and frontend_release() functions must be
in the same module.  dvb_attach(FEfoo_attach,...) incs the ref count of the
module that FEfoo_attach() is in.  If fe->obs->release points to
FEfoo_release(), then symbol_put_addr(fe->obs->release) would put the
module that FEfoo_release() is in.  If there was a frontend driver that was
made of multiple modules, those two functions might not be in the same
module.

_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux