I am learning linux network driver recently, and I wonder that if I have many network cards in same type on my board, how does the kernel drive them? Does the kernel need to
The driver code is only loaded once, but it allocates a separate context structure for each card. Typically you will see a struct pci_driver
with a .probe
function pointer. The probe function is called once for each card by the PCI support code, and it calls alloc_etherdev
to allocate a network interface with space for whatever private context it needs.