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 network hardware to transmit and receive network protocol packets. 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 […]
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 […]
Character Device driver – creating device file instance in code
In the previous example character driver code <character driver sample>, we used the “mknod command” to create the device file instance. it is possible to create a device file instance via code in the driver itself allowing the code to come up “on the go”. The below code snippet provides an example implementation of the […]
Character device driver sample user space code
The character device driver code can be looked at in the article placed at this location – <character device driver example>. The below user space sample code is to invoke the device file via the device driver. The output of the sample code is provided below The dmesg output indicates that the open, read, write […]