The nl80211 interface is the netlink based interface which is used by user space daemons such as wpa_supplicant, hostapd, iw tool to configure the lower WiFi device. The wpa_supplicant/hostapd register to the lower interface as nl80211_driver interface. once registered, the user space daemons can send configurations commands via netlink socket. A snippet of the nl80211 […]
mac80211 and cfg80211 callback structures
As seen in the previous article <Linux 802.11 SoftMAC architecture>, mac80211 interacts with the SoftMAC driver via “ieee80211_ops” structure and interacts with cfg80211 via “cfg80211_ops” structure. The structures can be found at cf80211_ops – /include/net/cfg80211.h ieee80211_ops – /include/net/mac80211.h Snippets of both structure are provided below to provide an idea on how the structures are and […]
Linux 802.11 SoftMAC architecture
Since, My work profile has involved WiFi for a large part of my career, i will start looking at WiFi support in Linux and how the WiFi sub-system operates before moving on to other topics. Linux provides a SoftMAC architecture wherein most of the Upper MAC functionality is handled in the host processor. The Linux […]
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 […]
Drivers for PCI BUS based peripherals
The reason that PCI bus drivers are being discussed is that PCI interface is now vastly popular and most peripheral devices are supporting the PCI bus. Though it would be nice to somehow spoof a PCI peripheral device, i am not aware of a method to do it or probably it cannot be done. Hence, […]
Understanding network device drivers in the Linux Kernel
A network device driver interfaces with a hardware to transmit and receive network protocol. it provides a means for upper layer protocols to be able to communicate with hardware devices and to send/receive information with remote systems. In some unique cases, a network device driver might not interface with a network hardware device but be […]
Platform device driver code example
In this example code, we will create a dummy platform device and register the device with the kernel. Later on, in the same driver code , we will register the driver and make the kernel invoke the “probe” function for the driver. the sample code is provided below The dmesg output of loading and unloading […]
Platform device drivers in the Linux Kernel
Platform devices in the Linux kernel are devices that are hardware devices that are autonomous can be directly addressed by the CPU and they are not based on communication via conventional buses. some examples of platform devices include legacy port-based devices and host bridges to peripheral buses, and most controllers integrated into system-on-chip platforms. Refer […]
Miscellaneous device driver example
The interested reader can refer <miscellaneous device drivers in linux kernel> for an introduction. The below code provides a sample code example for a miscellaneous device driver The below output of /dev folder shows the creation of a miscellaneous device. the minor number allocated is 120 The earlier sample code is modified to open the […]
Miscellaneous Device drivers in Linux
In Linux, each device is referenced by a major number and a minor number. The list of these numbers can be found by executing the command “ls -l /dev“. A small snippet is shown below Each driver that loads itself to the linux kernel must register its major number with the linux kernel. The specific […]