Notification Chains in Linux Kernel
Notification chains in Linux kernel is a mechanism for the subsystems being informed by the events generated by the other subsystems. In other words, if you are developing a new driver in Linux and you want to listen some events from other driver and handle these events in your own driver, you need to use the Linux's notification chains mechanism. As an example, if you develop a driver and this driver needs to be informed about the net device events such as net device UP, DOWN events, the driver needs to register itself to the net device notifications with the register_netdevice_notifier function. Similarly, it unregisters itself with the unregister_netdevice_notifier function. These functions are provided by the net device subsystem. The APIs and the data structures of notification chains are defined in the include/linux/notifier.h and kernel/notifier.c files under linux source code. In this post, I am going to explain how this notification chains mechanism wo...