http://www.draisberghof.de/usb_modeswitch/#download
** 修改3.10.23/drivers/usb/serial/option.c
static const struct usb_device_id option_ids[] = {
…..
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1520, 0xff, 0xff, 0xff) },/* Huawei K3765 HSPA*/
…..
}
** 重新编程kernerl和bootimage并烧写
在kernel根目录下面:
make -j16
生成arch/arm/boot/zImage
copy到android目录改名为device/mstar/orange/kernel
在android根目录下面:
make bootimage -j16
生成out/target/product/orange/boot.img
重新烧写boot.img
** 用push相关文件到board
adb连接board:
adb connect [board ip]
adb root
adb connect [board ip]
adb remount
adb push chat /system/bin/
adb push usb_modeswitch /system/bin/
adb push wcdma /data/misc/ppp/peers/
adb push wcdma-connect-chat /etc/ppp/peers/
adb push wcdma-disconnect-chat /etc/ppp/peers/
adb push usb_modeswitch.d/ /etc/usb_modeswitch.d/
shell@orange:/system/bin # chmod 777 usb_modeswitch
shell@orange:/system/bin # chmod 777 chat
shell@orange:/data/misc/ppp # ln -s /system/bin/sh ./sh
拔掉网线 reboot
** 运行usb_modeswitch转换到modem模式:
shell@orange:/data # usb_modeswitch -W -v 12d1 -p 1520 -c /etc/usb_modeswitch.d/12d1_1520
……
Mode switch succeeded. Bye.
shell@orange:/data # ls /dev/ttyUSB*
/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB2
shell@orange:/data # busybox lsusb
Bus 002 Device 011: ID 12d1:1465
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002
Bus 003 Device 001: ID 1d6b:0002
出现上面的打印 & 有/dev/ttyUSB & ID 12d1:1465 ===>表示转换成功
** 运行pppd生成ppp0:
注意:SIM卡不能欠费!!!
shell@orange:/data # pppd call wcdma&
……
Script /system/bin/chat -s -v -f /etc/ppp/peers/wcdma-connect-chat finished (pid 2261), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <–> /dev/ttyUSB0
……
local IP address 10.79.193.72
remote IP address 10.64.64.64
primary DNS address 210.21.196.6
secondary DNS address 221.5.88.88
* 确认有ppp0生成
shell@orange:/data # netcfg
sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
ppp0 UP 10.79.193.72/32 0x000010d1 00:00:00:00:00:00
eth0 UP 0.0.0.0/0 0x00001203 00:11:22:11:22:11
lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00
ip6tnl0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
* ping 外网确认网络连通
shell@orange:/data # ping 115.239.211.112 (baidu ip)
PING 115.239.211.112 (115.239.211.112) 56(84) bytes of data.
64 bytes from 115.239.211.112: icmp_seq=1 ttl=49 time=1898 ms
64 bytes from 115.239.211.112: icmp_seq=2 ttl=49 time=2879 ms
64 bytes from 115.239.211.112: icmp_seq=3 ttl=49 time=2119 ms
64 bytes from 115.239.211.112: icmp_seq=4 ttl=49 time=1369 ms
64 bytes from 115.239.211.112: icmp_seq=5 ttl=49 time=2096 ms
64 bytes from 115.239.211.112: icmp_seq=6 ttl=49 time=2055 ms
到此就可以用浏览器上网了