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

本文档详细介绍了如何在Linux 2.6.30内核中添加华为ME909S-821 4G模块的驱动支持,包括在`usb.h`中添加宏定义、修改`option.c`文件以匹配设备,定义华为vid和bcdUSB,以及内核配置和ppp拨号设置步骤。
摘要由CSDN通过智能技术生成

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 <huananhu@huawei.com>
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

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值