Re: Cmd/mmap with realtime

On Sat, 9 Nov 2002, David Schleef wrote:

> I haven't been impressed with any of the patches you've sent me
> so far.  I get the impression that you want to fundamentally
> change the way Comedi works internally, which _isn't_ going to
> happen.  Clean additions _are_ useful, however.  This means that
> 1) it doesn't require significant changes to very many drivers
> and/or there's an obviously correct fix for each affected driver,
> and 2) it can be cleanly turned on and off, for example, by a
> command flag.

Well, you could apply at least parts of it. I do not think that adding
"#include <linux/string.h>" to comedi/kcomedilib/dio.c and
comedi/kcomedilib/data.c changes things a lot. <linux/highmem.h> is just
not available in 2.2 and I think you know better than me which #ifdef to
use there. Exporting more functions from mite.c makes my life easier
without changing anything in comedi itself. If you do not like my vision
at least give me the bricks so I can build it on my own field. I am aware
that such usage is undocumented and unsupported and I will not complain if
interface to such functions changes.

In short in my recent compile-2.2.patch I intentionaly did not include any
really controversial code.

David, I also do not have much time. I have decided that is is better to
post what I have than nothing. I also do not know your API vision - so I
do not know where do you want to add a flag, how to name it etc. For
example, you have only 32 bits for command flags - is it worth to allocate
a number if not many people are going to use this feature?
For example, I have added async->flags and
COMEDI_ASYNC_BUFFER_LOCKED(buffer controlled by application, disable
automatic allocate and free) and COMEDI_ASYNC_MITED(buffer is already
pointed by mite->ring). But I am in the dark guessing whether you will
like it or not.

All what I need is :

1. AI and AO buffer set to the kernel address supplied by the
application (pages are already locked - mbuff). This feature is "nice to
have" if I am able to mmap current buffers in kernel and user space and to
set any size for them.

2. The data transfer runs by itself for both AI and AO. I need the driver
to tell me the current position in the buffer when I ask. If hardware
supports it, interrupts should be avoided if application does not request
any callbacks.

I see it rather as _disabling_ some of the Comedi functionality
conditionally. For AI (2) is working in 0.7.58-cvs and I have implemented
(1) for AI.

May be you have understood that I want such a behaviour to be default. No,
I want it to be possible even if I have to use some hacks in my code to
get it. 

I understand that you have no time to implement it. But at least let me
know which API you would prefer.

Best regards,
--
Tomek

Received on 2002-11-10Z12:18:09