Android 4G驱动移植流程

1. Linux Kernel Configure by "make menuconfig"
1.1 USB Driver Configure for L506
Device Drivers --->
[*] USB support --->
<*> USB Serial Converter support
[*] USB Generic Serail Driver
[*] USB Driver for GSM and CMDA modems
1.2 USB Driver Configure for UG95/UG96
Device Drivers --->
[*] USB support --->
<*> USB Modem (CDC ACM) support
1.3 PPP Configure
Device Drivers --->
[*] Network device support --->
<*> PPP (point-to-point protocol) support
<*> PPP support for async serial ports
<*> PPP support for sync tty ports
<*> PPP Deflate compression
2.Add PID and VID
drivers/usb/serial/option.c
static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(0xxxx, 0xxxxx) },
3. init.rc Configure
add service ril-daemon and service popped in init.rc, as below:
service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so
class main
socket rild stream 660 root radio
socket rild-debug stream 666 radio system
user root
group radio cache inet misc audio sdcard_rw log

the init.rc 's location depend on your project, for example:
system/core/rootdir/init.rc
device/fsl/imx6/init.rc
device/ti/am335xevm_sk/init.am335xevm.rc
device/generic/x86/init.rc
device/samsung/smdkv210/init.rc
3. modifying the Right of service ril-daemon
serivce ril-daemon require root privilege.
comment out the function switchUser() in the file hardware/ril/rild/rild.c. as below:
OpenLib:
#endif
//switchUser();
note:
64位的系统libreference-ril.so 需要放在lib64下,所以需要作出相应的更改
4.把4G模块对应的libreference-ril.so文件替换到lib文件里
5.添加APN,把需要的APN添加到system/etc/apns-conf.xml里
6.更改模式,打开Android/frameworks/base/telephony/java/con/android/internal/telephony/RILConstants.java
找到int PREFERRED_NETWORK_MODE=********;
根据自己的需要选择模式,最后编译就可以了。

你可能感兴趣的:(Android)