On 5/21/07, Darren J Moffat <[EMAIL PROTECTED]> wrote:
Thomas De Schampheleire wrote:
> You're right that this probably is the cleanest solution.
>
> However, this does not work for anything other than a debug parameter
> right? Suppose I want to communicate with the module, for something
> else. How can I do this?

An ioctl on the drivers device node, eg:

        fd = open("/dev/mydriver", O_RDWR);
        ioctl(fd, MYDRIVER_FOO_ACTION, &myfooadata);

Is this also available for modules which are not drivers?



> In Linux, drivers and modules can use the /proc filesystem to pass
> information from and to user space. A user can pass a parameter to the
> module by writing to such a virtual file in /proc.

Which IMO is an abomination and a gross miss use of /proc.

The exact location (/proc or elsewhere) is no point for me, but I do
find this mechanism an extremely useful feature.


For the reading part of /proc many things in the OpenSolaris kernel use
kstat instead.

--
Darren J Moffat

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to