Re: Some questions about callbacks...

On Wed, Apr 30, 2003 at 04:00:44PM +0200, Herman Bruyninckx wrote:
> 
> What is the exact aim/meaning of the comedi_event() function in
> comedi_fops?  It handles all events that have been generated and
> stored in the s->async->events flag?
> 
> The last "mask" argument of the function call is an integer, which is
> almost immediately overwritten before its value is used...
> Apparently "mask" is used as "s->async->events", which is a global
> variable and hence need not be given as argument in the function
> call. (So, can "mask" disappear from the comedi_event prototype?)
> If I am wrong here, where can I find the exact meaning of this mask
> flag, and of all the events that this command must/can service?

In the past, almost every driver had a separate variable to keep
track of the event mask before comedi_event() was called, essentially
duplicating s->async->events.  This was rather silly, so the drivers
(and comedi_event()) was changed to use s->async->events directly.
Unfortunately, the cleanup step of removing the parameter from the
comedi_event() prototype was never done.  It should be done now.

> Another point: callbacks can only be done when the subdevice has
> commands? This is not illogical....

Yes.

> Finally, the INTTRIG instruction carries a third numerical argument;
> what is the meaning of it? Encoding of driver-specific trigger
> identification?

It is for future use.  It should be set to 0 by the application,
and the driver should return -EINVAL if it is not 0.



dave...

Received on 2003-04-30Z18:34:24