8.1. When a Device Is Registered
The registration of a network device takes place in the following situations:
In the first situation, the registration model that applies is described in the later section "Skeleton of NIC Registration and Unregistration." It applies to all bus types, and is the same whether the registration routine ends up being called by the bus infrastructure or by the module initialization code. For example, we saw in Chapter 6 how loading a PCI device driver leads to the execution of the pci_driver->probe routine, usually named something like xxx_probe, which is provided by the driver and which takes care of device registration. In this chapter, we will look at how those probe routines are implemented.
The registration of devices using other bus types (USB, PCMCIA, etc.) shares the same skeleton. We will not look at how the infrastructure of those buses ends up calling their probe counterpart, as we saw for PCI in Chapter 6. Older buses may not be able to automatically detect the presence of devices and may require the device drivers to do it by manually probing specific memory addresses, using default parameters or boot-time parameters provided by the user.[*] We will not look at this case either.