移远EC200T内核驱动

1.添加PID和VID drivers/usb/serial/option.c
(1)
#define QUECTEL_VENDOR_ID 0x2C7C
#define QUECTEL_PRODUCT_EC200T 0x6026
(2)
static const struct usb_device_id option_ids[] = {

{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T)}, /* QUECTEL UC200T */

}
static int option_probe(struct usb_serial *serial,const struct usb_device_id *id)
{

#if 1//def CONFIG_SUPPORT_QUECTE_EC200T//add for Quectel
if(serial->dev->descriptor.idVendor == cpu_to_le16(0x2c7c) &&
serial->dev->descriptor.idProduct != cpu_to_le16(0x6026) &&
serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) {
return -ENODEV;
}
if(serial->dev->descriptor.idVendor == cpu_to_le16(0x2c7c) &&
serial->dev->descriptor.idProduct == cpu_to_le16(0x6026) &&
serial->interface->cur_altsetting->desc.bInterfaceNumber <= 1) {
return -ENODEV;
}
#endif

}
2.增加0包反馈
Add the Zero Packet Mechanism
As required by the USB protocol, you need to add the mechanism for processing zero packets during bulk out transmission.

For Linux Kernel Version newer than 2.6.34
/drivers/usb/serial/usb_wwan.c

usb_fill_bulk_urb(urb, serial->dev,
usb_sndbulkpipe(serial->dev, endpoint) | dir,
buf, len, callback, ctx);
#if 1//def CONFIG_SUPPORT_QUECTE_EC200T // YIYUAN add
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;
}
#endif

很多博客上面说做完这两步骤就可以识别到usb设备了,打印会打出ttyUSB0 ttyUSB1 ttyUSB2 ttyUSB3(也可在dev目录下查看),但是本人的还是不行,

3.如果你的内核代码中存在以下东西,请删掉
If you are using EC20 and following files and statements exist
in your kernel source files, please delete them, as they will conflict with EC20’s USB Drivers

(1)/drivers/usb/serial/qcserial.c

{USB_DEVICE(0x05c6, 0x9214)}, /* Acer Gobi 2000 QDL device (VP413) /
{USB_DEVICE(0x05c6, 0x9215)}, /
Acer Gobi 2000 Modem device (VP413) */

(2)/drivers/net/usb/qmi_wwan.c

{QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */

4.make linux-menuconfig
打开GSM和CDMA功能,打开ppp拨号功能
将内核烧进板子或挂载应该就可以看到识别ttyUSB*了
如何测试拨号呢?
这有一个测试好的包,按提示就可以进行测试拨号
https://download.csdn.net/download/qq_21948547/11924440点这里

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值