Module parameters are passed to a kernel module as name=value pairs at module insertion (insmod) time. For example, assume we have a module parameter named mp_debug_level; then, we could pass its value at insmod(8) time, like this:
sudo insmod modparams1.ko mp_debug_level=2
Here, the mp prefix stands for module parameter. It's not required to name it that way, of course, it is pedantic, but might just makes it a bit more intuitive.
That would be powerful. Now, the end user can decide at exactly what verbosity they want the debug-level messages. We can even easily arrange for the default value to be 0.
You might wonder: kernel modules have no main() function and hence no conventional (argc, argv) parameter list, so how exactly, then, do you pass parameters along? The fact is, it's a bit of linker trickery; just do this: declare your intended module parameter as a global (static...