I am moving my first steps into Linux Kernel Device Driver development.
I learnt that for pci-e cards I have to call pci_register_driver
providing information via an object of type pci_driver
( below an example ).
When I load my module ( via insmod
) If the information passed via .id_table
is found than the .probe
function is called.
由于我现在看不到我的<代码>.probe 功能(我通过<代码>k添加了一些伐木),因此我必须假设,<编码>pci_device_id中所载的信息。 必须是错的?
Is there any way to retrieve this information directly from the hardware itself? Once I plug my PCI-E card on my Linux box, where I can find all information about it? Maybe reading BIOS or some file in sys?
感谢任何帮助。
AFG
static struct pci_driver my_driver = {
// other here
.id_table = pci_datatable,
.probe = driver_add
//
};
static struct pci_device_id pci_datatable[] __devinitdata =
{
{ VendorID, PciExp_0041, PCI_ANY_ID, PCI_ANY_ID },
{ 0 },
};
int __devinit DmaDriverAdd(
struct pci_dev * pPciDev,
const struct pci_device_id * pPciEntry
)
{
// my stuff!
}