init_module() knowing probe parameters

From: David Schleef (ds@stm.lbl.gov)
Date: Fri Jan 28 2000 - 01:08:43 EST


Is there an existing method for a module to discover the request_module()
parameter that triggered its loading? I currently planning to use a
variable called request_module_minor in the interface module, which holds
the minor number of the most recently requested minor number. That way,
when init_module() calls comedi_driver_register(&this_driver),[1] the
function will return a minor number if it is supposed to go ahead and
attach itself. (Currently, they don't auto-attach.) Obviously, this
is a race condition waiting to happen.

An alternative that I've considered is to use something similar to the
following in /etc/conf.modules:

        alias char-major-98-2 whatever
        options whatever minor=2

I've noticed that many of the current interfaces don't necessarily
match up request_module("char-major-A-B") or request_module("ethN")
with the actual device A,B. This may not be too much of an issue for
interfaces that have, on average, one device, but I have several users
that have 3-4 devices, and I've been developing virtual device drivers
that could take up many more slots. You wouldn't want to modprobe a
direct digital synthesizer module, but get a demodulator, would you?

Is there any need for a kernel-wide solution to this, or does nobody
really care?

dave...

[1] Control and Measurement Device Interface, http://stm.lbl.gov/comedi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:20 EST