Android development-underlying driver development (2)

Source: Internet
Author: User

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:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.