加载中…
个人资料
峯挚
峯挚
  • 博客等级:
  • 博客积分:0
  • 博客访问:12,853
  • 关注人气:1
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
相关博文
推荐博文
谁看过这篇博文
加载中…
正文 字体大小:

i.MX6添加EC204G模块PPP驱动

(2019-12-02 16:50:03)
标签:

it

分类: 笔记
1,添加USB设备信息
1.1,修改drivers/usb/serial/option.c
(1)定义EC20 ID宏
#define QUECTEL_VENDOR_ID 0X2C7C3 
#define QUECTEL_PRODUCT_EC20 0X0125
(2)将ID宏信息添加到option_ids数组中
static const struct usb_device_id option_ids[] = {
        { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC20) }, 
(3)在option_probe中添加                                                                
        if (dev_desc->idVendor == cpu_to_le16(0x05c6) &&
            dev_desc->idProduct == cpu_to_le16(0x9003) &&
            iface_desc->bInterfaceNumber >= 4)
                return -ENODEV;

        if (dev_desc->idVendor == cpu_to_le16(0x05c6) &&
            dev_desc->idProduct == cpu_to_le16(0x9215) &&
            iface_desc->bInterfaceNumber >= 4)
                return -ENODEV;

        if (dev_desc->idVendor == cpu_to_le16(0x2c7c) &&
            iface_desc->bInterfaceNumber >= 4)
                return -ENODEV; 
()在option_1port_device中
.resume            = usb_wwan_resume,
下面添加
.reset_resume      = usb_wwan_resume, 

1.2,修改drivers/usb/serial/usb_wwan.c
在usb_wwan_setup_urb中
if (dir == USB_DIR_OUT) {
                struct usb_device_descriptor *desc =
                        &serial->dev->descriptor;
                if (desc->idVendor == cpu_to_le16(0x05c6) &&
                    desc->idProduct == cpu_to_le16(0x9090))
                        urb->transfer_flags |= URB_ZERO_PACKET;

                if (desc->idVendor == cpu_to_le16(0x05c6) &&
                    desc->idProduct == cpu_to_le16(0x9003))
                        urb->transfer_flags |= URB_ZERO_PACKET;

                if (desc->idVendor == cpu_to_le16(0x05c6) &&
                    desc->idProduct == cpu_to_le16(0x9215))
                        urb->transfer_flags |= URB_ZERO_PACKET;

                if (desc->idVendor == cpu_to_le16(0x2c7c))
                        urb->transfer_flags |= URB_ZERO_PACKET;
       


2,内核配置
2.1,使能USB NET功能
-> Device Drivers
-> -*- Network device support
-> USB Network Adapters
-> -*- Multi-purpose USB Networking Framework

2.2,使能USB串口GSM、CDMA驱动
-> Device Drivers
-> [*] USB support
-> <*> USB Serial Converter support
-> <*> USB driver for GSM and CDMA modems

2.3,使能USB的CDC ACM模式
-> Device Drivers
-> [*] USB support
-> <*> Support for Host-side USB
-> <*> USB Modem (CDC ACM) support

2.4,使能PPP功能
-> Device Drivers
-> [*] Network device support
-> <*> PPP (point-to-point protocol) support
-> <*> PPP BSD-Compress compression
-> <*> PPP Deflate compression
-> [*] PPP filtering
-> <*> PPP MPPE compression (encryption)
-> [*] PPP multilink support
-> <*> PPP over Ethernet
-> <*> PPP support for async serial ports
-> <*> PPP support for sync tty ports

3,编译内核,使用内核启动板子
可以看到系统输出以下信息
option 1-1.2:1.0: GSM modem (1-port) converter detected
usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1.2:1.1: GSM modem (1-port) converter detected
usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1.2:1.2: GSM modem (1-port) converter detected
usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
option 1-1.2:1.3: GSM modem (1-port) converter detected
usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB3

4,拨号
由于使用yocto配置的文件系统包含pppd(如果不包含需自行编译并配置板子),所以后续可以直接修改EC20官方的脚本文件来进行PPP拨号

0

阅读 收藏 禁止转载 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 电话:4000520066 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有