You are on page 1of 18

Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL

WCDMA/CDMA Module Dongles

Guide to Kernel Driver Integration in Android OS


for Huawei WCDMA/CDMA Module Dongles

Huawei Technologies Co., Ltd.


All rights reserved

2011-4-7 Huawei Confidential Page 1 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

Change History
Date Revision CR ID/Defect Section Change Description Author
Version ID Number

2011-2-9 V1.0 Completed the draft. Fang Xiaozhi (ID:


00110321)

2011-4-7 Huawei Confidential Page 2 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

Contents

1 Purpose ...................................................................................................................................... 4
2 Scope .......................................................................................................................................... 5
3 Overview ................................................................................................................................... 6
3.1 Linux Kernel Driver Architecture Supporting Huawei Module Dongle in Android OS .................................. 6
3.2 Linux Driver Integration Pack in Android OS ................................................................................................. 7

4 Linux Kernel Driver Integration Scheme for Android OS ................................................. 8


4.1 Integration Procedure for the USB Serial Port Driver of Android Kernel ........................................................ 8
4.1.1 Revision on USB Serial Port Driver Integration ..................................................................................... 8
4.1.2 Configuration Procedures for USB Serial Port Driver Integration .......................................................... 9

5 Appendix ................................................................................................................................. 17
5.1 Ensuring the Availability of a Correct USB Se rial Port Driver in the System ................................................ 17
5.2 Getting the Current Port Mapping Information of the Board ......................................................................... 18

2011-4-7 Huawei Confidential Page 3 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

1 Purpose

This guide instructs the kernel driver int egration development for Huawei module dongle
based on Android operating system (OS). It is intended for the driver developers of the
products based on Android OS.

2011-4-7 Huawei Confidential Page 4 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

2 Scope

This guide is applicable to:


1. Huawei module dongles based on the WCDMA/CDMA standard.
2. Android 2.1 or later versions.

2011-4-7 Huawei Confidential Page 5 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

3 Overview

3.1 Linux Kernel Driver Architecture Supporting Huawei


Module Dongle in Android OS
The Huawei module dongle typically communicates with Android OS via the USB interface.
The Linux kernel in Android OS needs to load USB drivers based on the information reported
by the USB device interface of Huawei module dongle. The Huawei module dongle can work
normally only after the USB driver is correctly loaded.
The following diagram shows the Linux kernel driver architecture suppor ting Huawei module
dongle in Android OS.

U
User program s
e
r

s
Character device Block device layer Network device layer VFS TTY Others p
layer layer layer a
c
e
USB device driver layer
K
USB serial port driver Network device driver Other device drivers e
r
n
USB core e
l

USB main controller s


p
a
c
e
Huawei module dongle

2011-4-7 Huawei Confidential Page 6 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

As shown in the preceding diagram, in the USB driver architecture of Linux OS, the driver
module closely related to Huawei module dongle is the USB serial port driver module at the
USB driver layer. Therefore, this guide focuses on the driver -related integration operations.

3.2 Linux Driver Integration Pack in Android OS


The integration code pack that Huawei offers is:
Android Driver x.xx.xx.xx.zip ( x.xx.xx.xx is the version number.)
This integration pack includes the source code files of USB serial port driver.

Driver Type Driver File Name Location in the Kernel


USB serial port driver option.c driver/usb/serial/

2011-4-7 Huawei Confidential Page 7 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

4 Linux Kernel Driver Integration Scheme


for Android OS

This integration scheme involves the following Linux kernel source code file:
drivers/usb/serial/option.c

4.1 Integration Procedure for the USB Serial Port Driver of


Android Kernel
This integration scheme involves the following Linux kernel source code file:
kernel/drivers/usb/serial/option.c

4.1.1 Revision on USB Serial Port Driver Integration


1. Get the option.c file from the integration code pack that Huawei offers, and then use this
file to replace the original option.c file in the drivers/usb/serial directory of the
embedded Android kernel.
2. Modify the compilation configuration of Android kernel (in the .config file in the kernel
root directory), and ensure that the following configuration options are selected (enabled).
For detailed configuration operations, see section 4.1.2 "Configuration Procedures for
USB Serial Port Driver Integration ."
 Configuration option related to USB power management properties:
CONFIG_USB_SUSPEND=y
 Configuration options related to the USB serial port driver :
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_OPTION=y
 Configuration options related to PPP dial -up connections:
CONFIG_PPP=y
CONFIG_PPP_MULTILINK=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_ASYNC=y

2011-4-7 Huawei Confidential Page 8 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

CONFIG_PPP_SYNC_TTY=y
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_BSDCOMP=y

4.1.2 Configuration Procedures for USB Serial Port Driver


Integration
Step 1 Run the Terminal tool, enter the kernel directory (assume that the kernel is in the
/usr/src/myandroid/ directory, that is, cd /usr/src/myandroid/kernel), and then run the
make <configuration> command (in this guide, assume that the standard make menuconfig
command is used).

2011-4-7 Huawei Confidential Page 9 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

Step 2 Select relevant configuration options.


1. Configuration options related to USB power management properties:
a. If the Android kernel version is 2.6.33 or later, configure as follows an d then proceed to
step b.

2011-4-7 Huawei Confidential Page 10 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

b. If the Android kernel version is earlier than 2.6.33, skip step a and configure as follows
directly.

2011-4-7 Huawei Confidential Page 11 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

2. Configuration options related to the USB serial port driver:

2011-4-7 Huawei Confidential Page 12 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

2011-4-7 Huawei Confidential Page 13 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

3. Configuration options related to PPP dia l-up connections:

2011-4-7 Huawei Confidential Page 14 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

2011-4-7 Huawei Confidential Page 15 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

Step 3 Select Exit to exit all configuration screens. When the following dialog box is displayed,
select Yes to save the configuration.

Step 4 After the configuration is completed, run the make command and compile the revised kernel
version.

2011-4-7 Huawei Confidential Page 16 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

5 Appendix

5.1 Ensuring the Availability of a Correct USB Serial Port


Driver in the System
Run the following command to check the kernel log information:
dmesg

If the following (or similar) information exists in the kernel log, it can be confirmed that a
correct USB serial port driver is in the system.

2011-4-7 Huawei Confidential Page 17 of 18


Guide to Kernel Driver Integration in Android System for Huawei CONFIDENTIAL
WCDMA/CDMA Module Dongles

5.2 Getting the Current Port Mapping Information of the


Board
 Query command of device file names of module dongle's ports, such as modem and pcui
ports
ls /dev/ttyUSB*

2011-4-7 Huawei Confidential Page 18 of 18

You might also like