七 rk3568 android 11 ec20 4G驱动移植

一 内核驱动集成 

参考:Quectel_LTE&5G_Linux_USB_Driver_V1.0.zip

EC20 内核驱动有两个版本 ,一个是 qmi_wwan, 一个是 GOBNet , 这里用的是 qmi_wwan版本

1.1 添加 USBNET 驱动文件 

将驱动包里的 qmi_wwan_q.c  拷到 kernel/driver/net/usb/ 下

修改  kernel/driver/net/usb/Makefile, 增加

obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan_q.o

修改 kernel/.config 

CONFIG_USB_NET_QMI_WWAN=y

1.2 修改 usb转串口

--- a/kernel/drivers/usb/serial/option.c

+++ b/kernel/drivers/usb/serial/option.c

@@ -596,9 +596,12 @@ static const struct usb_device_id option_ids[] = {

  { 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, 0x0512) }, /* Quectel EG12/EM12/EG18 */

+ { USB_DEVICE(0x2C7C, 0x0296) }, /* Quectel BG95 */

+ { USB_DEVICE(0x2C7C, 0x0700) }, /* Quectel BG96 */

  { USB_DEVICE(0x2C7C, 0x0435) }, /* Quectel AG35 */

  { USB_DEVICE(0x2C7C, 0x6002) }, /* Quectel EC200s */

+ { USB_DEVICE(0x2C7C, 0x0620) }, /* Quectel EG20 */

  { USB_DEVICE(0x2c7c, 0x6026) }, //EC200T

         { USB_DEVICE(0x2dee, 0x4d20) },  //for meige SLM790

         { USB_DEVICE(0x05c6, 0xf601) },  //for meige SLM730

@@ -2175,6 +2178,9 @@ 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

 };



@@ -2217,6 +2223,19 @@ static int option_probe(struct usb_serial *serial,

  */

  if (device_flags & NUMEP2 && iface_desc->bNumEndpoints != 2)

  return -ENODEV;

+       #if 1 //Added by Quectel

+        //Quectel modules鈥檚 interface 4 can be used as USB network device

+       if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) {

+            //some interfaces can be used as USB Network device (ecm, rndis, mbim)

+             if (serial->interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {

+                 return -ENODEV;

+             }

+            //interface 4 can be used as USB Network device (qmi)

+             else if (serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) {

+     
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

walletiger

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值