Mailing List archive

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

[linux-dvb] Re: Question about dvb_frontend.c



> Christian Gmeiner wrote:
> >
> > cat /proc/dvb/adapter0
> > ----- Adapter Info -----
> > DVB card: KNC1 DVB-S
> > Frontend: STV0299/TSA5059/SL1935 based
> >
> > ----- Devices -----
> > ~ frontend0
> > ~ net0
> > ~ dvr0
> > ~ demux0
>
> I'm not sure that I like this.
>
> Who is going to use /proc/dvb and for what purpose?
Maybe nobody is using this, but it was writen by me for testing. As you
mabe know the whole patch adds sysfs support to the dvb-core. So
i have coded the small dvb_procfs to check if my concepts are working or
not.
But i have asked some other guys and the told me that the proc is an nice
idea
to get very quickly some informations about adapters, so i wont kill procfs
support.

> You are creating an additional API that people are
> going to use in scripts/programs, so it better be
> well thought out, so it won't change all the time.
It is not an addinal API! I havent changed the interface of the dvb-core.
Look at this:

int dvb_register_adapter (struct dvb_adapter **padap, const char *name,
struct module *module)
{
 struct dvb_adapter *adap;
 int num;
 int i;

 if (down_interruptible (&dvbdev_register_lock))
  return -ERESTARTSYS;

 if ((num = dvbdev_get_free_adapter_num ()) < 0) {
  up (&dvbdev_register_lock);
  return -ENFILE;
 }

 if (!(*padap = adap = kmalloc(sizeof(struct dvb_adapter), GFP_KERNEL))) {
  up(&dvbdev_register_lock);
  return -ENOMEM;
 }

 memset (adap, 0, sizeof(struct dvb_adapter));
 INIT_LIST_HEAD (&adap->device_list);

 printk ("DVB: registering new adapter (%s).\n", name);

 adap->num = num;
 adap->name = name;
 adap->module = module;

 // call specific fs functions
 for (i = 0; registrars[i]; i++) {
  if (registrars[i]->register_adapter) {
   registrars[i]->register_adapter(adap);
  }
 }

 list_add_tail (&adap->list_head, &dvb_adapter_list);

 up (&dvbdev_register_lock);

 return num;
}

The first impresion could be, that it looks like the normal
dvb_register_adapter, but
i am using here a gernal interface for all kernel-fs (procfs, devfs and
sysfs).
So i would not say i have done an extra API, i have extended the current
API.

>
> If you state your goals and you motivation we could
> discuss if this is the right way to do it.
It would be nice, if we discuss this topic a little bit.
>
Greets,
Christian




-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index