Re: extra board specific functions

On 19/08/07, Frank Mori Hess <fmhess_at_speakeasy.net> wrote:
> On Saturday 18 August 2007 08:10, Gergely Imreh wrote:
> > Thanks for the advice, I found the INSN_CONFIG, and could make it
> > work. I have some design questions, though.
> >
> > My board is a DAC6703, using and already extended driver (cb_pcidda,
> > not the version that comes with Comedi at this point). The function
> > I'm trying to implement, is that the AO channels can have two update
> > modes: updating automatically when a new output is set, and updating
> > upon a trigger (which is writing to a specific register).
>
> It sounds to me like you want to support an analog output command with
> scan_begin_src=TRIG_INT and convert_src=TRIG_NOW?
>

Thanks for the advice, that looks pretty similar to what I was
thinking, though the way it should be implemented properly, like in
the other drivers, is not totally clear to me, yet.

So the analog output command should just replicate the single output
as before, but with a  few extra functions, like the triggering, and
writing to more than one channel in one command?

For example, if I want to update some channels immediately, some of
the delayed, then should call the command twice, with different
arguments, and the driver should set the trigger information of the
channels at every command over and over again?

Though, I run into some problems in the very beginning of this
implementation. When add the line in the attach function to tell
comedi, which function to call for the commands: s->do_cmd =
ao_do_cmd;
It compiles well, modprobe works, than when doing the comedi_config,
it throws a segmentation fault. In the kernel log it says, kernel BUG
in the attach function.

s->do_cmd = NULL; works without segfault, and I define my function as
it is in other drivers as well: static int ao_do_cmd(comedi_device
*dev,comedi_subdevice *s);

If I remove that line, and revert to a version of the driver which
worked fine before, it still throws segfaults until I reboot, then it
will work fine again....

Similar segfault appears whenever I do anything with the s->async,
like trying to set the function to call for the INTTRIG.

Is there anything that I missed? Something that I unknowingly do the
wrong way?  I have 2.6.23-rc2 kernel, without RTAI but with Xenomai
compiled in.

  I know this is a lot, but every suggestion appreciated.
  Cheers,
      Greg

Received on 2007-08-20Z10:15:06