linux2.6.30添加华为ME909S-821 4G模块驱动

1.在 linux_src/include/linux/usb.h 中添加如下宏

若部分内核已经添加,则无需添加此部分。详文如下:
#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
| USB_DEVICE_ID_MATCH_VENDOR, \
.idVendor = (vend), \
.bInterfaceClass = (cl), \
.bInterfaceSubClass = (sc), \
.bInterfaceProtocol = (pr)

2.在 linux_src/drivers/usb/serial/option.c 文件中的 static const struct
usb_device_id option_ids[]的 id 列表中增加如下语句,用于匹配设备数据。

{VID,InterfaceClass, InterfaceSubClass, InterfaceProtocol}。
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff,
0xff) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01,
0x01) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01,
0x02) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01,
0x03) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01,
0x04) },
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01,
0x05) },

............

3.在option.c中加入定义

 增加对 bcdUSB 值的定义:#define HW_bcdUSB 0x0110;
增加对华为 vid 值的定义:#define HUAWEI_VENDOR_ID 0x12d1。

#define HUAWEI_PRODUCT_MU709S            0x1c25 //add by cxy
#define HUAWEI_PRODUCT_ME909             0x15c1 //add by cxy

{ USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_MU709S) },//add by cxy
{ USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ME909) },//add by cxy

4.内核配置

1)USB driver for GSM and CDMA midems

2)ppp拨号 ppp BSD-compres comprossion

3)CDC相关

4.ppp拨号脚本

编译ppp2.2.4  pppd chat 放入文件系统/usr/sbin中

2种方式

1.huawei-ppp-on huawie-ppp-off...

2.evdo   evdo-chat-connect

#!/bin/sh
#
# Script to initiate a ppp connection. This is the first part of the
# pair of scripts. This is not a secure pair of scripts as the codes
# are visible with the 'ps' command.  However, it is simple.
# Modify: fangxiaozhi
programName=${0##*/}
# These are the parameters. Change as needed.
#DEVICE=/dev/usb/tts/0
#DEVICE=/dev/ttyACM0                  #The modem file name of the data card
DEVICE=/dev/ttyUSB0                  #The modem file name of the


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部