comedi: some questions
Hi,
Please find attached a patch related with the Comedi layer. This patch is just a proposal (among two) to change the way the ranges tables are managed.
I first tried to send it to the Comedi community three weeks ago:
http://groups.google.com/group/comedi_list/browse_thread/thread/85be8195ddf52896
One week after my first mail, Ian Abott told me the Comedi CVS tree would not integrate any code change other than bug fix; he redirected me to the linux-next mailing list. According to him, the clean up effort should be hosted on the staging area of the linux-next tree.
Then, I sent the patches (adapted for the linux-next git tree) to the linux-next mailing list:
http://marc.info/?l=linux-next&m=124078248400745&w=2
Greg KH asked me to send them to the Comedi community before asking for integration into the staging area (which I already did). After a few mails, it became clear that the suitable procedure was to send patches to the Comedi mailing-list and CC Greg KH. Thus, with the Comedi maintainers' agreements, GKH will integrate them.
I am kind of puzzled. That is why I thought mailing the LKML might be interesting.
It seems like the original Comedi developers (the ones who maintain the original CVS tree) do not seem involved in the developments for the integration of Comedi into mainstream. However, any contribution must go through them. That might slow down the evolutions. No ?
By the way, I have been waiting for one more week and I still have no feedback on my little proposals which are, I think, meaningless compared to other issues (kcomedilib, buffer management, user interfaces, etc.). I should ask once more.
That leads to the last point which I do not understand: Comedi is supposed to undergo a host of changes before considering integration into mainline (here is a mail which lists some of them:
http://lkml.org/lkml/2009/2/9/335). That should imply many incompatibilities with the original Comedi tree; so why keeping coherency with upstream?
Alexis.
Quoted 1 line
From
12b57a9ece86c658fc84db4c635d69d2f7e9638fMon Sep 17 00:00:00 2001
From: Alexis Berlemont <[email protected]>
Date: Sun, 26 Apr 2009 00:51:43 +0200
Subject: [PATCH] Introduce a container structure for ranges so as to handle global
range tables and per channel range tables
--- drivers/staging/comedi/comedi_fops.c | 11 +++-- drivers/staging/comedi/comedidev.h | 75 +++++++++++++++++++++++++++++++++- drivers/staging/comedi/drivers.c | 5 +- drivers/staging/comedi/range.c | 64 +++++++++++------------------ 4 files changed, 107 insertions(+), 48 deletions(-)
drivers/staging/comedi/comedi_fops.c +7 -4
@@ -419,7 +419,7 @@ static int do_subdinfo_ioctl(struct comedi_device *dev, struct comedi_subdinfo * us->maxdata = s->maxdata;if (s->range_table) { us->range_type = - (i <<24 ) | (0 <<16 ) | (s->range_table->length); + (i <<24 ) | (0 <<16 ) |get_range_table (s,0 )->length; }else { us->range_type =0 ;/* XXX */ }
@@ -437,7 +437,8 @@ static int do_subdinfo_ioctl(struct comedi_device *dev, struct comedi_subdinfo * us->subd_flags |=SDF_MAXDATA ;if (s->flaglist) us->subd_flags |=SDF_FLAGS ; -if (s->range_table_list) +if (s->range_table && + (s->range_table->mode &COMEDI_PERCHAN_LRANGE ) !=0 ) us->subd_flags |=SDF_RANGETYPE ;if (s->do_cmd) us->subd_flags |=SDF_CMD ;
@@ -503,13 +504,15 @@ static int do_chaninfo_ioctl(struct comedi_device *dev, struct comedi_chaninfo *if (it.rangelist) {int i; -if (!s->range_table_list) +if (s->range_table ==NULL || + (s->range_table->mode &COMEDI_PERCHAN_LRANGE ) ==0 )return -EINVAL ; +for (i =0 ; i < s->n_chan; i++) {int x; x = (dev->minor <<28 ) | (it.subdev <<24 ) | (i <<16 ) | - (s->range_table_list[i]->length); +get_range_table (s, i)->length;put_user (x, it.rangelist + i); }#if 0
drivers/staging/comedi/comedidev.h +73 -2
87 lines not on this page · raw message
drivers/staging/comedi/drivers.c +3 -2
@@ -273,8 +273,9 @@ static int postconfig(struct comedi_device *dev)comedi_alloc_subdevice_minor (dev, s); } -if (!s->range_table && !s->range_table_list) - s->range_table = &range_unknown; +if (!s->range_table) +setup_global_range_table + (s, (struct comedi_lrange *)&range_unknown);if (!s->insn_read && s->insn_bits) s->insn_read = insn_rw_emulate_bits;
drivers/staging/comedi/range.c +24 -40
75 lines not on this page · raw message
Signature · 1 line
1.6.2.4