Mailing List archive

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

[linux-dvb] Re: refactoring



> Before anyone gets too excited, this was an experimental structure. I think a 
> better solution would be something like:
> 
> struct dvb_fe {
>  struct fe_api  *api;
>  struct dvb_adapter *dvb;
>  void            *priv;
> };
> 
> struct fe_api {
>  struct dvb_frontend_info info;
> 
>  void (*attach)(....)
>  void (*set_tps)(struct dvb_fe*, struct dvb_frontend_parameters*);
>  void (*get_tps)(struct dvb_fe*, struct dvb_frontend_parameters*);
>  void (*get_status)(struct dvb_fe*, struct fe_status*);
>  /* whatever else is needed, for diseqc, ... */
>  void (*destroy)(struct dvb_fe*);
> };

Looks ok.  What attach() should do?

> fe_api then allows the card driver to override the functions as necessary, and 
> also to tailor the dvb_frontend_info structure to be suited to its exact 
> hardware.

I'd expect the fe drivers have fe_api statically allocated (maybe
multiple versions for different hardware) and then just put a pointer
to it into the dynamically allocated dvb_fe.  Thats an minor
implementation detail through, of course you'll can allocate it
dynamically as well, the driver just as to take care to release it in
the destroy callback then ;)

> Adding dvb_adapter to dvb_fe is purely for convenience - its not really 
> necessary if people don't like it.

Thats fine with me.

  Gerd

-- 
return -ENOSIG;




Home | Main Index | Thread Index