Hi,

Ron Lee wrote:

I would like to pass arguments/parameters to a kernel module. My current
method is to use the proc file system but I was told that sysfs would be
a cleaner way. Does anyone have an example for how to do this? Is there
a way to register callback functions that are invoked when a file in the
sysfs is read or written? Any help is appreciated!

Why not simply using module parameters, defined using module_param() ? You can have a look at page 21 of Linux Device Drivers, chapter 2 [1]. Module parameters are the best solution if you don't have to change the parameters when the module is loaded.

Sincerly,

Thomas

[1] http://lwn.net/images/pdf/LDD3/ch02.pdf
--
PETAZZONI Thomas - [EMAIL PROTECTED]
http://thomas.enix.org - Jabber: [EMAIL PROTECTED]
KOS: http://kos.enix.org/ - SOS: http://sos.enix.org
Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E  1624 F653 CB30 98D3 F7A7

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to