R: Using ioctl from with the kernel ???
s.coluccini at caen.it
Wed Nov 13 02:36:28 EST 2002
the driver is linked to the kernel, so global (not static) functions
declared in a driver can be called from the kernel and in particular from
another driver, so you can bound the code of your ioctl in a function and
call it from the ioctl handler and from the other driver ... using the
protection mechanism suggested by Stephan.
> -----Messaggio originale-----
> Da: owner-linuxppc-embedded at lists.linuxppc.org
> [mailto:owner-linuxppc-embedded at lists.linuxppc.org]Per conto di Steven
> Inviato: martedi 12 novembre 2002 16.11
> A: Stephan Linke
> Cc: Linuxppc-Embedded
> Oggetto: Re: Using ioctl from with the kernel ???
> Hi Stephan,
> > Your right IOCTL is not applicable for this. You can simply
> call the driver
> > functions directly. If these functions are called different
> from different
> > context(s) (like your driver and the IOCTL function) you have
> to add some
> > protection mechanism. (The code is not reentrant right?) You may try
> > spin_lock() for this job (linux/spinlock.h). If you are calling the
> > functions from interrupt contect too some extra protection is
> Thanks for your reply.
> But how could I call the ioctl handler of the driver?
> I would need some (dummy) inode...
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-embedded