Mailing List archive

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

[linux-dvb] Re: refactoring



On Wednesday 06 Oct 2004 03:18, Andreas Oberritter wrote:
> On Tue, 2004-10-05 at 21:45, Andrew de Quincey wrote:
> > Quick question about dvb_add_frontend_ioctls() - this is used to
> > intercept the standard frontend ioctl() call (both before and after) so
> > that card-specific processing may be done.
> >
> > However, its only ever used to intercept before the DISEQC ioctl so that
> > card-specific DISEQC hardware can be messed with instead of the
> > demodulator's support (if there is any).
> >
> > So we've got a whole infrastructure for doing this that is never used
> > beyond this one case (and with the frontend refactoring, is never going
> > to be IMO).
> >
> > I'd be inclined to remove it, and just add an extra function call into
> > the DVB-S demodulator structures - card drivers set this to non-NULL if
> > they want to intercept one of the DISEQC calls.
>
> FWIW, it is also used for setting the frequency and for FE_INIT/FE_SLEEP
> in our driver for the dbox2. See
> http://cvs.tuxbox.org/cgi-bin/viewcvs.cgi/tuxbox/driver/fp/dbox2_fp_napi.c?
>rev=1.14&content-type=text/vnd.viewcvs-markup

Ah I see - what I ended up doing was replacing it with this (from sp8870 as an 
example):

        int (*ioctl_override)(struct sp8870_state* state, unsigned int cmd, 
void *arg);

Each of the demodulator structures has this, and calls it at the start of its 
ioctl function (if non NULL). If you return 0, it doesn't do any more 
processing of that ioctl). So you can do exactly the same as before using 
this by setting a function, but it gets some of the cruft out of 
dvb_frontend.c. 




Home | Main Index | Thread Index