The probe function is quite basic, and only needs to perform a device's early init, and then register our network device with the kernel.
In other words, the probe function has to:
- Allocate the network device along with its private data using the alloc_etherdev() function (helped by netdev_priv()).
- Initialize private data fields (mutexes, spinlock, work_queue, and so on). You should use work queues (and mutexes) if the device sits on a bus whose access functions may sleep (SPI, for example). In this case, the hwirq just has to acknowledge the kernel code, and schedule the job that will perform operations on the device. An alternative solution is to use threaded IRQs. If the device is MMIO, you can use spinlock to protect ...