I am learning Kernel Programming these days I came across a structure
static DEFINE_PCI_DEVICE_TABLE(rtl8139_pci_tbl) = {
{0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x1186, 0x1300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x1186, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
Here are two links
LXR / The Linux Cross Reference
LXR / The Linux Cross Reference
but I could not understand this type of structure definition.
How does one point the following entry
{0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
1) What is first field 0x10ec mapped to is it vendor ?
2) What is second field 0x8139 mapped to is it device id ?
3) Does PCI_ANY_ID both represent subvendor,subdevice
4) What are these two 0,0 are they class,mask
5) What is RTL8139 is it driver_data
6) I am also not clear with the way the macro was defined.
In the definition of following macro
#define DEFINE_PCI_DEVICE_TABLE(_table) const struct pci_device_id _table[] __devinitconst
_table is it an array of structure of type pci_device_id ?
7) What is __devinitconst?


Sign In
Create Account


Back to top









