我在dragonboard410c工作具有内核模块wcn36xx哪些寄存器是这样的:中断处理程序未注册
static const struct of_device_id wcn36xx_of_match[] = {
{ .compatible = "qcom,wcnss-wlan" },
{}
};
MODULE_DEVICE_TABLE(of, wcn36xx_of_match);
static struct platform_driver wcn36xx_driver = {
.probe = wcn36xx_probe,
.remove = wcn36xx_remove,
.driver = {
.name = "wcn36xx",
.of_match_table = wcn36xx_of_match,
},
};
module_platform_driver(wcn36xx_driver);
我想写我自己的内核模块,也注册到同一个设备,我的代码:
static const struct of_device_id my_interrupt_of_match[] = {
{ .compatible = "qcom,wcnss-wlan" },
{}
};
MODULE_DEVICE_TABLE(of, lab2_interrupt_of_match);
static struct platform_driver my_driver = {
.driver= {
.name = "my_interrupt",
.of_match_table = my_interrupt_of_match,
},
.probe = my_probe,
.remove = my_remove,
};
在初始化函数注册我的司机:
int err = platform_driver_register(&my_driver);
但我的探测功能没有被调用。 我的模块在启动时自动加载,并调用init函数。
我建立我的模块中的目录外的内核代码,我把lab2_interrupt.ko在黑板上的相同目录wcn36xx.ko:
/lib/modules/4.4.23-linaro-lt -qcom/kernel/drivers/net/wireless/ath/wcn36xx/
它可以像你写的那样工作。当wcn36xx没有注册时,我的模块可以注册并且它的探测功能被调用。那么总是可以只注册一个设备的驱动程序? – dafnahaktana
@dafnahaktana您可以注册一个设备的多个驱动程序,但只有一个会“赢”。可以覆盖平台设备的驱动程序,然后解除绑定并重新探测。请参阅https://www.redhat.com/archives/libvir-list/2014-April/msg00382.html –