Mailing List archive

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

[linux-dvb] Re: refactoring



Andrew de Quincey wrote:

On Wednesday 06 Oct 2004 19:34, Holger Waechtler wrote:

Andrew de Quincey wrote:

[snip]


the ioctl wrapper is only implemented
once for all drivers (the demod code could communicate with the frontend
infrastructure via a thin function-pointer-in-struct interface).

Interesting idea this one - this is the sort of thing I'm trying to sort
out with the refactoring.


I see it as:

struct dvb_fe_functions {

int (*set_symbol_rate)(....)
....
};

Then each frontend driver exposes its implementation of that function (if
it has one):

extern int stv0299_set_symbol_rate(...);

why not:

extern struct dvb_fe_functions stv0299_functions;

and in stv0299.c:

struct dvb_fe_functions stv0299_functions {
int (*init)(....);
int (*set_parameters)(....);
int (*get_parameters)(....);
int (*set_voltage)(....);
int (*sleep)(....)
/* ... */
};

This way only a single pointer needs to get passed around.

I'm not quire sure what you mean - do you mean have a static const dvb_fe_functions structure defined in stv0299.c that exports pointers to all the functions defined in that module?

yes.

If so, thats quite neat - then we don't need to export masses of extra functions from all the demodulator modules - just the attach(), that structure, and possibly a detach().

Do we still need attach/detach()?

Holger





Home | Main Index | Thread Index