一 内核驱动集成
参考: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) {
+

最低0.47元/天 解锁文章
1146

被折叠的 条评论
为什么被折叠?



