kernel模块参数传递方法(现以sata_tangox模块的disable_ports参数为例)
sata_tangox.c中的disable_ports参数声明:
static int disable_ports = 0;
module_param(disable_ports, int, 0444);
MODULE_PARM_DESC(disable_ports, "which port to disable (1: disable port 0, 2: disable port 1, 3: both ports)");
传递参数时的两种方法:
1)模块单独加载
insmod sata_tangox disable_ports=1
2)将模块编译进内核
setxenv a.linux_cmd "mem=140M console=ttyS0,115200n8 noinitrd ip=off root=/dev/mtdblock4 rw rootfstype=yaffs2 sata_tangox.disable_ports=1"