Led灯总结1、module_param_call
函数源码defi
emodule_param_call
amesetgetargpermstaticco
ststructker
el_param_ops__param_ops_
ameflags0voidsetvoidget__module_param_callMODULE_PARAM_PREFIX
ame__param_ops_
amearg
permsizeof__check_old_set_paramset010调用module_param_call会填充ker
el_param中最重要的就是ker
el_param_ops结构体,此结构体会被填充,此结构体包含了set函数指针和get函数指针重要的函数指针。structker
el_paramco
stchar
ameco
ststructker
el_param_opsopsu16perms16levelu
io
voidargco
ststructkparam_stri
gstrco
ststructkparam_arrayarrstructker
el_param_opsHowtheopsshouldbehaveu
sig
edi
tflagsRetur
s0orerr
oargisi
kpargi
tsetco
stcharvalco
ststructker
el_paramkpRetur
sle
gthwritte
orerr
oBufferis4kiebeshorti
tgetcharbufferco
ststructker
el_paramkpOptio
alfu
ctio
tofreekpargwhe
moduleu
loadedvoidfreevoidarg在__module_param_call函数中,通过__attribute____sectio
“__param”将数据放入__param字段中,即初始化ker
el_param结构体。当通过echo进行输入时,当名字匹配时,则调用set函数。defi
e__module_param_callprefix
ameopsargpermlevelflagsDefaultvaluei
steadofpermissio
sstaticco
stchar__param_str_
ameprefix
amestaticstructker
el_param__moduleparam_co
st__param_
ame__used
__attribute__u
used__sectio
__