Driver on Linux

3 messages, 3 authors, 2003-06-30 · open the first message on its own page

Driver on Linux

From: <hidden>
Date: 2003-06-27 17:10:59

Hi.

I am working on a PPC860.

I have developped two drivers.

The driver 2 needs to use functions that are in driver 1.
driver 1 is /dev/visu.

I thought I could make fd=open("/dev/visu", 0) in init of the driver 2 but I
get ooops.
I also need to make something like ioctl(fd, IO_Special... )but the function
ioctl is unknown in the kernel.

What is the right way to work when you need to do that ?

Thanks.

Chris


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: Driver on Linux

From: Wolfgang Grandegger <hidden>
Date: 2003-06-27 17:24:52

On 06/27/2003 07:10 PM Christophe.LINDHEIMER@fr.thalesgroup.com wrote:
Hi.

I am working on a PPC860.

I have developped two drivers.

The driver 2 needs to use functions that are in driver 1.
driver 1 is /dev/visu.

I thought I could make fd=open("/dev/visu", 0) in init of the driver 2 but I
get ooops.
For file access within the kernel see for example:

  http://www.fenrus.demon.nl/kernel.html
I also need to make
I also need to make something like ioctl(fd, IO_Special... )but the function
ioctl is unknown in the kernel.

What is the right way to work when you need to do that ?
Using file access in the kernel is usually a bad thing. I think it's
easier and more straightforward to provide a small set of exported
kernel functions which the second (driver) module can use.

Hope it helps.

Wolfgang.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: Driver on Linux

From: Samuel Ortiz <hidden>
Date: 2003-06-30 07:00:51

On Fri, 27 Jun 2003 Christophe.LINDHEIMER@fr.thalesgroup.com wrote:
Hi.

I am working on a PPC860.

I have developped two drivers.

The driver 2 needs to use functions that are in driver 1.
driver 1 is /dev/visu.

I thought I could make fd=open("/dev/visu", 0) in init of the driver 2 but I
get ooops.
Kernel file opening is usually considered a very bad idea. If driver 2
needs some of driver 1 functions, then you should consider exporting these
functions from driver 1 (EXPORT(driver1_function);).
Once driver1 is loaded, and thus initialized, any other driver will be
able to call driver 1 exported functions.

Hope this helps,
Samuel.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help