Network device driver interfaced to a Hardware peripheral

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.

Network interface and Hardware interface 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

  1. 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.
  2. PCI card is detected at PCI slot
  3. 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
  4. 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
  5. The driver proceeds further and registers a network device interface with the linux kernel by invoking register_netdev.

Comments

  1. Pingback: Drivers for PCI BUS based peripherals | Hitch Hiker's Guide to Learning

  2. Pingback: How is Data packet TX/RX handled? | Hitch Hiker's Guide to Learning

Leave a Reply

Your email address will not be published. Required fields are marked *