public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* module_param() doesn't seem to work in 2.6.6-rc1
@ 2004-04-16 22:24 Pavel Roskin
  2004-04-16 23:35 ` Chris Wright
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pavel Roskin @ 2004-04-16 22:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: rusty

Hello!

I know that module_param is supposed to obsolete MODULE_PARM in 2.6
kernels.  However, module_param doesn't seem to work in Linux 2.6.6-rc1 (I
didn't test older kernels, so I don't know if it's a new bug).

I don't see any way to supply description with the new interface described
in moduleparam.h.  I see that some drivers (e.g. drivers/net/e100.c) use
MODULE_PARM_DESC together with module_param.  This seems wrong to me.
Shouldn't a new interface provide a new way to describe the parameters?

If MODULE_PARM or module_param is used without MODULE_PARM_DESC, modinfo
(module-init-tools version 3.0) fails to list the parameter.  It would be
great if the parameter was listed, even without description.

A bigger problem is that the new parameters cannot be used on the modprobe
command line.  I added this to orinoco.c:

static int parmtest1, parmtest2;
MODULE_PARM(parmtest1, "i");
module_param(parmtest2, int, 644);

After compiling and installing the module I tried this:

# modprobe orinoco parmtest1=1 parmtest2=2
FATAL: Error inserting orinoco
(/lib/modules/2.6.6-rc1/kernel/drivers/net/wireless/orinoco.ko): Unknown
symbol in module, or unknown parameter (see dmesg)

Kernel log shows:
orinoco: Unknown parameter `parmtest2'

Search for module_param in the Linux Documentation directory yielded
nothing.  I did notice, however, that the rate of adoption of module_param
is very low in the drivers directory.  Most drivers still use MODULE_PARM.
Isn't it because module_param is totally undocumented?

$ find drivers -name '*.c' | xargs grep '\<module_param\>' | wc -l
    244
$ find drivers -name '*.c' | xargs grep '\<MODULE_PARM\>' | wc -l
   1731

module_param is not mentioned in the sources of module-init-tools-3.0.  I
found this document that mentions "Optional viewing and control through
sysfs":

http://www.kernel.org/pub/linux/kernel/people/rusty/2.4_module_param_Forward_Compatibility_Macros.html

But even when I loaded the "orinoco" module without parameters.  I tried
this:

# find /sys | grep par
# find /sys | xargs grep -i par 2>/dev/null
#

Relevant settings from .config:

CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_OBSOLETE_MODPARM=y
CONFIG_MODVERSIONS=y
CONFIG_KMOD=y

i686, non-SMP, Fedora Core 1.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-04-17  3:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-16 22:24 module_param() doesn't seem to work in 2.6.6-rc1 Pavel Roskin
2004-04-16 23:35 ` Chris Wright
2004-04-16 23:35 ` [PATCH] " Pavel Roskin
2004-04-17  3:14 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox