As discussed in a previous article <Understanding network device drivers in the Linux Kernel>, network devices normally connect to a hardware peripheral to transmit and receive packets.
The lower interface of a network device will hence be a bus interface driver and the upper interface will be a network driver that provides a network interface for the Linux system.
The lower interface could be ethernet/pci/sdio etc. The below picture provides a visualization of the upper and lower interfaces for a network driver.

The enumeration of the network device happens for the hardware firstly and later, the network driver is registered to the kernel. The below image depicts the operation

The steps are outlined below
- PCI driver is loaded in kernel and it registers a PCI driver with the kernel. It provides details of Device ID + Vendor ID to the kernel stating that the driver supports specific Device ID + Vendor ID combination.
- PCI card is detected at PCI slot
- Kernel enumerates the list of drivers registered for the specific PCI peripheral by mapping the device ID + Vendor ID in the peripheral and that provided by the driver
- Kernel invokes the PCI device driver “probe” function and the driver proceeds with PCI peripheral initialization and to setup PCI device operation for the peripheral
- The driver proceeds further and registers a network device interface with the linux kernel by invoking register_netdev.
Pingback: Drivers for PCI BUS based peripherals | Hitch Hiker's Guide to Learning
Pingback: How is Data packet TX/RX handled? | Hitch Hiker's Guide to Learning