Android device driver(Lower)
MTD driver
Flash drivers usually use MTD (memory technology device) and memory technology devices.
MTD character device:
/Dev/mtdx
Master device No. 90.
MTD block device:
/Dev/block/mtdblockx
Main device No. 13.
MTD driver source code
Drivers/MTD/mtdcore. C: MTD core, which defines the original MTD device.
Drivers/MTD/mtdchar. C: MTD character device
Drivers/MTD/mtdblock. C: MTD block Device
MTD Structure Diagram
The MTD driver is a new type of driver specially developed for the embedded environment in Linux. MTD driver interfaces in Linux are divided into user modules and hardware modules:
User ModuleInterfaces used directly from the user space are provided: original character access, original block access, FTL (flash transition layer), and JFS (journaled File System ).
Hardware moduleProvides physical access to memory devices, but does not directly use them. These modules provide read, write, and erase operations on flash memory.
Bluetooth driver
In Linux, a bluetooth device driver is a network device that uses network interfaces.
Android's Bluetooth protocol stack uses bluez to support application specifications such as gap, SDP, and RFCOMM, and has obtained sig certification. Since bluez uses GPL authorization, the android framework uses D-BUS IPC to interact with bluez's user space code to avoid unauthorized code.
Some Bluetooth header files:
Include/NET/Bluetooth/hci_core.h
Include/NET/Bluetooth. h
Bluetooth source code file:
Net/Bluetooth /*
Files in the Bluetooth driver section:
Drivers/Bluetooth /*
Bluetooth drivers are generally implemented through standard HCI control. However, there are some differences between the hardware interface and the initialization process. These initialization actions are generally Basic settings such as crystal oscillator frequency and baud rate. For example, the CSR chip generally uses the bcsp protocol to complete initial Initialization Configuration and then activates the standard HCI control process. For Linux, once bluez can use HCI to establish communication with the chip (generally hciattach + hciconfig), it can use the standard protocols on it (SCO, L2CAP, etc ), communicate with Bluetooth to make it work properly.
WLAN Device Driver (Wi-Fi)(More complex I will write a dedicated WiFi Analysis)
In Linux, WLAN devices belong to network devices and use network interfaces.
WLAN uses standard socket interfaces for control in user space.
Header files of the WiFi protocol:
Include/NET/wireless. h
Some source files of the WiFi protocol:
Net/wireless /*
WiFi DRIVER:
Drivers/NET/wireless /*
WiFi module structure: