我正在编写pci驱动程序以访问ID为PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0的Intel设备,该设备位于ff:12.0(设备ID 0x6fa0)。
但是,原来sbridge_edac驱动程序已经安装并与该PCI设备相关联。这导致我的pci_register_driver()返回错误。 有没有办法让我的PCI驱动程序使用该PCI设备,如果另一个驱动程序已与之关联?
#define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0 0x6fa0
static const struct pci_device_id sbridge_pci_tbl[] = {
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TA)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HASWELL_IMC_HA0)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KNL_IMC_SAD0)},
{0,} /* 0 terminated list. */
};
MODULE_DEVICE_TABLE(pci, sbridge_pci_tbl);
static struct pci_driver discovery_pci_driver ={
.name = DRIVER_NAME,
.probe = discovery_probe,
.remove = discovery_remove,
.id_table = sbridge_pci_tbl,
};
static int __init discovery_init(void)
{
int res;
res = pci_register_driver(&discovery_pci_driver);
if(res<0) {
PERR("Adding driver to pci core failed\n");
return res;
}
return 0;
}
$lspci -x
ff:12.0 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Home Agent 0
Subsystem: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Home Agent 0
Kernel driver in use: sbridge_edac
答案 0 :(得分:0)
由于您要创建自己的驱动程序并将其与英特尔硬件关联,您可以执行以下操作之一:
sbridge_edac
驱动程序并重新编译。您也可以在此时添加驱动程序。sbridge_edac
驱动程序,然后加载到驱动程序中。sbridge_edac
驱动程序(编辑代码)。sbridge_edac
。但是其他用户程序可以访问这一个程序而不是驱动程序。