> Hi,
> I am doing serial port communication using rtlinux.
> I found that rt_com is very useful .
> But how to pass parameters to rt_com dynamically ?
> that is how to pass parameters to module and
> from there to the rt_com function ?
> 
> int init_module(int argc, char *argv[])
> {
>    rt_com(argv[1], argv[2], argv[3],argv[4]);
> }
> 
> Is the above possible ?? 

no - if you want to pass arguments from the commandline to the kernel module 
the declare the module parameters like

int some_int=0;
MODULE_PARM(some_int,"i"); 

this says that if the module is called without any arguments then some_int will
be 0 if you pass an argument with  insmod module_name.o some_int=5  then that
value will be passed. MODULE_PARM(name,type) takes the name of the variable and
you must pass the type - valid types are "b"(byte),"h"(short),"i" (int),
"l"(long) and "s"(string), and further modifyiers for arrays and limits, 
for details see Rubini, Linux Device Drivers second edition, chapter 2.

hofrat
_______________________________________________
Rtl mailing list
[EMAIL PROTECTED]
http://www2.fsmlabs.com/mailman/listinfo.cgi/rtl

Reply via email to