How linux drive many network cards with the same driver?

前端 未结 2 537
南方客
南方客 2021-01-05 14:22

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

2条回答
  •  再見小時候
    2021-01-05 14:54

    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.

提交回复
热议问题