LWN: Comments on "Driver porting: more module changes"
http://lwn.net/Articles/22197/
This is a special feed containing comments posted
to the individual LWN article titled "Driver porting: more module changes".
hourly2Driver porting: more module changes
http://lwn.net/Articles/94630/rss
2004-07-22T07:53:40+00:00linuxosa
<p>why the standand kernel source linux/moduleparam.h doesn't have:</p>
<I>extern int param_set_byte(const char *val, struct kernel_param *kp);
extern int param_get_byte(char *buffer, struct kernel_param *kp);</I>
<p>but the comments says:</p>
<p><b>/* Helper functions: type is byte, short, ushort, int, uint, long,
ulong, charp, bool or invbool, or XXX if you define param_get_XXX,
param_set_XXX and param_check_XXX. */</b>
</p>
Driver porting to 2.5.59: 'MOD_IN_USE' undeclared
http://lwn.net/Articles/23885/rss
2003-02-27T08:12:43+00:00hsieng
Hello,<p>While compiling a device driver in 2.5.59, I get the following error:<p>dmodule.c: 'MOD_IN_USE' undeclared<p>Please help on how to solve this problem.<p>Thank you.<p>Se-Hsieng<p><br>
Driver porting: more module changes
http://lwn.net/Articles/23390/rss
2003-02-21T10:17:43+00:00rrw
I think that there is one problem with this scheme of parameters. In case of numbers you cannot distinguish if the user didn't set the parameter or if he has set it to zero. Perheaps example will explain it better:<p>module_param(howmany, int, 0);<p>if you load this module with howmany=0, howmany will be zero. But if you omit howmany on modload commandline, howmany will be also zero.<p>One should pass the numeric arguments to the code as (int *), not the (int). Then NULL will be ``not set''.
Driver porting: more module changes
http://lwn.net/Articles/23383/rss
2003-02-21T06:35:25+00:00mmarq
Well, I wonder why bother, ...perahps going for one of the kernel maintainers listed emails,...but then, if anyone can answer to this question i'l be very much appreciataded...it's very important to me!!!<p> Does this >"new "version magic" scheme also records other information, including the compiler version, SMP status, and preempt status; it is thus able to catch more incompatible situations than the old scheme did"<, storm, is to be lefted in production 2.6 kernels, or is it going to be somehow abstracted??<p> Better put!, does a "stupid trying to be a hacker" programmer like me, if by any change achieves the feat of getting a working kernel hardware driver module for the most trivial piece of hardware in the world, say, compiled with kernel 2.6.6 and gcc 3.4, "be in a versioning storm" and have to fix the module for it to recompile with preempt enable, and fix the module againg for it to recompile with SMP enabled, and for Kernel 2.6.7 the same, and for gcc3.4.1 the same,..., meaning that 20 kernel versions and 3 compiler versions ahead i would have to make 180 fixes!?????<p> whaw!!...without meaning any disrespect, it sure is a job for a full time payed hacker!<p> Well!!...If the answer is yes than is very sad "for me and for thousands like me,...because i have a very small shop that transforms old gear and also produce new linux servers and firewall appliences, and dont have the many to hire an army of programmers.<p> Its double sad, because after 10 years of dreams and foughts, the kernel is sleeping to the hands of IBM, HP and the like, that not only have the resources for thousands of programmers, but also control the machines on witch full working kernels can be deployed.<p> Any way, i respectfuly be waiting for a answer.... thank you.
Driver porting: more module changes
http://lwn.net/Articles/22768/rss
2003-02-14T08:41:21+00:00rusty
Regarding module_param(): MODULE_PARM() will certainly stay throughout the 2.6 series, so no need to change existing code just yet.
<p>
However, the real power of module_param() is that you can easily build your own types: i.e. it is extensible. One way to do this is to use the underlying module_param_call() macro, but a more convenient way goes like this:
<pre>
#define param_check_mytype(name, p) /* optional typechecking */
int param_set_mytype(const char *val, struct kernel_param *kp) ...
int param_get_mytype(char *buffer, struct kernel_param *kp) ...
</pre>
Then you can use it as follows:
<pre>
module_param(myparam, mytype, 000);
</pre>
This is extremely useful for implementing things like ranges, or any holes in the provided macros.
<p>
The other issue to note is that (as an unrelated bonus) the module_param parameters are also available as boot parameters, prefixed with the module name and a "." (- and _ can be used interchangably here). Previously __setup() was needed for boot parameters, and MODULE_PARM for module parameters.
<p>
Hope that helps!<br>
Rusty.