TX2 移远 EC25 4G模块驱动移植 --- 笔记

1. 具体步骤

1.1 获取内核源码

git clone https://github.com/jetsonhacks/buildJetsonTX2Kernel.git
cd buildJetsonTX2Kernel
./getKernelSources.sh 

1.2 修改内核源码

在 [KERNEL]/drivers/usb/serial/option.c 文件中, 加入代码

static const struct usb_device_id option_ids[] = {
#if 1 //Added by Quectel
    { USB_DEVICE(0x05C6, 0x9090) }, /* Quectel UC15 */
    { USB_DEVICE(0x05C6, 0x9003) }, /* Quectel UC20 */    
    { USB_DEVICE(0x2C7C, 0x0125) }, /* Quectel EC25 */    
    { USB_DEVICE(0x2C7C, 0x0121) }, /* Quectel EC21 */    
    { USB_DEVICE(0x05C6, 0x9215) }, /* Quectel EC20 */    
    { USB_DEVICE(0x2C7C, 0x0191) }, /* Quectel EG91 */    
    { USB_DEVICE(0x2C7C, 0x0195) }, /* Quectel EG95 */   
    { USB_DEVICE(0x2C7C, 0x0306) }, /* Quectel EG06/EP06/EM06 */    
    { USB_DEVICE(0x2C7C, 0x0296) }, /* Quectel BG96 */    
    { USB_DEVICE(0x2C7C, 0x0435) }, /* Quectel AG35 */
#endif
...
}

static struct usb_serial_driver option_1port_device = {
……
#ifdef CONFIG_PM    
    .suspend = usb_wwan_suspend,
    .resume = usb_wwan_resume,
#if 1 //Added by Quectel
    .reset_resume = usb_wwan_resume,
#endif
#endif
};

File: [KERNEL]/drivers/usb/serial/qcserial.c 屏蔽代码

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

File: [KERNEL]/drivers/net/usb/qmi_wwan.c 屏蔽代码

 {QMI_GOBI_DEVICE(0x05c6, 0x9215)},                 /* Acer Gobi 2000 Modem device (VP413) */
 {QMI_FIXED_INTF(0x05c6, 0x9215, 4)},                 /* Quectel EC20 Mini PCIe */

File: [KERNEL]/drivers/usb/serial/usb_wwan.c 添加代码

static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint, 
                                      int dir, void *ctx, char *buf, int len, 
                                      void (*callback)(struct urb *)){
 ……
	usb_fill_bulk_urb(urb, serial->dev, usb_sndbulkpipe(serial->dev, endpoint) | dir, buf, len, callback, ctx);
#if 1 //Added by Quectel for zero packet    
	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
	return urb;
}

1.3 编译内核

./makeKernel.sh        # 编译内核
./copyImage.sh          # 将之前的启动镜像更新为新的镜像

1.4 重启

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值